Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_PDF_DOCUMENT_COLUMN_new_files

This commit is contained in:
John BOTELLA 2018-09-14 09:54:14 +02:00
commit ec23cd0da4
2478 changed files with 44598 additions and 31196 deletions

View File

@ -2,7 +2,7 @@
# from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
# We use dist: precise to have php 5.3 available
# We use dist: trusty to have php 5.4+ available
dist: trusty
sudo: required
@ -20,7 +20,7 @@ addons:
# To use the last version of pgloader, we add repo of postgresql
- postgresql
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main'
- key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
- key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
packages:
# We need a webserver to test the webservices
# Let's install Apache with.
@ -37,7 +37,6 @@ php:
- '7.0'
- '7.1'
- '7.2'
#- hhvm only with dist: trusty
- nightly
env:
@ -59,10 +58,17 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: nightly
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.5'
env: DB=mariadb
- php: '5.6'
env: DB=mariadb
- php: '7.0'
env: DB=mariadb
- php: '7.1'
env: DB=mariadb
- php: '5.5'
env: DB=postgresql
- php: '5.6'
@ -71,8 +77,6 @@ matrix:
env: DB=postgresql
- php: '7.1'
env: DB=postgresql
- php: hhvm
env: DB=postgresql
- php: nightly
env: DB=postgresql
@ -101,7 +105,7 @@ before_install:
pgloader --version
echo
fi
install:
- |
echo "Updating Composer"
@ -133,7 +137,7 @@ install:
- |
echo "Installing PHP CodeSniffer"
composer -n require squizlabs/php_codesniffer ^2
composer -n require squizlabs/php_codesniffer ^3
echo
- |
@ -195,7 +199,7 @@ before_script:
mysql --version | head -
mysql -e "SELECT VERSION();" | head -
echo
- |
echo "Setting up database"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
@ -203,12 +207,11 @@ before_script:
mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
mysql -e 'FLUSH PRIVILEGES;'
mysql -e 'FLUSH PRIVILEGES;'
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
if [ "$DB" = 'postgresql' ]; then
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
#pgloader mysql://root:pass@127.0.0.1/dolibarr_35 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
fi
# TODO: SQLite
@ -217,7 +220,7 @@ before_script:
- |
export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE"
echo '<?php ' > $CONF_FILE
echo '<?php' > $CONF_FILE
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
@ -238,8 +241,9 @@ before_script:
- |
echo "Create documents directory and set permissions"
# and admin/temp subdirectory needed for unit tests
mkdir -p documents/admin/temp
echo "first line" > documents/dolibarr.log
mkdir -p $TRAVIS_BUILD_DIR/documents/admin/temp
sudo chmod -R a+rwx $TRAVIS_BUILD_DIR/documents
echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log
echo
@ -334,32 +338,28 @@ script:
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
php upgrade2.php 7.0.0 8.0.0 MAIN_MODULE_TICKETSUP > $TRAVIS_BUILD_DIR/upgrade700800-2.log
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
cd -
set +e
echo
#cat $TRAVIS_BUILD_DIR/upgrade400500-2.log
#cat $TRAVIS_BUILD_DIR/upgrade500600.log
#cat $TRAVIS_BUILD_DIR/upgrade500600-2.log
#cat $TRAVIS_BUILD_DIR/upgrade500600-3.log
#cat /tmp/dolibarr_install.log
- |
echo "Unit testing"
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$?
echo "Phpunit return code = $phpunitresult"
set +e
- |
#echo "Output dolibarr.log"
#cat documents/dolibarr.log
after_script:
- |
# Dolibarr log file
#echo "After script"
#cat documents/dolibarr.log
echo "After script - Output 50 latest lines of dolibarr.log"
ls $TRAVIS_BUILD_DIR/documents
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
after_success:
- |
@ -367,20 +367,24 @@ after_success:
after_failure:
- |
echo Failure
# This part of code seems to be never executed, error or not ???
echo "Debugging informations"
echo Failure detected, so we show samples of log to help diagnose
# This part of code is executed only if previous commande that fails are enclosed with set +e
# Upgrade log files
cat *.log
echo "Debugging informations"
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
do
echo "Debugging informations for file $ficlog"
#cat $ficlog
done
# Apache log file
echo "Debugging informations for file apache error.log"
sudo cat /var/log/apache2/error.log
# Dolibarr log file
cat documents/dolibarr.log
if [ "$DEBUG" = true ]; then
# Dolibarr log file
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
# MariaDB log file
sudo cat /var/log/mysql/error.log
echo "Debugging informations for file mysql error.log"
sudo tail -n 50 /var/log/mysql/error.log
# TODO: PostgreSQL log file
echo
fi

View File

@ -38,6 +38,12 @@ source_file = htdocs/langs/en_US/bills.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.blockedlog]
file_filter = htdocs/langs/<lang>/blockedlog.lang
source_file = htdocs/langs/en_US/blockedlog.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.bookmarks]
file_filter = htdocs/langs/<lang>/bookmarks.lang
source_file = htdocs/langs/en_US/bookmarks.lang

269
ChangeLog
View File

