Merge remote-tracking branch 'upstream/develop' into 14a5
This commit is contained in:
commit
593f5bcb7a
@ -269,7 +269,7 @@ script:
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||
|
||||
@ -23,7 +23,6 @@ PEAR Mail_MIME 1.8.9 BSD Yes
|
||||
ParseDown 1.6 MIT License Yes Markdown parser
|
||||
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
|
||||
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
|
||||
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||
PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||
@ -53,7 +52,7 @@ jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes
|
||||
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for filetree
|
||||
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
|
||||
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
|
||||
jsGanttImproved 1.7.5.4 BSD License Yes JS library (to build Gantt reports)
|
||||
jsGanttImproved 2.7.3 BSD License Yes JS library (to build Gantt reports)
|
||||
JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone
|
||||
SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer
|
||||
|
||||
|
||||
100
ChangeLog
100
ChangeLog
@ -176,6 +176,7 @@ NEW: Weighing Scale compatibility with TakePOS connector
|
||||
NEW: when creating a user from a member linked to a thirdparty, you can choose to create it as external or internal user
|
||||
NEW: add clone button on miscellaneous payment
|
||||
NEW: #15065 Add option to put the product label in bold in the PDF templates if configured
|
||||
NEW: Add option "If the feature to manage kits of module Stock is used, show details of subproducts of a kit on PDF."
|
||||
|
||||
|
||||
For developers:
|
||||
@ -226,7 +227,7 @@ NEW: add hooks on newpayment page to allow external payment modules
|
||||
NEW: add hooks on stats pages
|
||||
NEW: add formConfirm hook on product page
|
||||
NEW: add two hooks printFieldListFrom and printFieldSearchParam
|
||||
|
||||
NEW: add hook "loginCheckSecurityAccess"
|
||||
|
||||
WARNING:
|
||||
|
||||
@ -246,8 +247,105 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* 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.
|
||||
* Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main"
|
||||
* Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet)
|
||||
|
||||
|
||||
***** ChangeLog for 12.0.4 compared to 12.0.3 *****
|
||||
FIX: make formConfirm an addreplace-type hook
|
||||
FIX: regex to remove 'action' parameter: taking feedback from PR#15213 into account
|
||||
FIX: remove 'action' parameter from redirect URL when reordering lines on a document
|
||||
FIX: error when displaying lines on order after adding a line if both MAIN_MULTILANGS and MAIN_DISABLE_PDF_AUTOUPDATE are activated
|
||||
FIX: on survey creation, entity is always set to 1 ⇒ set it to $conf->entity
|
||||
FIX: set entity to $conf->entity (instead of 1 by default) when creating a survey; otherwise the survey cannot be listed from the entity it was created on unless it is the main entity
|
||||
FIX: the stringent XSS protection provided by 'alphanohtml' causes problems with some clients who used basic tags (bold, italic, underline) in product labels. Using 'restricthtml' instead could be a good compromise.
|
||||
FIX: third party of object is not always fetched when initiating the e-mail presend action (e.g. from an order)
|
||||
FIX: when the cronjob 'params' field is empty, the cron method is called with one empty string param instead of no params at all
|
||||
FIX: XSS protection too stringent -> replace 'alphanohtml' with 'restricthtml'
|
||||
FIX: #13067 including opening balance in calculation of displayed balance
|
||||
FIX: #14326
|
||||
FIX: #14649
|
||||
FIX: #14901
|
||||
FIX: #14927 Change ContratLigne property type to product_type
|
||||
FIX: #14979
|
||||
FIX: #15074
|
||||
FIX: #15111 Fix special characters output in PDF
|
||||
FIX: #15161 MO translation conflict
|
||||
FIX: #15163
|
||||
FIX: #15199
|
||||
FIX: #15208
|
||||
FIX: #15303
|
||||
FIX: #15365 export of extrafields for user and resources
|
||||
FIX: #15374 : "New" doesn't clear total amounts
|
||||
FIX: #15501
|
||||
FIX: #15572
|
||||
FIX: #15590
|
||||
FIX: #15618
|
||||
FIX: supplier proposals as linked objects of events are not correctly fetched
|
||||
FIX: when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
|
||||
FIX: Accountancy - Some ajustments on length of the account (general & auxiliary)
|
||||
FIX: admin conf selected
|
||||
FIX: also check if there is a method $object->fetch_thirdparty() before calling it
|
||||
FIX: autofocus on first setup
|
||||
FIX: Bad rigths to send contract
|
||||
FIX: Better error message with IMAP when connection fails
|
||||
FIX: Can create user but not update user with activedirectory
|
||||
FIX: Can receipt of a product that required lot after disabling stock and
|
||||
FIX: Can't create shipment for virtual product. Add
|
||||
FIX: cant empty action comm desc
|
||||
FIX: CA report by product/service : subcategory filter
|
||||
FIX: Clean orphan records in llx_ecm_files into repair script.
|
||||
FIX: default accountancy values and posted values
|
||||
FIX: Deletion of expensereport + other generated object not complete.
|
||||
FIX: disabled users must not be available in sales representative list on societe edit mode
|
||||
FIX: Dol print error : conf usage thirdparty propagate extrafields to
|
||||
FIX: Don't display inactive users in birthday box and company card
|
||||
FIX: empty value is needed on filter list
|
||||
FIX: enable HTML in product labels depending on conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML
|
||||
FIX: error 500 on cash closure
|
||||
FIX: excess comma
|
||||
FIX: Export FEC - Remove line at zero
|
||||
FIX: extrafield required error after submit
|
||||
FIX: filter on project list
|
||||
FIX: force payment mode to withdraw
|
||||
FIX: formating of prices with foreign languages
|
||||
FIX: handling $heightforinfotot when he's superior to a page height
|
||||
FIX: if no PDF default model in admin for expense report, do not create a PDF
|
||||
FIX: invoice payment terms edition: error management
|
||||
FIX: list of fields in list of recurring invoices was empty
|
||||
FIX: load default linked options for linked sellist extra fields
|
||||
FIX: Loan - Return on list when you cancel create form or delete a loan
|
||||
FIX: Missing lang trans
|
||||
FIX: no empty value in required extrafield
|
||||
FIX: Param joinfiles not sanitized
|
||||
FIX: Payment by BankTransfer
|
||||
FIX: pdf_getlinetotalwithtax must show total incl tax
|
||||
FIX: Problem on supplier payment card
|
||||
FIX: product auto volume calculation
|
||||
FIX: product customer prices: missing triggers in CRUD class
|
||||
FIX: Request on purchase orders in timeout even on very small databases
|
||||
FIX: set paid on total discount of a product in cash desk
|
||||
FIX: several warning with the barcode use in ODT templates
|
||||
FIX: SHIP MODE install v12 bug insert
|
||||
FIX: stripe for connect mode
|
||||
FIX: subcat filter
|
||||
FIX: supplier invoice: automatically calculate payment term when modifying payment condition
|
||||
FIX: SUPPLIER PROPOSAL v12 bug add
|
||||
FIX: table making extrafield input too small on advance target mailing
|
||||
FIX: table making extrafield too small advtagertmailing
|
||||
FIX: Unable to edit extrafields in expense report
|
||||
FIX: update margins rates on object line edit
|
||||
FIX: uses price2numjs
|
||||
FIX: various payments: bad data handling for subledger account + useless db commit/rollback
|
||||
FIX: virtual products: displayed value is by unit
|
||||
FIX: virtual products: supplier discount was not applied in component list
|
||||
FIX: warning for purchase order delivery late.
|
||||
FIX: Warning on late purchase order delivery
|
||||
FIX: WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty
|
||||
FIX: wrong tab
|
||||
FIX: Yogosha report 4425 (backport)
|
||||
FIX: Yogosha report 4434 (backport)
|
||||
|
||||
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
||||
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
|
||||
FIX: 11.0 - expenses lines overlapping the total amounts frame
|
||||
|
||||
6
INSTALL
6
INSTALL
@ -1,6 +0,0 @@
|
||||
INSTALL
|
||||
-------
|
||||
|
||||
English: See README.md file.
|
||||
|
||||
French: Voir fichier README-FR.md.
|
||||
36
SECURITY.md
36
SECURITY.md
@ -6,8 +6,8 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
||||
|
||||
| Version | Supported |
|
||||
| --------- | ------------------ |
|
||||
| <= 9.0.* | :x: |
|
||||
| >= 10.0.* | :white_check_mark: |
|
||||
| <= 12.* | :x: |
|
||||
| >= 13.* | :white_check_mark: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
@ -23,11 +23,11 @@ If you believe you've found a security bug in our service, we are happy to work
|
||||
|
||||
Any type of denial of service attacks is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
|
||||
|
||||
We recommand to install Dolibarr ERP CRM on you own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
|
||||
We recommand to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
|
||||
|
||||
### User Agent
|
||||
|
||||
If you try to find bug on Dolibarr, we recommend to append to your user-agent header the following value: '-BugHunting-dolibarr'.
|
||||
If you try to find bug on Dolibarr, we recommend to append to your user-agent header the following value: '-securitytest-for-dolibarr'.
|
||||
|
||||
### Account access
|
||||
|
||||
@ -36,44 +36,32 @@ You can install the web application yourself on your own platform/server so you
|
||||
|
||||
## Eligibility and Responsible Disclosure
|
||||
|
||||
We are happy to thank everyone who submits valid reports which help us improve the security of Dolibarr however, only those that meet the following eligibility requirements may receive a monetary reward:
|
||||
We are happy to thank everyone who submits valid reports which help us improve the security of Dolibarr however, only those that meet the following eligibility requirements will be "validated reports" (if not, we may close the report without any answer):
|
||||
|
||||
You must be the first reporter of a vulnerability.
|
||||
|
||||
The vulnerability must be a qualifying vulnerability (see below)
|
||||
|
||||
Any vulnerability found must be reported no later than 24 hours after discovery
|
||||
You must be the first reporter of the vulnerability (duplicate reports are closed).
|
||||
|
||||
You must send a clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
|
||||
|
||||
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommand to install softwate on your own platform.
|
||||
|
||||
You must not leak, manipulate, or destroy any user data.
|
||||
|
||||
You must not be a former or current employee of Dolibarr or one of its contractor.
|
||||
|
||||
Reports about vulnerabilities are examined by our security analysts.
|
||||
|
||||
Our analysis is always based on worst case exploitation of the vulnerability, as is the reward we pay.
|
||||
|
||||
No vulnerability disclosure, including partial is allowed for the moment.
|
||||
You must not leak, manipulate, or destroy any user data of third parties to find your vulnerability.
|
||||
|
||||
|
||||
## Scope for qualified vulnerabilities
|
||||
|
||||
ONLY vulnerabilities discovered, when the following setup on test platform is used, are accepted:
|
||||
ONLY vulnerabilities discovered, when the following setup on test platform is used, are "valid":
|
||||
|
||||
* $dolibarr_main_prod must be set to 1 into conf.php
|
||||
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
|
||||
* $dolibarr_main_force_https must be set to something else than 0.
|
||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be enabled soon by default)
|
||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default)
|
||||
* The module DebugBar must NOT be enabled (by default, this module is not enabled. This is a developer tool)
|
||||
* The module ModuleBuilder must NOT be enabled (by default, this module is not enabled. This is a developer tool)
|
||||
* ONLY security reports on modules provided by default and with the "stable" status are allowed (troubles into "experimental", "developement" or external modules are not accepted).
|
||||
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
|
||||
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
||||
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
|
||||
* CSRF attacks are accepted for all when using a POST URL, but are accepted only for creating or updating data resctricted to the admin user when using GET URL.
|
||||
* Ability for a high level user to edit web site pages in the CMS by including javascript is an expected feature.
|
||||
* CSRF attacks are accepted for all when using a POST URL, but when using GET URL, they are validated only for creating or updating data resctricted to the admin user.
|
||||
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
|
||||
|
||||
Scope is the web application (back office) and the APIs.
|
||||
|
||||
|
||||
@ -306,7 +306,7 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
|
||||
- htdocs/includes/jquery/plugins/datatables
|
||||
- htdocs/includes/jszip
|
||||
- htdocs/includes/mike42
|
||||
- htdocs/includes/phpexcel or htdocs/includes/phpoffice
|
||||
- htdocs/includes/phpoffice
|
||||
- htdocs/includes/restler/framework/Luracast/Restler/explorer
|
||||
- htdocs/includes/swiftmailer
|
||||
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
|
||||
|
||||
@ -37,7 +37,7 @@ Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
2010, Servitux Servicios Informaticos <info@servitux.es>
|
||||
2011, Herve Prot <herve.prot@symeos.com>
|
||||
2011, Remy Younes <ryounes@gmail.com>
|
||||
2012-2013, Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
2012-2013, Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
|
||||
License: GPL-3+
|
||||
This program is free software; you can redistribute it
|
||||
@ -189,36 +189,12 @@ License: CC-BY-SA-3.0
|
||||
For more information, see https://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/fpdfi/*
|
||||
Copyright: 2004-2011 Setasign - Jan Slabon
|
||||
License: GPL-2+
|
||||
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 the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
.
|
||||
This program is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the full text of the GNU General Public
|
||||
License version 2 can be found in the file
|
||||
'/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/geoip/*
|
||||
Files: htdocs/includes/geoip2/*
|
||||
Copyright: 2007 MaxMind LLC
|
||||
License: LGPL-2.1+
|
||||
License: CC-By-SA
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
@ -380,30 +356,7 @@ License: GPL-2+
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/phpexcel/*
|
||||
Copyright: 2006-2011 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
License: LGPL-2.1+
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the full text of the GNU Lesser General Public
|
||||
License version 2.1 can be found in the file
|
||||
'/usr/share/common-licenses/LGPL-2.1'.
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/tcpdf/*
|
||||
Files: htdocs/includes/tecnickcom/*
|
||||
Copyright: 2002-2013 Nicola Asuni - Tecnick.com LTD
|
||||
License: LGPL-3.0+
|
||||
TCPDF is free software: you can redistribute it and/or modify it
|
||||
|
||||
@ -150,7 +150,6 @@ case "$1" in
|
||||
##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
##grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
##grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
|
||||
@ -35,7 +35,6 @@ $force_install_distrib='debian';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled'
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
|
||||
@ -103,8 +103,6 @@ override_dh_install:
|
||||
|
||||
# clean from useless files
|
||||
rm -fr htdocs/includes/jquery/plugins/multiselect
|
||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
|
||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
|
||||
rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33
|
||||
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
|
||||
rm -fr htdocs/includes/tcpdf/fonts/utils
|
||||
@ -113,7 +111,6 @@ override_dh_install:
|
||||
|
||||
# Licence files are already included into copyright file.
|
||||
rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt
|
||||
rm -f htdocs/includes/phpexcel/license.txt
|
||||
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
||||
|
||||
# Drop unwanted executable permissions
|
||||
|
||||
@ -118,7 +118,7 @@ Source: "C:\wamp64\bin\mariadb\mariadb10.4.10\*.*"; DestDir: "{app}\bin\mariadb\
|
||||
;Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mariadb\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
||||
|
||||
; Dolibarr
|
||||
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
|
||||
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
|
||||
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
|
||||
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
|
||||
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
|
||||
|
||||
@ -476,6 +476,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
||||
@ -615,13 +616,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PDF`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
||||
$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`;
|
||||
|
||||
@ -274,7 +274,6 @@ then
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
|
||||
@ -424,7 +424,6 @@ then
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
|
||||
@ -271,7 +271,6 @@ then
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
|
||||
@ -282,7 +282,6 @@ then
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||
|
||||
@ -25,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
||||
$force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
|
||||
@ -25,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
||||
$force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
|
||||
@ -25,7 +25,6 @@ $force_install_distrib='rpmopensuse';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
||||
$force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
|
||||
@ -59,4 +59,4 @@
|
||||
"ext-zip" : "ODT, Excel and file compression support",
|
||||
"ext-xml" : "Excel support"
|
||||
}
|
||||
}
|
||||
}
|
||||
501
composer.lock
generated
501
composer.lock
generated
@ -6,53 +6,6 @@
|
||||
],
|
||||
"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",
|
||||
@ -92,6 +45,12 @@
|
||||
"text",
|
||||
"wysiwyg"
|
||||
],
|
||||
"support": {
|
||||
"forum": "http://ckeditor.com/forums",
|
||||
"issues": "http://dev.ckeditor.com",
|
||||
"source": "http://github.com/ckeditor/ckeditor-dev",
|
||||
"wiki": "http://docs.ckeditor.com"
|
||||
},
|
||||
"time": "2019-06-28T10:41:23+00:00"
|
||||
},
|
||||
{
|
||||
@ -153,6 +112,10 @@
|
||||
"debug",
|
||||
"debugbar"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/maximebf/php-debugbar/issues",
|
||||
"source": "https://github.com/maximebf/php-debugbar/tree/v1.15.1"
|
||||
},
|
||||
"time": "2019-09-24T14:55:42+00:00"
|
||||
},
|
||||
{
|
||||
@ -208,6 +171,10 @@
|
||||
"print",
|
||||
"receipt"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/mike42/escpos-php/issues",
|
||||
"source": "https://github.com/mike42/escpos-php/tree/v2.2"
|
||||
},
|
||||
"time": "2019-10-05T05:59:00+00:00"
|
||||
},
|
||||
{
|
||||
@ -260,6 +227,10 @@
|
||||
"mobile detector",
|
||||
"php mobile detect"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/serbanghita/Mobile-Detect/issues",
|
||||
"source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.34"
|
||||
},
|
||||
"time": "2019-09-18T18:44:20+00:00"
|
||||
},
|
||||
{
|
||||
@ -308,62 +279,54 @@
|
||||
"time": "2020-10-19T12:22:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpexcel",
|
||||
"version": "1.8.1",
|
||||
"name": "psr/log",
|
||||
"version": "1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPOffice/PHPExcel.git",
|
||||
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32"
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
|
||||
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-xml": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.2.0"
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"PHPExcel": "Classes/"
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "Psr/Log/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL"
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Maarten Balliauw",
|
||||
"homepage": "http://blog.maartenballiauw.be"
|
||||
},
|
||||
{
|
||||
"name": "Mark Baker"
|
||||
},
|
||||
{
|
||||
"name": "Franck Lefevre",
|
||||
"homepage": "http://blog.rootslabs.net"
|
||||
},
|
||||
{
|
||||
"name": "Erik Tilt"
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
|
||||
"homepage": "http://phpexcel.codeplex.com",
|
||||
"description": "Common interface for logging libraries",
|
||||
"homepage": "https://github.com/php-fig/log",
|
||||
"keywords": [
|
||||
"OpenXML",
|
||||
"excel",
|
||||
"php",
|
||||
"spreadsheet",
|
||||
"xls",
|
||||
"xlsx"
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"abandoned": "phpoffice/phpspreadsheet",
|
||||
"time": "2015-05-01T07:00:55+00:00"
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/log/tree/1.1.3"
|
||||
},
|
||||
"time": "2020-03-23T09:12:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "restler/framework",
|
||||
@ -424,6 +387,9 @@
|
||||
"rest",
|
||||
"server"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/Luracast/Restler-Framework/tree/3.0.0-RC6"
|
||||
},
|
||||
"time": "2020-02-13T16:05:12+00:00"
|
||||
},
|
||||
{
|
||||
@ -480,24 +446,28 @@
|
||||
"payment processing",
|
||||
"stripe"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/stripe/stripe-php/issues",
|
||||
"source": "https://github.com/stripe/stripe-php/tree/master"
|
||||
},
|
||||
"time": "2019-08-29T16:56:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.18.1",
|
||||
"version": "v1.20.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a"
|
||||
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a",
|
||||
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
|
||||
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
@ -505,7 +475,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.18-dev"
|
||||
"dev-main": "1.20-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@ -543,6 +513,9 @@
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
@ -557,7 +530,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-14T12:35:20+00:00"
|
||||
"time": "2020-10-23T14:02:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
@ -620,6 +593,9 @@
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/master"
|
||||
},
|
||||
"time": "2015-11-18T13:48:51+00:00"
|
||||
},
|
||||
{
|
||||
@ -682,40 +658,40 @@
|
||||
"pdf417",
|
||||
"qrcode"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/tecnickcom/TCPDF/tree/6.3.2"
|
||||
},
|
||||
"time": "2019-09-20T09:35:01+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
"version": "1.0.5",
|
||||
"version": "1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/instantiator.git",
|
||||
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
|
||||
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
|
||||
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
|
||||
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3,<8.0-DEV"
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"athletic/athletic": "~0.1.8",
|
||||
"doctrine/coding-standard": "^8.0",
|
||||
"ext-pdo": "*",
|
||||
"ext-phar": "*",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
"phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
|
||||
"phpstan/phpstan": "^0.12",
|
||||
"phpstan/phpstan-phpunit": "^0.12",
|
||||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
||||
@ -729,38 +705,59 @@
|
||||
{
|
||||
"name": "Marco Pivetta",
|
||||
"email": "ocramius@gmail.com",
|
||||
"homepage": "http://ocramius.github.com/"
|
||||
"homepage": "https://ocramius.github.io/"
|
||||
}
|
||||
],
|
||||
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
||||
"homepage": "https://github.com/doctrine/instantiator",
|
||||
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
|
||||
"keywords": [
|
||||
"constructor",
|
||||
"instantiate"
|
||||
],
|
||||
"time": "2015-06-14T21:17:01+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/instantiator/issues",
|
||||
"source": "https://github.com/doctrine/instantiator/tree/1.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.doctrine-project.org/sponsorship.html",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/phpdoctrine",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-11-10T18:47:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-parallel-lint/php-console-color",
|
||||
"version": "v0.2",
|
||||
"version": "v0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-parallel-lint/PHP-Console-Color.git",
|
||||
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191"
|
||||
"reference": "b6af326b2088f1ad3b264696c9fd590ec395b49e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191",
|
||||
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191",
|
||||
"url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/b6af326b2088f1ad3b264696c9fd590ec395b49e",
|
||||
"reference": "b6af326b2088f1ad3b264696c9fd590ec395b49e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"replace": {
|
||||
"jakub-onderka/php-console-color": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"jakub-onderka/php-code-style": "1.0",
|
||||
"jakub-onderka/php-parallel-lint": "1.0",
|
||||
"jakub-onderka/php-var-dump-check": "0.*",
|
||||
"php-parallel-lint/php-code-style": "1.0",
|
||||
"php-parallel-lint/php-parallel-lint": "1.0",
|
||||
"php-parallel-lint/php-var-dump-check": "0.*",
|
||||
"phpunit/phpunit": "~4.3",
|
||||
"squizlabs/php_codesniffer": "1.*"
|
||||
},
|
||||
@ -780,7 +777,11 @@
|
||||
"email": "jakub.onderka@gmail.com"
|
||||
}
|
||||
],
|
||||
"time": "2018-09-29T17:23:10+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/php-parallel-lint/PHP-Console-Color/issues",
|
||||
"source": "https://github.com/php-parallel-lint/PHP-Console-Color/tree/master"
|
||||
},
|
||||
"time": "2020-05-14T05:47:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "php-parallel-lint/php-console-highlighter",
|
||||
@ -829,6 +830,10 @@
|
||||
}
|
||||
],
|
||||
"description": "Highlight PHP code in terminal",
|
||||
"support": {
|
||||
"issues": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/issues",
|
||||
"source": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/tree/master"
|
||||
},
|
||||
"time": "2020-05-13T07:37:49+00:00"
|
||||
},
|
||||
{
|
||||
@ -876,39 +881,37 @@
|
||||
],
|
||||
"description": "This tool check syntax of PHP files about 20x faster than serial check.",
|
||||
"homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint",
|
||||
"support": {
|
||||
"source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v0.9.2"
|
||||
},
|
||||
"time": "2015-12-15T10:42:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
"version": "1.0.1",
|
||||
"version": "2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
||||
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
|
||||
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
||||
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
|
||||
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.6"
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-2.x": "2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"phpDocumentor\\Reflection\\": [
|
||||
"src"
|
||||
]
|
||||
"phpDocumentor\\Reflection\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@ -930,44 +933,45 @@
|
||||
"reflection",
|
||||
"static analysis"
|
||||
],
|
||||
"time": "2017-09-11T18:02:19+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
|
||||
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
|
||||
},
|
||||
"time": "2020-06-27T09:03:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-docblock",
|
||||
"version": "4.3.2",
|
||||
"version": "5.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e"
|
||||
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
|
||||
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
|
||||
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0",
|
||||
"phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0",
|
||||
"phpdocumentor/type-resolver": "~0.4 || ^1.0.0",
|
||||
"webmozart/assert": "^1.0"
|
||||
"ext-filter": "*",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"phpdocumentor/reflection-common": "^2.2",
|
||||
"phpdocumentor/type-resolver": "^1.3",
|
||||
"webmozart/assert": "^1.9.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/instantiator": "^1.0.5",
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^6.4"
|
||||
"mockery/mockery": "~1.3.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.x-dev"
|
||||
"dev-master": "5.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"phpDocumentor\\Reflection\\": [
|
||||
"src/"
|
||||
]
|
||||
"phpDocumentor\\Reflection\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@ -978,37 +982,44 @@
|
||||
{
|
||||
"name": "Mike van Riel",
|
||||
"email": "me@mikevanriel.com"
|
||||
},
|
||||
{
|
||||
"name": "Jaap van Otterdijk",
|
||||
"email": "account@ijaap.nl"
|
||||
}
|
||||
],
|
||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||
"time": "2019-09-12T14:27:41+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
||||
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
|
||||
},
|
||||
"time": "2020-09-03T19:13:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/type-resolver",
|
||||
"version": "0.5.1",
|
||||
"version": "1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
||||
"reference": "cf842904952e64e703800d094cdf34e715a8a3ae"
|
||||
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae",
|
||||
"reference": "cf842904952e64e703800d094cdf34e715a8a3ae",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
|
||||
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0",
|
||||
"phpdocumentor/reflection-common": "^1.0"
|
||||
"php": "^7.2 || ^8.0",
|
||||
"phpdocumentor/reflection-common": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^6.4"
|
||||
"ext-tokenizer": "*"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-1.x": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -1026,37 +1037,42 @@
|
||||
"email": "me@mikevanriel.com"
|
||||
}
|
||||
],
|
||||
"time": "2017-12-30T13:23:38+00:00"
|
||||
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
|
||||
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
|
||||
},
|
||||
"time": "2020-09-17T18:55:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpspec/prophecy",
|
||||
"version": "1.9.0",
|
||||
"version": "v1.10.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpspec/prophecy.git",
|
||||
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203"
|
||||
"reference": "451c3cd1418cf640de218914901e51b064abb093"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203",
|
||||
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203",
|
||||
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
|
||||
"reference": "451c3cd1418cf640de218914901e51b064abb093",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/instantiator": "^1.0.2",
|
||||
"php": "^5.3|^7.0",
|
||||
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
|
||||
"sebastian/comparator": "^1.1|^2.0|^3.0",
|
||||
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
|
||||
"sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
|
||||
"sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpspec/phpspec": "^2.5|^3.2",
|
||||
"phpspec/phpspec": "^2.5 || ^3.2",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.8.x-dev"
|
||||
"dev-master": "1.10.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -1089,7 +1105,11 @@
|
||||
"spy",
|
||||
"stub"
|
||||
],
|
||||
"time": "2019-10-03T11:07:50+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/phpspec/prophecy/issues",
|
||||
"source": "https://github.com/phpspec/prophecy/tree/v1.10.3"
|
||||
},
|
||||
"time": "2020-03-05T15:02:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@ -1151,6 +1171,11 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.net/phpunit",
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2"
|
||||
},
|
||||
"time": "2015-10-06T15:47:00+00:00"
|
||||
},
|
||||
{
|
||||
@ -1198,6 +1223,11 @@
|
||||
"filesystem",
|
||||
"iterator"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.net/phpunit",
|
||||
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5"
|
||||
},
|
||||
"time": "2017-11-27T13:52:08+00:00"
|
||||
},
|
||||
{
|
||||
@ -1239,6 +1269,10 @@
|
||||
"keywords": [
|
||||
"template"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1"
|
||||
},
|
||||
"time": "2015-06-21T13:50:34+00:00"
|
||||
},
|
||||
{
|
||||
@ -1288,6 +1322,10 @@
|
||||
"keywords": [
|
||||
"timer"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-timer/tree/master"
|
||||
},
|
||||
"time": "2017-02-26T11:10:40+00:00"
|
||||
},
|
||||
{
|
||||
@ -1337,6 +1375,10 @@
|
||||
"keywords": [
|
||||
"tokenizer"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4"
|
||||
},
|
||||
"abandoned": true,
|
||||
"time": "2017-12-04T08:55:13+00:00"
|
||||
},
|
||||
@ -1410,6 +1452,10 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36"
|
||||
},
|
||||
"time": "2017-06-21T08:07:12+00:00"
|
||||
},
|
||||
{
|
||||
@ -1466,6 +1512,11 @@
|
||||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.net/phpunit",
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3"
|
||||
},
|
||||
"abandoned": true,
|
||||
"time": "2015-10-02T06:51:40+00:00"
|
||||
},
|
||||
@ -1531,6 +1582,11 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.net/phpunit",
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit-selenium/issues",
|
||||
"source": "https://github.com/giorgiosironi/phpunit-selenium/tree/2.x"
|
||||
},
|
||||
"time": "2017-01-23T22:15:32+00:00"
|
||||
},
|
||||
{
|
||||
@ -1595,6 +1651,10 @@
|
||||
"compare",
|
||||
"equality"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/comparator/issues",
|
||||
"source": "https://github.com/sebastianbergmann/comparator/tree/1.2"
|
||||
},
|
||||
"time": "2017-01-29T09:50:25+00:00"
|
||||
},
|
||||
{
|
||||
@ -1647,6 +1707,10 @@
|
||||
"keywords": [
|
||||
"diff"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/diff/issues",
|
||||
"source": "https://github.com/sebastianbergmann/diff/tree/1.4"
|
||||
},
|
||||
"time": "2017-05-22T07:24:03+00:00"
|
||||
},
|
||||
{
|
||||
@ -1697,6 +1761,10 @@
|
||||
"environment",
|
||||
"hhvm"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/environment/issues",
|
||||
"source": "https://github.com/sebastianbergmann/environment/tree/1.3"
|
||||
},
|
||||
"time": "2016-08-18T05:49:44+00:00"
|
||||
},
|
||||
{
|
||||
@ -1764,6 +1832,10 @@
|
||||
"export",
|
||||
"exporter"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/exporter/issues",
|
||||
"source": "https://github.com/sebastianbergmann/exporter/tree/master"
|
||||
},
|
||||
"time": "2016-06-17T09:04:28+00:00"
|
||||
},
|
||||
{
|
||||
@ -1815,6 +1887,10 @@
|
||||
"keywords": [
|
||||
"global state"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/global-state/issues",
|
||||
"source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1"
|
||||
},
|
||||
"time": "2015-10-12T03:26:01+00:00"
|
||||
},
|
||||
{
|
||||
@ -1868,6 +1944,10 @@
|
||||
],
|
||||
"description": "Provides functionality to recursively process PHP variables",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
|
||||
"source": "https://github.com/sebastianbergmann/recursion-context/tree/master"
|
||||
},
|
||||
"time": "2016-10-03T07:41:43+00:00"
|
||||
},
|
||||
{
|
||||
@ -1903,6 +1983,10 @@
|
||||
],
|
||||
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
||||
"homepage": "https://github.com/sebastianbergmann/version",
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/version/issues",
|
||||
"source": "https://github.com/sebastianbergmann/version/tree/1.0.6"
|
||||
},
|
||||
"time": "2015-06-21T13:59:46+00:00"
|
||||
},
|
||||
{
|
||||
@ -1981,24 +2065,29 @@
|
||||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
|
||||
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
|
||||
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
|
||||
},
|
||||
"time": "2018-11-07T22:31:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.12.0",
|
||||
"version": "v1.20.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
|
||||
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
|
||||
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
|
||||
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "For best performance"
|
||||
@ -2006,7 +2095,11 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.12-dev"
|
||||
"dev-main": "1.20-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -2039,20 +2132,37 @@
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"time": "2019-08-06T08:03:45+00:00"
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
|
||||
},
|
||||
"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-10-23T14:02:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v3.4.32",
|
||||
"version": "v3.4.47",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "768f817446da74a776a31eea335540f9dcb53942"
|
||||
"reference": "88289caa3c166321883f67fe5130188ebbb47094"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/768f817446da74a776a31eea335540f9dcb53942",
|
||||
"reference": "768f817446da74a776a31eea335540f9dcb53942",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094",
|
||||
"reference": "88289caa3c166321883f67fe5130188ebbb47094",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2069,11 +2179,6 @@
|
||||
"symfony/console": "For validating YAML files using the lint command"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Yaml\\": ""
|
||||
@ -2098,35 +2203,51 @@
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-09-10T10:38:46+00:00"
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/yaml/tree/v3.4.47"
|
||||
},
|
||||
"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-10-24T10:57:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "1.5.0",
|
||||
"version": "1.9.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozart/assert.git",
|
||||
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
|
||||
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
|
||||
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.3.3 || ^7.0",
|
||||
"php": "^5.3.3 || ^7.0 || ^8.0",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"phpstan/phpstan": "<0.12.20",
|
||||
"vimeo/psalm": "<3.9.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webmozart\\Assert\\": "src/"
|
||||
@ -2148,7 +2269,11 @@
|
||||
"check",
|
||||
"validate"
|
||||
],
|
||||
"time": "2019-08-24T08:43:50+00:00"
|
||||
"support": {
|
||||
"issues": "https://github.com/webmozart/assert/issues",
|
||||
"source": "https://github.com/webmozart/assert/tree/master"
|
||||
},
|
||||
"time": "2020-07-08T17:02:28+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
@ -48,6 +48,7 @@ By
|
||||
* In file nusoap.php, to avoid a warning,
|
||||
Replace call to serialize_val with no bugged value
|
||||
|
||||
* In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
|
||||
|
||||
|
||||
|
||||
@ -217,14 +218,6 @@ JQUERYFILETREE:
|
||||
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
|
||||
|
||||
|
||||
PHPEXCEL:
|
||||
---------
|
||||
* Replace in htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
|
||||
continue;
|
||||
with:
|
||||
continue 2;
|
||||
|
||||
|
||||
RESTLER:
|
||||
--------
|
||||
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
||||
|
||||
@ -189,8 +189,8 @@ export res=$?
|
||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||
if [ "x$documentdir" != "x" ]
|
||||
then
|
||||
$DIALOG --title "Reset document directory tpp" --clear \
|
||||
--inputbox "Delete and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
|
||||
$DIALOG --title "Reset document directory" --clear \
|
||||
--inputbox "DELETE and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
|
||||
|
||||
valret=$?
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -801,7 +801,7 @@ class AccountancyExport
|
||||
public function exportFEC($objectLines)
|
||||
{
|
||||
$separator = "\t";
|
||||
$end_line = "\n";
|
||||
$end_line = "\r\n";
|
||||
|
||||
print "JournalCode".$separator;
|
||||
print "JournalLib".$separator;
|
||||
@ -824,65 +824,70 @@ class AccountancyExport
|
||||
print $end_line;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
unset($array[$line]);
|
||||
} else {
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal.$separator;
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal.$separator;
|
||||
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label.$separator;
|
||||
// FEC:JournalLib
|
||||
print $line->journal_label.$separator;
|
||||
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num.$separator;
|
||||
// FEC:EcritureNum
|
||||
print $line->piece_num.$separator;
|
||||
|
||||
// FEC:EcritureDate
|
||||
print $date_document.$separator;
|
||||
// FEC:EcritureDate
|
||||
print $date_document.$separator;
|
||||
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte.$separator;
|
||||
// FEC:CompteNum
|
||||
print $line->numero_compte.$separator;
|
||||
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte).$separator;
|
||||
// FEC:CompteLib
|
||||
print dol_string_unaccent($line->label_compte).$separator;
|
||||
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account.$separator;
|
||||
// FEC:CompAuxNum
|
||||
print $line->subledger_account.$separator;
|
||||
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label).$separator;
|
||||
// FEC:CompAuxLib
|
||||
print dol_string_unaccent($line->subledger_label).$separator;
|
||||
|
||||
// FEC:PieceRef
|
||||
print $line->doc_ref.$separator;
|
||||
// FEC:PieceRef
|
||||
print $line->doc_ref.$separator;
|
||||
|
||||
// FEC:PieceDate
|
||||
print dol_string_unaccent($date_creation).$separator;
|
||||
// FEC:PieceDate
|
||||
print dol_string_unaccent($date_creation).$separator;
|
||||
|
||||
// FEC:EcritureLib
|
||||
print $line->label_operation.$separator;
|
||||
// FEC:EcritureLib
|
||||
print dol_string_unaccent($line->label_operation).$separator;
|
||||
|
||||
// FEC:Debit
|
||||
print price2fec($line->debit).$separator;
|
||||
// FEC:Debit
|
||||
print price2fec($line->debit).$separator;
|
||||
|
||||
// FEC:Credit
|
||||
print price2fec($line->credit).$separator;
|
||||
// FEC:Credit
|
||||
print price2fec($line->credit).$separator;
|
||||
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code.$separator;
|
||||
// FEC:EcritureLet
|
||||
print $line->lettering_code.$separator;
|
||||
|
||||
// FEC:DateLet
|
||||
print $line->date_lettering.$separator;
|
||||
// FEC:DateLet
|
||||
print $date_lettering.$separator;
|
||||
|
||||
// FEC:ValidDate
|
||||
print $date_validation.$separator;
|
||||
// FEC:ValidDate
|
||||
print $date_validation.$separator;
|
||||
|
||||
// FEC:Montantdevise
|
||||
print $line->multicurrency_amount.$separator;
|
||||
// FEC:Montantdevise
|
||||
print $line->multicurrency_amount.$separator;
|
||||
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
// FEC:Idevise
|
||||
print $line->multicurrency_code;
|
||||
|
||||
print $end_line;
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -960,7 +960,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$form->editfieldkey("Categories", 'memcats', '', $object, 0).'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
|
||||
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
|
||||
print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -178,13 +178,6 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FACEBOOK_URL", GETPOST("facebookurl", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TWITTER_URL", GETPOST("twitterurl", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LINKEDIN_URL", GETPOST("linkedinurl", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_INSTAGRAM_URL", GETPOST("instagramurl", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_YOUTUBE_URL", GETPOST("youtubeurl", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GITHUB_URL", GETPOST("githuburl", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'nohtml'), 'chaine', 0, '', $conf->entity);
|
||||
@ -478,6 +471,14 @@ if (!empty($mysoc->logo_small)) {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||
print '</div>';
|
||||
} elseif (!empty($mysoc->logo)) {
|
||||
if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_mini', $quality);
|
||||
}
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_small', $quality);
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
} elseif (!empty($mysoc->logo)) {
|
||||
@ -505,6 +506,14 @@ if (!empty($mysoc->logo_squarred_small)) {
|
||||
print '<div class="inline-block valignmiddle marginrightonly">';
|
||||
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small).'">';
|
||||
print '</div>';
|
||||
} elseif (!empty($mysoc->logo_squarred)) {
|
||||
if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
|
||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini, '_mini', $quality);
|
||||
}
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini, '_small', $quality);
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
} elseif (!empty($mysoc->logo_squarred)) {
|
||||
@ -530,25 +539,6 @@ print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
// Social networks
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$listofnetworks = array('facebook'=>'facebook', 'twitter'=>'twitter', 'linkedin'=>'linkedin', 'instagram'=>'instagram', 'youtube'=>'youtube', 'github'=>'github');
|
||||
foreach ($listofnetworks as $networkkey => $networkicon) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<label for="'.$networkkey.'url">'.$langs->trans("SocialNetworks".ucfirst($networkkey)."URL").'</label></td><td>';
|
||||
$networkconst = 'MAIN_INFO_SOCIETE_'.strtoupper($networkkey).'_URL';
|
||||
print '<span class="fa paddingright fa-'.($networkicon ? $networkicon : 'link').'"></span>';
|
||||
print '<input name="'.$networkkey.'url" id="'.$networkkey.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconst).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
// IDs of the company (country-specific)
|
||||
@ -695,7 +685,7 @@ print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Main tax
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
$tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') $tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
|
||||
@ -703,7 +693,7 @@ print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDes
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
||||
print '<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="no_vat" value="0"'.(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
$tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') $tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
|
||||
@ -723,7 +713,7 @@ print "</tr>\n";
|
||||
if ($mysoc->useLocalTax(1))
|
||||
{
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print '<div class="nobordernopadding">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||
@ -742,7 +732,7 @@ if ($mysoc->useLocalTax(1))
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
|
||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||
@ -770,7 +760,7 @@ print "</tr>\n";
|
||||
if ($mysoc->useLocalTax(2))
|
||||
{
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print '<div class="nobordernopadding">';
|
||||
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
||||
@ -786,7 +776,7 @@ if ($mysoc->useLocalTax(2))
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<div>";
|
||||
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
|
||||
|
||||
142
htdocs/admin/company_socialnetworks.php
Normal file
142
htdocs/admin/company_socialnetworks.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2017 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/company_socialnetworks.php
|
||||
* \ingroup company
|
||||
* \brief Setup page to configure company social networks
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'companies'));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
$listofnetworks = getArrayOfSocialNetworks();
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('adminsocialnetworkscompany', 'globaladmin'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (($action == 'update' && !GETPOST("cancel", 'alpha'))) {
|
||||
foreach ($listofnetworks as $key => $value) {
|
||||
if (!empty($value['active'])) {
|
||||
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
|
||||
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
|
||||
if (GETPOSTISSET($key.'url') && GETPOST($key.'url', 'alpha') != '') {
|
||||
dolibarr_set_const($db, $networkconstname, GETPOST($key.'url', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, $networkconstid, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
} elseif (GETPOSTISSET($key) && GETPOST($key, 'alpha') != '') {
|
||||
if (!empty($listofnetworks[$key]['url'])) {
|
||||
$url = str_replace('{socialid}', GETPOST($key, 'alpha'), $listofnetworks[$key]['url']);
|
||||
dolibarr_set_const($db, $networkconstname, $url, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
dolibarr_set_const($db, $networkconstid, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
dolibarr_del_const($db, $networkconstname, $conf->entity);
|
||||
dolibarr_del_const($db, $networkconstid, $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
|
||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
|
||||
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
|
||||
|
||||
$head = company_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'socialnetworks', $langs->trans("SocialNetworksInformation"), -1, 'company');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
/**
|
||||
* Edit parameters
|
||||
*/
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
// Social networks
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
foreach ($listofnetworks as $key => $value) {
|
||||
if (!empty($value['active'])) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><label for="'.$key.'url">'.$langs->trans(ucfirst($key)).'</label></td>';
|
||||
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
|
||||
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
|
||||
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
|
||||
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstname).'">';
|
||||
print '</td><td>';
|
||||
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstid).'">';
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_socialnetworks($conf->global->$networkconstid, 0, 0, $key, $listofnetworks).'</td>';
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -412,13 +412,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver);
|
||||
} else {
|
||||
$morehtml .= 'IMAP functions not available on your PHP';
|
||||
$morehtml .= 'IMAP functions not available on your PHP. ';
|
||||
}
|
||||
|
||||
if (!$connection)
|
||||
{
|
||||
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
|
||||
$morehtml .= '<br>'.imap_last_error();
|
||||
if (function_exists('imap_last_error')) {
|
||||
$morehtml .= '<br>'.imap_last_error();
|
||||
}
|
||||
//var_dump(imap_errors())
|
||||
} else {
|
||||
$morehtml .= imap_num_msg($connection);
|
||||
|
||||
@ -131,9 +131,12 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
$permissiontoread = $user->rights->emailcollector->read;
|
||||
/*$permissiontoread = $user->rights->emailcollector->read;
|
||||
$permissiontoadd = $user->rights->emailcollector->write;
|
||||
$permissiontodelete = $user->rights->emailcollector->delete;
|
||||
$permissiontodelete = $user->rights->emailcollector->delete;*/
|
||||
$permissiontoread = $user->admin;
|
||||
$permissiontoadd = $user->admin;
|
||||
$permissiontodelete = $user->admin;
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (empty($conf->emailcollector->enabled)) accessforbidden('Module not enabled');
|
||||
@ -175,8 +178,6 @@ if (empty($reshook))
|
||||
// Mass actions
|
||||
$objectclass = 'EmailCollector';
|
||||
$objectlabel = 'EmailCollector';
|
||||
$permissiontoread = $user->rights->emailcollector->read;
|
||||
$permissiontodelete = $user->rights->emailcollector->delete;
|
||||
$uploaddir = $conf->emailcollector->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
@ -156,7 +156,8 @@ if ($action == 'update')
|
||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
//dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
//dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
//dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
@ -241,30 +242,33 @@ print '<input type="hidden" name="action" value="update">';
|
||||
clearstatcache();
|
||||
|
||||
print '<br>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
|
||||
print '</tr>';
|
||||
|
||||
// Default language
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
|
||||
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multilingual GUI
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table><br>'."\n";
|
||||
print '</div>';
|
||||
|
||||
// Themes and themes options
|
||||
showSkins(null, 1);
|
||||
print '<br>';
|
||||
|
||||
// Other
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="otherparameters" class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th>'.$langs->trans("Miscellaneous").'</th><th></th>';
|
||||
print '<th width="20"> </tg>';
|
||||
@ -299,37 +303,46 @@ print '</tr>';
|
||||
*/
|
||||
|
||||
// First day for weeks
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("WeekStartOnDay").'</td><td>';
|
||||
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// DefaultWorkingDays
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
||||
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5').'">';
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// DefaultWorkingHours
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
||||
print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18').'">';
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname/Name
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
||||
$array = array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
|
||||
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Hide unauthorized menus
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideUnauthorizedMenu").'</td><td>';
|
||||
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
|
||||
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Hide unauthorized button
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
|
||||
print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
|
||||
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
|
||||
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
@ -337,7 +350,7 @@ print '</tr>';
|
||||
// Hide version link
|
||||
/*
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
|
||||
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
@ -345,7 +358,7 @@ print '</tr>';
|
||||
*/
|
||||
|
||||
// Show bugtrack link
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
||||
print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0);
|
||||
//print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1);
|
||||
print '</td>';
|
||||
@ -354,7 +367,7 @@ print '</tr>';
|
||||
|
||||
// Hide wiki link on login page
|
||||
$pictohelp = '<span class="fa fa-question-circle"></span>';
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp", $pictohelp).'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')).'</td><td>';
|
||||
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
|
||||
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
|
||||
print '</td>';
|
||||
@ -365,7 +378,7 @@ print '</tr>';
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
print '<tr class="oddeven"><td class="titlefield">';
|
||||
print '<tr class="oddeven"><td>';
|
||||
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
foreach ($substitutionarray as $key => $val)
|
||||
{
|
||||
@ -381,18 +394,19 @@ $doleditor->Create();
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Other
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="edit" class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage").'</th><th></th>';
|
||||
print '<tr class="liste_titre"><th>'.$langs->trans("LoginPage").'</th><th></th>';
|
||||
print '<th width="20"> </th>';
|
||||
print '</tr>';
|
||||
|
||||
// Hide helpcenter link on login page
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
||||
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
|
||||
@ -141,12 +141,6 @@ $head[$h][1] = $langs->trans("MenuAdmin");
|
||||
$head[$h][2] = 'editor';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'misc';
|
||||
$h++;
|
||||
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
@ -224,11 +224,6 @@ $head[$h][1] = $langs->trans("MenuAdmin");
|
||||
$head[$h][2] = 'editor';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'misc';
|
||||
$h++;
|
||||
|
||||
print dol_get_fiche_head($head, 'editor', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("MenusEditorDesc")."</span><br>\n";
|
||||
|
||||
@ -1,106 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/menus/other.php
|
||||
* \ingroup core
|
||||
* \brief Menus options setup
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("user", "other", "admin"));
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'activate_hidemenu')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
} elseif ($action == 'disable_hidemenu')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("Setup"));
|
||||
|
||||
print load_fiche_titre($langs->trans("Menus"), '', 'title_setup');
|
||||
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
|
||||
$head[$h][1] = $langs->trans("MenuHandlers");
|
||||
$head[$h][2] = 'handler';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
|
||||
$head[$h][1] = $langs->trans("MenuAdmin");
|
||||
$head[$h][2] = 'editor';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'misc';
|
||||
$h++;
|
||||
|
||||
print dol_get_fiche_head($head, 'misc', '', -1);
|
||||
|
||||
|
||||
// Other Options
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
|
||||
print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Hide unauthorized menu
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
|
||||
print '<td class="center">';
|
||||
if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members'));
|
||||
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'stocks'));
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@ -80,6 +80,7 @@ if ($action == 'update')
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -331,6 +332,10 @@ print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? G
|
||||
//}
|
||||
print '</td></tr>';
|
||||
|
||||
// SHOW_SUBPRODUCT_REF_IN_PDF - Option to show the detail of product ref for kits.
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("SHOW_SUBPRODUCT_REF_IN_PDF", $langs->transnoentitiesnoconv("AssociatedProductsAbility"), $langs->transnoentitiesnoconv("Products")).'</td><td>';
|
||||
print $form->selectyesno('SHOW_SUBPRODUCT_REF_IN_PDF', (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) ? $conf->global->SHOW_SUBPRODUCT_REF_IN_PDF : 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -146,8 +146,7 @@ elseif ($action == 'setdoc')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
} elseif ($action == 'unsetdoc')
|
||||
{
|
||||
} elseif ($action == 'unsetdoc') {
|
||||
dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,6 @@ $configfileparameters = array(
|
||||
'?dolibarr_lib_FPDI_PATH',
|
||||
'?dolibarr_lib_TCPDI_PATH',
|
||||
'?dolibarr_lib_NUSOAP_PATH',
|
||||
'?dolibarr_lib_PHPEXCEL_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
@ -124,7 +123,6 @@ $configfilelib = array(
|
||||
'dolibarr_lib_TCPDF_PATH',
|
||||
'dolibarr_lib_FPDI_PATH',
|
||||
'dolibarr_lib_NUSOAP_PATH',
|
||||
'dolibarr_lib_PHPEXCEL_PATH',
|
||||
'dolibarr_lib_GEOIP_PATH',
|
||||
'dolibarr_lib_ODTPHP_PATH',
|
||||
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
|
||||
@ -319,7 +319,6 @@ $configfileparameters = array(
|
||||
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
|
||||
'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
|
||||
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
|
||||
'?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
|
||||
@ -191,6 +191,16 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
$functions = ["imap_open"];
|
||||
$name = "IMAP";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
print "</tr>";
|
||||
|
||||
$functions = array();
|
||||
$name = "xDebug";
|
||||
|
||||
@ -346,7 +356,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function
|
||||
}
|
||||
|
||||
$html = "<td>";
|
||||
$html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport".$name);
|
||||
$html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport", $name);
|
||||
$html .= "</td>";
|
||||
|
||||
return $html;
|
||||
|
||||
@ -33,8 +33,8 @@ $langs->load("admin");
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$what = GETPOST('what', 'alpha');
|
||||
$export_type = GETPOST('export_type', 'alpha');
|
||||
$file = GETPOST('zipfilename_template', 'alpha');
|
||||
$compression = GETPOST('compression');
|
||||
$file = trim(GETPOST('zipfilename_template', 'alpha'));
|
||||
$compression = GETPOST('compression', 'aZ09');
|
||||
|
||||
$file = dol_sanitizeFileName($file);
|
||||
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);
|
||||
|
||||
@ -120,7 +120,7 @@ class Documents extends DolibarrApi
|
||||
/**
|
||||
* Build a document.
|
||||
*
|
||||
* Test sample 1: { "module_part": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
|
||||
* Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
|
||||
*
|
||||
* @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...).
|
||||
* @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf).
|
||||
@ -497,6 +497,17 @@ class Documents extends DolibarrApi
|
||||
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||
if (empty($filearray)) {
|
||||
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
|
||||
} else {
|
||||
if (($object->id) > 0 && !empty($modulepart)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
|
||||
$ecmfile = new EcmFiles($this->db);
|
||||
$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id));
|
||||
if ($result < 0) {
|
||||
throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror());
|
||||
} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
|
||||
$filearray['ecmfiles_infos'] = $ecmfile->lines;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $filearray;
|
||||
|
||||
@ -84,9 +84,9 @@ class Asset extends CommonObject
|
||||
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>1),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1),
|
||||
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'searchall'=>1),
|
||||
'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
|
||||
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
|
||||
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1),
|
||||
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>41, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,),
|
||||
|
||||
@ -18,16 +18,6 @@
|
||||
* See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54
|
||||
*/
|
||||
|
||||
/*ini_set('unserialize_callback_func', 'mycallback');
|
||||
|
||||
function mycallback($classname)
|
||||
{
|
||||
//var_dump($classname);
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage Blocked Log
|
||||
@ -182,8 +172,8 @@ class BlockedLog
|
||||
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY';
|
||||
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE';
|
||||
|
||||
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all POS modules
|
||||
$moduleposenabled = ($conf->cashdesk->enabled || $conf->takepos->enabled || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
|
||||
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules
|
||||
$moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
|
||||
if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE';
|
||||
|
||||
if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) {
|
||||
@ -454,7 +444,9 @@ class BlockedLog
|
||||
'ref', 'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc', 'qty', 'product_type', 'vat_src_code', 'tva_tx', 'info_bits', 'localtax1_tx', 'localtax2_tx', 'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2'
|
||||
))) continue; // Discard if not into a dedicated list
|
||||
|
||||
if (!is_object($this->object_data->invoiceline[$lineid])) $this->object_data->invoiceline[$lineid] = new stdClass();
|
||||
if (empty($this->object_data->invoiceline[$lineid]) || !is_object($this->object_data->invoiceline[$lineid])) { // To avoid warning
|
||||
$this->object_data->invoiceline[$lineid] = new stdClass();
|
||||
}
|
||||
|
||||
$this->object_data->invoiceline[$lineid]->{$keyline} = $valueline;
|
||||
}
|
||||
@ -465,7 +457,7 @@ class BlockedLog
|
||||
if (!empty($object->newref)) $this->object_data->ref = $object->newref;
|
||||
} elseif ($this->element == 'invoice_supplier')
|
||||
{
|
||||
foreach ($object as $key=>$value)
|
||||
foreach ($object as $key => $value)
|
||||
{
|
||||
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
|
||||
if (!in_array($key, array(
|
||||
|
||||
@ -35,7 +35,7 @@ $langs->load("categories");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alphanohtml');
|
||||
$type = (int) GETPOST('type', 'int');
|
||||
$type = GETPOST('type', 'aZ09'); // Can be int or string
|
||||
$action = (GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'edit');
|
||||
$confirm = GETPOST('confirm');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
@ -172,7 +172,7 @@ foreach ($fulltree as $key => $val)
|
||||
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
||||
}
|
||||
|
||||
$color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #bbb"';
|
||||
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
|
||||
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
|
||||
@ -1246,17 +1246,18 @@ if ($action == 'create')
|
||||
|
||||
//Reminder
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
|
||||
print '<input class="width50" type="number" name="offsetvalue" value="'.(GETPOSTISSET('offsetvalue') ? GETPOST('offsetvalue', 'int') : '15').'"> '.$form->selectTypeDuration('offsetunit', 'i');
|
||||
print '<input class="width50" type="number" name="offsetvalue" value="'.(GETPOSTISSET('offsetvalue') ? GETPOST('offsetvalue', 'int') : '15').'"> ';
|
||||
print $form->selectTypeDuration('offsetunit', 'i', array('y', 'm'));
|
||||
print '</td></tr>';
|
||||
|
||||
//Reminder Type
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
|
||||
print $form->selectarray('selectremindertype', $TRemindTypes);
|
||||
print $form->selectarray('selectremindertype', $TRemindTypes, '', 0, 0, 0, '', 0, 0, 0, '', 'mimnwidth200', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Mail Model
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
|
||||
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1);
|
||||
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1719,21 +1720,23 @@ if ($id > 0)
|
||||
$actionCommReminder->typeremind = 'email';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("AddReminder").'</td><td colspan="3"><input type="checkbox" id="addreminder" name="addreminder" '.$checked.'></td></tr>';
|
||||
print '<label for="addreminder">'.$langs->trans("AddReminder").'</label> <input type="checkbox" id="addreminder" name="addreminder" '.$checked.'><br>';
|
||||
|
||||
print '<div class="reminderparameters" '.(empty($checked) ? 'style="display: none;"' : '').'>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Reminder
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
|
||||
print '<input type="number" name="offsetvalue" class="width50" value="'.$actionCommReminder->offsetvalue.'"> '.$form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit);
|
||||
print '<input type="number" name="offsetvalue" class="width50" value="'.$actionCommReminder->offsetvalue.'"> ';
|
||||
print $form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit, array('y', 'm'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Reminder Type
|
||||
$TRemindTypes = array();
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
|
||||
print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind);
|
||||
print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
$hide = '';
|
||||
@ -1741,7 +1744,7 @@ if ($id > 0)
|
||||
|
||||
// Mail Model
|
||||
print '<tr '.$hide.'><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
|
||||
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1);
|
||||
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -1767,6 +1770,8 @@ if ($id > 0)
|
||||
|
||||
})';
|
||||
print '</script>'."\n";
|
||||
|
||||
print '</div>'; // End of div for reminderparameters
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -518,7 +518,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
||||
}
|
||||
|
||||
// Birthdays
|
||||
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_birthday" name="check_birthday" class="check_birthday"> <span class="check_birthday_text">'.$langs->trans("AgendaShowBirthdayEvents").'</span> </div>';
|
||||
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_birthday" name="check_birthday" class="check_birthday"><label for="check_birthday"> <span class="check_birthday_text">'.$langs->trans("AgendaShowBirthdayEvents").'</span></label> </div>';
|
||||
|
||||
// Calendars from hooks
|
||||
$parameters = array(); $object = null;
|
||||
|
||||
@ -38,7 +38,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other"));
|
||||
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "orders", "bills"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
|
||||
@ -673,7 +673,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
||||
echo '<table width="100%" class="noborder nocellnopadd cal_month">';
|
||||
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<td class="nopaddingtopimp nopaddingbottomimp">';
|
||||
echo '<td class="nopaddingtopimp nopaddingbottomimp nowraponsmartphone">';
|
||||
|
||||
if ($canedit && $action == 'show_peruser')
|
||||
{
|
||||
|
||||
@ -137,8 +137,12 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) {
|
||||
* Draft customer proposals
|
||||
*/
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
|
||||
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -171,13 +175,17 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
|
||||
@ -204,8 +212,12 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
* Draft supplier proposals
|
||||
*/
|
||||
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
|
||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email";
|
||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -237,12 +249,17 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
|
||||
@ -269,8 +286,12 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
||||
* Draft customer orders
|
||||
*/
|
||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
|
||||
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -303,12 +324,17 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
|
||||
@ -335,8 +361,12 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
* Draft purchase orders
|
||||
*/
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
|
||||
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email";
|
||||
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -369,12 +399,17 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
|
||||
@ -403,7 +438,12 @@ print '<div class="ficheaddleft">';
|
||||
* Last modified customers or prospects
|
||||
*/
|
||||
if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas, s.code_client, s.code_compta, s.entity, s.email";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= ", s.datec, s.tms";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
|
||||
@ -434,15 +474,19 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||
while ($i < $num && $i < $max) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$companystatic->id = $objp->rowid;
|
||||
$companystatic->id = $objp->socid;
|
||||
$companystatic->name = $objp->name;
|
||||
$companystatic->client = $objp->client;
|
||||
$companystatic->name_alias = $objp->name_alias;
|
||||
$companystatic->code_client = $objp->code_client;
|
||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$companystatic->canvas = $objp->canvas;
|
||||
$companystatic->code_compta = $objp->code_compta;
|
||||
$companystatic->entity = $objp->entity;
|
||||
$companystatic->client = $objp->client;
|
||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $objp->fournisseur;
|
||||
$companystatic->logo = $objp->logo;
|
||||
$companystatic->email = $objp->email;
|
||||
$companystatic->entity = $objp->entity;
|
||||
$companystatic->canvas = $objp->canvas;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
@ -488,7 +532,12 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||
* Last suppliers
|
||||
*/
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
|
||||
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm, s.code_fournisseur, s.entity, s.email, s.fournisseur";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= ", s.datec as dc, s.tms as dm";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
|
||||
@ -508,14 +557,19 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
while ($i < $num && $i < $max) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$companystatic->id = $objp->rowid;
|
||||
$companystatic->id = $objp->socid;
|
||||
$companystatic->name = $objp->name;
|
||||
$companystatic->name_alias = $objp->name_alias;
|
||||
$companystatic->code_client = $objp->code_client;
|
||||
$companystatic->code_compta = $objp->code_compta;
|
||||
$companystatic->client = $objp->client;
|
||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$companystatic->canvas = $objp->canvas;
|
||||
$companystatic->entity = $objp->entity;
|
||||
$companystatic->email = $objp->email;
|
||||
$companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $objp->fournisseur;
|
||||
$companystatic->logo = $objp->logo;
|
||||
$companystatic->email = $objp->email;
|
||||
$companystatic->entity = $objp->entity;
|
||||
$companystatic->canvas = $objp->canvas;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
|
||||
@ -577,7 +631,11 @@ if ($user->rights->agenda->myactions->read) {
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
|
||||
$staticcontrat = new Contrat($db);
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid, s.canvas, s.code_client, s.entity, s.email";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= ", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
@ -602,13 +660,19 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$companystatic->id = $objp->rowid;
|
||||
$companystatic->name = $objp->name;
|
||||
$companystatic->code_client = $objp->code_client;
|
||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$companystatic->canvas = $objp->canvas;
|
||||
$companystatic->entity = $objp->entity;
|
||||
$companystatic->email = $objp->email;
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
$staticcontrat->id = $obj->contratid;
|
||||
$staticcontrat->ref = $obj->ref;
|
||||
@ -638,7 +702,11 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
|
||||
*/
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
|
||||
$sql .= ", s.nom as name, s.rowid, s.code_client, s.entity, s.email";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -678,14 +746,19 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$propalstatic->total_tva = $obj->total_tva;
|
||||
$propalstatic->total_ttc = $obj->total_ttc;
|
||||
|
||||
$companystatic->id = $obj->rowid;
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
$filename = dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
@ -739,7 +812,11 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
*/
|
||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||
$sql .= ", s.nom as name, s.rowid, s.code_client, s.entity, s.email";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -779,14 +856,19 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$orderstatic->total_tva = $obj->total_tva;
|
||||
$orderstatic->total_ttc = $obj->total_ttc;
|
||||
|
||||
$companystatic->id = $obj->rowid;
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
|
||||
$filename = dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
||||
|
||||
@ -911,6 +911,7 @@ if (empty($reshook))
|
||||
if (count($prodcustprice->lines) > 0) {
|
||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_min = price($prodcustprice->lines[0]->price_min);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
|
||||
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
|
||||
@ -654,8 +654,8 @@ class Propal extends CommonObject
|
||||
$this->line->tva_tx = $txtva;
|
||||
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
|
||||
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
|
||||
$this->line->localtax1_type = $localtaxes_type[0];
|
||||
$this->line->localtax2_type = $localtaxes_type[2];
|
||||
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
|
||||
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
|
||||
$this->line->fk_product = $fk_product;
|
||||
$this->line->product_type = $type;
|
||||
$this->line->fk_remise_except = $fk_remise_except;
|
||||
|
||||
@ -644,8 +644,8 @@ if (empty($reshook))
|
||||
$tva_tx = '';
|
||||
}
|
||||
|
||||
$qty = GETPOST('qty'.$predef);
|
||||
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
|
||||
$qty = price2num(GETPOST('qty'.$predef, 'alpha'));
|
||||
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
|
||||
|
||||
// Extrafields
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
@ -749,6 +749,7 @@ if (empty($reshook))
|
||||
{
|
||||
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||
$price_min = price($prodcustprice->lines[0]->price_min);
|
||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||
|
||||
@ -962,8 +962,8 @@ class Commande extends CommonOrder
|
||||
$sql .= ", ".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null");
|
||||
$sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
|
||||
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : 'NULL');
|
||||
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
|
||||
$sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
|
||||
$sql .= ", ".(!empty($this->shipping_method_id) && $this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
|
||||
$sql .= ", ".(!empty($this->warehouse_id) && $this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
|
||||
$sql .= ", ".($this->remise_absolue > 0 ? $this->db->escape($this->remise_absolue) : 'NULL');
|
||||
$sql .= ", ".($this->remise_percent > 0 ? $this->db->escape($this->remise_percent) : 0);
|
||||
$sql .= ", ".(int) $this->fk_incoterms;
|
||||
@ -1081,7 +1081,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
@ -1605,8 +1605,8 @@ class Commande extends CommonOrder
|
||||
$this->line->tva_tx = $txtva;
|
||||
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
|
||||
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
|
||||
$this->line->localtax1_type = $localtaxes_type[0];
|
||||
$this->line->localtax2_type = $localtaxes_type[2];
|
||||
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
|
||||
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
|
||||
$this->line->fk_product = $fk_product;
|
||||
$this->line->product_type = $product_type;
|
||||
$this->line->fk_remise_except = $fk_remise_except;
|
||||
@ -3924,7 +3924,9 @@ class Commande extends CommonOrder
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'einstein';
|
||||
|
||||
if (!empty($this->modelpdf)) {
|
||||
if (!empty($this->model_pdf)) {
|
||||
$modele = $this->model_pdf;
|
||||
} elseif (!empty($this->modelpdf)) { // dperecated
|
||||
$modele = $this->modelpdf;
|
||||
} elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) {
|
||||
$modele = $conf->global->COMMANDE_ADDON_PDF;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* 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
|
||||
@ -30,8 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
@ -122,8 +121,8 @@ if (empty($reshook))
|
||||
$object->accountancy_code = GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : "";
|
||||
$object->subledger_account = $subledger_account;
|
||||
|
||||
$object->sens = GETPOST('sens');
|
||||
$object->fk_project = GETPOST('fk_project', 'int');
|
||||
$object->sens = GETPOSTINT('sens');
|
||||
$object->fk_project = GETPOSTINT('fk_project');
|
||||
|
||||
if (empty($datep) || empty($datev))
|
||||
{
|
||||
@ -131,12 +130,6 @@ if (empty($reshook))
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (empty($object->type_payment) || $object->type_payment < 0)
|
||||
{
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (empty($object->amount))
|
||||
{
|
||||
$langs->load('errors');
|
||||
@ -149,13 +142,24 @@ if (empty($reshook))
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
// TODO Remove this and allow instead to edit a various payment to enter accounting code
|
||||
if (empty($object->type_payment) || $object->type_payment < 0)
|
||||
{
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (!empty($conf->accounting->enabled) && !$object->accountancy_code)
|
||||
{
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($object->sens < 0)
|
||||
{
|
||||
$langs->load('errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Sens")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@ -358,13 +362,6 @@ if ($action == 'create')
|
||||
print '<input name="label" id="label" class="minwidth300 maxwidth150onsmartphone" value="'.($label ? $label : $langs->trans("VariousPayment")).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Sens
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('Sens', 'sens', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$sensarray = array('0' => $langs->trans("Debit"), '1' => $langs->trans("Credit"));
|
||||
print $form->selectarray('sens', $sensarray, $sens);
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
@ -396,6 +393,43 @@ if ($action == 'create')
|
||||
print '<td><input name="num_payment" class="maxwidth150onsmartphone" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
// Accountancy account
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
// TODO Remove the fieldrequired and allow instead to edit a various payment to enter accounting code
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("AccountAccounting").'</td>';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1);
|
||||
print '</td></tr>';
|
||||
} else { // For external software
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("AccountAccounting").'</td>';
|
||||
print '<td><input class="minwidth100 maxwidthonsmartphone" name="accountancy_code" value="'.$accountancy_code.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Subledger account
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("SubledgerAccount").'aaaa</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1, '');
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth200 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
} else { // For external software
|
||||
print '<tr><td>'.$langs->trans("SubledgerAccount").'</td>';
|
||||
print '<td><input class="minwidth100 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Sens
|
||||
print '<tr><td>';
|
||||
$labelsens = $form->textwithpicto('Sens', $langs->trans("AccountingDirectionHelp"));
|
||||
print $form->editfieldkey($labelsens, 'sens', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$sensarray = array('0' => $langs->trans("Debit"), '1' => $langs->trans("Credit"));
|
||||
print $form->selectarray('sens', $sensarray, $sens, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled))
|
||||
{
|
||||
@ -417,44 +451,9 @@ if ($action == 'create')
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Category
|
||||
if (is_array($options) && count($options) && $conf->categorie->enabled)
|
||||
{
|
||||
if (is_array($options) && count($options) && $conf->categorie->enabled) {
|
||||
print '<tr><td>'.$langs->trans("RubriquesTransactions").'</td><td>';
|
||||
print Form::selectarray('category_transaction', $options, GETPOST('category_transaction'), 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Accountancy account
|
||||
if (!empty($conf->accounting->enabled))
|
||||
{
|
||||
// TODO Remove the fieldrequired and allow instead to edit a various payment to enter accounting code
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("AccountAccounting").'</td>';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1);
|
||||
print '</td></tr>';
|
||||
} else // For external software
|
||||
{
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("AccountAccounting").'</td>';
|
||||
print '<td><input class="minwidth100 maxwidthonsmartphone" name="accountancy_code" value="'.$accountancy_code.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Subledger account
|
||||
if (!empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("SubledgerAccount").'aaaa</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
|
||||
{
|
||||
print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1, '');
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth200 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
} else // For external software
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("SubledgerAccount").'</td>';
|
||||
print '<td><input class="minwidth100 maxwidthonsmartphone" name="subledger_account" value="'.$subledger_account.'">';
|
||||
print img_picto('', 'category').Form::selectarray('category_transaction', $options, GETPOST('category_transaction'), 1, 0, 0, '', 0, 0, 0, '', 'minwidth300', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -186,6 +186,8 @@ class Facture extends CommonInvoice
|
||||
|
||||
public $fac_rec;
|
||||
|
||||
public $date_pointoftax;
|
||||
|
||||
// Multicurrency
|
||||
/**
|
||||
* @var int ID
|
||||
@ -645,7 +647,7 @@ class Facture extends CommonInvoice
|
||||
$sql .= ", ".$this->cond_reglement_id;
|
||||
$sql .= ", ".$this->mode_reglement_id;
|
||||
$sql .= ", '".$this->db->idate($this->date_lim_reglement)."'";
|
||||
$sql .= ", ".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null");
|
||||
$sql .= ", ".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null");
|
||||
$sql .= ", ".($this->situation_cycle_ref ? "'".$this->db->escape($this->situation_cycle_ref)."'" : "null");
|
||||
$sql .= ", ".($this->situation_counter ? "'".$this->db->escape($this->situation_counter)."'" : "null");
|
||||
$sql .= ", ".($this->situation_final ? $this->situation_final : 0);
|
||||
@ -677,7 +679,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
@ -1080,6 +1082,8 @@ class Facture extends CommonInvoice
|
||||
$facture->retained_warranty_fk_cond_reglement = $this->retained_warranty_fk_cond_reglement;
|
||||
$facture->retained_warranty_date_limit = $this->retained_warranty_date_limit;
|
||||
|
||||
$facture->fk_user_author = $user->id;
|
||||
|
||||
|
||||
// Loop on each line of new invoice
|
||||
foreach ($facture->lines as $i => $tmpline)
|
||||
@ -1164,8 +1168,10 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Clear fields
|
||||
$object->date = (empty($this->date) ? dol_now() : $this->date);
|
||||
$object->user_author = $user->id;
|
||||
$object->user_valid = '';
|
||||
$object->user_author = $user->id; // deprecated
|
||||
$object->user_valid = null; // deprecated
|
||||
$object->fk_user_author = $user->id;
|
||||
$object->fk_user_valid = null;
|
||||
$object->fk_facture_source = 0;
|
||||
$object->date_creation = '';
|
||||
$object->date_modification = '';
|
||||
@ -1317,8 +1323,9 @@ class Facture extends CommonInvoice
|
||||
|
||||
// get extrafields from original line
|
||||
$object->lines[$i]->fetch_optionals();
|
||||
foreach ($object->lines[$i]->array_options as $options_key => $value)
|
||||
foreach ($object->lines[$i]->array_options as $options_key => $value) {
|
||||
$line->array_options[$options_key] = $value;
|
||||
}
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
@ -1348,6 +1355,8 @@ class Facture extends CommonInvoice
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
$this->fk_user_author = $user->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals();
|
||||
foreach ($object->array_options as $options_key => $value)
|
||||
@ -1362,8 +1371,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
$ret = $this->create($user);
|
||||
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($ret > 0) {
|
||||
// Actions hooked (by external module)
|
||||
$hookmanager->initHooks(array('invoicedao'));
|
||||
|
||||
@ -1600,8 +1608,10 @@ class Facture extends CommonInvoice
|
||||
$this->note = $obj->note_private; // deprecated
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->user_author = $obj->fk_user_author;
|
||||
$this->user_valid = $obj->fk_user_valid;
|
||||
$this->user_author = $obj->fk_user_author; // deprecated
|
||||
$this->user_valid = $obj->fk_user_valid; // deprecated
|
||||
$this->fk_user_author = $obj->fk_user_author;
|
||||
$this->fk_user_valid = $obj->fk_user_valid;
|
||||
$this->model_pdf = $obj->model_pdf;
|
||||
$this->modelpdf = $obj->model_pdf; // deprecated
|
||||
$this->last_main_doc = $obj->last_main_doc;
|
||||
@ -1890,7 +1900,7 @@ class Facture extends CommonInvoice
|
||||
$sql .= " date_lim_reglement=".(strval($this->date_lim_reglement) != '' ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'null').",";
|
||||
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
|
||||
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
|
||||
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").",";
|
||||
$sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").",";
|
||||
$sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null").",";
|
||||
$sql .= " situation_cycle_ref=".(empty($this->situation_cycle_ref) ? "null" : $this->db->escape($this->situation_cycle_ref)).",";
|
||||
$sql .= " situation_counter=".(empty($this->situation_counter) ? "null" : $this->db->escape($this->situation_counter)).",";
|
||||
@ -2113,7 +2123,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
$rowid = $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::delete rowid=".$rowid.", ref=".$this->ref.", thirdparty=".$this->thirdparty->name, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::delete rowid=".$rowid.", ref=".$this->ref.", thirdparty=".(empty($this->thirdparty) ? '' : $this->thirdparty->name), LOG_DEBUG);
|
||||
|
||||
// Test to avoid invoice deletion (allowed if draft)
|
||||
$result = $this->is_erasable();
|
||||
@ -4118,7 +4128,7 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
public function initAsSpecimen($option = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$now = dol_now();
|
||||
$arraynow = dol_getdate($now);
|
||||
@ -4167,6 +4177,8 @@ class Facture extends CommonInvoice
|
||||
$this->note_private = 'This is a comment (private)';
|
||||
$this->note = 'This is a comment (private)';
|
||||
|
||||
$this->fk_user_author = $user->id;
|
||||
|
||||
$this->multicurrency_tx = 1;
|
||||
$this->multicurrency_code = $conf->currency;
|
||||
|
||||
@ -4326,8 +4338,8 @@ class Facture extends CommonInvoice
|
||||
/**
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
* @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf','alpha') for example.
|
||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @param string $modele Generator to use. Caller must set it to obj->model_pdf or GETPOST('model','alpha') for example.
|
||||
* @param Translate $outputlangs Object lang to use for translation
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
@ -4345,7 +4357,9 @@ class Facture extends CommonInvoice
|
||||
$modele = 'crabe';
|
||||
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$this->type;
|
||||
|
||||
if (!empty($this->modelpdf)) {
|
||||
if (!empty($this->model_pdf)) {
|
||||
$modele = $this->model_pdf;
|
||||
} elseif (!empty($this->modelpdf)) { // deprecated
|
||||
$modele = $this->modelpdf;
|
||||
} elseif (!empty($conf->global->$thisTypeConfName)) {
|
||||
$modele = $conf->global->$thisTypeConfName;
|
||||
|
||||
@ -144,8 +144,12 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>').')';
|
||||
if (!empty($conf->accounting->enabled)) $calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</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=".($tmps['year'] - 1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] + 1)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesResultDue");
|
||||
@ -157,8 +161,12 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
if (!empty($conf->accounting->enabled)) $calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">', '</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=".($tmps['year'] - 1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year'] + 1)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesResultInOut");
|
||||
@ -168,8 +176,10 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">', '</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);
|
||||
$arraylist = array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
|
||||
$period .= ' '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
|
||||
|
||||
@ -123,8 +123,12 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>').')';
|
||||
if (!empty($conf->accounting->enabled)) $calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</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("RulesAmountWithTaxIncluded");
|
||||
@ -136,8 +140,12 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
if (!empty($conf->accounting->enabled)) $calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</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("RulesAmountWithTaxIncluded");
|
||||
@ -148,8 +156,10 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</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("RulesAmountOnInOutBookkeepingRecord");
|
||||
@ -818,17 +828,15 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan
|
||||
if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
|
||||
{
|
||||
$predefinedgroupwhere = "(";
|
||||
//$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$predefinedgroupwhere .= " (pcg_type = 'EXPENSE')";
|
||||
$predefinedgroupwhere .= " (aa.pcg_type = 'EXPENSE')";
|
||||
$predefinedgroupwhere .= " OR ";
|
||||
//$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$predefinedgroupwhere .= " (pcg_type = 'INCOME')";
|
||||
$predefinedgroupwhere .= " (aa.pcg_type = 'INCOME')";
|
||||
$predefinedgroupwhere .= ")";
|
||||
|
||||
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
|
||||
$charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
$sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
|
||||
$sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, aa.pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql .= " WHERE b.entity = ".$conf->entity;
|
||||
$sql .= " AND aa.entity = ".$conf->entity;
|
||||
@ -855,10 +863,18 @@ if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
if (!isset($encaiss[$obj->dm])) $encaiss[$obj->dm] = 0;
|
||||
if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0;
|
||||
$encaiss[$obj->dm] += $obj->credit;
|
||||
$decaiss[$obj->dm] += $obj->debit;
|
||||
if ($obj->pcg_type == 'INCOME') {
|
||||
if (!isset($encaiss[$obj->dm])) $encaiss[$obj->dm] = 0; // To avoid warning of var not defined
|
||||
$encaiss[$obj->dm] += $obj->credit;
|
||||
$encaiss[$obj->dm] -= $obj->credit;
|
||||
}
|
||||
if ($obj->pcg_type == 'INCOME') {
|
||||
if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0; // To avoid warning of var not defined
|
||||
$decaiss[$obj->dm] += $obj->debit;
|
||||
$decaiss[$obj->dm] -= $obj->credit;
|
||||
}
|
||||
|
||||
// ???
|
||||
if (!isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm] = 0;
|
||||
if (!isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm] = 0;
|
||||
$encaiss_ttc[$obj->dm] += 0;
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@ -181,7 +182,8 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->cre
|
||||
|
||||
if (!$dateech)
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldReqrequire_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
uired", $langs->transnoentities("Date")), null, 'errors');
|
||||
$action = 'edit';
|
||||
} elseif (!$dateperiod)
|
||||
{
|
||||
@ -300,7 +302,7 @@ if ($action == 'create')
|
||||
print '<td class="titlefieldcreate fieldrequired">';
|
||||
print $langs->trans("Label");
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="34" name="label" class="flat" value="'.dol_escape_htmltag(GETPOST('label', 'alpha')).'" autofocus></td>';
|
||||
print '<td><input type="text" name="label" class="flat minwidth300" value="'.dol_escape_htmltag(GETPOST('label', 'alpha')).'" autofocus></td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
|
||||
@ -610,14 +612,22 @@ if ($id > 0)
|
||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$paymentsocialcontributiontmp = new PaymentSocialContribution($db);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$paymentsocialcontributiontmp->id = $objp->rowid;
|
||||
$paymentsocialcontributiontmp->ref = $objp->rowid;
|
||||
$paymentsocialcontributiontmp->datep = $db->jdate($objp->dp);
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
|
||||
print $paymentsocialcontributiontmp->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
|
||||
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
|
||||
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
|
||||
|
||||
@ -694,7 +694,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
}
|
||||
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
|
||||
}
|
||||
if ($this->date) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->date, 'day');
|
||||
if ($this->datep) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
|
||||
|
||||
if (!empty($this->id)) {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
@ -707,4 +707,37 @@ class PaymentSocialContribution extends CommonObject
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return if object was dispatched into bookkeeping
|
||||
*
|
||||
* @return int <0 if KO, 0=no, 1=yes
|
||||
*/
|
||||
public function getVentilExportCompta()
|
||||
{
|
||||
$alreadydispatched = 0;
|
||||
|
||||
$type = 'bank';
|
||||
|
||||
$sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".$this->bank_line;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj)
|
||||
{
|
||||
$alreadydispatched = $obj->nb;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($alreadydispatched)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution
|
||||
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||
|
||||
|
||||
$hookmanager = new HookManager($db);
|
||||
@ -49,9 +50,7 @@ if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|');
|
||||
|
||||
$year = GETPOST("year", 'int');
|
||||
$filtre = GETPOST("filtre", 'alpha');
|
||||
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
$search_sc_type = GETPOST('search_sc_type', 'int');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -64,6 +63,24 @@ $pagenext = $page + 1;
|
||||
if (!$sortfield) $sortfield = "cs.date_ech";
|
||||
if (!$sortorder) $sortorder = "DESC";
|
||||
|
||||
if (empty($conf->tax->enabled) || empty($user->rights->tax->charges->lire))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_sc_type = '';
|
||||
//$toselect = '';
|
||||
//$search_array_options = array();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -74,18 +91,20 @@ $socialcontrib = new ChargeSociales($db);
|
||||
$payment_sc_static = new PaymentSocialContribution($db);
|
||||
$sal_static = new PaymentSalary($db);
|
||||
$accountstatic = new Account($db);
|
||||
|
||||
llxHeader('', $langs->trans("SpecialExpensesArea"));
|
||||
$formsocialcontrib = new FormSocialContrib($db);
|
||||
|
||||
$title = $langs->trans("SocialContributionsPayments");
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
||||
if ($sortfield) $param .= '&sortfield='.$sortfield;
|
||||
if ($sortorder) $param .= '&sortorder='.$sortorder;
|
||||
llxHeader('', $title);
|
||||
|
||||
$totalnboflines = 0;
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
if ($sortfield) $param .= '&sortfield='.urlencode($sortfield);
|
||||
if ($sortorder) $param .= '&sortorder='.urlencode($sortorder);
|
||||
if ($year) $param .= '&year='.urlencode($year);
|
||||
if ($search_sc_type) $param .= '&search_sc_type='.urlencode($search_sc_type);
|
||||
$num = 0;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -95,135 +114,183 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$sql = "SELECT c.id, c.libelle as label,";
|
||||
$sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
||||
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||
$sql .= " pct.code as payment_code,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND cs.entity IN (".getEntity("tax").")";
|
||||
if ($search_sc_type > 0) {
|
||||
$sql .= " AND cs.fk_type = ".((int) $search_sc_type);
|
||||
}
|
||||
if ($year > 0) {
|
||||
$sql .= " AND (";
|
||||
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
|
||||
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
|
||||
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
|
||||
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
|
||||
$sql .= ")";
|
||||
}
|
||||
if (preg_match('/^cs\./', $sortfield) || preg_match('/^c\./', $sortfield) || preg_match('/^pc\./', $sortfield) || preg_match('/^pct\./', $sortfield)) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
}
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
|
||||
$num = $nbtotalofrecords;
|
||||
} else {
|
||||
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
}
|
||||
//$sql.= $db->plimit($limit+1,$offset);
|
||||
//print $sql;
|
||||
|
||||
$nav = '';
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 0);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_payment', 0, $nav, '', $limit, 0);
|
||||
|
||||
if ($year) $param .= '&year='.$year;
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
$formsocialcontrib->select_type_socialcontrib(GETPOSTISSET("search_sc_type") ? $search_sc_type : '', 'search_sc_type', 1, 0, 0, 'minwidth200 maxwidth300');
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
if (!empty($conf->banque->enabled)) print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="140px"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
if (!$resql)
|
||||
{
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="140px"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT c.id, c.libelle as label,";
|
||||
$sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
||||
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||
$sql .= " pct.code as payment_code,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND cs.entity IN (".getEntity("tax").")";
|
||||
if ($year > 0)
|
||||
{
|
||||
$sql .= " AND (";
|
||||
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
|
||||
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
|
||||
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
|
||||
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
|
||||
$sql .= ")";
|
||||
}
|
||||
if (preg_match('/^cs\./', $sortfield) || preg_match('/^c\./', $sortfield) || preg_match('/^pc\./', $sortfield) || preg_match('/^pct\./', $sortfield)) $sql .= $db->order($sortfield, $sortorder);
|
||||
//$sql.= $db->plimit($limit+1,$offset);
|
||||
//print $sql;
|
||||
|
||||
dol_syslog("compta/charges/index.php: select payment", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
$totalnb = 0;
|
||||
$totalpaye = 0;
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
// Date
|
||||
$date = $obj->periode;
|
||||
if (empty($date)) $date = $obj->date_ech;
|
||||
print '<td>'.dol_print_date($date, 'day').'</td>';
|
||||
// Label
|
||||
print '<td>';
|
||||
$socialcontrib->id = $obj->rowid;
|
||||
$socialcontrib->ref = $obj->label;
|
||||
$socialcontrib->label = $obj->label;
|
||||
print $socialcontrib->getNomUrl(1, '20');
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->label.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td class="right">'.price($obj->total).'</td>';
|
||||
// Ref payment
|
||||
$payment_sc_static->id = $obj->pid;
|
||||
$payment_sc_static->ref = $obj->pid;
|
||||
print '<td>'.$payment_sc_static->getNomUrl(1)."</td>\n";
|
||||
// Date payment
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
|
||||
// Type payment
|
||||
print '<td>';
|
||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
print $obj->num_payment.'</td>';
|
||||
// Account
|
||||
if (!empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->fk_bank > 0)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id = $obj->bid;
|
||||
$accountstatic->ref = $obj->bref;
|
||||
$accountstatic->number = $obj->bnumber;
|
||||
$accountstatic->accountancy_number = $obj->account_number;
|
||||
$accountstatic->accountancy_journal = $obj->accountancy_journal;
|
||||
$accountstatic->label = $obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
} else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
// Paid
|
||||
print '<td class="right">';
|
||||
if ($obj->totalpaye) print price($obj->totalpaye);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $obj->total;
|
||||
$totalnb = $totalnb + $obj->nb;
|
||||
$totalpaye = $totalpaye + $obj->totalpaye;
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td class="liste_total right"></td>'; // A total here has no sense
|
||||
print '<td align="center" class="liste_total"> </td>';
|
||||
print '<td align="center" class="liste_total"> </td>';
|
||||
print '<td align="center" class="liste_total"> </td>';
|
||||
if (!empty($conf->banque->enabled)) print '<td></td>';
|
||||
print '<td class="liste_total right">'.price($totalpaye)."</td>";
|
||||
print "</tr>";
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '</table>';
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
$totalnb = 0;
|
||||
$totalpaye = 0;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
// Date
|
||||
$date = $obj->periode;
|
||||
if (empty($date)) $date = $obj->date_ech;
|
||||
print '<td>'.dol_print_date($date, 'day').'</td>';
|
||||
// Label
|
||||
print '<td>';
|
||||
$socialcontrib->id = $obj->rowid;
|
||||
$socialcontrib->ref = $obj->label;
|
||||
$socialcontrib->label = $obj->label;
|
||||
print $socialcontrib->getNomUrl(1, '20');
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td title="'.dol_escape_htmltag($obj->label).'" class="tdmaxoverflow300">'.$obj->label.'</td>';
|
||||
// Expected to pay
|
||||
print '<td class="right">'.price($obj->total).'</td>';
|
||||
// Ref payment
|
||||
$payment_sc_static->id = $obj->pid;
|
||||
$payment_sc_static->ref = $obj->pid;
|
||||
print '<td>'.$payment_sc_static->getNomUrl(1)."</td>\n";
|
||||
// Date payment
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
|
||||
// Type payment
|
||||
print '<td>';
|
||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
print $obj->num_payment.'</td>';
|
||||
// Account
|
||||
if (!empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->fk_bank > 0)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id = $obj->bid;
|
||||
$accountstatic->ref = $obj->bref;
|
||||
$accountstatic->number = $obj->bnumber;
|
||||
$accountstatic->accountancy_number = $obj->account_number;
|
||||
$accountstatic->accountancy_journal = $obj->accountancy_journal;
|
||||
$accountstatic->label = $obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
} else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
// Paid
|
||||
print '<td class="right">';
|
||||
if ($obj->totalpaye) print price($obj->totalpaye);
|
||||
print '</td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $obj->total;
|
||||
$totalnb = $totalnb + $obj->nb;
|
||||
$totalpaye = $totalpaye + $obj->totalpaye;
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td class="liste_total right"></td>'; // A total here has no sense
|
||||
print '<td align="center" class="liste_total"> </td>';
|
||||
print '<td align="center" class="liste_total"> </td>';
|
||||
print '<td align="center" class="liste_total"> </td>';
|
||||
if (!empty($conf->banque->enabled)) print '<td></td>';
|
||||
print '<td class="liste_total right">'.price($totalpaye)."</td>";
|
||||
print '<td></td>';
|
||||
print "</tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
$parameters = array('user' => $user);
|
||||
|
||||
@ -122,7 +122,7 @@ 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", '{links1}', '{link2}').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{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);
|
||||
|
||||
@ -59,7 +59,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
{
|
||||
// We define date_start and date_end
|
||||
$year_end = $year_start + ($nbofyear - 1);
|
||||
$month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
$month_start = GETPOST("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
if (!GETPOST('month'))
|
||||
{
|
||||
if (!GETPOST("year") && $month_start > $month_current)
|
||||
@ -113,8 +113,9 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("PurchaseTurnover");
|
||||
$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 href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?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("RulesPurchaseTurnoverDue");
|
||||
@ -124,8 +125,6 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("PurchaseTurnoverCollected");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPINGCOLLECTED">','</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>" : "");
|
||||
$description = $langs->trans("RulesPurchaseTurnoverIn");
|
||||
@ -135,8 +134,9 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("PurchaseTurnover");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', $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("RulesPurchaseTurnoverTotalPurchaseJournal");
|
||||
|
||||
@ -335,7 +335,6 @@ $dolibarr_cron_allow_cli='0';
|
||||
//$dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
|
||||
//$dolibarr_lib_GEOIP_PATH='';
|
||||
//$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$dolibarr_lib_PHPEXCEL_PATH='';
|
||||
//$dolibarr_lib_ODTPHP_PATH='';
|
||||
//$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip";
|
||||
// Value to overwrite path to use shared javascript instead of embedded one
|
||||
|
||||
@ -967,7 +967,7 @@ while ($i < min($num, $limit))
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
|
||||
print '<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key).'</td>';
|
||||
print '<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014-2020 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -2035,7 +2035,7 @@ if ($action == 'create')
|
||||
// Send
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut == 1) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a></div>';
|
||||
} else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
|
||||
@ -2417,7 +2417,9 @@ class Contrat extends CommonObject
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'strato';
|
||||
|
||||
if (!empty($this->modelpdf)) {
|
||||
if (!empty($this->model_pdf)) {
|
||||
$modele = $this->model_pdf;
|
||||
} elseif (!empty($this->modelpdf)) { // deprecated
|
||||
$modele = $this->modelpdf;
|
||||
} elseif (!empty($conf->global->CONTRACT_ADDON_PDF)) {
|
||||
$modele = $conf->global->CONTRACT_ADDON_PDF;
|
||||
|
||||
@ -114,17 +114,17 @@ $fieldstosearchall = array(
|
||||
if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
|
||||
|
||||
$arrayfields = array(
|
||||
'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||
'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
|
||||
'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1),
|
||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
||||
's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0),
|
||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
|
||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
|
||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
||||
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
|
||||
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1),
|
||||
'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>10),
|
||||
'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1, 'position'=>12),
|
||||
'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'position'=>14),
|
||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30),
|
||||
's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30),
|
||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31),
|
||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0, 'position'=>32),
|
||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33),
|
||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34),
|
||||
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1, 'position'=>80),
|
||||
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45),
|
||||
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||
'lower_planned_end_date'=>array('label'=>$langs->trans("LowerDateEndPlannedShort"), 'checked'=>1, 'position'=>900, 'help'=>$langs->trans("LowerDateEndPlannedShort")),
|
||||
|
||||
@ -315,11 +315,15 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd)
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$model = $object->model_pdf;
|
||||
|
||||
$ret = $object->fetch($id); // Reload to get new records
|
||||
|
||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
$model = $object->model_pdf;
|
||||
|
||||
$retgen = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($retgen < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -159,7 +159,7 @@ if ($action == 'add')
|
||||
$parameters = $param;
|
||||
$parameters_array = explode("\r\n", $parameters);
|
||||
//In sellist we have only one line and it can have come to do SQL expression
|
||||
if ($type == 'sellist') {
|
||||
if ($type == 'sellist' || $type == 'chkbxlst') {
|
||||
foreach ($parameters_array as $param_ligne)
|
||||
{
|
||||
$params['options'] = array($parameters=>null);
|
||||
@ -338,7 +338,7 @@ if ($action == 'update')
|
||||
$parameters = $param;
|
||||
$parameters_array = explode("\r\n", $parameters);
|
||||
//In sellist we have only one line and it can have come to do SQL expression
|
||||
if ($type == 'sellist') {
|
||||
if ($type == 'sellist' || $type == 'chkbxlst') {
|
||||
foreach ($parameters_array as $param_ligne)
|
||||
{
|
||||
$params['options'] = array($parameters=>null);
|
||||
|
||||
@ -141,8 +141,8 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
||||
}
|
||||
|
||||
if ($num == 0) $this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center opacitymedium"',
|
||||
'text'=>$langs->trans("NoRecordedManualEntries")
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedManualEntries").'</span>'
|
||||
);
|
||||
|
||||
$this->db->free($result);
|
||||
@ -155,8 +155,8 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
'td' => 'class="nohover left"',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,9 +88,9 @@ class box_actions extends ModeleBoxes
|
||||
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage";
|
||||
$sql .= ", ta.code";
|
||||
$sql .= ", ta.libelle as type_label";
|
||||
$sql .= ", s.nom as name";
|
||||
$sql .= ", s.rowid as socid";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, ".MAIN_DB_PREFIX."actioncomm AS a";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
@ -116,13 +116,21 @@ class box_actions extends ModeleBoxes
|
||||
$late = '';
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datelimite = $this->db->jdate($objp->dp);
|
||||
|
||||
$actionstatic->id = $objp->id;
|
||||
$actionstatic->label = $objp->label;
|
||||
$actionstatic->type_label = $objp->type_label;
|
||||
$actionstatic->code = $objp->code;
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
|
||||
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning))
|
||||
$late = img_warning($langs->trans("Late"));
|
||||
|
||||
@ -86,7 +86,7 @@ class box_birthdays extends ModeleBoxes
|
||||
{
|
||||
$tmparray = dol_getdate(dol_now(), true);
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, u.email, u.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql .= " AND u.statut = 1";
|
||||
@ -104,10 +104,13 @@ class box_birthdays extends ModeleBoxes
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$userstatic->id = $objp->rowid;
|
||||
$userstatic->firstname = $objp->firstname;
|
||||
$userstatic->lastname = $objp->lastname;
|
||||
$userstatic->email = $objp->email;
|
||||
$userstatic->statut = $objp->status;
|
||||
|
||||
$dateb = $this->db->jdate($objp->birth);
|
||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||
|
||||
|
||||
@ -80,28 +80,22 @@ class box_clients extends ModeleBoxes
|
||||
$this->max = $max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$thirdpartystatic = new Societe($this->db);
|
||||
$thirdpartystatic = new Client($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max));
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.client";
|
||||
$sql .= ", s.code_fournisseur";
|
||||
$sql .= ", s.fournisseur";
|
||||
$sql .= ", s.code_compta";
|
||||
$sql .= ", s.code_compta_fournisseur";
|
||||
$sql .= ", s.logo";
|
||||
$sql .= ", s.email";
|
||||
$sql .= ", s.datec, s.tms, s.status, s.entity";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.datec, s.tms, s.status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE s.client IN (1, 3)";
|
||||
$sql .= " AND s.entity IN (".getEntity('societe').")";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($user->socid) $sql .= " AND s.rowid = $user->socid";
|
||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||
$sql .= " ORDER BY s.tms DESC";
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
@ -117,14 +111,13 @@ class box_clients extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta = $objp->code_compta;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->client = $objp->client;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
@ -87,10 +87,9 @@ class box_commandes extends ModeleBoxes
|
||||
|
||||
if ($user->rights->commande->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name";
|
||||
$sql .= ", s.rowid as socid";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.logo, s.email";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", c.ref, c.tms";
|
||||
$sql .= ", c.rowid";
|
||||
$sql .= ", c.date_commande";
|
||||
@ -123,17 +122,23 @@ class box_commandes extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$date = $this->db->jdate($objp->date_commande);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$commandestatic->id = $objp->rowid;
|
||||
$commandestatic->ref = $objp->ref;
|
||||
$commandestatic->ref_client = $objp->ref_client;
|
||||
$commandestatic->total_ht = $objp->total_ht;
|
||||
$commandestatic->total_tva = $objp->total_tva;
|
||||
$commandestatic->total_ttc = $objp->total_ttc;
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->email = $objp->email;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
|
||||
@ -86,8 +86,10 @@ class box_contacts extends ModeleBoxes
|
||||
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status";
|
||||
|
||||
$sql .= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail";
|
||||
$sql .= ", s.nom as socname, s.name_alias, s.email as semail";
|
||||
$sql .= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", co.label as country, co.code as country_code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON sp.fk_pays = co.rowid";
|
||||
@ -128,14 +130,18 @@ class box_contacts extends ModeleBoxes
|
||||
$contactstatic->country = $objp->country;
|
||||
$contactstatic->country_code = $objp->country_code;
|
||||
|
||||
$societestatic->id = $objp->fk_soc;
|
||||
$societestatic->name = $objp->socname;
|
||||
$societestatic->email = $objp->semail;
|
||||
$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$societestatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$societestatic->fournisseur = $objp->fournisseur;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
@ -145,7 +151,7 @@ class box_contacts extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => ($objp->fk_soc > 0 ? $societestatic->getNomUrl(1) : ''),
|
||||
'text' => ($societestatic->id > 0 ? $societestatic->getNomUrl(1) : ''),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
@ -180,8 +186,8 @@ class box_contacts extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
'td' => 'class="nohover left"',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,17 +86,11 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.client";
|
||||
$sql .= ", s.code_fournisseur";
|
||||
$sql .= ", s.fournisseur";
|
||||
$sql .= ", s.code_compta";
|
||||
$sql .= ", s.code_compta_fournisseur";
|
||||
$sql .= ", s.logo";
|
||||
$sql .= ", s.email";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.outstanding_limit";
|
||||
$sql .= ", s.datec, s.tms, s.status, s.entity";
|
||||
$sql .= ", s.datec, s.tms, s.status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE s.client IN (1, 3)";
|
||||
@ -120,17 +114,15 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta = $objp->code_compta;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->client = $objp->client;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
@ -158,8 +150,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
||||
}
|
||||
|
||||
if ($num == 0 || $nboutstandingbillreachedcustomers == 0) $this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center opacitymedium"',
|
||||
'text'=>$langs->trans("NoRecordedCustomers")
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("None").'</span>'
|
||||
);
|
||||
|
||||
$this->db->free($result);
|
||||
@ -172,8 +164,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
'td' => 'class="nohover left"',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,8 +94,11 @@ class box_factures extends ModeleBoxes
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.datef as df";
|
||||
$sql .= ", f.paye, f.fk_statut, f.datec, f.tms";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.code_client, s.email, s.tva_intra, s.code_compta, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
||||
$sql .= ", f.date_lim_reglement as datelimite";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
||||
$sql .= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= ")";
|
||||
@ -133,9 +136,14 @@ class box_factures extends ModeleBoxes
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->tva_intra = $objp->tva_intra;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
$societestatic->tva_intra = $objp->tva_intra;
|
||||
$societestatic->idprof1 = $objp->idprof1;
|
||||
$societestatic->idprof2 = $objp->idprof2;
|
||||
$societestatic->idprof3 = $objp->idprof3;
|
||||
|
||||
@ -78,7 +78,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
|
||||
$facturestatic = new FactureFournisseur($this->db);
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
$thirdpartystatic = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array(
|
||||
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."SupplierBills", $max)
|
||||
@ -86,17 +86,17 @@ class box_factures_fourn extends ModeleBoxes
|
||||
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid,";
|
||||
$sql .= " s.code_fournisseur, s.email,";
|
||||
$sql .= " s.logo,";
|
||||
$sql .= " f.rowid as facid, f.ref, f.ref_supplier,";
|
||||
$sql .= " f.total_ht,";
|
||||
$sql .= " f.total_tva,";
|
||||
$sql .= " f.total_ttc,";
|
||||
$sql .= " f.paye, f.fk_statut,";
|
||||
$sql .= ' f.datef as df,';
|
||||
$sql .= ' f.datec as datec,';
|
||||
$sql .= ' f.date_lim_reglement as datelimite, f.tms, f.type';
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", f.rowid as facid, f.ref, f.ref_supplier";
|
||||
$sql .= ", f.total_ht";
|
||||
$sql .= ", f.total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.paye, f.fk_statut";
|
||||
$sql .= ', f.datef as df';
|
||||
$sql .= ', f.datec as datec';
|
||||
$sql .= ', f.date_lim_reglement as datelimite, f.tms, f.type';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -131,12 +131,15 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->ref_supplier = $objp->ref_supplier;
|
||||
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->email = $objp->email;
|
||||
$thirdpartytmp->fournisseur = 1;
|
||||
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$late = '';
|
||||
|
||||
@ -160,7 +163,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150"',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
|
||||
'text' => $thirdpartystatic->getNomUrl(1, 'supplier'),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
|
||||
@ -76,19 +76,21 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$facturestatic = new FactureFournisseur($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
$thirdpartystatic = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidSupplierBills", $max));
|
||||
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid,";
|
||||
$sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,";
|
||||
$sql .= " f.datef as df,";
|
||||
$sql .= " f.total_ht as total_ht,";
|
||||
$sql .= " f.tva as total_tva,";
|
||||
$sql .= " f.total_ttc,";
|
||||
$sql .= " f.paye, f.fk_statut, f.type";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite";
|
||||
$sql .= ", f.datef as df";
|
||||
$sql .= ", f.total_ht as total_ht";
|
||||
$sql .= ", f.tva as total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.paye, f.fk_statut, f.type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ",".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -117,6 +119,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$datelimite = $this->db->jdate($objp->datelimite);
|
||||
$date = $this->db->jdate($objp->df);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
@ -124,11 +127,16 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->date_echeance = $datelimite;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->fournisseur = 1;
|
||||
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$late = '';
|
||||
if ($facturestatic->hasDelay()) {
|
||||
@ -146,7 +154,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, '', 40),
|
||||
'text' => $thirdpartystatic->getNomUrl(1, '', 40),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
|
||||
@ -88,16 +88,17 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
if ($user->rights->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email,";
|
||||
$sql .= " s.code_client,";
|
||||
$sql .= " s.logo,";
|
||||
$sql .= " f.ref, f.date_lim_reglement as datelimite,";
|
||||
$sql .= " f.type,";
|
||||
$sql .= " f.datef as df,";
|
||||
$sql .= " f.total as total_ht,";
|
||||
$sql .= " f.tva as total_tva,";
|
||||
$sql .= " f.total_ttc,";
|
||||
$sql .= " f.paye, f.fk_statut, f.rowid as facid";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
||||
$sql .= ", f.ref, f.date_lim_reglement as datelimite";
|
||||
$sql .= ", f.type";
|
||||
$sql .= ", f.datef as df";
|
||||
$sql .= ", f.total as total_ht";
|
||||
$sql .= ", f.tva as total_tva";
|
||||
$sql .= ", f.total_ttc";
|
||||
$sql .= ", f.paye, f.fk_statut, f.rowid as facid";
|
||||
$sql .= ", sum(pf.amount) as am";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -139,10 +140,20 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->client = 1;
|
||||
$societestatic->email = $objp->email;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
$societestatic->tva_intra = $objp->tva_intra;
|
||||
$societestatic->idprof1 = $objp->idprof1;
|
||||
$societestatic->idprof2 = $objp->idprof2;
|
||||
$societestatic->idprof3 = $objp->idprof3;
|
||||
$societestatic->idprof4 = $objp->idprof4;
|
||||
$societestatic->idprof5 = $objp->idprof5;
|
||||
$societestatic->idprof6 = $objp->idprof6;
|
||||
|
||||
$late = '';
|
||||
if ($facturestatic->hasDelay()) {
|
||||
|
||||
@ -76,17 +76,19 @@ class box_ficheinter extends ModeleBoxes
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
$ficheinterstatic = new Fichinter($this->db);
|
||||
$companystatic = new Societe($this->db);
|
||||
$thirdpartystatic = new Societe($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastFicheInter", $max));
|
||||
|
||||
if (!empty($user->rights->ficheinter->lire))
|
||||
{
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut,";
|
||||
$sql .= " f.datec,";
|
||||
$sql .= " f.date_valid as datev,";
|
||||
$sql .= " f.tms as datem,";
|
||||
$sql .= " s.nom as name, s.rowid as socid, s.client, s.email as semail";
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut";
|
||||
$sql .= ", f.datec";
|
||||
$sql .= ", f.date_valid as datev";
|
||||
$sql .= ", f.tms as datem";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."fichinter as f";
|
||||
@ -115,9 +117,15 @@ class box_ficheinter extends ModeleBoxes
|
||||
$ficheinterstatic->id = $objp->rowid;
|
||||
$ficheinterstatic->ref = $objp->ref;
|
||||
|
||||
$companystatic->id = $objp->socid;
|
||||
$companystatic->name = $objp->name;
|
||||
$companystatic->email = $objp->semail;
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
$thirdpartystatic->code_compta = $objp->code_compta;
|
||||
$thirdpartystatic->client = $objp->client;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
@ -127,7 +135,7 @@ class box_ficheinter extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => $companystatic->getNomUrl(1),
|
||||
'text' => $thirdpartystatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
|
||||
@ -76,18 +76,17 @@ class box_fournisseurs extends ModeleBoxes
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$thirdpartystatic = new Societe($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
$thirdpartystatic = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers", $max));
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,";
|
||||
$sql .= " s.code_fournisseur, s.email as semail,";
|
||||
$sql .= " s.logo, s.code_compta_fournisseur, s.entity";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.datec, s.tms, s.status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE s.fournisseur = 1";
|
||||
@ -108,17 +107,20 @@ class box_fournisseurs extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->email = $objp->semail;
|
||||
$thirdpartytmp->code_client = $objp->code_client;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
$thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartytmp->entity = $objp->entity;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => '',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, '', 40),
|
||||
'text' => $thirdpartystatic->getNomUrl(1, '', 40),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
|
||||
@ -61,6 +61,8 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->enabled = ($conf->global->MAIN_FEATURES_LEVEL >= 1); // Not enabled by default, still need some work
|
||||
|
||||
$this->hidden = !($user->rights->projet->lire);
|
||||
}
|
||||
|
||||
@ -73,7 +75,23 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf;
|
||||
include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
||||
|
||||
// default values
|
||||
$badgeStatus0 = '#cbd3d3'; // draft
|
||||
$badgeStatus1 = '#bc9526'; // validated
|
||||
$badgeStatus1b = '#bc9526'; // validated
|
||||
$badgeStatus2 = '#9c9c26'; // approved
|
||||
$badgeStatus3 = '#bca52b';
|
||||
$badgeStatus4 = '#25a580'; // Color ok
|
||||
$badgeStatus4b = '#25a580'; // Color ok
|
||||
$badgeStatus5 = '#cad2d2';
|
||||
$badgeStatus6 = '#cad2d2';
|
||||
$badgeStatus7 = '#baa32b';
|
||||
$badgeStatus8 = '#993013';
|
||||
$badgeStatus9 = '#e7f0f0';
|
||||
if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) {
|
||||
include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
||||
}
|
||||
$listofoppstatus = array();
|
||||
$listofopplabel = array();
|
||||
$listofoppcode = array();
|
||||
@ -81,6 +99,8 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
$sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "c_lead_status as cls";
|
||||
$sql .= " WHERE active=1";
|
||||
$sql .= " AND cls.code <> 'LOST'";
|
||||
$sql .= $this->db->order('cls.rowid', 'ASC');
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -108,20 +128,20 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
$colorseriesstat[$objp->rowid] = $badgeStatus6;
|
||||
break;
|
||||
default:
|
||||
$colorseriesstat[$objp->rowid] = $badgeStatus2;
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else dol_print_error($this->db);
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
$this->info_box_head = array(
|
||||
'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("OpportunitiesStatusForOpenedProjects"),
|
||||
$max
|
||||
'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("BoxTitleFunnelOfProspection"),
|
||||
'graph' => '1'
|
||||
);
|
||||
|
||||
if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
@ -134,7 +154,7 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
$sql .= " GROUP BY p.fk_opp_status, cls.code";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$form = new Form($ths->db);
|
||||
$form = new Form($this->db);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
@ -153,7 +173,9 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
$valsnb[$obj->opp_status] = $obj->nb;
|
||||
$valsamount[$obj->opp_status] = $obj->opp_amount;
|
||||
$totalnb += $obj->nb;
|
||||
if ($obj->opp_status) $totaloppnb += $obj->nb;
|
||||
if ($obj->opp_status) {
|
||||
$totaloppnb += $obj->nb;
|
||||
}
|
||||
if (!in_array($obj->code, array('WON', 'LOST'))) {
|
||||
$totalamount += $obj->opp_amount;
|
||||
$ponderated_opp_amount += $obj->ponderated_opp_amount;
|
||||
@ -167,14 +189,21 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
$stringtoprint = '';
|
||||
$stringtoprint .= '<div class="div-table-responsive-no-min ">';
|
||||
$listofstatus = array_keys($listofoppstatus);
|
||||
$liststatus = array();
|
||||
$data = array('');
|
||||
foreach ($listofstatus as $status) {
|
||||
$labelStatus = '';
|
||||
if ($status != 7) {
|
||||
$code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code');
|
||||
if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code);
|
||||
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];
|
||||
if ($code) {
|
||||
$labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code);
|
||||
}
|
||||
if (empty($labelStatus)) {
|
||||
$labelStatus = $listofopplabel[$status];
|
||||
}
|
||||
|
||||
$dataseries[] = array($labelStatus,(isset($valsamount[$status]) ? (float) $valsamount[$status] : 0));
|
||||
$data[] = (isset($valsamount[$status]) ? (float) $valsamount[$status] : 0);
|
||||
$liststatus[] = $labelStatus;
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
$stringtoprint .= '<tr class="oddeven">';
|
||||
$stringtoprint .= '<td>' . $labelStatus . '</td>';
|
||||
@ -183,17 +212,22 @@ class box_funnel_of_prospection extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
}
|
||||
$dataseries[] = $data;
|
||||
if ($conf->use_javascript_ajax) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php';
|
||||
$dolgraph = new DolGraph();
|
||||
$dolgraph->SetMinValue(0);
|
||||
$dolgraph->SetData($dataseries);
|
||||
$dolgraph->SetLegend($liststatus);
|
||||
$dolgraph->SetDataColor(array_values($colorseriesstat));
|
||||
//$dolgraph->SetLegend(array('PROSP',$dataseries['PROSP']));
|
||||
$dolgraph->setShowLegend(2);
|
||||
$dolgraph->setShowPercent(1);
|
||||
$dolgraph->SetType(array('pie'));
|
||||
$dolgraph->setTitle('');
|
||||
$dolgraph->SetType(array('horizontalbars'));
|
||||
$dolgraph->SetHeight('200');
|
||||
$dolgraph->draw('idgraphstatus');
|
||||
$dolgraph->SetWidth('600');
|
||||
$dolgraph->mode = 'depth';
|
||||
$dolgraph->draw('idgraphleadfunnel');
|
||||
$stringtoprint .= $dolgraph->show($totaloppnb ? 0 : 1);
|
||||
}
|
||||
$stringtoprint .= '</div>';
|
||||
|
||||
@ -269,8 +269,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
'td' => 'class="nohover left"',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,8 +150,8 @@ class box_mos extends ModeleBoxes
|
||||
}
|
||||
|
||||
if ($num == 0) $this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center opacitymedium"',
|
||||
'text'=>$langs->trans("NoRecordedOrders")
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
);
|
||||
|
||||
$this->db->free($result);
|
||||
@ -164,8 +164,8 @@ class box_mos extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
'td' => 'class="nohover left"',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,8 +85,10 @@ class box_propales extends ModeleBoxes
|
||||
|
||||
if ($user->rights->propale->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, s.logo, s.entity, s.email,";
|
||||
$sql .= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -113,14 +115,19 @@ class box_propales extends ModeleBoxes
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
$dateterm = $this->db->jdate($objp->fin_validite);
|
||||
$dateclose = $this->db->jdate($objp->date_cloture);
|
||||
|
||||
$propalstatic->id = $objp->rowid;
|
||||
$propalstatic->ref = $objp->ref;
|
||||
$propalstatic->total_ht = $objp->total_ht;
|
||||
$propalstatic->total_tva = $objp->total_tva;
|
||||
$propalstatic->total_ttc = $objp->total_ttc;
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
|
||||
@ -86,13 +86,11 @@ class box_prospect extends ModeleBoxes
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.client, s.email";
|
||||
$sql .= ", s.code_fournisseur";
|
||||
$sql .= ", s.fournisseur";
|
||||
$sql .= ", s.logo";
|
||||
$sql .= ", s.fk_stcomm, s.datec, s.tms, s.status";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.fk_stcomm";
|
||||
$sql .= ", s.datec, s.tms, s.status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE s.client IN (2, 3)";
|
||||
@ -114,14 +112,16 @@ class box_prospect extends ModeleBoxes
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta = $objp->code_compta;
|
||||
$thirdpartystatic->client = $objp->client;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => '',
|
||||
|
||||
197
htdocs/core/boxes/box_scheduled_jobs.php
Normal file
197
htdocs/core/boxes/box_scheduled_jobs.php
Normal file
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Nicolas Zabouri <info@inovea-conseil.com>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_scheduled_jobs.php
|
||||
* \ingroup task
|
||||
* \brief Widget of scheduled jobs
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/boxes/modules_boxes.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage the box to show last contracted products/services lines
|
||||
*/
|
||||
class box_scheduled_jobs extends ModeleBoxes
|
||||
{
|
||||
public $boxcode = "scheduledjobs";
|
||||
public $boximg = "object_cron";
|
||||
public $boxlabel = "BoxScheduledJobs";
|
||||
public $depends = array("cron");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
public $param;
|
||||
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden = !($user->rights->service->lire && $user->rights->contrat->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$langs->load("cron");
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxScheduledJobs", $max));
|
||||
|
||||
if ($user->rights->cron->read) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php';
|
||||
$cronstatic = new Cronjob($this->db);
|
||||
$resultarray = array();
|
||||
|
||||
$result = 0;
|
||||
$sql = "SELECT t.rowid, t.datelastrun, t.datenextrun,";
|
||||
$sql .= " t.label, t.status, t.test, t.lastresult";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "cronjob as t";
|
||||
$sql .= " WHERE status <> ".$cronstatic::STATUS_DISABLED;
|
||||
$sql .= " AND entity IN (0, ".$conf->entity.")";
|
||||
$sql .= $this->db->order("t.datelastrun", "DESC");
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
$line = 0;
|
||||
$nbjobsinerror = 0;
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
if (dol_eval($objp->test, 1, 1)) {
|
||||
$nextrun = $this->db->jdate($objp->datenextrun);
|
||||
if (empty($nextrun)) $nextrun = $this->db->jdate($objp->datestart);
|
||||
|
||||
if ($line == 0 || ($nextrun < $cronstatic->datenextrun && (empty($objp->nbrun) || empty($objp->maxrun) || $objp->nbrun < $obj->maxrun))) {
|
||||
$cronstatic->id = $objp->rowid;
|
||||
$cronstatic->ref = $objp->rowid;
|
||||
$cronstatic->label = $langs->trans($objp->label);
|
||||
$cronstatic->status = $objp->status;
|
||||
$cronstatic->datenextrun = $this->db->jdate($objp->datenextrun);
|
||||
$cronstatic->datelastrun = $this->db->jdate($objp->datelastrun);
|
||||
}
|
||||
if ($line == 0) {
|
||||
$resultarray[$line] = array(
|
||||
$langs->trans("LastExecutedScheduledJob"),
|
||||
$cronstatic->getNomUrl(1),
|
||||
$cronstatic->datelastrun,
|
||||
$cronstatic->status,
|
||||
$cronstatic->getLibStatut(2)
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
|
||||
if (!empty($objp->lastresult)) {
|
||||
$nbjobsinerror++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($line) {
|
||||
$resultarray[$line] = array(
|
||||
$langs->trans("NextScheduledJobExecute"),
|
||||
$cronstatic->getNomUrl(1),
|
||||
$cronstatic->datenextrun,
|
||||
$cronstatic->status,
|
||||
$cronstatic->getLibStatut(2)
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($resultarray as $line => $value) {
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="left"',
|
||||
'text' => $resultarray[$line][0]
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="left"',
|
||||
'textnoformat' => $resultarray[$line][1]
|
||||
);
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'textnoformat' => dol_print_date($resultarray[$line][2], "dayhoursec")
|
||||
);
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" ',
|
||||
'textnoformat' => $resultarray[$line][4]
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="left" colspan="2"',
|
||||
'text' => $langs->trans("NumberScheduledJobError")
|
||||
);
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" colspan="2"',
|
||||
'textnoformat' => ($nbjobsinerror ? '<span class="error"><a href="'.DOL_URL_ROOT.'/cron/list.php?search_lastresult='.urlencode('<>0').'">'.$nbjobsinerror.'</a></span>'.img_error() : '<span class="opacitymedium">'.$langs->trans("None").'<span>')
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->lasterror() . ' sql=' . $sql)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||
}
|
||||
}
|
||||
@ -88,10 +88,9 @@ class box_shipments extends ModeleBoxes
|
||||
|
||||
if ($user->rights->expedition->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name";
|
||||
$sql .= ", s.rowid as socid";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.logo, s.email";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", e.ref, e.tms";
|
||||
$sql .= ", e.rowid";
|
||||
$sql .= ", e.ref_customer";
|
||||
@ -128,9 +127,13 @@ class box_shipments extends ModeleBoxes
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->email = $objp->email;
|
||||
//$societestatic->name_alias = $objp->name_alias;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->code_compta = $objp->code_compta;
|
||||
$societestatic->client = $objp->client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
|
||||
@ -77,20 +77,20 @@ class box_supplier_orders extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$supplierorderstatic = new CommandeFournisseur($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
$thirdpartystatic = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."SupplierOrders", $max));
|
||||
|
||||
if ($user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid,";
|
||||
$sql .= " s.code_client, s.code_fournisseur,";
|
||||
$sql .= " s.logo, s.email,";
|
||||
$sql .= " c.rowid, c.ref, c.tms, c.date_commande,";
|
||||
$sql .= " c.total_ht,";
|
||||
$sql .= " c.tva as total_tva,";
|
||||
$sql .= " c.total_ttc,";
|
||||
$sql .= " c.fk_statut";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", c.rowid, c.ref, c.tms, c.date_commande";
|
||||
$sql .= ", c.total_ht";
|
||||
$sql .= ", c.tva as total_tva";
|
||||
$sql .= ", c.total_ttc";
|
||||
$sql .= ", c.fk_statut";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -116,12 +116,15 @@ class box_supplier_orders extends ModeleBoxes
|
||||
$supplierorderstatic->id = $objp->rowid;
|
||||
$supplierorderstatic->ref = $objp->ref;
|
||||
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->email = $objp->email;
|
||||
$thirdpartytmp->fournisseur = 1;
|
||||
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
@ -131,7 +134,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
|
||||
'text' => $thirdpartystatic->getNomUrl(1, 'supplier'),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
@ -169,8 +172,8 @@ class box_supplier_orders extends ModeleBoxes
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => 'class="nohover opacitymedium left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||
'td' => 'class="nohover left"',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,20 +77,20 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$supplierorderstatic = new CommandeFournisseur($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
$thirdpartystatic = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleSupplierOrdersAwaitingReception", $max));
|
||||
|
||||
if ($user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid,";
|
||||
$sql .= " s.code_client, s.code_fournisseur, s.email,";
|
||||
$sql .= " s.logo,";
|
||||
$sql .= " c.rowid, c.ref, c.tms, c.date_commande, c.date_livraison as delivery_date, ";
|
||||
$sql .= " c.total_ht,";
|
||||
$sql .= " c.tva as total_tva,";
|
||||
$sql .= " c.total_ttc,";
|
||||
$sql .= " c.fk_statut";
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", c.rowid, c.ref, c.tms, c.date_commande, c.date_livraison as delivery_date";
|
||||
$sql .= ", c.total_ht";
|
||||
$sql .= ", c.tva as total_tva";
|
||||
$sql .= ", c.total_ttc";
|
||||
$sql .= ", c.fk_statut";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -121,12 +121,15 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
$supplierorderstatic->id = $objp->rowid;
|
||||
$supplierorderstatic->ref = $objp->ref;
|
||||
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->email = $objp->email;
|
||||
$thirdpartytmp->fournisseur = 1;
|
||||
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
//$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
|
||||
$thirdpartystatic->fournisseur = $objp->fournisseur;
|
||||
$thirdpartystatic->logo = $objp->logo;
|
||||
$thirdpartystatic->email = $objp->email;
|
||||
$thirdpartystatic->entity = $objp->entity;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
@ -136,7 +139,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => $thirdpartytmp->getNomUrl(1, 'supplier'),
|
||||
'text' => $thirdpartystatic->getNomUrl(1, 'supplier'),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
|
||||
@ -146,8 +146,10 @@ class CMailFile
|
||||
}
|
||||
}
|
||||
|
||||
// Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
|
||||
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
// Add autocopy to if not already in $to (Note: Adding bcc for specific modules are also done from pages)
|
||||
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && !preg_match('/'.preg_quote($conf->global->MAIN_MAIL_AUTOCOPY_TO, '/').'/i', $to)) {
|
||||
$addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
|
||||
$this->subject = $subject;
|
||||
$this->addr_to = $to;
|
||||
@ -275,6 +277,11 @@ class CMailFile
|
||||
}
|
||||
}
|
||||
|
||||
// Add autocopy to if not already in $to (Note: Adding bcc for specific modules are also done from pages)
|
||||
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && !preg_match('/'.preg_quote($conf->global->MAIN_MAIL_AUTOCOPY_TO, '/').'/i', $to)) {
|
||||
$addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
|
||||
$this->addr_to = $to;
|
||||
$this->addr_cc = $addr_cc;
|
||||
$this->addr_bcc = $addr_bcc;
|
||||
@ -292,11 +299,6 @@ class CMailFile
|
||||
$this->addr_bcc = '';
|
||||
}
|
||||
|
||||
// Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
|
||||
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) {
|
||||
$addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
|
||||
$keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED';
|
||||
if (!empty($this->sendcontext)) {
|
||||
$smtpContextKey = strtoupper($this->sendcontext);
|
||||
@ -725,7 +727,11 @@ class CMailFile
|
||||
|
||||
if (!empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam ? ' ' : '').'-U '.$additionnalparam; // Use -U to add additionnal params
|
||||
|
||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
|
||||
$linuxlike = 1;
|
||||
if (preg_match('/^win/i', PHP_OS)) $linuxlike = 0;
|
||||
if (preg_match('/^mac/i', PHP_OS)) $linuxlike = 0;
|
||||
|
||||
dol_syslog("CMailFile::sendfile: mail start".($linuxlike ? '' : " HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port')).", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
|
||||
|
||||
$this->message = stripslashes($this->message);
|
||||
|
||||
@ -744,11 +750,7 @@ class CMailFile
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error = "Failed to send mail with php mail";
|
||||
$linuxlike = 1;
|
||||
if (preg_match('/^win/i', PHP_OS)) $linuxlike = 0;
|
||||
if (preg_match('/^mac/i', PHP_OS)) $linuxlike = 0;
|
||||
if (!$linuxlike)
|
||||
{
|
||||
if (!$linuxlike) {
|
||||
$this->error .= " to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'); // This values are value used only for non linuxlike systems
|
||||
}
|
||||
$this->error .= ".<br>";
|
||||
|
||||
@ -195,6 +195,11 @@ abstract class CommonObject
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
/**
|
||||
* @var string An external reference for the object
|
||||
*/
|
||||
public $ref_ext;
|
||||
|
||||
/**
|
||||
* @var string The object's previous reference
|
||||
*/
|
||||
@ -205,11 +210,6 @@ abstract class CommonObject
|
||||
*/
|
||||
public $ref_next;
|
||||
|
||||
/**
|
||||
* @var string An external reference for the object
|
||||
*/
|
||||
public $ref_ext;
|
||||
|
||||
/**
|
||||
* @var int The object's status
|
||||
* @see setStatut()
|
||||
@ -469,6 +469,12 @@ abstract class CommonObject
|
||||
*/
|
||||
public $specimen = 0;
|
||||
|
||||
/**
|
||||
* @var int Id of contact to send object (used by the trigger of module Agenda)
|
||||
*/
|
||||
public $sendtoid;
|
||||
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
@ -694,17 +700,14 @@ abstract class CommonObject
|
||||
$contactid = 0;
|
||||
$thirdpartyid = 0;
|
||||
$elementforaltlanguage = $this->element;
|
||||
if ($this->element == 'societe')
|
||||
{
|
||||
if ($this->element == 'societe') {
|
||||
$thirdpartyid = $this->id;
|
||||
}
|
||||
if ($this->element == 'contact')
|
||||
{
|
||||
if ($this->element == 'contact') {
|
||||
$contactid = $this->id;
|
||||
$thirdpartyid = $object->fk_soc;
|
||||
}
|
||||
if ($this->element == 'user')
|
||||
{
|
||||
if ($this->element == 'user') {
|
||||
$contactid = $this->contact_id;
|
||||
$thirdpartyid = $object->fk_soc;
|
||||
}
|
||||
@ -773,54 +776,62 @@ abstract class CommonObject
|
||||
|
||||
if (!empty($this->phone) || !empty($this->phone_pro) || !empty($this->phone_mobile) || !empty($this->phone_perso) || !empty($this->fax) || !empty($this->office_phone) || !empty($this->user_mobile) || !empty($this->office_fax)) $out .= ($outdone ? '<br>' : '');
|
||||
if (!empty($this->phone) && empty($this->phone_pro)) { // For objects that store pro phone into ->phone
|
||||
$out .= dol_print_phone($this->phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro")); $outdone++;
|
||||
$out .= dol_print_phone($this->phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->phone_pro)) {
|
||||
$out .= dol_print_phone($this->phone_pro, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro")); $outdone++;
|
||||
$out .= dol_print_phone($this->phone_pro, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->phone_mobile)) {
|
||||
$out .= dol_print_phone($this->phone_mobile, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'mobile', $langs->trans("PhoneMobile")); $outdone++;
|
||||
$out .= dol_print_phone($this->phone_mobile, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'mobile', $langs->trans("PhoneMobile"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->phone_perso)) {
|
||||
$out .= dol_print_phone($this->phone_perso, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePerso")); $outdone++;
|
||||
$out .= dol_print_phone($this->phone_perso, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePerso"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->office_phone)) {
|
||||
$out .= dol_print_phone($this->office_phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro")); $outdone++;
|
||||
$out .= dol_print_phone($this->office_phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->user_mobile)) {
|
||||
$out .= dol_print_phone($this->user_mobile, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'mobile', $langs->trans("PhoneMobile")); $outdone++;
|
||||
$out .= dol_print_phone($this->user_mobile, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'mobile', $langs->trans("PhoneMobile"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->fax)) {
|
||||
$out .= dol_print_phone($this->fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', ' ', 'fax', $langs->trans("Fax")); $outdone++;
|
||||
$out .= dol_print_phone($this->fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', ' ', 'fax', $langs->trans("Fax"));
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->office_fax)) {
|
||||
$out .= dol_print_phone($this->office_fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', ' ', 'fax', $langs->trans("Fax")); $outdone++;
|
||||
$out .= dol_print_phone($this->office_fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', ' ', 'fax', $langs->trans("Fax"));
|
||||
$outdone++;
|
||||
}
|
||||
|
||||
if ($out) $out .= '<div style="clear: both;"></div>';
|
||||
$outdone = 0;
|
||||
if (!empty($this->email))
|
||||
{
|
||||
if (!empty($this->email)) {
|
||||
$out .= dol_print_email($this->email, $this->id, $object->id, 'AC_EMAIL', 0, 0, 1);
|
||||
$outdone++;
|
||||
}
|
||||
if (!empty($this->url))
|
||||
{
|
||||
if (!empty($this->url)) {
|
||||
//$out.=dol_print_url($this->url,'_goout',0,1);//steve changed to blank
|
||||
$out .= dol_print_url($this->url, '_blank', 0, 1);
|
||||
$outdone++;
|
||||
}
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
$outsocialnetwork = '';
|
||||
|
||||
if (is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {
|
||||
$socialnetworksdict = getArrayOfSocialNetworks();
|
||||
foreach ($this->socialnetworks as $key => $value) {
|
||||
$outsocialnetwork .= dol_print_socialnetworks($value, $this->id, $object->id, $key);
|
||||
if ($value) {
|
||||
$outsocialnetwork .= dol_print_socialnetworks($value, $this->id, $object->id, $key, $socialnetworksdict);
|
||||
}
|
||||
$outdone++;
|
||||
}
|
||||
} else {
|
||||
} else { // Old code to remove
|
||||
if ($this->skype) $outsocialnetwork .= dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype');
|
||||
$outdone++;
|
||||
if ($this->jabberid) $outsocialnetwork .= dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber');
|
||||
@ -4555,6 +4566,11 @@ abstract class CommonObject
|
||||
{
|
||||
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
|
||||
|
||||
if (empty($modele)) {
|
||||
$this->error = 'BadValueForParameterModele';
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Increase limit for PDF build
|
||||
$err = error_reporting();
|
||||
error_reporting(0);
|
||||
|
||||
@ -103,9 +103,8 @@ class DolGraph
|
||||
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
|
||||
$this->bgcolor = array(235, 235, 224);
|
||||
|
||||
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
if (is_readable($color_file))
|
||||
{
|
||||
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
||||
if (is_readable($color_file)) {
|
||||
include_once $color_file;
|
||||
if (isset($theme_bordercolor)) $this->bordercolor = $theme_bordercolor;
|
||||
if (isset($theme_datacolor)) $this->datacolor = $theme_datacolor;
|
||||
@ -261,7 +260,7 @@ class DolGraph
|
||||
* Set type
|
||||
*
|
||||
* @param array $type Array with type for each serie. Example: array('type1', 'type2', ...) where type can be:
|
||||
* 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horirontalbars'...
|
||||
* 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horizontalbars'...
|
||||
* @return void
|
||||
*/
|
||||
public function SetType($type)
|
||||
@ -466,10 +465,8 @@ class DolGraph
|
||||
// phpcs:enable
|
||||
global $theme_bgcolor, $theme_bgcoloronglet;
|
||||
|
||||
if (!is_array($bg_color))
|
||||
{
|
||||
if ($bg_color == 'onglet')
|
||||
{
|
||||
if (!is_array($bg_color)) {
|
||||
if ($bg_color == 'onglet') {
|
||||
//print 'ee'.join(',',$theme_bgcoloronglet);
|
||||
$this->bgcolor = $theme_bgcoloronglet;
|
||||
} else {
|
||||
@ -492,10 +489,8 @@ class DolGraph
|
||||
// phpcs:enable
|
||||
global $theme_bgcolor, $theme_bgcoloronglet;
|
||||
|
||||
if (!is_array($bg_colorgrid))
|
||||
{
|
||||
if ($bg_colorgrid == 'onglet')
|
||||
{
|
||||
if (!is_array($bg_colorgrid)) {
|
||||
if ($bg_colorgrid == 'onglet') {
|
||||
//print 'ee'.join(',',$theme_bgcoloronglet);
|
||||
$this->bgcolorgrid = $theme_bgcoloronglet;
|
||||
} else {
|
||||
@ -535,10 +530,8 @@ class DolGraph
|
||||
$nblines = count($this->data);
|
||||
$nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1);
|
||||
|
||||
for ($j = 0; $j < $nblines; $j++)
|
||||
{
|
||||
for ($i = 0; $i < $nbvalues; $i++)
|
||||
{
|
||||
for ($j = 0; $j < $nblines; $j++) {
|
||||
for ($i = 0; $i < $nbvalues; $i++) {
|
||||
$vals[$k] = $this->data[$j][$i + 1];
|
||||
$k++;
|
||||
}
|
||||
@ -564,10 +557,8 @@ class DolGraph
|
||||
$nblines = count($this->data);
|
||||
$nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1);
|
||||
|
||||
for ($j = 0; $j < $nblines; $j++)
|
||||
{
|
||||
for ($i = 0; $i < $nbvalues; $i++)
|
||||
{
|
||||
for ($j = 0; $j < $nblines; $j++) {
|
||||
for ($i = 0; $i < $nbvalues; $i++) {
|
||||
$vals[$k] = $this->data[$j][$i + 1];
|
||||
$k++;
|
||||
}
|
||||
@ -589,8 +580,7 @@ class DolGraph
|
||||
if ($max != 0) $max++;
|
||||
$size = dol_strlen(abs(ceil($max)));
|
||||
$factor = 1;
|
||||
for ($i = 0; $i < ($size - 1); $i++)
|
||||
{
|
||||
for ($i = 0; $i < ($size - 1); $i++) {
|
||||
$factor *= 10;
|
||||
}
|
||||
|
||||
@ -615,8 +605,7 @@ class DolGraph
|
||||
if ($min != 0) $min--;
|
||||
$size = dol_strlen(abs(floor($min)));
|
||||
$factor = 1;
|
||||
for ($i = 0; $i < ($size - 1); $i++)
|
||||
{
|
||||
for ($i = 0; $i < ($size - 1); $i++) {
|
||||
$factor *= 10;
|
||||
}
|
||||
|
||||
@ -635,24 +624,21 @@ class DolGraph
|
||||
*/
|
||||
public function draw($file, $fileurl = '')
|
||||
{
|
||||
if (empty($file))
|
||||
{
|
||||
if (empty($file)) {
|
||||
$this->error = "Call to draw method was made with empty value for parameter file.";
|
||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
if (!is_array($this->data))
|
||||
{
|
||||
if (!is_array($this->data)) {
|
||||
$this->error = "Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
|
||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this) . "::draw " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (count($this->data) < 1)
|
||||
{
|
||||
if (count($this->data) < 1) {
|
||||
$this->error = "Call to draw method was made but SetData was is an empty dataset";
|
||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_WARNING);
|
||||
dol_syslog(get_class($this) . "::draw " . $this->error, LOG_WARNING);
|
||||
}
|
||||
$call = "draw_".$this->_library;
|
||||
$call = "draw_" . $this->_library;
|
||||
call_user_func_array(array($this, $call), array($file, $fileurl));
|
||||
}
|
||||
|
||||
@ -678,10 +664,9 @@ class DolGraph
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
|
||||
dol_syslog(get_class($this) . "::draw_jflot this->type=" . join(',', $this->type) . " this->MaxValue=" . $this->MaxValue);
|
||||
|
||||
if (empty($this->width) && empty($this->height))
|
||||
{
|
||||
if (empty($this->width) && empty($this->height)) {
|
||||
print 'Error width or height not set';
|
||||
return;
|
||||
}
|
||||
@ -701,7 +686,7 @@ class DolGraph
|
||||
while ($i < $nblot) // Loop on each serie
|
||||
{
|
||||
$values = array(); // Array with horizontal y values (specific values of a serie) for each abscisse x
|
||||
$serie[$i] = "var d".$i." = [];\n";
|
||||
$serie[$i] = "var d" . $i . " = [];\n";
|
||||
|
||||
// Fill array $values
|
||||
$x = 0;
|
||||
@ -712,14 +697,13 @@ class DolGraph
|
||||
$x++;
|
||||
}
|
||||
|
||||
if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar')))
|
||||
{
|
||||
if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) {
|
||||
foreach ($values as $x => $y) {
|
||||
if (isset($y)) $serie[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n";
|
||||
if (isset($y)) $serie[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n";
|
||||
}
|
||||
} else {
|
||||
foreach ($values as $x => $y) {
|
||||
if (isset($y)) $serie[$i] .= 'd'.$i.'.push(['.$x.', '.$y.']);'."\n";
|
||||
if (isset($y)) $serie[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -728,43 +712,39 @@ class DolGraph
|
||||
}
|
||||
$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
|
||||
|
||||
$this->stringtoshow = '<!-- Build using jflot -->'."\n";
|
||||
if (!empty($this->title)) $this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
|
||||
if (!empty($this->shownographyet))
|
||||
{
|
||||
$this->stringtoshow .= '<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>';
|
||||
$this->stringtoshow .= '<div class="nographyettext margintoponly">'.$langs->trans("NotEnoughDataYet").'...</div>';
|
||||
$this->stringtoshow = '<!-- Build using jflot -->' . "\n";
|
||||
if (!empty($this->title)) $this->stringtoshow .= '<div class="center dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>';
|
||||
if (!empty($this->shownographyet)) {
|
||||
$this->stringtoshow .= '<div style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="nographyet"></div>';
|
||||
$this->stringtoshow .= '<div class="nographyettext margintoponly">' . $langs->trans("NotEnoughDataYet") . '...</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
// Start the div that will contains all the graph
|
||||
$dolxaxisvertical = '';
|
||||
if (count($this->data) > 20) $dolxaxisvertical = 'dol-xaxis-vertical';
|
||||
$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center"></div>'."\n";
|
||||
$this->stringtoshow .= '<div id="placeholder_' . $tag . '" style="width:' . $this->width . 'px;height:' . $this->height . 'px;" class="dolgraph' . (empty($dolxaxisvertical) ? '' : ' ' . $dolxaxisvertical) . (empty($this->cssprefix) ? '' : ' dolgraph' . $this->cssprefix) . ' center"></div>' . "\n";
|
||||
|
||||
$this->stringtoshow .= '<script id="'.$tag.'">'."\n";
|
||||
$this->stringtoshow .= '$(function () {'."\n";
|
||||
$this->stringtoshow .= '<script id="' . $tag . '">' . "\n";
|
||||
$this->stringtoshow .= '$(function () {' . "\n";
|
||||
$i = $firstlot;
|
||||
if ($nblot < 0)
|
||||
{
|
||||
$this->stringtoshow .= '<!-- No series of data -->'."\n";
|
||||
if ($nblot < 0) {
|
||||
$this->stringtoshow .= '<!-- No series of data -->' . "\n";
|
||||
} else {
|
||||
while ($i < $nblot)
|
||||
{
|
||||
$this->stringtoshow .= '<!-- Serie '.$i.' -->'."\n";
|
||||
$this->stringtoshow .= $serie[$i]."\n";
|
||||
while ($i < $nblot) {
|
||||
$this->stringtoshow .= '<!-- Serie ' . $i . ' -->' . "\n";
|
||||
$this->stringtoshow .= $serie[$i] . "\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$this->stringtoshow .= "\n";
|
||||
|
||||
// Special case for Graph of type 'pie'
|
||||
if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar')))
|
||||
{
|
||||
if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) {
|
||||
$datacolor = array();
|
||||
foreach ($this->datacolor as $val) {
|
||||
if (is_array($val)) $datacolor[] = "#".sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B)
|
||||
else $datacolor[] = "#".str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124'
|
||||
if (is_array($val)) $datacolor[] = "#" . sprintf("%02x%02x%02x", $val[0], $val[1], $val[2]); // If datacolor is array(R, G, B)
|
||||
else $datacolor[] = "#" . str_replace(array('#', '-'), '', $val); // If $val is '124' or '#124'
|
||||
}
|
||||
|
||||
$urltemp = ''; // TODO Add support for url link into labels
|
||||
@ -773,17 +753,17 @@ class DolGraph
|
||||
$showpercent = $this->showpercent;
|
||||
|
||||
$this->stringtoshow .= '
|
||||
function plotWithOptions_'.$tag.'() {
|
||||
$.plot($("#placeholder_'.$tag.'"), d0,
|
||||
function plotWithOptions_' . $tag . '() {
|
||||
$.plot($("#placeholder_' . $tag . '"), d0,
|
||||
{
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 0.8,
|
||||
'.($this->combine ? '
|
||||
' . ($this->combine ? '
|
||||
combine: {
|
||||
threshold: '.$this->combine.'
|
||||
},' : '').'
|
||||
threshold: ' . $this->combine . '
|
||||
},' : '') . '
|
||||
label: {
|
||||
show: true,
|
||||
radius: 0.9,
|
||||
@ -791,15 +771,15 @@ class DolGraph
|
||||
var percent=Math.round(series.percent);
|
||||
var number=series.data[0][1];
|
||||
return \'';
|
||||
$this->stringtoshow .= '<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
|
||||
if ($urltemp) $this->stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
|
||||
$this->stringtoshow .= '\'+';
|
||||
$this->stringtoshow .= ($showlegend ? '' : 'label+\' \'+'); // Hide label if already shown in legend
|
||||
$this->stringtoshow .= ($showpointvalue ? 'number+' : '');
|
||||
$this->stringtoshow .= ($showpercent ? '\'<br/>\'+percent+\'%\'+' : '');
|
||||
$this->stringtoshow .= '\'';
|
||||
if ($urltemp) $this->stringtoshow .= '</a>';
|
||||
$this->stringtoshow .= '</span>\';
|
||||
$this->stringtoshow .= '<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
|
||||
if ($urltemp) $this->stringtoshow .= '<a style="color: #FFFFFF;" border="0" href="' . $urltemp . '">';
|
||||
$this->stringtoshow .= '\'+';
|
||||
$this->stringtoshow .= ($showlegend ? '' : 'label+\' \'+'); // Hide label if already shown in legend
|
||||
$this->stringtoshow .= ($showpointvalue ? 'number+' : '');
|
||||
$this->stringtoshow .= ($showpercent ? '\'<br/>\'+percent+\'%\'+' : '');
|
||||
$this->stringtoshow .= '\'';
|
||||
if ($urltemp) $this->stringtoshow .= '</a>';
|
||||
$this->stringtoshow .= '</span>\';
|
||||
},
|
||||
background: {
|
||||
opacity: 0.0,
|
||||
@ -814,21 +794,20 @@ class DolGraph
|
||||
pan: {
|
||||
interactive: true
|
||||
},';
|
||||
if (count($datacolor))
|
||||
{
|
||||
$this->stringtoshow .= 'colors: '.(!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor)).',';
|
||||
if (count($datacolor)) {
|
||||
$this->stringtoshow .= 'colors: ' . (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor)) . ',';
|
||||
}
|
||||
$this->stringtoshow .= 'legend: {show: '.($showlegend ? 'true' : 'false').', position: \'ne\' }
|
||||
$this->stringtoshow .= 'legend: {show: ' . ($showlegend ? 'true' : 'false') . ', position: \'ne\' }
|
||||
});
|
||||
}'."\n";
|
||||
}' . "\n";
|
||||
}
|
||||
// Other cases, graph of type 'bars', 'lines'
|
||||
else {
|
||||
// Add code to support tooltips
|
||||
// TODO: remove js css and use graph-tooltip-inner class instead by adding css in each themes
|
||||
$this->stringtoshow .= '
|
||||
function showTooltip_'.$tag.'(x, y, contents) {
|
||||
$(\'<div class="graph-tooltip-inner" id="tooltip_'.$tag.'">\' + contents + \'</div>\').css({
|
||||
function showTooltip_' . $tag . '(x, y, contents) {
|
||||
$(\'<div class="graph-tooltip-inner" id="tooltip_' . $tag . '">\' + contents + \'</div>\').css({
|
||||
position: \'absolute\',
|
||||
display: \'none\',
|
||||
top: y + 10,
|
||||
@ -844,7 +823,7 @@ class DolGraph
|
||||
}
|
||||
|
||||
var previousPoint = null;
|
||||
$("#placeholder_'.$tag.'").bind("plothover", function (event, pos, item) {
|
||||
$("#placeholder_' . $tag . '").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
|
||||
@ -858,27 +837,26 @@ class DolGraph
|
||||
var y = item.datapoint[1].toFixed(2);
|
||||
var z = item.series.xaxis.ticks[item.dataIndex].label;
|
||||
';
|
||||
if ($this->showpointvalue > 0) $this->stringtoshow .= '
|
||||
showTooltip_'.$tag.'(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y);
|
||||
if ($this->showpointvalue > 0) $this->stringtoshow .= '
|
||||
showTooltip_' . $tag . '(item.pageX, item.pageY, item.series.label + "<br>" + z + " => " + y);
|
||||
';
|
||||
$this->stringtoshow .= '
|
||||
$this->stringtoshow .= '
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#tooltip_'.$tag.'").remove();
|
||||
$("#tooltip_' . $tag . '").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
';
|
||||
|
||||
$this->stringtoshow .= 'var stack = null, steps = false;'."\n";
|
||||
$this->stringtoshow .= 'var stack = null, steps = false;' . "\n";
|
||||
|
||||
$this->stringtoshow .= 'function plotWithOptions_'.$tag.'() {'."\n";
|
||||
$this->stringtoshow .= '$.plot($("#placeholder_'.$tag.'"), [ '."\n";
|
||||
$this->stringtoshow .= 'function plotWithOptions_' . $tag . '() {' . "\n";
|
||||
$this->stringtoshow .= '$.plot($("#placeholder_' . $tag . '"), [ ' . "\n";
|
||||
$i = $firstlot;
|
||||
while ($i < $nblot)
|
||||
{
|
||||
if ($i > $firstlot) $this->stringtoshow .= ', '."\n";
|
||||
while ($i < $nblot) {
|
||||
if ($i > $firstlot) $this->stringtoshow .= ', ' . "\n";
|
||||
$color = sprintf("%02x%02x%02x", $this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]);
|
||||
$this->stringtoshow .= '{ ';
|
||||
if (!isset($this->type[$i]) || $this->type[$i] == 'bars') {
|
||||
@ -886,42 +864,41 @@ class DolGraph
|
||||
if ($i == $firstlot) $align = 'right';
|
||||
elseif ($i == $firstlot + 1) $align = 'center';
|
||||
else $align = 'left';
|
||||
$this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.$align.'", barWidth: 0.45 }, ';
|
||||
} else $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.($i == $firstlot ? 'center' : 'left').'", barWidth: 0.5 }, ';
|
||||
$this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "' . $align . '", barWidth: 0.45 }, ';
|
||||
} else $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "' . ($i == $firstlot ? 'center' : 'left') . '", barWidth: 0.5 }, ';
|
||||
}
|
||||
if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) $this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: '.($this->type[$i] == 'linesnopoint' ? 'false' : 'true').' }, ';
|
||||
$this->stringtoshow .= 'color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }';
|
||||
if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) $this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: ' . ($this->type[$i] == 'linesnopoint' ? 'false' : 'true') . ' }, ';
|
||||
$this->stringtoshow .= 'color: "#' . $color . '", label: "' . (isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '') . '", data: d' . $i . ' }';
|
||||
$i++;
|
||||
}
|
||||
// shadowSize: 0 -> Drawing is faster without shadows
|
||||
$this->stringtoshow .= "\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6, fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }'."\n";
|
||||
$this->stringtoshow .= "\n" . ' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6, fillColor: { colors: [{opacity: 0.9 }, {opacity: 0.85}] }} }' . "\n";
|
||||
|
||||
// Xaxis
|
||||
$this->stringtoshow .= ', xaxis: { ticks: ['."\n";
|
||||
$this->stringtoshow .= ', xaxis: { ticks: [' . "\n";
|
||||
$x = 0;
|
||||
foreach ($this->data as $key => $valarray)
|
||||
{
|
||||
if ($x > 0) $this->stringtoshow .= ', '."\n";
|
||||
$this->stringtoshow .= ' ['.$x.', "'.$valarray[0].'"]';
|
||||
foreach ($this->data as $key => $valarray) {
|
||||
if ($x > 0) $this->stringtoshow .= ', ' . "\n";
|
||||
$this->stringtoshow .= ' [' . $x . ', "' . $valarray[0] . '"]';
|
||||
$x++;
|
||||
}
|
||||
$this->stringtoshow .= '] }'."\n";
|
||||
$this->stringtoshow .= '] }' . "\n";
|
||||
|
||||
// Yaxis
|
||||
$this->stringtoshow .= ', yaxis: { min: '.$this->MinValue.', max: '.($this->MaxValue).' }'."\n";
|
||||
$this->stringtoshow .= ', yaxis: { min: ' . $this->MinValue . ', max: ' . ($this->MaxValue) . ' }' . "\n";
|
||||
|
||||
// Background color
|
||||
$color1 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[0], $this->bgcolorgrid[2]);
|
||||
$color2 = sprintf("%02x%02x%02x", $this->bgcolorgrid[0], $this->bgcolorgrid[1], $this->bgcolorgrid[2]);
|
||||
$this->stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#e6e6e6\', tickColor : \'#e6e6e6\' }'."\n";
|
||||
$this->stringtoshow .= ', grid: { hoverable: true, backgroundColor: { colors: ["#' . $color1 . '", "#' . $color2 . '"] }, borderWidth: 1, borderColor: \'#e6e6e6\', tickColor : \'#e6e6e6\' }' . "\n";
|
||||
//$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this
|
||||
$this->stringtoshow .= '});'."\n";
|
||||
$this->stringtoshow .= '}'."\n";
|
||||
$this->stringtoshow .= '});' . "\n";
|
||||
$this->stringtoshow .= '}' . "\n";
|
||||
}
|
||||
|
||||
$this->stringtoshow .= 'plotWithOptions_'.$tag.'();'."\n";
|
||||
$this->stringtoshow .= '});'."\n";
|
||||
$this->stringtoshow .= '</script>'."\n";
|
||||
$this->stringtoshow .= 'plotWithOptions_' . $tag . '();' . "\n";
|
||||
$this->stringtoshow .= '});' . "\n";
|
||||
$this->stringtoshow .= '</script>' . "\n";
|
||||
}
|
||||
|
||||
|
||||
@ -947,10 +924,9 @@ class DolGraph
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::draw_chart this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
|
||||
dol_syslog(get_class($this) . "::draw_chart this->type=" . join(',', $this->type) . " this->MaxValue=" . $this->MaxValue);
|
||||
|
||||
if (empty($this->width) && empty($this->height))
|
||||
{
|
||||
if (empty($this->width) && empty($this->height)) {
|
||||
print 'Error width or height not set';
|
||||
return;
|
||||
}
|
||||
@ -971,7 +947,8 @@ class DolGraph
|
||||
// Works with line but not with bars
|
||||
//if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x
|
||||
|
||||
$serie = array(); $arrayofgroupslegend = array();
|
||||
$serie = array();
|
||||
$arrayofgroupslegend = array();
|
||||
//var_dump($this->data);
|
||||
|
||||
$i = $firstlot;
|
||||
@ -989,15 +966,15 @@ class DolGraph
|
||||
$alabelexists = 1;
|
||||
$tmpykey = explode('_', ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3);
|
||||
if (!empty($tmpykey[2]) || $tmpykey[2] == '0') { // This is a 'Group by' array
|
||||
$tmpvalue = (array_key_exists('y_'.$tmpykey[1].'_'.$tmpykey[2], $valarray) ? $valarray['y_'.$tmpykey[1].'_'.$tmpykey[2]] : $valarray[$i + 1]);
|
||||
$tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]);
|
||||
$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
|
||||
$arrayofgroupslegend[$i] = array(
|
||||
'stacknum'=> $tmpykey[1],
|
||||
'stacknum' => $tmpykey[1],
|
||||
'legend' => $this->Legend[$tmpykey[1]],
|
||||
'legendwithgroup' => $this->Legend[$tmpykey[1]].' - '.$tmpykey[2]
|
||||
'legendwithgroup' => $this->Legend[$tmpykey[1]] . ' - ' . $tmpykey[2]
|
||||
);
|
||||
} else {
|
||||
$tmpvalue = (array_key_exists('y_'.$i, $valarray) ? $valarray['y_'.$i] : $valarray[$i + 1]);
|
||||
$tmpvalue = (array_key_exists('y_' . $i, $valarray) ? $valarray['y_' . $i] : $valarray[$i + 1]);
|
||||
//var_dump($i.'_'.$x.'_'.$tmpvalue);
|
||||
$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
|
||||
}
|
||||
@ -1007,9 +984,9 @@ class DolGraph
|
||||
$j = 0;
|
||||
foreach ($values as $x => $y) {
|
||||
if (isset($y)) {
|
||||
$serie[$i] .= ($j > 0 ? ", " : "").$y;
|
||||
$serie[$i] .= ($j > 0 ? ", " : "") . $y;
|
||||
} else {
|
||||
$serie[$i] .= ($j > 0 ? ", " : "").'null';
|
||||
$serie[$i] .= ($j > 0 ? ", " : "") . 'null';
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
@ -1022,12 +999,11 @@ class DolGraph
|
||||
|
||||
$tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.'))));
|
||||
|
||||
$this->stringtoshow = '<!-- Build using chart -->'."\n";
|
||||
if (!empty($this->title)) $this->stringtoshow .= '<div class="center dolgraphtitle'.(empty($this->cssprefix) ? '' : ' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
|
||||
if (!empty($this->shownographyet))
|
||||
{
|
||||
$this->stringtoshow .= '<div style="width:'.$this->width.(strpos($this->width, '%') > 0 ? '' : 'px').'; height:'.$this->height.'px;" class="nographyet"></div>';
|
||||
$this->stringtoshow .= '<div class="nographyettext margintoponly">'.$langs->trans("NotEnoughDataYet").'...</div>';
|
||||
$this->stringtoshow = '<!-- Build using chart -->' . "\n";
|
||||
if (!empty($this->title)) $this->stringtoshow .= '<div class="center dolgraphtitle' . (empty($this->cssprefix) ? '' : ' dolgraphtitle' . $this->cssprefix) . '">' . $this->title . '</div>';
|
||||
if (!empty($this->shownographyet)) {
|
||||
$this->stringtoshow .= '<div style="width:' . $this->width . (strpos($this->width, '%') > 0 ? '' : 'px') . '; height:' . $this->height . 'px;" class="nographyet"></div>';
|
||||
$this->stringtoshow .= '<div class="nographyettext margintoponly">' . $langs->trans("NotEnoughDataYet") . '...</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1036,17 +1012,15 @@ class DolGraph
|
||||
if (count($this->data) > 20) $dolxaxisvertical = 'dol-xaxis-vertical';
|
||||
// No height for the pie grah
|
||||
$cssfordiv = 'dolgraphchart';
|
||||
if (isset($this->type[$firstlot])) $cssfordiv .= ' dolgraphchar'.$this->type[$firstlot];
|
||||
$this->stringtoshow .= '<div id="placeholder_'.$tag.'" style="min-height: '.$this->height.(strpos($this->height, '%') > 0 ? '' : 'px').'; width:'.$this->width.(strpos($this->width, '%') > 0 ? '' : 'px').';" class="'.$cssfordiv.' dolgraph'.(empty($dolxaxisvertical) ? '' : ' '.$dolxaxisvertical).(empty($this->cssprefix) ? '' : ' dolgraph'.$this->cssprefix).' center"><canvas id="canvas_'.$tag.'"></canvas></div>'."\n";
|
||||
if (isset($this->type[$firstlot])) $cssfordiv .= ' dolgraphchar' . $this->type[$firstlot];
|
||||
$this->stringtoshow .= '<div id="placeholder_' . $tag . '" style="min-height: ' . $this->height . (strpos($this->height, '%') > 0 ? '' : 'px') . '; width:' . $this->width . (strpos($this->width, '%') > 0 ? '' : 'px') . ';" class="' . $cssfordiv . ' dolgraph' . (empty($dolxaxisvertical) ? '' : ' ' . $dolxaxisvertical) . (empty($this->cssprefix) ? '' : ' dolgraph' . $this->cssprefix) . ' center"><canvas id="canvas_' . $tag . '"></canvas></div>' . "\n";
|
||||
|
||||
$this->stringtoshow .= '<script id="'.$tag.'">'."\n";
|
||||
$this->stringtoshow .= '<script id="' . $tag . '">' . "\n";
|
||||
$i = $firstlot;
|
||||
if ($nblot < 0)
|
||||
{
|
||||
if ($nblot < 0) {
|
||||
$this->stringtoshow .= '<!-- No series of data -->';
|
||||
} else {
|
||||
while ($i < $nblot)
|
||||
{
|
||||
while ($i < $nblot) {
|
||||
//$this->stringtoshow .= '<!-- Series '.$i.' -->'."\n";
|
||||
//$this->stringtoshow .= $serie[$i]."\n";
|
||||
$i++;
|
||||
@ -1055,69 +1029,69 @@ class DolGraph
|
||||
$this->stringtoshow .= "\n";
|
||||
|
||||
// Special case for Graph of type 'pie', 'piesemicircle', or 'polar'
|
||||
if (isset($this->type[$firstlot]) && (in_array($this->type[$firstlot], array('pie', 'polar', 'piesemicircle'))))
|
||||
{
|
||||
if (isset($this->type[$firstlot]) && (in_array($this->type[$firstlot], array('pie', 'polar', 'piesemicircle')))) {
|
||||
$type = $this->type[$firstlot]; // pie or polar
|
||||
$this->stringtoshow .= 'var options = {'."\n";
|
||||
$this->stringtoshow .= 'var options = {' . "\n";
|
||||
$legendMaxLines = 0; // Does not work
|
||||
if (empty($showlegend)) {
|
||||
$this->stringtoshow .= 'legend: { display: false }, ';
|
||||
} else {
|
||||
$this->stringtoshow .= 'legend: { position: \''.($showlegend == 2 ? 'right' : 'top').'\'';
|
||||
$this->stringtoshow .= 'legend: { position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\'';
|
||||
if (!empty($legendMaxLines)) {
|
||||
$this->stringtoshow .= ', maxLines: '.$legendMaxLines.'';
|
||||
$this->stringtoshow .= ', maxLines: ' . $legendMaxLines . '';
|
||||
}
|
||||
$this->stringtoshow .= ' }, '."\n";
|
||||
$this->stringtoshow .= ' }, ' . "\n";
|
||||
}
|
||||
|
||||
if ($this->type[$firstlot] == 'piesemicircle') {
|
||||
$this->stringtoshow .= 'circumference: Math.PI,'."\n";
|
||||
$this->stringtoshow .= 'rotation: -Math.PI,'."\n";
|
||||
$this->stringtoshow .= 'circumference: Math.PI,' . "\n";
|
||||
$this->stringtoshow .= 'rotation: -Math.PI,' . "\n";
|
||||
}
|
||||
$this->stringtoshow .= 'elements: { arc: {'."\n";
|
||||
$this->stringtoshow .= 'elements: { arc: {' . "\n";
|
||||
// Color of earch arc
|
||||
$this->stringtoshow .= 'backgroundColor: [';
|
||||
$i = 0; $foundnegativecolor = 0;
|
||||
$i = 0;
|
||||
$foundnegativecolor = 0;
|
||||
foreach ($legends as $val) // Loop on each serie
|
||||
{
|
||||
if ($i > 0) $this->stringtoshow .= ', '."\n";
|
||||
if (is_array($this->datacolor[$i])) $color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')'; // If datacolor is array(R, G, B)
|
||||
if ($i > 0) $this->stringtoshow .= ', ' . "\n";
|
||||
if (is_array($this->datacolor[$i])) $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')'; // If datacolor is array(R, G, B)
|
||||
else {
|
||||
$tmp = str_replace('#', '', $this->datacolor[$i]);
|
||||
if (strpos($tmp, '-') !== false) {
|
||||
$foundnegativecolor++;
|
||||
$color = '#FFFFFF'; // If $val is '-123'
|
||||
} else $color = "#".$tmp; // If $val is '123' or '#123'
|
||||
} else $color = "#" . $tmp; // If $val is '123' or '#123'
|
||||
}
|
||||
$this->stringtoshow .= "'".$color."'";
|
||||
$this->stringtoshow .= "'" . $color . "'";
|
||||
$i++;
|
||||
}
|
||||
$this->stringtoshow .= '], '."\n";
|
||||
$this->stringtoshow .= '], ' . "\n";
|
||||
// Border color
|
||||
if ($foundnegativecolor) {
|
||||
$this->stringtoshow .= 'borderColor: [';
|
||||
$i = 0;
|
||||
foreach ($legends as $val) // Loop on each serie
|
||||
{
|
||||
if ($i > 0) $this->stringtoshow .= ', '."\n";
|
||||
if ($i > 0) $this->stringtoshow .= ', ' . "\n";
|
||||
if (is_array($this->datacolor[$i])) $color = 'null'; // If datacolor is array(R, G, B)
|
||||
else {
|
||||
$tmp = str_replace('#', '', $this->datacolor[$i]);
|
||||
if (strpos($tmp, '-') !== false) $color = '#'.str_replace('-', '', $tmp); // If $val is '-123'
|
||||
if (strpos($tmp, '-') !== false) $color = '#' . str_replace('-', '', $tmp); // If $val is '-123'
|
||||
else $color = 'null'; // If $val is '123' or '#123'
|
||||
}
|
||||
$this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'".$color."'");
|
||||
$this->stringtoshow .= ($color == 'null' ? "'rgba(0,0,0,0.2)'" : "'" . $color . "'");
|
||||
$i++;
|
||||
}
|
||||
$this->stringtoshow .= ']';
|
||||
}
|
||||
$this->stringtoshow .= '} } };'."\n";
|
||||
$this->stringtoshow .= '} } };' . "\n";
|
||||
|
||||
$this->stringtoshow .= '
|
||||
var ctx = document.getElementById("canvas_'.$tag.'").getContext("2d");
|
||||
var ctx = document.getElementById("canvas_' . $tag . '").getContext("2d");
|
||||
var chart = new Chart(ctx, {
|
||||
// The type of chart we want to create
|
||||
type: \''.(in_array($type, array('pie', 'piesemicircle')) ? 'doughnut' : 'polarArea').'\',
|
||||
type: \'' . (in_array($type, array('pie', 'piesemicircle')) ? 'doughnut' : 'polarArea') . '\',
|
||||
// Configuration options go here
|
||||
options: options,
|
||||
data: {
|
||||
@ -1127,7 +1101,7 @@ class DolGraph
|
||||
foreach ($legends as $val) // Loop on each serie
|
||||
{
|
||||
if ($i > 0) $this->stringtoshow .= ', ';
|
||||
$this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 32))."'";
|
||||
$this->stringtoshow .= "'" . dol_escape_js(dol_trunc($val, 32)) . "'";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1137,24 +1111,28 @@ class DolGraph
|
||||
$i = 0;
|
||||
while ($i < $nblot) // Loop on each serie
|
||||
{
|
||||
$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].')';
|
||||
$color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')';
|
||||
//$color = (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor));
|
||||
|
||||
if ($i > 0) $this->stringtoshow .= ', '."\n";
|
||||
$this->stringtoshow .= '{'."\n";
|
||||
if ($i > 0) $this->stringtoshow .= ', ' . "\n";
|
||||
$this->stringtoshow .= '{' . "\n";
|
||||
//$this->stringtoshow .= 'borderColor: \''.$color.'\', ';
|
||||
//$this->stringtoshow .= 'backgroundColor: \''.$color.'\', ';
|
||||
$this->stringtoshow .= ' data: ['.$serie[$i].']';
|
||||
$this->stringtoshow .= '}'."\n";
|
||||
$this->stringtoshow .= ' data: [' . $serie[$i] . ']';
|
||||
$this->stringtoshow .= '}' . "\n";
|
||||
$i++;
|
||||
}
|
||||
$this->stringtoshow .= ']'."\n";
|
||||
$this->stringtoshow .= '}'."\n";
|
||||
$this->stringtoshow .= '});'."\n";
|
||||
$this->stringtoshow .= ']' . "\n";
|
||||
$this->stringtoshow .= '}' . "\n";
|
||||
$this->stringtoshow .= '});' . "\n";
|
||||
}
|
||||
// Other cases, graph of type 'bars', 'lines', 'linesnopoint'
|
||||
else {
|
||||
$type = 'bar';
|
||||
|
||||
$isfunnel = false;
|
||||
if ($file == 'idgraphleadfunnel') $isfunnel = true;
|
||||
|
||||
if (!isset($this->type[$firstlot]) || $this->type[$firstlot] == 'bars') $type = 'bar';
|
||||
if (isset($this->type[$firstlot]) && $this->type[$firstlot] == 'horizontalbars') $type = 'horizontalBar';
|
||||
if (isset($this->type[$firstlot]) && ($this->type[$firstlot] == 'lines' || $this->type[$firstlot] == 'linesnopoint')) $type = 'line';
|
||||
@ -1164,34 +1142,52 @@ class DolGraph
|
||||
$this->stringtoshow .= 'legend: { display: false }, ';
|
||||
}
|
||||
$this->stringtoshow .= 'scales: { xAxes: [{ ';
|
||||
if ($isfunnel) { // FIXME Remove isfunnel by introducing a method hideXValues() on dolgraph
|
||||
$this->stringtoshow .= ' ticks: { display: false }, display: true,';
|
||||
}
|
||||
//$this->stringtoshow .= 'type: \'time\', '; // Need Moment.js
|
||||
$this->stringtoshow .= 'distribution: \'linear\'';
|
||||
if ($type == 'bar' && count($arrayofgroupslegend) > 0) {
|
||||
$this->stringtoshow .= ', stacked: true';
|
||||
}
|
||||
$this->stringtoshow .= ' }]';
|
||||
$this->stringtoshow .= ', yAxes: [{ ticks: { beginAtZero: true }';
|
||||
if ($type == 'bar' && count($arrayofgroupslegend) > 0) {
|
||||
$this->stringtoshow .= ', yAxes: [{ stacked: true }]';
|
||||
$this->stringtoshow .= ', stacked: true';
|
||||
}
|
||||
$this->stringtoshow .= ' }] }';
|
||||
// Add a callback to change label to show only positive value
|
||||
if ($isfunnel) {
|
||||
$this->stringtoshow .= ', tooltips: { mode: \'nearest\',
|
||||
callbacks: {
|
||||
title: function(tooltipItem, data) {
|
||||
return data.datasets[tooltipItem[0].datasetIndex].label;
|
||||
},
|
||||
label: function(tooltipItem, data) {
|
||||
return data.datasets[tooltipItem.datasetIndex].data[0][1];
|
||||
}
|
||||
}
|
||||
},';
|
||||
}
|
||||
$this->stringtoshow .= ' }';
|
||||
$this->stringtoshow .= '};';
|
||||
|
||||
$this->stringtoshow .= '
|
||||
var ctx = document.getElementById("canvas_'.$tag.'").getContext("2d");
|
||||
var ctx = document.getElementById("canvas_' . $tag . '").getContext("2d");
|
||||
var chart = new Chart(ctx, {
|
||||
// The type of chart we want to create
|
||||
type: \''.$type.'\',
|
||||
type: \'' . $type . '\',
|
||||
// Configuration options go here
|
||||
options: options,
|
||||
data: {
|
||||
labels: [';
|
||||
|
||||
$i = 0;
|
||||
foreach ($legends as $val) // Loop on each serie
|
||||
{
|
||||
if ($i > 0) $this->stringtoshow .= ', ';
|
||||
$this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 32))."'";
|
||||
$i++;
|
||||
if (!$isfunnel) {
|
||||
foreach ($legends as $val) // Loop on each serie
|
||||
{
|
||||
if ($i > 0) $this->stringtoshow .= ', ';
|
||||
$this->stringtoshow .= "'".dol_escape_js(dol_trunc($val, 32))."'";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($arrayofgroupslegend);
|
||||
@ -1205,6 +1201,7 @@ class DolGraph
|
||||
$oldstacknum = -1;
|
||||
while ($i < $nblot) // Loop on each serie
|
||||
{
|
||||
$foundnegativecolor = 0;
|
||||
$usecolorvariantforgroupby = 0;
|
||||
// We used a 'group by' and we have too many colors so we generated color variants per
|
||||
if (is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by.
|
||||
@ -1233,7 +1230,7 @@ class DolGraph
|
||||
$ratio = min(95, 10 + 10 * $iinstack); // step of 20
|
||||
$brightnessratio = min(90, 5 + 5 * $iinstack); // step of 10
|
||||
} else { // We decrease agressiveness of reference color for color 3, 5, 7, ..
|
||||
$ratio = max(-100, - 15 * $iinstack + 10); // step of -20
|
||||
$ratio = max(-100, -15 * $iinstack + 10); // step of -20
|
||||
$brightnessratio = min(90, 10 * $iinstack); // step of 20
|
||||
}
|
||||
//var_dump('Color '.($iinstack+1).' : '.$ratio.' '.$brightnessratio);
|
||||
@ -1242,37 +1239,72 @@ class DolGraph
|
||||
}
|
||||
$oldstacknum = $arrayofgroupslegend[$i]['stacknum'];
|
||||
|
||||
$color = 'rgb('.$newcolor[0].', '.$newcolor[1].', '.$newcolor[2].', 0.9)';
|
||||
$bordercolor = 'rgb('.$newcolor[0].', '.$newcolor[1].', '.$newcolor[2].')';
|
||||
} else { // We do not use a 'group by'
|
||||
$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].', 0.9)';
|
||||
$bordercolor = $color;
|
||||
//$color = (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor));
|
||||
$color = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ', 0.9)';
|
||||
$bordercolor = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ')';
|
||||
} else { // We do not use a 'group by'
|
||||
if ($isfunnel) {
|
||||
if (is_array($this->datacolor[$i])) {
|
||||
$color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)'; // If datacolor is array(R, G, B)
|
||||
} else {
|
||||
// TODO FIXME This logic must be in the caller that set $this->datacolor
|
||||
$tmp = str_replace('#', '', $this->datacolor[$i]);
|
||||
if (strpos($tmp, '-') !== false) {
|
||||
$foundnegativecolor++;
|
||||
$color = '#FFFFFF'; // If $val is '-123'
|
||||
} else {
|
||||
$color = "#" . $tmp; // If $val is '123' or '#123'
|
||||
$bordercolor = $color;
|
||||
}
|
||||
if ($foundnegativecolor) {
|
||||
if (is_array($this->datacolor[$i])) $color = 'null'; // If datacolor is array(R, G, B)
|
||||
else {
|
||||
$tmp = str_replace('#', '', $this->datacolor[$i]);
|
||||
if (strpos($tmp, '-') !== false) $bordercolor = '#' . str_replace('-', '', $tmp); // If $val is '-123'
|
||||
else $bordercolor = 'null'; // If $val is '123' or '#123'
|
||||
}
|
||||
$bordercolor == 'null' ? "'rgba(0,0,0,0.2)'" : "'" . $bordercolor . "'";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$color = 'rgb('.$this->datacolor[$i][0].', '.$this->datacolor[$i][1].', '.$this->datacolor[$i][2].', 0.9)';
|
||||
$bordercolor = $color;
|
||||
//$color = (!empty($data['seriescolor']) ? json_encode($data['seriescolor']) : json_encode($datacolor));
|
||||
}
|
||||
}
|
||||
|
||||
if ($i > 0) $this->stringtoshow .= ', ';
|
||||
$this->stringtoshow .= "\n";
|
||||
$this->stringtoshow .= '{';
|
||||
$this->stringtoshow .= 'dolibarrinfo: \'y_'.$i.'\', ';
|
||||
$this->stringtoshow .= 'label: \''.dol_escape_js(dol_string_nohtmltag($textoflegend)).'\', ';
|
||||
$this->stringtoshow .= 'pointStyle: \''.($this->type[$i] == 'linesnopoint' ? 'line' : 'circle').'\', ';
|
||||
$this->stringtoshow .= 'fill: '.($type == 'bar' ? 'true' : 'false').', ';
|
||||
if ($type == 'bar') { $this->stringtoshow .= 'borderWidth: \'1\', '; }
|
||||
$this->stringtoshow .= 'borderColor: \''.$bordercolor.'\', ';
|
||||
$this->stringtoshow .= 'backgroundColor: \''.$color.'\', ';
|
||||
if ($arrayofgroupslegend[$i]) $this->stringtoshow .= 'stack: \''.$arrayofgroupslegend[$i]['stacknum'].'\', ';
|
||||
$this->stringtoshow .= 'data: ['.$serie[$i].']';
|
||||
$this->stringtoshow .= '}'."\n";
|
||||
$this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', ';
|
||||
$this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', ';
|
||||
$this->stringtoshow .= 'pointStyle: \'' . ($this->type[$i] == 'linesnopoint' ? 'line' : 'circle') . '\', ';
|
||||
$this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', ';
|
||||
if ($isfunnel) {
|
||||
$this->stringtoshow .= 'borderWidth: \'2\', ';
|
||||
} elseif ($type == 'bar' || $type == 'horizontalBar') {
|
||||
$this->stringtoshow .= 'borderWidth: \'1\', ';
|
||||
}
|
||||
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
|
||||
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
|
||||
if ($arrayofgroupslegend[$i]) $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
|
||||
$this->stringtoshow .='data: [';
|
||||
if ($isfunnel) {
|
||||
$this->stringtoshow .= '['.-$serie[$i].','.$serie[$i].']';
|
||||
} else {
|
||||
$this->stringtoshow .= $serie[$i];
|
||||
}
|
||||
$this->stringtoshow .=']';
|
||||
$this->stringtoshow .= '}' . "\n";
|
||||
|
||||
$i++;
|
||||
$iinstack++;
|
||||
}
|
||||
$this->stringtoshow .= ']'."\n";
|
||||
$this->stringtoshow .= '}'."\n";
|
||||
$this->stringtoshow .= '});'."\n";
|
||||
$this->stringtoshow .= ']' . "\n";
|
||||
$this->stringtoshow .= '}' . "\n";
|
||||
$this->stringtoshow .= '});' . "\n";
|
||||
}
|
||||
|
||||
$this->stringtoshow .= '</script>'."\n";
|
||||
$this->stringtoshow .= '</script>' . "\n";
|
||||
}
|
||||
|
||||
|
||||
@ -1301,14 +1333,13 @@ class DolGraph
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if ($shownographyet)
|
||||
{
|
||||
$s = '<div class="nographyet" style="width:'.(preg_match('/%/', $this->width) ? $this->width : $this->width.'px').'; height:'.(preg_match('/%/', $this->height) ? $this->height : $this->height.'px').';"></div>';
|
||||
if ($shownographyet) {
|
||||
$s = '<div class="nographyet" style="width:' . (preg_match('/%/', $this->width) ? $this->width : $this->width . 'px') . '; height:' . (preg_match('/%/', $this->height) ? $this->height : $this->height . 'px') . ';"></div>';
|
||||
$s .= '<div class="nographyettext margintoponly">';
|
||||
if (is_numeric($shownographyet)) {
|
||||
$s .= $langs->trans("NotEnoughDataYet").'...';
|
||||
$s .= $langs->trans("NotEnoughDataYet") . '...';
|
||||
} else {
|
||||
$s .= $shownographyet.'...';
|
||||
$s .= $shownographyet . '...';
|
||||
}
|
||||
$s .= '</div>';
|
||||
return $s;
|
||||
|
||||
@ -1914,7 +1914,7 @@ class Form
|
||||
$out .= '});';
|
||||
$out .= '})</script>';
|
||||
$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
|
||||
$out .= ' <input type="submit" disabled class="button valignmiddle" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
||||
$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
||||
$out .= '<br>';
|
||||
}
|
||||
|
||||
@ -1995,7 +1995,7 @@ class Form
|
||||
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
||||
$urloption .= '&socid='.$socid;
|
||||
}
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
$out .= '
|
||||
@ -5928,18 +5928,31 @@ class Form
|
||||
/**
|
||||
* selectTypeDuration
|
||||
*
|
||||
* @param string $prefix Prefix
|
||||
* @param string $selected Selected type
|
||||
* @return string HTML select string
|
||||
* @param string $prefix Prefix
|
||||
* @param string $selected Selected duration type
|
||||
* @param array $excludetypes Array of duration types to exclude. Example array('y', 'm')
|
||||
* @return string HTML select string
|
||||
*/
|
||||
public function selectTypeDuration($prefix, $selected = 'i')
|
||||
public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = array())
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
|
||||
$TDurationTypes = array(
|
||||
'y'=>$langs->trans('Years'),
|
||||
'm'=>$langs->trans('Month'),
|
||||
'w'=>$langs->trans('Weeks'),
|
||||
'd'=>$langs->trans('Days'),
|
||||
'h'=>$langs->trans('Hours'),
|
||||
'i'=>$langs->trans('Minutes')
|
||||
);
|
||||
|
||||
// Removed undesired duration types
|
||||
foreach ($excludetypes as $value) {
|
||||
unset($TDurationTypes[$value]);
|
||||
}
|
||||
|
||||
$retstring = '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
|
||||
foreach ($TDurationTypes as $key=>$typeduration) {
|
||||
foreach ($TDurationTypes as $key => $typeduration) {
|
||||
$retstring .= '<option value="'.$key.'"';
|
||||
if ($key == $selected) {
|
||||
$retstring .= " selected";
|
||||
@ -5948,6 +5961,8 @@ class Form
|
||||
}
|
||||
$retstring .= "</select>";
|
||||
|
||||
$retstring .= ajax_combobox('select_'.$prefix.'type_duration');
|
||||
|
||||
return $retstring;
|
||||
}
|
||||
|
||||
@ -6182,6 +6197,7 @@ class Form
|
||||
$tmpfieldstoshow = '';
|
||||
foreach ($objecttmp->fields as $key => $val)
|
||||
{
|
||||
if (!dol_eval($val['enabled'], 1, 1)) continue;
|
||||
if ($val['showoncombobox']) $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
|
||||
}
|
||||
if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow;
|
||||
@ -6279,8 +6295,7 @@ class Form
|
||||
}
|
||||
if (empty($outputmode))
|
||||
{
|
||||
if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid)
|
||||
{
|
||||
if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
|
||||
$out .= '<option value="'.$obj->rowid.'" selected>'.$label.'</option>';
|
||||
} else {
|
||||
$out .= '<option value="'.$obj->rowid.'">'.$label.'</option>';
|
||||
@ -6757,7 +6772,7 @@ class Form
|
||||
{
|
||||
$out .= ' selected';
|
||||
}
|
||||
$out .= ' data-html="'.$newval.'"';
|
||||
$out .= ' data-html="'.dol_escape_htmltag($newval).'"';
|
||||
$out .= '>';
|
||||
$out .= dol_htmlentitiesbr($newval);
|
||||
$out .= '</option>'."\n";
|
||||
@ -7560,41 +7575,37 @@ class Form
|
||||
if ($modulepart == 'societe')
|
||||
{
|
||||
$dir = $conf->societe->multidir_output[$entity];
|
||||
if (!empty($object->logo))
|
||||
{
|
||||
if ((string) $imagesize == 'mini') $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
|
||||
elseif ((string) $imagesize == 'small') $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
|
||||
else $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
|
||||
$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
|
||||
if (!empty($object->logo)) {
|
||||
if ((string) $imagesize == 'mini') $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
|
||||
elseif ((string) $imagesize == 'small') $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
|
||||
else $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
|
||||
$originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
|
||||
}
|
||||
$email = $object->email;
|
||||
} elseif ($modulepart == 'contact')
|
||||
{
|
||||
} elseif ($modulepart == 'contact') {
|
||||
$dir = $conf->societe->multidir_output[$entity].'/contact';
|
||||
if (!empty($object->photo))
|
||||
{
|
||||
if ((string) $imagesize == 'mini') $file = get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||
elseif ((string) $imagesize == 'small') $file = get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||
else $file = get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
|
||||
$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
|
||||
if ((string) $imagesize == 'mini') $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||
elseif ((string) $imagesize == 'small') $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||
else $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
|
||||
$originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
|
||||
}
|
||||
$email = $object->email;
|
||||
$capture = 'user';
|
||||
} elseif ($modulepart == 'userphoto')
|
||||
{
|
||||
} elseif ($modulepart == 'userphoto') {
|
||||
$dir = $conf->user->dir_output;
|
||||
if (!empty($object->photo))
|
||||
{
|
||||
if ((string) $imagesize == 'mini') $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_mini');
|
||||
elseif ((string) $imagesize == 'small') $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small');
|
||||
else $file = get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
|
||||
$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
|
||||
if ((string) $imagesize == 'mini') $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
|
||||
elseif ((string) $imagesize == 'small') $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
|
||||
else $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo;
|
||||
$originalfile = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo;
|
||||
}
|
||||
if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile = $object->id.".jpg"; // For backward compatibility
|
||||
$email = $object->email;
|
||||
$capture = 'user';
|
||||
} elseif ($modulepart == 'memberphoto')
|
||||
{
|
||||
} elseif ($modulepart == 'memberphoto') {
|
||||
$dir = $conf->adherent->dir_output;
|
||||
if (!empty($object->photo))
|
||||
{
|
||||
@ -8234,12 +8245,13 @@ class Form
|
||||
/**
|
||||
* selectModelMail
|
||||
*
|
||||
* @param string $prefix Prefix
|
||||
* @param string $modelType Model type
|
||||
* @param int $default 1=Show also Default mail template
|
||||
* @return string HTML select string
|
||||
* @param string $prefix Prefix
|
||||
* @param string $modelType Model type
|
||||
* @param int $default 1=Show also Default mail template
|
||||
* @param int $addjscombo Add js combobox
|
||||
* @return string HTML select string
|
||||
*/
|
||||
public function selectModelMail($prefix, $modelType = '', $default = 0)
|
||||
public function selectModelMail($prefix, $modelType = '', $default = 0, $addjscombo = 0)
|
||||
{
|
||||
global $langs, $db, $user;
|
||||
|
||||
@ -8267,6 +8279,8 @@ class Form
|
||||
|
||||
$retstring .= "</select>";
|
||||
|
||||
if ($addjscombo) $retstring .= ajax_combobox('select_'.$prefix.'model_mail');
|
||||
|
||||
return $retstring;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1371,9 +1371,10 @@ class FormOther
|
||||
* @param mixed $object Object analyzed
|
||||
* @param array $search_groupby Array of preselected fields
|
||||
* @param array $arrayofgroupby Array of groupby to fill
|
||||
* @param string $morecss More CSS
|
||||
* @return string HTML string component
|
||||
*/
|
||||
public function selectGroupByField($object, $search_groupby, &$arrayofgroupby)
|
||||
public function selectGroupByField($object, $search_groupby, &$arrayofgroupby, $morecss = 'minwidth200 maxwidth250')
|
||||
{
|
||||
global $langs, $extrafields, $form;
|
||||
|
||||
@ -1395,9 +1396,9 @@ class FormOther
|
||||
if (preg_match('/^pass/', $key)) continue;
|
||||
if (in_array($val['type'], array('html', 'text'))) continue;
|
||||
if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) {
|
||||
$arrayofgroupby['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' ('.$YYYY.')', 'position' => $val['position'].'-y');
|
||||
$arrayofgroupby['t.'.$key.'-month'] = array('label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.')', 'position' => $val['position'].'-m');
|
||||
$arrayofgroupby['t.'.$key.'-day'] = array('label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.'-'.$DD.')', 'position' => $val['position'].'-d');
|
||||
$arrayofgroupby['t.'.$key.'-year'] = array('label' => $langs->trans($val['label']).' <span class="opacitymedium">('.$YYYY.')</span>', 'position' => $val['position'].'-y');
|
||||
$arrayofgroupby['t.'.$key.'-month'] = array('label' => $langs->trans($val['label']).' <span class="opacitymedium">('.$YYYY.'-'.$MM.')</span>', 'position' => $val['position'].'-m');
|
||||
$arrayofgroupby['t.'.$key.'-day'] = array('label' => $langs->trans($val['label']).' <span class="opacitymedium">('.$YYYY.'-'.$MM.'-'.$DD.')</span>', 'position' => $val['position'].'-d');
|
||||
} else {
|
||||
$arrayofgroupby['t.'.$key] = array('label' => $langs->trans($val['label']), 'position' => (int) $val['position']);
|
||||
}
|
||||
@ -1417,7 +1418,7 @@ class FormOther
|
||||
foreach ($arrayofgroupby as $key => $val) {
|
||||
$arrayofgroupbylabel[$key] = $val['label'];
|
||||
}
|
||||
$result = $form->selectarray('search_groupby', $arrayofgroupbylabel, $search_groupby, 1, 0, 0, '', 0, 0, 0, '', 'minwidth250', 1);
|
||||
$result = $form->selectarray('search_groupby', $arrayofgroupbylabel, $search_groupby, 1, 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -608,9 +608,10 @@ class FormProjets
|
||||
* @param int $showpercent Show default probability for status
|
||||
* @param string $morecss Add more css
|
||||
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
||||
* @param int $addcombojs 1=Add a js combo
|
||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||
*/
|
||||
public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0)
|
||||
public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0, $addcombojs = 0)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
@ -656,7 +657,10 @@ class FormProjets
|
||||
$i++;
|
||||
}
|
||||
$sellist .= '</select>';
|
||||
|
||||
if ($user->admin && !$noadmininfo) $sellist .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
|
||||
if ($addcombojs) $sellist .= ajax_combobox($htmlname);
|
||||
}
|
||||
/*else
|
||||
{
|
||||
|
||||
@ -34,6 +34,11 @@ class FormWebsite
|
||||
*/
|
||||
public $error;
|
||||
|
||||
/**
|
||||
* var int A number of lines
|
||||
*/
|
||||
public $num;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -220,11 +225,11 @@ class FormWebsite
|
||||
* @param string $action Action on page that use this select list
|
||||
* @param string $morecss More CSS
|
||||
* @param array $excludeids Exclude some ID in list
|
||||
* @return string HTML select component with list of type of containers
|
||||
* @return string HTML select component with list of block containers
|
||||
*/
|
||||
public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null)
|
||||
{
|
||||
global $langs;
|
||||
$this->num = 0;
|
||||
|
||||
$atleastonepage = (is_array($website->lines) && count($website->lines) > 0);
|
||||
|
||||
@ -273,6 +278,8 @@ class FormWebsite
|
||||
$out .= '>';
|
||||
$out .= $valueforoption;
|
||||
$out .= '</option>';
|
||||
|
||||
++$this->num;
|
||||
}
|
||||
}
|
||||
$out .= '</select>';
|
||||
|
||||
@ -343,7 +343,7 @@ class Notify
|
||||
$sql = '';
|
||||
|
||||
// Check notification per third party
|
||||
if ($object->socid > 0)
|
||||
if (!empty($object->socid) && $object->socid > 0)
|
||||
{
|
||||
$sql .= "SELECT 'tocontactid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
|
||||
$sql .= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
||||
@ -576,7 +576,7 @@ class Notify
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_syslog("No notification to thirdparty sent, nothing into notification setup for the thirdparty socid = ".$object->socid);
|
||||
dol_syslog("No notification to thirdparty sent, nothing into notification setup for the thirdparty socid = ".(empty($object->socid) ? '' : $object->socid));
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user