@ -2,6 +2,250 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
For Users:
NEW: Stable module: Website
NEW: Stable module: WebDAV
NEW: Stable module: Module Builder
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
Android application like DoliDroid able to provide native features for multicompany module.
For developers:
* Code changes to be more compatible with PSR2
* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
modulepart=mycompany that now works like others).
***** ChangeLog for 8.0.1 compared to 8.0.0 *****
FIX: #9258
FIX: #9328
FIX: #9337
FIX: adding GROUP BY for PostgreSQL
FIX: API template for list pages in module builder
FIX: API template for record page to delete a record
FIX: a removed option was still in setup
FIX: badge on time spent on project and tasks
FIX: Delete file on smartphone
FIX: Fetch function will fetch comments
FIX: Fetch task will now fetch comments
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: Force stripe api version to avoid trouble if we update stripe api
FIX: get_product_vat_for_country functions.lib.php
FIX: Get templates in a forced language
FIX: hook on dispatch order fourn
FIX: Language selection lost if error during creation of email template
FIX: Look and feel v8
FIX: propal.class.php
FIX: Add calls to fetchComments function
FIX: Remove fetchComments from project and task fetch function
FIX: remove internal property isextrafieldmanaged from API returns
FIX: sql error
FIX: table llx_chargessociales doesn't exists
FIX: trans on null object
FIX: vat rate code not returned by get_product_vat_for_country
FIX: warning for late template invoices to remove when suspended
FIX: Add hidden option MAIN_xxx_IN_SOURCE_ADDRESS to solve legal issues on PDF
FIX: Table llx_facture_rec_extrafields missing after migration
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
For Users:
NEW: Experimental module: Ticket
NEW: Experimental module: WebDAV
NEW: Accept anonymous events (no user assigned)
NEW: Accountancy - Add import on general ledger
NEW: Accountancy - Show journal name on journal page and hide button draft export (Add an option in admin)
NEW: Can create event from record card of a company and/or member
NEW: Add a button to create Stripe customer from the customer Payment mode tab
NEW: Add accounting account number on product tooltip
NEW: Add any predefined mail content
NEW: Add arrows to navigate into containers in experimental website module
NEW: Add a tab to specify accountant/auditor of the company
NEW: Add Date delivery and Availability on Propals List
NEW: Add date in goods reception supplier order table
NEW: Add delivery_time_days of suppliers in export profile
NEW: Add Documents'tab to expedition module
NEW: Use dol_print_phone in thirdparty list page to format phone
NEW: Add entry for the GDPR contact
NEW: Add extrafield type "html"
NEW: Add file number in accountant card and update export filename
NEW: Add files management on products lot
NEW: add filter on project task list
NEW: Add hidden option COMPANY_AQUARIUM_CLEAN_REGEX to clean generated
NEW: add internal stripe payment page for invoice
NEW: Add key __USER_REMOTE_IP__ into available substitution variables
NEW: Add link between credit note invoice and origin
NEW: Add linked file tab to vat
NEW: add link to stripe's info in bank menu
NEW: Add margin filters
NEW: Add mass action enable/disable on cron job list
NEW: Add mass action on project's list to close projects
NEW: Add method to register distributed payments on invoices
NEW: Add multicurrency support for product buy price for supplier propales, orders and invoices
NEW: Add name of day in the timesheet input page per day.
NEW: add new parameters for tcpf encryption
NEW: add optional esign field in pdf propal
NEW: Add option BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD
NEW: Add option CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES
NEW: Add param $dolibarr_main_restrict_ip in config file to limit ips
NEW: add pdf function to check if pdf file is protected/encrypted
NEW: Add pdf template for stock/warehouse module
NEW: Add phone format for a lot of countries
NEW: Add product and product categories filters on customer margins
NEW: Add product categories filter on product margin
NEW: Add romanian chart of accounts
NEW: Add stats in salaries module
NEW: add stripe transaction
NEW: Add tab contact on supplier proposals
NEW: Add total of time spent in timespent page at top of page too.
NEW: Add trigger CONTRACT_MODIFY
NEW: Add triggers on ECM object and add fill src_object_type/id fields
NEW: Add type of website container/page into dictionary
NEW: advance target filtering can be used everywhere with tpl and fk_element
NEW: Allow negative quantity for dispatch (supplier order)
NEW: bank reconcile: checkbox to select all bank operations
NEW: Better performance with openldap
NEW: Can add filter actiontype and notactiontype on event ical export
NEW: Can add product in supplier order/invoice even w/o predefined price
NEW: cancel orders on massaction
NEW: Can crop image files attached in "document" tabs of a member
NEW: Can delete dir content in media and ECM module recursively
NEW: Can dispatch if more than ordered (if hidden option set)
NEW: Can edit the text color for title line of tables
NEW: Can enter time spent from the list of time spent of project
NEW: Can export leave requests
NEW: Can filter on account range in general ledger grouped by account
NEW: Can filter on country and taxid into the binding page
NEW: Can filter on progression in timesheet
NEW: Can fix the bank account of a payment if payment not conciliated
NEW: Can force usage of shared link for photo of products
NEW: Can get template of email from its label
NEW: Can see Unit Purchase Value of product in stock movement
NEW: Can select from the user list into send form email (For field to and CC)
NEW: Can select sample to use when creating a new page
NEW: can send mail from project card
NEW: Can set position of images in module tickets
NEW: Can set the reply-to into email sent
NEW: Can set the start/end date of service line in invoice templates
NEW: Can share any file from the "Document" tab.
NEW: Can sort on priority in task scheduler list
NEW: Can sort order of files in attach tab for leave and expensereport
NEW: Can use setValueFrom without user modification field
NEW: Cat set the encryption algorithm for extrafields of type password
NEW: check idprof1 for country pt
NEW: default add action: new param $backurlforcard to redirect to card
NEW: default warehouse field for products + prefill warehouses when dispatching supplier orders
NEW: Display price HT on all commercial area boards
NEW: display total on contract service list
NEW: display weight volume in proposal
NEW: Edit of extrafields position page on the edit form
NEW: Experimental DAV module provides a public and private directory
NEW: export filter models can be share or not by user
NEW: Externalsite module can accept iframe content.
NEW: Filter export model is now by user
NEW: Finish implementation of option PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES
NEW: generalize use of button to create new element from list
NEW: hidden conf AGENDA_NB_WEEKS_IN_VIEW_PER_USER to set nb weeks to show into per user view
NEW: hidden conf to assign category to thirparty that are neither customer nor prospect or supplier
NEW: hidden conf to set nb weeks to show into user view
NEW: hidden option MAIN_DISABLE_FREE_LINES
NEW: improve way of adding users/sales representative to thirdparty
NEW: Introduce option THIRDPARTY_QUICKSEARCH_ON_FIELDS to personalize fields use to search on quick search.
NEW: Introduce permission "approve" for "leave request" like for "expense report"
NEW: Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
NEW: Look and feel v8 - Show Picto "+" on all links "Add record"
NEW: Look and feel v8: Use a different picto for delete and unlink
NEW: mail templates for projects
NEW: Module variant supported on services
NEW: monthly VAT report show "Claimed for the period" + "Paid during this
NEW: Mutualize code for action="update_extras"
NEW: On invoice card, show accounting account linked
NEW: Online payment of invoice and subscription record the payment
NEW: OnSearchAndListGoOnCustomerOrSupplierCard conf
NEW: Optimize load of hooks classes (save 1-5Kb of memory)
NEW: Option MAIN_SHOW_REGION_IN_STATE renamed into MAIN_SHOW_REGION_IN_STATE_SELECT are more complete
NEW: Option to force all emails recipient
NEW: Hidden option to send to salaries into emails forms
NEW: order minimum amount
NEW: add price in burger menu on mouvement list
NEW: Report a list of leave requests for a month
NEW: Section of files generated by mass action not visible if empty
NEW: send mails from project card
NEW: Show also size in bytes in tooltip if visible unit is not bytes
NEW: Show keyboard shortcut of nav arrow into tooltip
NEW: Show last result code of cron jobs in error in red
NEW: Show region in company info & Global option to show state code MAIN_SHOW_STATE_CODE
NEW: Show total number of records by category
NEW: Show total of time consumed in week in time spent entry page
NEW: Stripe online payments reuse the same stripe customer account
NEW: Suggest link to pay online for customer orders
NEW: supplier credit notes is now supported like for customer credit notes
NEW: supplier order/order lines export: add supplier product ref
NEW: supplier relative discounts
NEW: Support alternative aliases of page name in website
NEW: syslog file autoclean
NEW: thirdparty categ filter on lists
NEW: Use a css style for weekend in time spent
NEW: Use common substitution rule for language to get translation in ODT
NEW: Variable __ONLINE_PAYMENT_URL__ available in email templates
For developers:
NEW: class reposition can also work on POST (not only GET)
NEW: add a hook in dol_print_phone
NEW: The field "visible" on extrafield can accept expression as condition
NEW: Upgrade of Stripe lib to 6.4.1
NEW: work on CommonObject 'array' field typeNew common object array
NEW: method Form::selectArrayFilter() + use in left menu search
NEW: [REST API] Add the possibility to remove a category from a thirdparty
NEW: doActions on categorycard
NEW: add "moreHtmlRef" hook
NEW: add hook for more permissions control
NEW: add hook moreHtmlStatus to complete to status on banners
NEW: Add hook printEmail
NEW: Add hook setContentSecurityPolicy
NEW: Add password_hash as a hash algorithm
NEW: Add dol_is_link function
NEW: Adds a contact to an invoice with REST API
NEW: Adds a payment for the list of invoices given as parameter
NEW: adds billing contacts ids to REST API returns
NEW: Add showempty parameter in country selection
NEW: add printUserListWhere hook
NEW: add "printUserPasswordField" hooks
NEW: Call to trigger on payment social contribution creation
NEW: Call to trigger on social contribution creation
NEW: hook getnomurltooltip is replaced with hook getNomUrl more powerfull
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Remove old deprecated hook 'insertExtraFields'. Triggers must be used for action on CRUD events.
* Hook 'maildao' was renamed into 'mail' into the method sendfile that send emails, and method was renamed from
'doaction' into 'sendMail'.
* Rename trigger CONTRACT_SERVICE_ACTIVATE into LINECONTRACT_ACTIVATE and
CONTRACT_SERVICE_CLOSE into LINECONTRACT_CLOSE
* Remove triggers *_CLONE. The trigger CREATE with context 'createfromclone' is already called so this is
a duplicated feature. Cloning is not a business event, the business event is CREATE, so no trigger required.
* PHP 5.3 is no more supported. Minimum PHP is now 5.4+
* Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are
already available and are better.
* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better.
* The hook contaxt commcard has been renamed thirdpartycomm
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
* Remove method Categorie:get_nb_categories() that was not used.
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
are now replaced with hook getNomUrl.
* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
FIX: 7.0 task contact card without withproject parameters
FIX: #8722
@ -40,29 +284,6 @@ FIX: supplier order: product supplier ref not saved on addline
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: wrong var name $search_month_lim
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Remove old deprecated hook 'insertExtraFields'. Triggers must be used for action on CRUD events.
* Hook 'maildao' was renamed into 'mail' into the method sendfile that send emails, and method was renamed from
'doaction' into 'sendMail'.
* Rename trigger CONTRACT_SERVICE_ACTIVATE into LINECONTRACT_ACTIVATE and
CONTRACT_SERVICE_CLOSE into LINECONTRACT_CLOSE
* Remove triggers *_CLONE. The trigger CREATE with context 'createfromclone' is already called so this is
a duplicated feature. Cloning is not a business event, the business event is CREATE, so no trigger required.
* PHP 5.3 is no more supported. Minimum PHP is now 5.4+
* Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are
already available and are better.
* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better.
* The hook contaxt commcard has been renamed thirdpartycomm
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
* Remove method Categorie:get_nb_categories() that was not used.
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
are now replaced with hook getNomUrl.
***** ChangeLog for 7.0.2 compared to 7.0.1 *****
FIX: #8023
FIX: #8259 can't update contact birthday with REST API
@ -220,7 +441,7 @@ FIX: Use of undefined constant _ROWS_2
FIX: warning when adding ECM files using old photo path
***** ChangeLog for 7.0.0 compared to 6.0.5 *****
***** ChangeLog for 7.0.0 compared to 6.0.7 *****
For users:
NEW: Add a preview icon after files that can be previewed (pdf + images)
NEW: When payment is registered, PDF of invoices are also regenerated so payments

View File

@ -1,6 +1,10 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
|6|7|8|develop|
|----------|----------|----------|----------|
|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).

View File

@ -15,14 +15,14 @@ else return 0;
function highlightTOC(str) {
if (StopProcess()) return;
try {
str = str || parent.BODY.document.location.href;
uri = last(str);
list = parent.TOC.document.getElementsByTagName("a");
@ -33,7 +33,7 @@ function highlightTOC(str) {
list[i].style.backgroundColor = "#6697cc";
list[i].style.padding = "2px";
list[i].style.color = "#ffffff";
} else {
list[i].style.backgroundColor = "#ffffff";
list[i].style.color = "#003380";

View File

@ -12,7 +12,7 @@
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }
pre.preformatted {
pre.preformatted {
display: block;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;

View File

@ -1116,7 +1116,7 @@ window['_pr_isIE6'] = function () {
for (var i = 0; i < 10; ++i) {
lineBreaks[i] = lineBreakHtml + '</li><li class="L' + i + '">';
}
var lineNum = numberLines[1] && numberLines[1].length
var lineNum = numberLines[1] && numberLines[1].length
? numberLines[1] - 1 : 0; // Lines are 1-indexed
html.push('<ol class="linenums"><li class="L', (lineNum) % 10, '"');
if (lineNum) {

View File

@ -1,5 +1,5 @@
body
{
{
background: #FFFFFF
}
@ -100,7 +100,7 @@ li.listalpha3 {
width: auto;
height: auto;
white-space: normal;
}
}
/*li.listalpha2, li.listalpha, li.listalpha3
{
@ -207,7 +207,7 @@ p.listcontinue3 {
height: auto;
}
.prcontinuous
.prcontinuous
{font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-style: normal;
font-variant: normal;
@ -237,7 +237,7 @@ p.listcontinue3 {
height: auto;
}
.prefblue
.prefblue
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-size: 10pt;
@ -253,7 +253,7 @@ p.listcontinue3 {
padding-left: 0pt;
padding-right: 0pt;
}
.prefred
.prefred
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-size: 10pt;
@ -269,7 +269,7 @@ p.listcontinue3 {
padding-left: 0pt;
padding-right: 0pt;
}
.prefdarkblue
.prefdarkblue
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-weight: bold;
@ -286,7 +286,7 @@ p.listcontinue3 {
padding-left: 0pt;
padding-right: 0pt;
}
.prefgrey
.prefgrey
{display: inline;
font-family: "Courier New", verdana, arial, helvetica, sans-serif;
font-size: 10pt;
@ -303,7 +303,7 @@ p.listcontinue3 {
padding-right: 0pt;
}
.expandingblock
.expandingblock
{font-family: "Tahoma", verdana, arial, helvetica, sans-serif;
border-color: #AFAFAF;
border-top-style: dotted;
@ -363,7 +363,7 @@ p.listcontinue3 {
.pagenavigation a, .pagenavigation a:link, .pagenavigation a:visited {
color: #000000;
text-decoration: none;
text-decoration: none;
}
.pagenavigation a:hover {
text-decoration: none;
@ -387,7 +387,7 @@ p.listcontinue3 {
}
.nav a, .nav a:link, .nav a:visited {
color: #000000;
text-decoration: none;
text-decoration: none;
}
.nav a:hover {
text-decoration: none;
@ -400,9 +400,9 @@ td.navTabActive {
vertical-align: middle;
font-family: tahoma, verdana, arial, helvetica, sans-serif;
font-size: 8pt;
padding-top: 4px;
padding-bottom: 0px;
padding-left: 8px;
padding-top: 4px;
padding-bottom: 0px;
padding-left: 8px;
padding-right: 8px;
font-weight: bold;
background-image: url('nav_bg_active.gif');
@ -567,7 +567,7 @@ a:visited,
border-right-color: #FFFFFF;
border-bottom-style: solid;
border-bottom-width: 2px;
border-bottom-color: #ffffff;
border-bottom-color: #ffffff;
}
.bodytext {
font-family: verdana, tahoma, arial, helvetica, sans-serif;
@ -582,7 +582,7 @@ a:visited,
font-weight: bold;
font-size: 8pt;
line-height: 12px;
color: #2f739b;
color: #2f739b;
line-height: 11px;
margin: 0px;
padding: 3px;
@ -1303,7 +1303,7 @@ li.listnumber2 {
font-style: normal;
font-variant: normal;
font-size: 12pt;
color: #5c5b64;
color: #5c5b64;
background-color: inherit;
word-spacing: normal;
letter-spacing: normal;
@ -1512,7 +1512,7 @@ li.listnumber2 {
span.toc {
line-height: 19px;
}
.searchDetails {
font-family: tahoma, verdana, arial, helvetica, sans-serif;
font-size: 11px;
@ -1561,11 +1561,11 @@ form {
font-weight: bold;
}
.searchFoundWord {
background-color: #fffdce;
background-color: #fffdce;
}
.searchToTop {
text-align: left;
border-top: 1px solid #cfcfcf;
padding: 7px 0px 15px 0px;
margin: 0px;
}
}

View File

@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit;
}
require_once($path."../htdocs/master.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
require_once $path."../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
/*

View File

@ -212,6 +212,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webservices

View File

@ -292,6 +292,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webservices

View File

@ -209,6 +209,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webservices

View File

@ -220,6 +220,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webservices

View File

@ -48,6 +48,23 @@ into
// initialize subsetchars
$subsetchars = array_fill(0, 256, true);
* Replace the continue into switch with a break:
case 're': {
// justify block
if (!TCPDF_STATIC::empty_string($this->lispacer)) {
$this->lispacer = '';
continue;
}
into
case 're': {
// justify block
if (!TCPDF_STATIC::empty_string($this->lispacer)) {
$this->lispacer = '';
break;
}
* Optionnaly, removed all fonts except
dejavusans* (used by greek, arab, persan, romanian, turkish),
freemono* (russian),

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
// Create invoice object
$obj = new Facture($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
// Create order object
$com = new Commande($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
// Create instance of object
$myproduct=new Product($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
// Create user object
$obj = new User($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -65,7 +65,7 @@ print 'Argument id_thirdparty='.$argv[1]."\n";
// Start of transaction
$db->begin();
require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
// Create contract object
$obj = new Contrat($db);

View File

@ -32,9 +32,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php');
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
require __DIR__. '/../../htdocs/master.inc.php';
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/*

View File

@ -33,14 +33,14 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php');
require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
/*

View File

@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php');
require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';

View File

@ -33,11 +33,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php');
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
require __DIR__. '/../../htdocs/master.inc.php';
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php";
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/*
* Parameters
@ -157,7 +157,7 @@ $user->rights->propal->propal_advance->validate=1;
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
require_once(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php");
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php";
}
$i=0;

View File

@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php');
require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';

View File

@ -21,7 +21,7 @@
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]);
require ($path."../../htdocs/master.inc.php");
require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -118,22 +118,22 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
{
$i++;
$errorrecord=0;
if ($startlinenb && $i < $startlinenb) continue;
if ($endlinenb && $i > $endlinenb) continue;
$nboflines++;
$produit = new Product($db);
$produit->type = 0;
$produit->status = 1;
$produit->ref = trim($fields[0]);
print "Process line nb ".$i.", ref ".$produit->ref;
$produit->label = trim($fields[2]);
$produit->description = trim($fields[4]."\n".($fields[5] ? $fields[5].' x '.$fields[6].' x '.$fields[7] : ''));
$produit->volume = price2num($fields[8]);
$produit->volume_unit = 0;
$produit->volume_unit = 0;
$produit->weight = price2num($fields[9]);
$produit->weight_units = 0; // -3 = g
@ -142,9 +142,9 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
$produit->status = 1;
$produit->status_buy = 1;
$produit->finished = 1;
$produit->price_min = null;
$produit->price_min_ttc = null;
$produit->price = price2num($fields[11]);
@ -152,25 +152,25 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
$produit->price_base_type = 'TTC';
$produit->tva_tx = price2num($fields[13]);
$produit->tva_npr = 0;
$produit->cost_price = price2num($fields[16]);
// Extrafields
$produit->array_options['options_ecotaxdeee']=price2num($fields[17]);
$ret=$produit->create($user);
if ($ret < 0)
{
print " - Error in create result code = ".$ret." - ".$produit->errorsToString();
$errorrecord++;
}
else
else
{
print " - Creation OK with ref ".$produit->ref." - id = ".$ret;
}
dol_syslog("Add prices");
// If we use price level, insert price for each level
if (! $errorrecord && 1)
{
@ -181,14 +181,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString();
$errorrecord++;
}
else
else
{
print " - updatePrice OK";
}
}
dol_syslog("Add multilangs");
// Add alternative languages
if (! $errorrecord && 1)
{
@ -201,15 +201,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString();
$errorrecord++;
}
else
else
{
print " - setMultiLangs OK";
}
}
print "\n";
if ($errorrecord)
if ($errorrecord)
{
fwrite($fhandleerr, 'Error on record nb '.$i." - ".$produit->errorsToString()."\n");
$error++; // $errorrecord will be reset

View File

@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]);
require ($path."../../htdocs/master.inc.php");
require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';

View File

@ -21,7 +21,7 @@
/**
* \file dev/initdata/import-thirdparties.php
* \brief Script example to insert thirdparties from a csv file.
* \brief Script example to insert thirdparties from a csv file.
* To purge data, you can have a look at purge-data.php
*/
@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]);
require ($path."../../htdocs/master.inc.php");
require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -118,15 +118,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
{
$i++;
$errorrecord=0;
if ($startlinenb && $i < $startlinenb) continue;
if ($endlinenb && $i > $endlinenb) continue;
$nboflines++;
$object = new User($db);
$object->statut = 1;
$tmp=explode(' ',$fields[3],2);
$object->firstname = trim($tmp[0]);
$object->lastname = trim($tmp[1]);
@ -134,23 +134,23 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
else $object->login=strtolower($object->firstname);
$object->login=preg_replace('/ /','',$object->login);
$object->password = 'init';
print "Process line nb ".$i.", login ".$object->login;
$ret=$object->create($user);
if ($ret < 0)
{
print " - Error in create result code = ".$ret." - ".$object->errorsToString();
$errorrecord++;
}
else
else
{
print " - Creation OK with login ".$object->login." - id = ".$ret;
}
print "\n";
if ($errorrecord)
if ($errorrecord)
{
fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n");
$error++; // $errorrecord will be reset

View File

@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]);
require ($path."../../htdocs/master.inc.php");
require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';

View File

@ -41,15 +41,15 @@ $passwordbase=isset($argv[6])?$argv[6]:'';
// Include Dolibarr environment
$res=0;
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
/*

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*
*
* Get a distant dump file and load it into a mysql database
*/
@ -36,15 +36,15 @@ $confirm=isset($argv[1])?$argv[1]:'';
// Include Dolibarr environment
$res=0;
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
/*
@ -74,7 +74,7 @@ $tables=array(
$year=2010;
$currentyear=$tmp['year'];
while ($year <= $currentyear)
while ($year <= $currentyear)
{
//$year=2021;
$delta=($currentyear - $year);
@ -84,7 +84,7 @@ while ($year <= $currentyear)
{
foreach($tables as $tablekey => $tableval)
{
print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
$resql = $db->query($sql);
@ -110,14 +110,14 @@ while ($year <= $currentyear)
//print $sql2."\n";
$resql2 = $db->query($sql2);
if (! $resql2) dol_print_error($db);
}
}
$i++;
}
}
else dol_print_error($db);
}
}
$year++;
}

View File

@ -4,6 +4,7 @@
<description>Dolibarr coding standard.</description>
<exclude-pattern type="relative">build/html</exclude-pattern>
<exclude-pattern type="relative">build/aps</exclude-pattern>
<exclude-pattern type="relative">documents</exclude-pattern>
<exclude-pattern type="relative">htdocs/custom</exclude-pattern>
<exclude-pattern type="relative">htdocs/includes</exclude-pattern>
@ -11,43 +12,29 @@
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
<exclude-pattern type="relative">*.min.css</exclude-pattern>
<exclude-pattern type="relative">*.js</exclude-pattern>
<!-- List of all tests -->
<!-- Rules from Internal Standard -->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<!-- Rules from Generic Standard -->
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSEIF">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowed">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning">
<severity>0</severity>
</rule>
<!-- Rules from Generic Standard -->
<rule ref="Generic.CodeAnalysis.EmptyStatement">
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowed"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning"/>
</rule>
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
@ -147,7 +134,7 @@
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
<severity>0</severity>
</rule>
<rule ref="Generic.PHP.DisallowShortOpenTag" />
<rule ref="Generic.PHP.ForbiddenFunctions" />
@ -163,7 +150,7 @@
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
<severity>0</severity>
</rule>
<!-- Disallow usage of tab -->
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
@ -171,7 +158,23 @@
<!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<!-- Rules from PEAR Standard -->
@ -186,7 +189,7 @@
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity>
</rule>
@ -206,14 +209,14 @@
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity>
</rule>
<!--
<!--
<rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
<severity>0</severity>
@ -225,20 +228,20 @@
<severity>0</severity>
</rule>
-->
<rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.Empty">
<severity>5</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
</rule>-->
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
</rule>-->
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
@ -254,11 +257,11 @@
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity>
</rule>
@ -285,7 +288,20 @@
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
<!-- Test if () are removed for includes -->
<!-- <rule ref="PEAR.Files.IncludingFile"/> -->
<rule ref="PEAR.Files.IncludingFile" />
<!-- Disable some error messages that we do not want. -->
<rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.UseRequire">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
<severity>0</severity>
</rule>
<rule ref="PEAR.Formatting.MultiLineAssignment" />
@ -315,14 +331,14 @@
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue" />
<rule ref="PEAR.NamingConventions.ValidClassName" />
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
<severity>0</severity>
</rule>
@ -330,7 +346,7 @@
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
@ -347,31 +363,37 @@
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
<severity>0</severity>
</rule>
</rule>-->
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<severity>0</severity>
</rule>-->
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidVariableName" />
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<!-- This is not in PSR2 -->
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
<!-- Need to be commented to be disabled
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
<severity>0</severity>
</rule>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
<severity>0</severity>
</rule>
-->
<!-- Already found as a Generic rule -->
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->

View File

@ -27,8 +27,8 @@
* @since 2008-03-04
*/
require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php';
require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php';
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

View File

@ -47,8 +47,8 @@ print 'Files has been created. Check its name from your explorer'."\n";
* @since 2008-09-15
*/
require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php';
require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php';
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

View File

@ -64,8 +64,7 @@ class autoTranslator
// Translate
//ini_set('default_charset','UTF-8');
ini_set('default_charset',$this->_outputpagecode);
$this->parse_refLangTranslationFiles();
$this->parseRefLangTranslationFiles();
}
/**
@ -73,7 +72,7 @@ class autoTranslator
*
* @return void
*/
private function parse_refLangTranslationFiles()
private function parseRefLangTranslationFiles()
{
$files = $this->getTranslationFilesArray($this->_refLang);
@ -346,5 +345,4 @@ class autoTranslator
return $rep;
}
}

View File

@ -37,8 +37,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Include Dolibarr environment
require_once($path.'../../htdocs/master.inc.php');
require_once($path.'../../htdocs/core/lib/files.lib.php');
require_once $path.'../../htdocs/master.inc.php';
require_once $path.'../../htdocs/core/lib/files.lib.php';
// After this $db is an opened handler to database. We close it at end of file.
// Load main language strings
@ -88,7 +88,7 @@ if ($argv[2] != 'all')
}
}
require_once(DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php");
require_once DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php";
$langParser = new autoTranslator($argv[2],$argv[1],$dir,$file,$argv[3]);

View File

@ -295,6 +295,9 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
// admin.lang
if (preg_match('/^DAV_ALLOW_PUBLIC_DIR/i', $value)) $qualifiedforclean=0;
if (preg_match('/^DAV_ALLOW_ECM_DIR/i', $value)) $qualifiedforclean=0;
// boxes.lang
if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0;
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;

View File

@ -121,6 +121,9 @@ if (empty($reshook))
if ($country_code)
{
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
// FIXME Get the ADD rowid and pass it + num of comapny * 100 000 000 to run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
$result = run_sql($sqlfile, 1, 0, 1);
}
@ -406,5 +409,6 @@ if ($resql)
dol_print_error($db);
}
// End of page
llxFooter();
$db->close();

View File

@ -1004,7 +1004,7 @@ if ($id)
print '<br>';
// End of page
llxFooter();
$db->close();

View File

@ -397,6 +397,6 @@ else if ($id > 0 || $ref) {
}
}
// End of page
llxFooter();
$db->close();

View File

@ -184,6 +184,6 @@ if ($action == 'display' || $action == 'delete') {
print "</table>";
}
// End of page
llxFooter();
$db->close();

View File

@ -800,7 +800,7 @@ if ($id)
print '<br>';
// End of page
llxFooter();
$db->close();

View File

@ -190,5 +190,6 @@ print '<div class="center"><input type="submit" class="button" value="' . $langs
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -5,7 +5,7 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017-2018 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
@ -50,11 +50,11 @@ $main_option = array (
$configuration = AccountancyExport::getTypeConfig();
$listparam = $configuration[param];
$listparam = $configuration['param'];
$listformat = $configuration[format];
$listformat = $configuration['format'];
$listcr = $configuration[cr];
$listcr = $configuration['cr'];
$model_option = array (
@ -117,7 +117,7 @@ if ($action == 'update') {
if (! $error) {
// reload
$configuration = AccountancyExport::getTypeConfig();
$listparam = $configuration[param];
$listparam = $configuration['param'];
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
@ -142,27 +142,27 @@ print ' {'."\n";
foreach ($listparam as $key => $param) {
print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n";
print ' {'."\n";
print ' //console.log("'.$param[label].'");'."\n";
if (empty($param[ACCOUNTING_EXPORT_FORMAT])) {
print ' //console.log("'.$param['label'].'");'."\n";
if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) {
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[ACCOUNTING_EXPORT_FORMAT].'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n";
}
if (empty($param[ACCOUNTING_EXPORT_SEPARATORCSV])) {
if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) {
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n";
}
if (empty($param[ACCOUNTING_EXPORT_ENDLINE])) {
if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) {
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n";
}
if (empty($param[ACCOUNTING_EXPORT_DATE])) {
if (empty($param['ACCOUNTING_EXPORT_DATE'])) {
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n";
} else {
@ -257,15 +257,15 @@ if ($num2) {
print '<tr class="oddeven value">';
// Param
$label = $key[label];
$label = $key['label'];
print '<td width="50%">' . $langs->trans($label) . '</td>';
// Value
print '<td>';
if (is_array($key[param])) {
print $form->selectarray($label, $key[param], $conf->global->$label, 0);
if (is_array($key['param'])) {
print $form->selectarray($label, $key['param'], $conf->global->$label, 0);
} else {
print '<input type="text" size="20" id="'. $label .'" name="' . $key[label] . '" value="' . $conf->global->$label . '">';
print '<input type="text" size="20" id="'. $label .'" name="' . $key['label'] . '" value="' . $conf->global->$label . '">';
}
print '</td></tr>';
@ -278,5 +278,6 @@ print '<div class="center"><input type="submit" class="button" value="' . dol_es
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -156,6 +156,6 @@ if ($result)
dol_print_error($db);
}
// End of page
llxFooter();
$db->close();

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 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
@ -169,12 +170,12 @@ if ($action == 'create')
// Date start
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
print $form->select_date(($date_start ? $date_start : ''), 'fiscalyear');
print $form->selectDate(($date_start ? $date_start : ''), 'fiscalyear');
print '</td></tr>';
// Date end
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend');
print $form->selectDate(($date_end ? $date_end : - 1), 'fiscalyearend');
print '</td></tr>';
/*
@ -225,12 +226,12 @@ if ($action == 'create')
// Date start
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
print $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear');
print $form->selectDate($object->date_start ? $object->date_start : - 1, 'fiscalyear');
print '</td></tr>';
// Date end
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
print $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
print $form->selectDate($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
print '</td></tr>';
// Statut
@ -318,5 +319,6 @@ if ($action == 'create')
}
}
// End of page
llxFooter();
$db->close();

View File

@ -58,5 +58,6 @@ if ($id) {
print '</div>';
}
// End of page
llxFooter();
$db->close();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
@ -18,7 +18,7 @@
*/
/**
* \file htdocs/accountancy/admin/importaccounts.php
* \file htdocs/accountancy/admin/importaccounts.php
* \ingroup Advanced accountancy
* \brief Page import accounting account
*/
@ -83,7 +83,7 @@ if ($_POST["action"] == 'import') {
$accounting->pcg_type = $monType;
$accounting->pcg_subtype = $monSubType;
$accounting->active = 1;
$result = $accounting->create($user);
if ($result > 0) {
setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs');
@ -101,7 +101,7 @@ if ($_POST["action"] == 'import') {
print '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
}
// list accounting account from product
// list accounting account from product
$sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting ";
$sql .= " FROM " . MAIN_DB_PREFIX . "product as p ";
@ -172,14 +172,15 @@ if ($result) {
print '</tr>';
$i ++;
}
print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Import") . '"></td></tr>';
print '</table>';
print '</form>';
} else {
print $db->error();
}
// End of page
llxFooter();
$db->close();

View File

@ -295,5 +295,6 @@ print '<br>';
print '<br>';
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -128,16 +128,16 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
$elementList = array();
// Must match ids defined into eldy.lib.php
$sourceList = array(
'1' => $langs->trans('AccountingJournalType1'),
'2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'),
'4' => $langs->trans('AccountingJournalType4'),
'5' => $langs->trans('AccountingJournalType5'),
'8' => $langs->trans('AccountingJournalType8'),
'9' => $langs->trans('AccountingJournalType9')
);
// Must match ids defined into eldy.lib.php
$sourceList = array(
'1' => $langs->trans('AccountingJournalType1'),
'2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'),
'4' => $langs->trans('AccountingJournalType4'),
'5' => $langs->trans('AccountingJournalType5'),
'8' => $langs->trans('AccountingJournalType8'),
'9' => $langs->trans('AccountingJournalType9'),
);
/*
* Actions
@ -294,10 +294,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
}
if (GETPOST('actioncancel'))
{
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
}
//if (GETPOST('actioncancel'))
//{
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
//}
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
@ -683,7 +683,7 @@ if ($id)
print '<br>';
// End of page
llxFooter();
$db->close();

View File

@ -495,5 +495,6 @@ if ($result)
dol_print_error($db);
}
// End of page
llxFooter();
$db->close();

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 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
@ -193,9 +194,9 @@ else {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('DateStart') . ': ';
$moreforfilter .= $form->select_date($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0, 1);
$moreforfilter .= $form->selectDate($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0);
$moreforfilter .= $langs->trans('DateEnd') . ': ';
$moreforfilter .= $form->select_date($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0, 1);
$moreforfilter .= $form->selectDate($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0);
$moreforfilter .= '</div>';
if (! empty($moreforfilter)) {
@ -298,7 +299,8 @@ else {
print "</table>";
print '</form>';
llxFooter();
}
// End of page
llxFooter();
$db->close();

View File

@ -140,5 +140,6 @@ if ($resql) {
}
print "</table>\n";
// End of page
llxFooter();
$db->close();

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 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
@ -350,7 +351,7 @@ if ($action == 'create')
print '<tr>';
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Docdate") . '</td>';
print '<td>';
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print $html->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '</td>';
print '</tr>';
@ -432,7 +433,7 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
$form->select_date($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>';
} else {
@ -714,5 +715,6 @@ if ($action == 'create')
dol_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 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
@ -465,11 +466,11 @@ if (! empty($arrayfields['t.doc_date']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>';
}
@ -556,11 +557,11 @@ if (! empty($arrayfields['t.date_creation']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_creation_start, 'date_creation_start', 0, 0, 1);
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_creation_end, 'date_creation_end', 0, 0, 1);
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1);
print '</div>';
print '</td>';
}
@ -570,11 +571,11 @@ if (! empty($arrayfields['t.tms']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_modification_start, 'date_modification_start', 0, 0, 1);
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_modification_end, 'date_modification_end', 0, 0, 1);
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1);
print '</div>';
print '</td>';
}
@ -748,6 +749,6 @@ print '</div>';
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 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
@ -287,10 +288,10 @@ print '</td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre" align="center">';
print $langs->trans('From') . ': ';
print $form->select_date($search_date_start, 'search_date_start', 0, 0, 1);
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
print '<br>';
print $langs->trans('to') . ': ';
print $form->select_date($search_date_end, 'search_date_end', 0, 0, 1);
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
print '</td>';
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>';
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>';
@ -421,5 +422,6 @@ print '</tr>';
print "</table>";
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -21,7 +21,7 @@
*/
/**
* \file accounting/bookkeeping/thirdparty_lettrage.php
* \file accountancy/bookkeeping/thirdparty_lettrage.php
* \ingroup Advanced accountancy
* \brief Onglet de gestion de parametrages des ventilations
*/
@ -82,8 +82,9 @@ $socid = GETPOST("socid", 'int');
$object = new Societe($db);
$object->id = $socid;
$result = $object->fetch($socid);
if ($result < 0) {
setEventMessage($object->error, 'errors');
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
}
$form = new Form($db);
@ -252,7 +253,6 @@ if ($resql) {
print '</td>';
print '</tr>';
$var = false;
$solde = 0;
$tmp = '';
while ( $obj = $db->fetch_object($resql) ) {
@ -261,11 +261,10 @@ if ($resql) {
$tmp = $obj->lettering_code;
if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
$var = ! $var;
$solde += ($obj->credit - $obj->debit);
print "<tr $bc[$var]>";
print '<tr class="oddeven">';
if (empty($obj->lettering_code)) {
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
@ -293,14 +292,13 @@ if ($resql) {
}
print '<tr class="oddeven">';
print '<td colspan="4">Mouvement totaux</td>' . "\n";
print '<td><strong>' . price($debit) . '</strong></td>';
print '<td><strong>' . price($credit) . '</strong></td>';
print '<td colspan="5"></td>';
print "</tr>\n";
print "<tr $bc[$var]>";
print '<tr class="oddeven">';
print '<td colspan="9">Solde Comptable</td>' . "\n";
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
print '<td colspan="5"></td>';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -21,7 +21,7 @@
*/
/**
* \file accounting/bookkeeping/thirdparty_lettrage.php
* \file accountancy/bookkeeping/thirdparty_lettrage_supplier.php
* \ingroup Advanced accountancy
* \brief Tab to setup lettering
*/
@ -86,8 +86,9 @@ $socid = GETPOST("socid", 'int');
$object = new Societe($db);
$object->id = $socid;
$result = $object->fetch($socid);
if ($result<0) {
setEventMessage($object->error,'errors');
if ($result<0)
{
setEventMessages($object->error, $object->errors, 'errors');
}
$form = new Form($db);
@ -133,7 +134,7 @@ if (!empty($search_doc_ref)) $param.='&search_doc_ref='.$search_doc_ref;
/*
* Affichage onglets
* Display tabs
*/
$head = societe_prepare_head($object);
@ -272,7 +273,6 @@ if ($resql) {
print '</td>';
print '</tr>';
$var = false;
$solde = 0;
$tmp = '';
while ($obj = $db->fetch_object($resql)) {
@ -281,11 +281,10 @@ if ($resql) {
$tmp = $obj->lettering_code;
if ($tmp != $obj->lettering_code || empty($obj->lettering_code))
$var = ! $var;
$solde += ($obj->credit - $obj->debit);
print "<tr $bc[$var]>";
print '<tr class="oddeven">';
if (empty($obj->lettering_code)) {
print '<td><a href="' . dol_buildpath('/accountancy/bookkeeping/card.php', 1) . '?piece_num=' . $obj->piece_num . '">';
@ -320,7 +319,7 @@ if ($resql) {
print '<td colspan="5"></td>';
print "</tr>\n";
print "<tr $bc[$var]>";
print '<tr class="oddeven">';
print '<td colspan="9">Solde Comptable</td>' . "\n";
print '<td><strong>' . price($credit - $debit) . '</strong></td>';
print '<td colspan="5"></td>';

View File

@ -28,27 +28,97 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
/**
* Class to manage categories of an accounting account
*/
class AccountancyCategory // extends CommonObject
class AccountancyCategory // extends CommonObject
{
public $db; //!< To store db handler
public $error; //!< To return error code (or message)
public $errors=array(); //!< To return several error codes (or messages)
public $element='c_accounting_category'; //!< Id that identify managed objects
public $table_element='c_accounting_category'; //!< Name of table without prefix where object is stored
/**
* @var DoliDB Database handler.
*/
public $db;
public $id;
/**
* @var string Error string
* @see errors
*/
public $error;
/**
* @var string[] Error codes (or messages)
*/
public $errors = array();
/**
* @var string ID to identify managed object
*/
public $element='c_accounting_category';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='c_accounting_category';
/**
* @var int ID
*/
public $id;
/**
* @var mixed Sample property 1
*/
public $code;
public $label;
/**
* @var string Accountancy Category label
*/
public $label;
/**
* @var mixed Sample property 1
*/
public $range_account;
/**
* @var mixed Sample property 1
*/
public $sens;
/**
* @var mixed Sample property 1
*/
public $category_type;
/**
* @var mixed Sample property 1
*/
public $formula;
/**
* @var mixed Sample property 1
*/
public $position;
/**
* @var mixed Sample property 1
*/
public $fk_country;
/**
* @var mixed Sample property 1
*/
public $active;
/**
* @var mixed Sample property 1
*/
public $lines_cptbk;
/**
* @var mixed Sample property 1
*/
public $lines_display;
/**
* @var mixed Sample property 1
*/
public $sdc;
@ -125,18 +195,18 @@ class AccountancyCategory // extends CommonObject
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category");
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
//{
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback
@ -264,18 +334,17 @@ class AccountancyCategory // extends CommonObject
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
//{
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback
@ -320,18 +389,17 @@ class AccountancyCategory // extends CommonObject
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
//{
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback
@ -359,7 +427,8 @@ class AccountancyCategory // extends CommonObject
* @param int $id Id
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function display($id) {
public function display($id)
{
global $conf;
$sql = "SELECT t.rowid, t.account_number, t.label";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
@ -394,7 +463,8 @@ class AccountancyCategory // extends CommonObject
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function getCptBK($id) {
public function getCptBK($id)
{
global $conf;
$sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref";
@ -442,8 +512,9 @@ class AccountancyCategory // extends CommonObject
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function getAccountsWithNoCategory($id) {
global $conf;
public function getAccountsWithNoCategory($id)
{
global $conf;
$sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
@ -485,7 +556,8 @@ class AccountancyCategory // extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
public function updateAccAcc($id_cat, $cpts = array()) {
public function updateAccAcc($id_cat, $cpts = array())
{
global $conf;
$error = 0;
@ -548,7 +620,8 @@ class AccountancyCategory // extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
public function deleteCptCat($cpt_id) {
public function deleteCptCat($cpt_id)
{
$error = 0;
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa";
@ -799,5 +872,4 @@ class AccountancyCategory // extends CommonObject
return -1;
}
}
}

View File

@ -55,11 +55,11 @@ class AccountancyExport
public static $EXPORT_TYPE_AGIRIS = 9;
public static $EXPORT_TYPE_CONFIGURABLE = 10;
/**
*
* @var string[] Error codes (or messages)
*/
public $errors = array ();
public $errors = array();
/**
*
@ -78,7 +78,8 @@ class AccountancyExport
*
* @param DoliDb $db Database handler
*/
public function __construct(DoliDB &$db) {
public function __construct(DoliDB &$db)
{
global $conf;
$this->db = &$db;
@ -91,7 +92,8 @@ class AccountancyExport
*
* @return array of type
*/
public static function getType() {
public static function getType()
{
global $langs;
return array (
@ -113,7 +115,8 @@ class AccountancyExport
*
* @return array of type
*/
public static function getTypeConfig() {
public static function getTypeConfig()
{
global $conf, $langs;
return array (
@ -175,7 +178,8 @@ class AccountancyExport
*
* @return void
*/
public static function downloadFile() {
public static function downloadFile()
{
global $conf;
$filename = 'general_ledger';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
@ -185,8 +189,10 @@ class AccountancyExport
* Function who chose which export to use with the default config
*
* @param unknown $TData data
* @return void
*/
public function export(&$TData) {
public function export(&$TData)
{
global $conf, $langs;
self::downloadFile();
@ -235,7 +241,8 @@ class AccountancyExport
*
* @return void
*/
public function exportNormal($objectLines) {
public function exportNormal($objectLines)
{
global $conf;
foreach ( $objectLines as $line ) {
@ -259,7 +266,8 @@ class AccountancyExport
*
* @return void
*/
public function exportCegid($objectLines) {
public function exportCegid($objectLines)
{
foreach ( $objectLines as $line ) {
$date = dol_print_date($line->doc_date, '%d%m%Y');
$separator = ";";
@ -284,7 +292,8 @@ class AccountancyExport
*
* @return void
*/
public function exportCogilog($objectLines) {
public function exportCogilog($objectLines)
{
foreach ( $objectLines as $line ) {
$date = dol_print_date($line->doc_date, '%d%m%Y');
$separator = ";";
@ -317,7 +326,8 @@ class AccountancyExport
*
* @return void
*/
public function exportCoala($objectLines) {
public function exportCoala($objectLines)
{
// Coala export
$separator = ";";
$end_line = "\n";
@ -344,7 +354,8 @@ class AccountancyExport
*
* @return void
*/
public function exportBob50($objectLines) {
public function exportBob50($objectLines)
{
// Bob50
$separator = ";";
@ -382,7 +393,8 @@ class AccountancyExport
*
* @return void
*/
public function exportCiel(&$TData) {
public function exportCiel(&$TData)
{
global $conf;
$end_line ="\r\n";
@ -422,7 +434,8 @@ class AccountancyExport
*
* @return void
*/
public function exportQuadratus(&$TData) {
public function exportQuadratus(&$TData)
{
global $conf;
$end_line ="\r\n";
@ -505,7 +518,8 @@ class AccountancyExport
*
* @return void
*/
public function exportEbp($objectLines) {
public function exportEbp($objectLines)
{
$separator = ',';
$end_line = "\n";
@ -537,7 +551,8 @@ class AccountancyExport
*
* @return void
*/
public function exportAgiris($objectLines) {
public function exportAgiris($objectLines)
{
$separator = ';';
$end_line = "\n";
@ -574,7 +589,8 @@ class AccountancyExport
*
* @return void
*/
public function exportConfigurable($objectLines) {
public function exportConfigurable($objectLines)
{
global $conf;
foreach ($objectLines as $line) {
@ -602,8 +618,10 @@ class AccountancyExport
*
* @param unknown $str data
* @param integer $size data
* @return string
*/
public static function trunc($str, $size) {
public static function trunc($str, $size)
{
return dol_trunc($str, $size, 'right', 'UTF-8', 1);
}
}

View File

@ -28,13 +28,26 @@
*/
class AccountancySystem
{
var $db;
var $error;
/**
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string Error code (or message)
*/
public $error='';
var $rowid;
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
var $label;
/**
* @var string Accountancy System label
*/
public $label;
var $account_number;
var $account_parent;
@ -43,7 +56,8 @@ class AccountancySystem
*
* @param DoliDB $db handler
*/
function __construct($db) {
function __construct($db)
{
$this->db = $db;
}
@ -102,7 +116,8 @@ class AccountancySystem
* @param User $user making insert
* @return int if KO, Id of line if OK
*/
function create($user) {
function create($user)
{
$now = dol_now();
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system";
@ -130,4 +145,4 @@ class AccountancySystem
return $result;
}
}
}

View File

@ -31,7 +31,15 @@
class AccountingAccount extends CommonObject
{
public $element='accounting_account';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='accounting_account';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'billr';
/**
@ -39,29 +47,63 @@ class AccountingAccount extends CommonObject
* @var int
*/
public $ismultientitymanaged = 1;
/**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* @var integer
*/
public $restrictiononfksoc = 1;
var $db;
var $error;
var $errors;
var $id;
var $rowid;
var $datec; // Creation date
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
var $account_number;
var $account_parent;
var $account_category;
var $label;
var $fk_user_author;
var $fk_user_modif;
var $active; // duplicate with status
var $status;
/**
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string Error code (or message)
*/
public $error='';
/**
* @var string[] Error codes (or messages)
*/
public $errors = array();
/**
* @var int ID
*/
public $id;
/**
* @var int ID
*/
public $rowid;
public $datec; // Creation date
public $fk_pcg_version;
public $pcg_type;
public $pcg_subtype;
public $account_number;
public $account_parent;
public $account_category;
public $status;
/**
* @var string Label of account
*/
public $label;
/**
* @var int ID
*/
public $fk_user_author;
/**
* @var int ID
*/
public $fk_user_modif;
public $active; // duplicate with status
/**
@ -69,7 +111,8 @@ class AccountingAccount extends CommonObject
*
* @param DoliDB $db Database handle
*/
function __construct($db) {
function __construct($db)
{
global $conf;
$this->db = $db;
@ -146,7 +189,8 @@ class AccountingAccount extends CommonObject
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
function create($user, $notrigger = 0) {
function create($user, $notrigger = 0)
{
global $conf;
$error = 0;
$now = dol_now();
@ -297,7 +341,8 @@ class AccountingAccount extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
function checkUsage() {
function checkUsage()
{
global $langs;
$sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet";
@ -330,7 +375,8 @@ class AccountingAccount extends CommonObject
* @param int $notrigger 0=triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger = 0) {
function delete($user, $notrigger = 0)
{
$error = 0;
$result = $this->checkUsage();
@ -391,7 +437,7 @@ class AccountingAccount extends CommonObject
* @param string $moretitle Add more text to title tooltip
* @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
* @return string String with URL
*/
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1)
{
@ -457,7 +503,8 @@ class AccountingAccount extends CommonObject
* @param int $id of record
* @return void
*/
function info($id) {
function info($id)
{
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
$sql .= ' WHERE a.rowid = ' . $id;
@ -488,13 +535,16 @@ class AccountingAccount extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Account deactivated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
function account_desactivate($id) {
function account_desactivate($id)
{
// phpcs:enable
$result = $this->checkUsage();
if ($result > 0) {
@ -520,13 +570,16 @@ class AccountingAccount extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Account activated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
function account_activate($id) {
function account_activate($id)
{
// phpcs:enable
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
@ -557,6 +610,7 @@ class AccountingAccount extends CommonObject
return $this->LibStatut($this->status,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@ -566,6 +620,7 @@ class AccountingAccount extends CommonObject
*/
function LibStatut($statut,$mode=0)
{
// phpcs:enable
global $langs;
$langs->loadLangs(array("users"));
@ -575,27 +630,27 @@ class AccountingAccount extends CommonObject
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');

View File

@ -26,16 +26,40 @@
*/
class AccountingJournal extends CommonObject
{
/**
* @var string ID to identify managed object
*/
public $element='accounting_journal';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='accounting_journal';
/**
* @var int Field with ID of parent key if this field has a parent
*/
public $fk_element = '';
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'generic';
var $rowid;
/**
* @var int ID
*/
public $rowid;
public $code;
public $label;
/**
* @var string Accounting Journal label
*/
public $label;
public $nature; // 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new
public $active;
@ -46,7 +70,8 @@ class AccountingJournal extends CommonObject
*
* @param DoliDB $db Database handle
*/
function __construct($db) {
function __construct($db)
{
$this->db = $db;
}
@ -117,7 +142,8 @@ class AccountingJournal extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
$sql = "SELECT rowid, code, label, nature, active";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
// Manage filter
@ -245,6 +271,7 @@ class AccountingJournal extends CommonObject
return $this->LibType($this->nature,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return type of an accounting journal
*
@ -254,6 +281,7 @@ class AccountingJournal extends CommonObject
*/
function LibType($nature,$mode=0)
{
// phpcs:enable
global $langs;
$langs->loadLangs(array("accountancy"));

View File

@ -35,19 +35,25 @@ class BookKeeping extends CommonObject
* @var string Error code (or message)
*/
public $error;
/**
* @var string[] Error codes (or messages)
*/
public $errors = array ();
public $errors = array();
/**
* @var string Id to identify managed objects
*/
public $element = 'accountingbookkeeping';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'accounting_bookkeeping';
/**
* @var int Entity
*/
public $entity;
/**
@ -59,8 +65,7 @@ class BookKeeping extends CommonObject
* @var int ID
*/
public $id;
/**
*/
public $doc_date;
public $date_lim_reglement;
public $doc_type;
@ -88,7 +93,8 @@ class BookKeeping extends CommonObject
*
* @param DoliDb $db Database handler
*/
public function __construct(DoliDB $db) {
public function __construct(DoliDB $db)
{
$this->db = $db;
}
@ -99,7 +105,8 @@ class BookKeeping extends CommonObject
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, Id of created object if OK
*/
public function create(User $user, $notrigger = false) {
public function create(User $user, $notrigger = false)
{
global $conf, $langs;
dol_syslog(__METHOD__, LOG_DEBUG);
@ -328,18 +335,15 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (! $error) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
//if (! $error && ! $notrigger) {
if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
}
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
//}
// Commit or rollback
if ($error) {
@ -420,7 +424,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, Id of created object if OK
*/
public function createStd(User $user, $notrigger = false, $mode='') {
public function createStd(User $user, $notrigger = false, $mode='')
{
global $conf;
dol_syslog(__METHOD__, LOG_DEBUG);
@ -558,15 +563,15 @@ class BookKeeping extends CommonObject
if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode);
if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
//if (! $notrigger) {
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
//}
}
// Commit or rollback
@ -590,7 +595,8 @@ class BookKeeping extends CommonObject
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $ref = null, $mode='') {
public function fetch($id, $ref = null, $mode='')
{
global $conf;
dol_syslog(__METHOD__, LOG_DEBUG);
@ -687,7 +693,8 @@ class BookKeeping extends CommonObject
*
* @return int <0 if KO, >=0 if OK
*/
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
global $conf;
dol_syslog(__METHOD__, LOG_DEBUG);
@ -811,7 +818,8 @@ class BookKeeping extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') {
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
global $conf;
dol_syslog(__METHOD__, LOG_DEBUG);
@ -1016,7 +1024,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = false, $mode='') {
public function update(User $user, $notrigger = false, $mode='')
{
$error = 0;
dol_syslog(__METHOD__, LOG_DEBUG);
@ -1119,15 +1128,15 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (! $error && ! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//if (! $error && ! $notrigger) {
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
//}
// Commit or rollback
if ($error) {
@ -1185,24 +1194,23 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user, $notrigger = false, $mode='') {
public function delete(User $user, $notrigger = false, $mode='')
{
dol_syslog(__METHOD__, LOG_DEBUG);
$error = 0;
$this->db->begin();
if (! $error) {
if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//if (! $error && ! $notrigger) {
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
}
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
//}
if (! $error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode;
@ -1234,7 +1242,8 @@ class BookKeeping extends CommonObject
* @param string $importkey Import key
* @return int Result
*/
function deleteByImportkey($importkey) {
function deleteByImportkey($importkey)
{
$this->db->begin();
// first check if line not yet in bookkeeping
@ -1263,7 +1272,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
function deleteByYearAndJournal($delyear='', $journal='', $mode='') {
function deleteByYearAndJournal($delyear='', $journal='', $mode='')
{
global $conf;
if (empty($delyear) && empty($journal))
@ -1302,7 +1312,8 @@ class BookKeeping extends CommonObject
* @param int $piecenum Piecenum to delete
* @return int Result
*/
function deleteMvtNum($piecenum) {
function deleteMvtNum($piecenum)
{
global $conf;
$this->db->begin();
@ -1336,7 +1347,8 @@ class BookKeeping extends CommonObject
*
* @return int New id of clone
*/
public function createFromClone($fromid) {
public function createFromClone($fromid)
{
dol_syslog(__METHOD__, LOG_DEBUG);
global $user;
@ -1381,7 +1393,8 @@ class BookKeeping extends CommonObject
*
* @return void
*/
public function initAsSpecimen() {
public function initAsSpecimen()
{
global $user;
$now=dol_now();
@ -1417,7 +1430,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
public function fetchPerMvt($piecenum, $mode='') {
public function fetchPerMvt($piecenum, $mode='')
{
global $conf;
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
@ -1481,7 +1495,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
function fetchAllPerMvt($piecenum, $mode='') {
function fetchAllPerMvt($piecenum, $mode='')
{
global $conf;
$sql = "SELECT rowid, doc_date, doc_type,";
@ -1533,13 +1548,16 @@ class BookKeeping extends CommonObject
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Export bookkeping
*
* @param string $model Model
* @return int Result
*/
function export_bookkeping($model = 'ebp') {
function export_bookkeping($model = 'ebp')
{
// phpcs:enable
global $conf;
$sql = "SELECT rowid, doc_date, doc_type,";
@ -1684,19 +1702,22 @@ class BookKeeping extends CommonObject
*/
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of accounts with label by chart of accounts
*
* @param string $selectid Preselected chart of accounts
* @param string $htmlname Name of field in html form
* @param string $selectid Preselected chart of accounts
* @param string $htmlname Name of field in html form
* @param int $showempty Add an empty field
* @param array $event Event options
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
* @param int $select_out Set value returned by select 0=rowid (default), 1=account_number
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
* @return string String with HTML select
*/
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') {
*/
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
{
// phpcs:enable
global $conf;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@ -1753,6 +1774,7 @@ class BookKeeping extends CommonObject
return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Description of a root accounting account
*
@ -1761,6 +1783,7 @@ class BookKeeping extends CommonObject
*/
function get_compte_racine($account = null)
{
// phpcs:enable
global $conf;
$pcgver = $conf->global->CHARTOFACCOUNTS;
@ -1793,6 +1816,7 @@ class BookKeeping extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Description of accounting account
*
@ -1801,6 +1825,7 @@ class BookKeeping extends CommonObject
*/
function get_compte_desc($account = null)
{
// phpcs:enable
global $conf;
$pcgver = $conf->global->CHARTOFACCOUNTS;
@ -1838,7 +1863,11 @@ class BookKeeping extends CommonObject
*/
class BookKeepingLine
{
/**
* @var int ID
*/
public $id;
public $doc_date = '';
public $doc_type;
public $doc_ref;

View File

@ -159,5 +159,6 @@ if (! empty($id)) {
print "Error ID incorrect";
}
// End of page
llxFooter();
$db->close();

View File

@ -89,7 +89,7 @@ if ($action == 'clean' || $action == 'validatehistory')
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
} else {
$db->commit();
}
@ -153,7 +153,7 @@ $y = $year_current;
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -229,7 +229,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -309,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -415,6 +415,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
}
}
// End of page
llxFooter();
$db->close();

View File

@ -400,6 +400,6 @@ if ($result) {
print $db->lasterror();
}
// End of page
llxFooter();
$db->close();

View File

@ -201,8 +201,9 @@ llxHeader('', $langs->trans("Ventilation"));
if (empty($chartaccountcode))
{
print $langs->trans("ErrorChartOfAccountSystemNotSelected");
llxFooter();
$db->close();
// End of page
llxFooter();
$db->close();
exit;
}
@ -361,8 +362,8 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
@ -524,5 +525,6 @@ jQuery(document).ready(function() {
});
</script>';
// End of page
llxFooter();
$db->close();

View File

@ -167,5 +167,6 @@ if (! empty($id)) {
print "Error ID incorrect";
}
// End of page
llxFooter();
$db->close();

View File

@ -86,7 +86,7 @@ if ($action == 'clean' || $action == 'validatehistory')
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
} else {
$db->commit();
}
@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -221,7 +221,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -345,5 +345,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '</div>';
}
// End of page
llxFooter();
$db->close();

View File

@ -349,6 +349,6 @@ if ($result) {
print $db->lasterror();
}
// End of page
llxFooter();
$db->close();

View File

@ -180,8 +180,9 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation"));
if (empty($chartaccountcode))
{
print $langs->trans("ErrorChartOfAccountSystemNotSelected");
llxFooter();
$db->close();
// End of page
llxFooter();
$db->close();
exit;
}
@ -308,8 +309,8 @@ if ($result) {
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
@ -422,5 +423,6 @@ jQuery(document).ready(function() {
});
</script>';
// End of page
llxFooter();
$db->close();

View File

@ -55,7 +55,7 @@ if ($conf->accounting->enabled)
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
print "<br>\n";print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print '<hr>';
print "<br>\n";
@ -131,7 +131,7 @@ if ($conf->accounting->enabled)
print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print '<hr>';
print "<br>\n";
$step = 0;
@ -163,5 +163,6 @@ else
print $langs->trans("Module10Desc")."<br>\n";
}
// End of page
llxFooter();
$db->close();

View File

@ -7,7 +7,7 @@
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017-2018 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
@ -147,6 +147,7 @@ $paymentsalstatic = new PaymentSalary($db);
$paymentexpensereportstatic = new PaymentExpenseReport($db);
$paymentvariousstatic = new PaymentVarious($db);
$paymentloanstatic = new PaymentLoan($db);
$accountLinestatic=new AccountLine($db);
// Get code of finance journal
$accountingjournalstatic = new AccountingJournal($db);
@ -370,7 +371,8 @@ if ($result) {
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
//$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
} else if ($links[$key]['type'] == 'banktransfert') {
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
$accountLinestatic->fetch($links[$key]['url_id']);
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
$bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']);
$tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2);
@ -850,7 +852,8 @@ if (empty($action) || $action == 'view') {
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 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
@ -534,7 +535,8 @@ if (empty($action) || $action == 'view') {
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 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
@ -726,7 +727,8 @@ if (empty($action) || $action == 'view') {
}
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -8,6 +8,7 @@
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 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
@ -656,7 +657,8 @@ if (empty($action) || $action == 'view') {
$description .= $langs->trans("DepositsAreIncluded");
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -162,5 +162,6 @@ if (! empty($id)) {
print "Error ID incorrect";
}
// End of page
llxFooter();
$db->close();

View File

@ -87,7 +87,7 @@ if ($action == 'clean' || $action == 'validatehistory')
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
setEventMessages($db->lasterror(), null, 'errors');
} else {
$db->commit();
}
@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -221,7 +221,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -295,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -342,6 +342,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '</div>';
}
// End of page
llxFooter();
$db->close();

View File

@ -406,7 +406,6 @@ if ($result) {
print $db->lasterror();
}
// End of page
llxFooter();
$db->close();

View File

@ -202,8 +202,9 @@ llxHeader('', $langs->trans("SuppliersVentilation"));
if (empty($chartaccountcode))
{
print $langs->trans("ErrorChartOfAccountSystemNotSelected");
llxFooter();
$db->close();
// End of page
llxFooter();
$db->close();
exit;
}
@ -362,8 +363,8 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
@ -532,5 +533,6 @@ jQuery(document).ready(function() {
});
</script>';
// End of page
llxFooter();
$db->close();

View File

@ -33,8 +33,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("admin");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
if (! $user->admin) accessforbidden();
@ -265,7 +265,6 @@ form_constantes($constantes, 0, $helptext);
dol_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -33,8 +33,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("admin");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
if (! $user->admin) accessforbidden();
@ -160,7 +160,6 @@ form_constantes($constantes, 0, $helptext);
dol_fiche_end();
// End of page
llxFooter();
$db->close();

View File

@ -28,8 +28,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("members");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
llxFooter();
$db->close();

View File

@ -31,8 +31,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("members");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
llxFooter();
$db->close();

View File

@ -19,7 +19,7 @@
*/
/**
* \file htdocs/adherents/admin/public.php
* \file htdocs/adherents/admin/website.php
* \ingroup member
* \brief File of main public page for member module
* \author Laurent Destailleur
@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("members");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
$action=GETPOST('action', 'alpha');
@ -55,14 +55,12 @@ if ($action == 'update')
$amount=GETPOST('MEMBER_NEWFORM_AMOUNT');
$editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE');
$email=GETPOST('MEMBER_PAYONLINE_SENDEMAIL');
$forcetype=GETPOST('MEMBER_NEWFORM_FORCETYPE');
$forcetype=GETPOST('MEMBER_NEWFORM_FORCETYPE');
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_PAYONLINE_SENDEMAIL",$email,'chaine',0,'',$conf->entity);
if ($forcetype < 0) $res=dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE",$conf->entity);
else $res=dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE",$forcetype,'chaine',0,'',$conf->entity);
@ -211,13 +209,6 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),0);
print "</td></tr>\n";
// Jump to an online payment page
print '<tr class="oddeven" id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
print '</table>';
print '<center>';
@ -250,7 +241,6 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.$urlwithroot.'/public/members/new.php'.$entity_qr.'</a>';
}
// End of page
llxFooter();
$db->close();

View File

@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int');
@ -175,8 +175,6 @@ if ($object->id > 0)
}
}
// End of page
llxFooter();
$db->close();

View File

@ -28,10 +28,10 @@
abstract class ActionsAdherentCardCommon
{
/**
* Database handler
* @var DoliDB
* @var DoliDB Database handler.
*/
var $db;
public $db;
var $dirmodule;
var $targetmodule;
var $canvas;
@ -41,10 +41,16 @@ abstract class ActionsAdherentCardCommon
var $tpl = array();
//! Object container
var $object;
//! Error string
var $error;
//! Error array
var $errors=array();
/**
* @var string Error code (or message)
*/
public $error='';
/**
* @var string[] Error codes (or messages)
*/
public $errors = array();
/**
@ -69,7 +75,8 @@ abstract class ActionsAdherentCardCommon
//}
}
/**
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Set content of ->tpl array, to use into template
*
* @param string $action Type of action
@ -78,6 +85,7 @@ abstract class ActionsAdherentCardCommon
*/
function assign_values(&$action, $id)
{
// phpcs:enable
global $conf, $langs, $user, $canvas;
global $form, $formcompany, $objsoc;
@ -226,6 +234,7 @@ abstract class ActionsAdherentCardCommon
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Assign POST values into object
*
@ -233,6 +242,7 @@ abstract class ActionsAdherentCardCommon
*/
private function assign_post()
{
// phpcs:enable
global $langs, $mysoc;
$this->object->old_name = $_POST["old_name"];
@ -271,5 +281,4 @@ abstract class ActionsAdherentCardCommon
}
}
}
}

View File

@ -67,6 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Assign custom values for canvas
*
@ -76,6 +77,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
*/
function assign_values(&$action, $id)
{
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
@ -117,10 +119,10 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
{
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Fetch datas list and save into ->list_datas
*
@ -132,6 +134,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
*/
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
// phpcs:enable
global $conf, $langs;
//$this->getFieldList();
@ -139,4 +142,3 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
$this->list_datas = array();
}
}

View File

@ -1,11 +1,12 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 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
@ -209,7 +210,7 @@ if (empty($reshook))
}
else
{
setEventMessages($object->errors, $object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -980,7 +981,7 @@ else
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print "</td></tr>\n";
// Public profil
@ -1218,7 +1219,7 @@ else
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print "</td></tr>\n";
// Public profil
@ -1896,6 +1897,6 @@ else
}
}
// End of page
llxFooter();
$db->close();

View File

@ -310,6 +310,6 @@ print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc"
print '</form>';
print '<br>';
// End of page
llxFooter();
$db->close();

View File

@ -41,71 +41,85 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
*/
class Adherent extends CommonObject
{
/**
* @var string ID to identify managed object
*/
public $element='member';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='adherent';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $mesgs;
public $mesgs;
var $login;
public $login;
//! Clear password in memory
var $pass;
public $pass;
//! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
var $pass_indatabase;
public $pass_indatabase;
//! Encrypted password in database (always defined)
var $pass_indatabase_crypted;
public $pass_indatabase_crypted;
var $societe;
var $company;
var $address;
var $zip;
var $town;
public $societe;
public $company;
public $address;
public $zip;
public $town;
var $state_id; // Id of department
var $state_code; // Code of department
var $state; // Label of department
public $state_id; // Id of department
public $state_code; // Code of department
public $state; // Label of department
var $email;
var $skype;
var $phone;
var $phone_perso;
var $phone_mobile;
public $email;
public $skype;
public $phone;
public $phone_perso;
public $phone_mobile;
var $morphy;
var $public;
var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
var $photo;
public $morphy;
public $public;
public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
public $photo;
var $datec;
var $datem;
var $datefin;
var $datevalid;
var $birth;
public $datec;
public $datem;
public $datefin;
public $datevalid;
public $birth;
var $note_public;
var $note_private;
public $note_public;
public $note_private;
var $typeid; // Id type adherent
var $type; // Libelle type adherent
var $need_subscription;
public $typeid; // Id type adherent
public $type; // Libelle type adherent
public $need_subscription;
var $user_id;
var $user_login;
public $user_id;
public $user_login;
var $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
// Fields loaded by fetch_subscriptions()
var $first_subscription_date;
var $first_subscription_amount;
var $last_subscription_date;
var $last_subscription_date_start;
var $last_subscription_date_end;
var $last_subscription_amount;
var $subscriptions=array();
public $first_subscription_date;
public $first_subscription_amount;
public $last_subscription_date;
public $last_subscription_date_start;
public $last_subscription_date_end;
public $last_subscription_amount;
public $subscriptions=array();
var $oldcopy; // To contains a clone of this when we need to save old properties of object
public $oldcopy; // To contains a clone of this when we need to save old properties of object
/**
* @var int Entity
*/
public $entity;
/**
@ -124,6 +138,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function sending an email has the adherent with the text supplied in parameter.
*
@ -141,6 +156,7 @@ class Adherent extends CommonObject
*/
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
{
// phpcs:enable
global $conf,$langs;
// Detect if message is HTML
@ -464,7 +480,7 @@ class Adherent extends CommonObject
$action='update';
// Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
@ -531,6 +547,13 @@ class Adherent extends CommonObject
$luser->pass=$this->pass;
$luser->societe_id=$this->societe;
$luser->birth=$this->birth;
$luser->address=$this->address;
$luser->zip=$this->zip;
$luser->town=$this->town;
$luser->country_id=$this->country_id;
$luser->state_id=$this->state_id;
$luser->email=$this->email;
$luser->skype=$this->skype;
$luser->office_phone=$this->phone;
@ -622,6 +645,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Update denormalized last subscription date.
* This function is called when we delete a subscription for example.
@ -631,6 +655,7 @@ class Adherent extends CommonObject
*/
function update_end_date($user)
{
// phpcs:enable
$this->db->begin();
// Search for last subscription id and end date
@ -675,7 +700,6 @@ class Adherent extends CommonObject
$this->db->rollback();
return -1;
}
}
/**
@ -977,6 +1001,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Method to load member from its login
*
@ -985,6 +1010,7 @@ class Adherent extends CommonObject
*/
function fetch_login($login)
{
// phpcs:enable
global $conf;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
@ -1006,6 +1032,7 @@ class Adherent extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Method to load member from its name
*
@ -1015,6 +1042,7 @@ class Adherent extends CommonObject
*/
function fetch_name($firstname,$lastname)
{
// phpcs:enable
global $conf;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
@ -1177,6 +1205,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Fonction qui recupere pour un adherent les parametres
* first_subscription_date
@ -1188,6 +1217,7 @@ class Adherent extends CommonObject
*/
function fetch_subscriptions()
{
// phpcs:enable
global $langs;
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
@ -1340,7 +1370,7 @@ class Adherent extends CommonObject
* @param string $num_chq Numero cheque (if Id bank account provided)
* @param string $emetteur_nom Name of cheque writer
* @param string $emetteur_banque Name of bank of cheque
* @param string $autocreatethirdparty Auto create new thirdparty if member not linked to a thirdparty and we request an option that generate invoice.
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
* @return int <0 if KO, >0 if OK
*/
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0)
@ -1731,6 +1761,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to add member into external tools mailing-list, spip, etc.
*
@ -1738,6 +1769,7 @@ class Adherent extends CommonObject
*/
function add_to_abo()
{
// phpcs:enable
global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -1788,6 +1820,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to delete a member from external tools like mailing-list, spip, etc.
*
@ -1795,6 +1828,7 @@ class Adherent extends CommonObject
*/
function del_to_abo()
{
// phpcs:enable
global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -1967,6 +2001,7 @@ class Adherent extends CommonObject
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@ -1978,6 +2013,7 @@ class Adherent extends CommonObject
*/
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
{
// phpcs:enable
global $langs;
$langs->load("members");
if ($mode == 0)
@ -1991,7 +2027,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
if ($statut >= 1)
@ -2002,7 +2038,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort");
if ($statut >= 1)
@ -2013,7 +2049,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1)
@ -2024,7 +2060,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
if ($statut >= 1)
@ -2035,7 +2071,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1)
@ -2046,7 +2082,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
}
if ($mode == 6)
elseif ($mode == 6)
{
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1)
@ -2060,6 +2096,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Charge indicateurs this->nb de tableau de bord
*
@ -2067,6 +2104,7 @@ class Adherent extends CommonObject
*/
function load_state_board()
{
// phpcs:enable
global $conf;
$this->nb=array();
@ -2092,9 +2130,9 @@ class Adherent extends CommonObject
$this->error=$this->db->error();
return -1;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
@ -2103,6 +2141,7 @@ class Adherent extends CommonObject
*/
function load_board($user)
{
// phpcs:enable
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
@ -2237,6 +2276,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@ -2248,6 +2288,7 @@ class Adherent extends CommonObject
*/
function _load_ldap_dn($info,$mode=0)
{
// phpcs:enable
global $conf;
$dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN;
@ -2257,6 +2298,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Initialise tableau info (tableau des attributs LDAP)
*
@ -2264,6 +2306,7 @@ class Adherent extends CommonObject
*/
function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
$info=array();
@ -2454,6 +2497,7 @@ class Adherent extends CommonObject
* Existing categories are left untouch.
*
* @param int[]|int $categories Category or categories IDs
* @return void
*/
public function setCategories($categories)
{
@ -2592,6 +2636,7 @@ class Adherent extends CommonObject
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
@ -2655,5 +2700,4 @@ class Adherent extends CommonObject
return 0;
}
}

View File

@ -32,9 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
*/
class AdherentType extends CommonObject
{
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'adherent_type';
/**
* @var string ID to identify managed object
*/
public $element = 'adherent_type';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
@ -43,19 +55,25 @@ class AdherentType extends CommonObject
* @see label
*/
public $libelle;
/** @var string Label */
public $label;
/**
* @var int Subsription required (0 or 1)
* @since 5.0
*/
public $subscription;
/** @var string Public note */
public $note;
/** @var integer Can vote */
public $vote;
/** @var string Email sent during validation */
public $mail_valid;
/** @var array Array of members */
public $members=array();
@ -142,7 +160,7 @@ class AdherentType extends CommonObject
/**
* Met a jour en base donnees du type
*
* @param User $user Object user making change
* @param User $user Object user making change
* @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO
*/
@ -172,7 +190,7 @@ class AdherentType extends CommonObject
$action='update';
// Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
@ -282,6 +300,7 @@ class AdherentType extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of members' type
*
@ -289,6 +308,7 @@ class AdherentType extends CommonObject
*/
function liste_array()
{
// phpcs:enable
global $conf,$langs;
$adherenttypes = array();
@ -413,6 +433,7 @@ class AdherentType extends CommonObject
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@ -424,6 +445,7 @@ class AdherentType extends CommonObject
*/
function _load_ldap_dn($info,$mode=0)
{
// phpcs:enable
global $conf;
$dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN;
@ -433,6 +455,7 @@ class AdherentType extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
*
@ -440,6 +463,7 @@ class AdherentType extends CommonObject
*/
function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
$info=array();
@ -547,5 +571,4 @@ class AdherentType extends CommonObject
return '';
}
}

View File

@ -32,6 +32,9 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/subscription.class.php';
*/
class AdherentStats extends Stats
{
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element;
var $socid;
@ -178,5 +181,4 @@ class AdherentStats extends Stats
return $this->_getAllByYear($sql);
}
}

View File

@ -91,7 +91,8 @@ class Members extends DolibarrApi
*
* @throws RestException
*/
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '') {
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
{
global $db, $conf;
$obj_ret = array();
@ -293,7 +294,8 @@ class Members extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object) {
function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@ -407,5 +409,4 @@ class Members extends DolibarrApi
return $result;
}
}

View File

@ -31,7 +31,7 @@ class MembersTypes extends DolibarrApi
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
static $FIELDS = array(
'label'
'label',
);
/**
@ -86,7 +86,8 @@ class MembersTypes extends DolibarrApi
*
* @throws RestException
*/
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
{
global $db, $conf;
$obj_ret = array();
@ -271,7 +272,8 @@ class MembersTypes extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object) {
function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@ -318,5 +320,4 @@ class MembersTypes extends DolibarrApi
return $object;
}
}

View File

@ -34,7 +34,7 @@ class Subscriptions extends DolibarrApi
'fk_adherent',
'dateh',
'datef',
'amount'
'amount',
);
/**
@ -85,7 +85,8 @@ class Subscriptions extends DolibarrApi
*
* @throws RestException
*/
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
{
global $db, $conf;
$obj_ret = array();

View File

@ -32,17 +32,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
*/
class Subscription extends CommonObject
{
/**
* @var string ID to identify managed object
*/
public $element='subscription';
public $table_element='subscription';
public $picto='payment';
var $datec; // Date creation
var $datem; // Date modification
var $dateh; // Subscription start date (date subscription)
var $datef; // Subscription end date
var $fk_adherent;
var $amount;
var $fk_bank;
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='subscription';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='payment';
public $datec; // Date creation
public $datem; // Date modification
public $dateh; // Subscription start date (date subscription)
public $datef; // Subscription end date
public $fk_adherent;
public $amount;
public $fk_bank;
/**
@ -355,6 +366,7 @@ class Subscription extends CommonObject
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@ -363,6 +375,7 @@ class Subscription extends CommonObject
*/
function LibStatut($statut)
{
// phpcs:enable
global $langs;
$langs->load("members");
return '';

View File

@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("members");
$langs->load("companies");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array("companies","members","other"));
$id=GETPOST('id','int');
$action=GETPOST('action','alpha');
@ -91,7 +91,7 @@ if ($id > 0)
if ($result > 0)
{
// Construit liste des fichiers
// Build file list
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
@ -170,6 +170,6 @@ else
print $langs->trans("ErrorRecordNotFound");
}
// End of page
llxFooter();
$db->close();

View File

@ -86,7 +86,6 @@ else
dol_print_error($db);
}
// End of page
llxFooter();
$db->close();

View File

@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$langs->load("companies");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
// Security check
$result=restrictedArea($user,'adherent');
@ -435,6 +435,6 @@ print "</div>";
print '</div></div></div>';
// End of page
llxFooter();
$db->close();

Some files were not shown because too many files have changed in this diff Show More