Merge branch 'develop' into new_branch_20_06_2018

This commit is contained in:
Philippe Grand 2018-08-23 10:41:34 +02:00 committed by GitHub
commit f98d2078e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2122 changed files with 56003 additions and 48534 deletions

View File

@ -2,7 +2,7 @@
# from Dolibarr GitHub repository. # from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/ # 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: precise to have php 5.3 available
dist: trusty dist: trusty
sudo: required sudo: required
@ -20,7 +20,7 @@ addons:
# To use the last version of pgloader, we add repo of postgresql # To use the last version of pgloader, we add repo of postgresql
- postgresql - postgresql
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' - 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: packages:
# We need a webserver to test the webservices # We need a webserver to test the webservices
# Let's install Apache with. # Let's install Apache with.
@ -101,7 +101,7 @@ before_install:
pgloader --version pgloader --version
echo echo
fi fi
install: install:
- | - |
echo "Updating Composer" echo "Updating Composer"
@ -133,7 +133,7 @@ install:
- | - |
echo "Installing PHP CodeSniffer" echo "Installing PHP CodeSniffer"
composer -n require squizlabs/php_codesniffer ^2 composer -n require squizlabs/php_codesniffer ^3
echo echo
- | - |
@ -195,7 +195,7 @@ before_script:
mysql --version | head - mysql --version | head -
mysql -e "SELECT VERSION();" | head - mysql -e "SELECT VERSION();" | head -
echo echo
- | - |
echo "Setting up database" echo "Setting up database"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
@ -203,12 +203,11 @@ before_script:
mysql -e 'DROP DATABASE IF EXISTS travis;' mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT 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 '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 mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi fi
if [ "$DB" = 'postgresql' ]; then if [ "$DB" = 'postgresql' ]; then
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql #pgloader mysql://root:pass@127.0.0.1/dolibarr_35 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
pgloader mysql://root@127.0.0.1/travis postgresql:///travis pgloader mysql://root@127.0.0.1/travis postgresql:///travis
fi fi
# TODO: SQLite # TODO: SQLite
@ -238,8 +237,9 @@ before_script:
- | - |
echo "Create documents directory and set permissions" echo "Create documents directory and set permissions"
# and admin/temp subdirectory needed for unit tests # and admin/temp subdirectory needed for unit tests
mkdir -p documents/admin/temp mkdir -p $TRAVIS_BUILD_DIR/documents/admin/temp
echo "first line" > documents/dolibarr.log sudo chmod -R a+rwx $TRAVIS_BUILD_DIR/documents
echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log
echo echo
@ -334,32 +334,28 @@ script:
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log 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 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 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 - cd -
set +e set +e
echo 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 #cat /tmp/dolibarr_install.log
- | - |
echo "Unit testing" echo "Unit testing"
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. # Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
set -e set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$?
echo "Phpunit return code = $phpunitresult"
set +e set +e
- |
#echo "Output dolibarr.log"
#cat documents/dolibarr.log
after_script: after_script:
- | - |
# Dolibarr log file echo "After script - Output 50 latest lines of dolibarr.log"
#echo "After script" ls $TRAVIS_BUILD_DIR/documents
#cat documents/dolibarr.log tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
after_success: after_success:
- | - |
@ -367,20 +363,24 @@ after_success:
after_failure: after_failure:
- | - |
echo Failure echo Failure detected, so we show samples of log to help diagnose
# This part of code seems to be never executed, error or not ??? # This part of code is executed only if previous commande that fails are enclosed with set +e
echo "Debugging informations"
# Upgrade log files # Upgrade log files
cat *.log for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
echo "Debugging informations" do
echo "Debugging informations for file $ficlog"
#cat $ficlog
done
# Apache log file # Apache log file
echo "Debugging informations for file apache error.log"
sudo cat /var/log/apache2/error.log sudo cat /var/log/apache2/error.log
# Dolibarr log file
cat documents/dolibarr.log
if [ "$DEBUG" = true ]; then 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 # 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 # TODO: PostgreSQL log file
echo echo
fi fi

218
ChangeLog
View File

@ -3,8 +3,185 @@ 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
***** ChangeLog for 8.0.0 compared to 7.0.0 ***** ***** 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: WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
@ -26,6 +203,45 @@ Following changes may create regressions for some external modules, but were nec
are now replaced with hook getNomUrl. are now replaced with hook getNomUrl.
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
FIX: 7.0 task contact card without withproject parameters
FIX: #8722
FIX: #8762
FIX: #8813
FIX: #8858 #8860 Backport better compatibility fix
FIX: #8893 to get formatted price as substitution vars
FIX: Avoid converting into reduction twice and draft invoice
FIX: bad result on fetch ProductStockEntrepot
FIX: Bad substitution key used for default send proposal email
FIX: button to pay still visible when amount null used
FIX: clause must not be there
FIX: Contact tab not visible when using canvas
FIX: dol_delete_file must work in a context without db handler loaded
FIX: entity test must be on product_fourn_price table and not product table
FIX: Fetch shipping will now fetch project id
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
FIX: intervention: extrafield error when calling insertExtrafields
FIX: It's not possible to remove a contact which is assigned to an event #8852
FIX: javascript showempty error
FIX: Keep supplier proposal price for supplier order
FIX: link for projets not linked to a thirdparties
FIX: Missing extrafields in export of stock or products
FIX: missing filters during ordering
FIX: missing filters during reordering
FIX: missing parenthesis
FIX: need to filter on aa.entity for same accounting accounts available in several entities
FIX: picto for type in product link in accountany list is wrong
FIX: Problems in accountancy module when using multicompany module.
FIX: proposal: missing contact type translation key
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
FIX: Select user on add time spent form
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
FIX: sometimes amounts are identical but php find them different.
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 7.0.2 compared to 7.0.1 ***** ***** ChangeLog for 7.0.2 compared to 7.0.1 *****
FIX: #8023 FIX: #8023
FIX: #8259 can't update contact birthday with REST API FIX: #8259 can't update contact birthday with REST API
@ -183,7 +399,7 @@ FIX: Use of undefined constant _ROWS_2
FIX: warning when adding ECM files using old photo path 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: For users:
NEW: Add a preview icon after files that can be previewed (pdf + images) 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 NEW: When payment is registered, PDF of invoices are also regenerated so payments

View File

@ -34,8 +34,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit; exit;
} }
require_once($path."../htdocs/master.inc.php"); require_once $path."../htdocs/master.inc.php";
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.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/supplier_proposal
%_datadir/dolibarr/htdocs/support %_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme %_datadir/dolibarr/htdocs/theme
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user %_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants %_datadir/dolibarr/htdocs/variants
%_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/webservices

View File

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

View File

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

View File

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

View File

@ -48,6 +48,23 @@ into
// initialize subsetchars // initialize subsetchars
$subsetchars = array_fill(0, 256, true); $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 * Optionnaly, removed all fonts except
dejavusans* (used by greek, arab, persan, romanian, turkish), dejavusans* (used by greek, arab, persan, romanian, turkish),
freemono* (russian), freemono* (russian),

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE -------------------- // -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment // 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. // 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 //$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction // Start of transaction
$db->begin(); $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 // Create invoice object
$obj = new Facture($db); $obj = new Facture($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE -------------------- // -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment // 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. // 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 //$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction // Start of transaction
$db->begin(); $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 // Create order object
$com = new Commande($db); $com = new Commande($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE -------------------- // -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment // 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. // 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 //$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction // Start of transaction
$db->begin(); $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 // Create instance of object
$myproduct=new Product($db); $myproduct=new Product($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE -------------------- // -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment // 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. // 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 //$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction // Start of transaction
$db->begin(); $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 // Create user object
$obj = new User($db); $obj = new User($db);

View File

@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE -------------------- // -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment // 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. // 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 //$langs->setDefaultLang('en_US'); // To change default language of $langs
@ -65,7 +65,7 @@ print 'Argument id_thirdparty='.$argv[1]."\n";
// Start of transaction // Start of transaction
$db->begin(); $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 // Create contract object
$obj = new Contrat($db); $obj = new Contrat($db);

View File

@ -32,9 +32,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr // Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); //$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php'); require __DIR__. '/../../htdocs/master.inc.php';
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.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 // Recupere root dolibarr
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]); //$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.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.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.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.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.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.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 // Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); //$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.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.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.'/compta/facture/class/facture.class.php';

View File

@ -33,11 +33,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr // Recupere root dolibarr
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]); //$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
require (__DIR__. '/../../htdocs/master.inc.php'); require __DIR__. '/../../htdocs/master.inc.php';
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.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."/comm/propal/class/propal.class.php";
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/* /*
* Parameters * 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")) 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; $i=0;

View File

@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr // Recupere root dolibarr
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]); //$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.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.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.'/compta/facture/class/facture.class.php';

View File

@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr // Recupere root dolibarr
$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]); $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.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';

View File

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

View File

@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr // Recupere root dolibarr
$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]); $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.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';

View File

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

View File

@ -41,15 +41,15 @@ $passwordbase=isset($argv[6])?$argv[6]:'';
// Include Dolibarr environment // Include Dolibarr environment
$res=0; $res=0;
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php"); 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($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 && 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 $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 && 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"); 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

@ -36,15 +36,15 @@ $confirm=isset($argv[1])?$argv[1]:'';
// Include Dolibarr environment // Include Dolibarr environment
$res=0; $res=0;
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php"); 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($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 && 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 $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 && 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"); 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

@ -4,6 +4,7 @@
<description>Dolibarr coding standard.</description> <description>Dolibarr coding standard.</description>
<exclude-pattern type="relative">build/html</exclude-pattern> <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">documents</exclude-pattern>
<exclude-pattern type="relative">htdocs/custom</exclude-pattern> <exclude-pattern type="relative">htdocs/custom</exclude-pattern>
<exclude-pattern type="relative">htdocs/includes</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">*/nltechno*</exclude-pattern>
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern> <exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
<exclude-pattern type="relative">*.min.css</exclude-pattern> <exclude-pattern type="relative">*.min.css</exclude-pattern>
<exclude-pattern type="relative">*.js</exclude-pattern>
<!-- List of all tests --> <!-- List of all tests -->
<!-- Rules from Internal Standard --> <!-- Rules from Internal Standard -->
<rule ref="Internal.NoCodeFound"> <rule ref="Internal.NoCodeFound">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- Rules from Generic Standard -->
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH"> <!-- Rules from Generic Standard -->
<severity>0</severity>
</rule> <rule ref="Generic.CodeAnalysis.EmptyStatement">
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH"> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
<severity>0</severity> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
</rule> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF"> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<severity>0</severity> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
</rule> <exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowed"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE"> <exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning"/>
<severity>0</severity> </rule>
</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>
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> --> <!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
@ -147,7 +134,7 @@
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated"> <rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="Generic.PHP.DisallowShortOpenTag" /> <rule ref="Generic.PHP.DisallowShortOpenTag" />
<rule ref="Generic.PHP.ForbiddenFunctions" /> <rule ref="Generic.PHP.ForbiddenFunctions" />
@ -163,7 +150,7 @@
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found"> <rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- Disallow usage of tab --> <!-- Disallow usage of tab -->
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
@ -171,7 +158,7 @@
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<!-- Rules from PEAR Standard --> <!-- Rules from PEAR Standard -->
@ -186,7 +173,7 @@
<rule ref="PEAR.Commenting.ClassComment.Missing"> <rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Commenting.ClassComment.MissingTag"> <rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -206,14 +193,14 @@
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag"> <rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag"> <rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!--
<!--
<rule ref="PEAR.Commenting.FileComment" /> <rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle"> <rule ref="PEAR.Commenting.FileComment.WrongStyle">
<severity>0</severity> <severity>0</severity>
@ -225,20 +212,20 @@
<severity>0</severity> <severity>0</severity>
</rule> </rule>
--> -->
<rule ref="PEAR.Commenting.FunctionComment" /> <rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.Empty"> <rule ref="PEAR.Commenting.FunctionComment.Empty">
<severity>5</severity> <severity>5</severity>
</rule> </rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn"> <!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity> <severity>0</severity>
</rule> </rule>-->
<rule ref="PEAR.Commenting.FunctionComment.Missing"> <rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" /> <rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName"> <rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
@ -254,11 +241,11 @@
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired"> <rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle"> <rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType"> <rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -285,7 +272,20 @@
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> --> <!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
<!-- Test if () are removed for includes --> <!-- 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" /> <rule ref="PEAR.Formatting.MultiLineAssignment" />
@ -315,14 +315,14 @@
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket"> <rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Functions.ValidDefaultValue" /> <rule ref="PEAR.Functions.ValidDefaultValue" />
<rule ref="PEAR.NamingConventions.ValidClassName" /> <rule ref="PEAR.NamingConventions.ValidClassName" />
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid"> <rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital"> <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -330,7 +330,7 @@
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial"> <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName" /> <rule ref="PEAR.NamingConventions.ValidFunctionName" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore"> <rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
@ -350,6 +350,9 @@
<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps"> <rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore"> <rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -359,19 +362,19 @@
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore"> <rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" /> <rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
<!-- Need to be commented to be disabled <!-- Need to be commented to be disabled
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"> <rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line"> <rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
--> -->
<!-- Already found as a Generic rule --> <!-- Already found as a Generic rule -->
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->

View File

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

View File

@ -37,8 +37,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
} }
// Include Dolibarr environment // Include Dolibarr environment
require_once($path.'../../htdocs/master.inc.php'); require_once $path.'../../htdocs/master.inc.php';
require_once($path.'../../htdocs/core/lib/files.lib.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. // After this $db is an opened handler to database. We close it at end of file.
// Load main language strings // 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]); $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('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0; if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
if (preg_match('/^ModuleCompanyCode/', $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 // boxes.lang
if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0; if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0;
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0; if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -318,5 +318,6 @@ if ($action == 'create')
} }
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

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

View File

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

View File

@ -21,6 +21,7 @@
* \ingroup Advanced accountancy * \ingroup Advanced accountancy
* \brief Setup page to configure journals * \brief Setup page to configure journals
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@ -682,7 +683,7 @@ if ($id)
print '<br>'; print '<br>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -38,8 +38,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
$langs->loadLangs(array("accountancy")); $langs->loadLangs(array("accountancy"));
$page = GETPOST("page"); $page = GETPOST("page");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST("sortfield", 'alpha');
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); $search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
@ -53,7 +53,7 @@ if ($search_accountancy_code_end == - 1) {
$search_accountancy_code_end = ''; $search_accountancy_code_end = '';
} }
if (GETPOST("exportcsv")) $action = 'export_csv'; if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
@ -186,8 +186,8 @@ else {
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
$button = '<input type="submit" name="exportcsv" class="butActionNew" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />'; $button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button); print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0);
$moreforfilter = ''; $moreforfilter = '';
@ -298,7 +298,8 @@ else {
print "</table>"; print "</table>";
print '</form>'; print '</form>';
llxFooter();
} }
// End of page
llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -555,8 +555,9 @@ if ($action == 'create')
*/ */
print "</table>\n"; print "</table>\n";
print '</div></div>'; print '</div></div><!-ee-->';
print '</div>';
dol_fiche_end();
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
@ -712,5 +713,7 @@ if ($action == 'create')
} }
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -421,5 +421,6 @@ print '</tr>';
print "</table>"; print "</table>";
print '</form>'; print '</form>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

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

View File

@ -359,7 +359,8 @@ class AccountancyCategory // extends CommonObject
* @param int $id Id * @param int $id Id
* @return int <0 if KO, 0 if not found, >0 if OK * @return int <0 if KO, 0 if not found, >0 if OK
*/ */
public function display($id) { public function display($id)
{
global $conf; global $conf;
$sql = "SELECT t.rowid, t.account_number, t.label"; $sql = "SELECT t.rowid, t.account_number, t.label";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t";
@ -394,7 +395,8 @@ class AccountancyCategory // extends CommonObject
* *
* @return int <0 if KO, 0 if not found, >0 if OK * @return int <0 if KO, 0 if not found, >0 if OK
*/ */
public function getCptBK($id) { public function getCptBK($id)
{
global $conf; global $conf;
$sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref"; $sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref";
@ -442,8 +444,9 @@ class AccountancyCategory // extends CommonObject
* *
* @return int <0 if KO, 0 if not found, >0 if OK * @return int <0 if KO, 0 if not found, >0 if OK
*/ */
public function getAccountsWithNoCategory($id) { public function getAccountsWithNoCategory($id)
global $conf; {
global $conf;
$sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte"; $sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
@ -485,7 +488,8 @@ class AccountancyCategory // extends CommonObject
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function updateAccAcc($id_cat, $cpts = array()) { public function updateAccAcc($id_cat, $cpts = array())
{
global $conf; global $conf;
$error = 0; $error = 0;
@ -548,7 +552,8 @@ class AccountancyCategory // extends CommonObject
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function deleteCptCat($cpt_id) { public function deleteCptCat($cpt_id)
{
$error = 0; $error = 0;
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa";

View File

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

View File

@ -29,7 +29,11 @@
class AccountancySystem class AccountancySystem
{ {
var $db; var $db;
var $error; /**
* @var string Error code (or message)
*/
public $error='';
var $rowid; var $rowid;
var $fk_pcg_version; var $fk_pcg_version;
var $pcg_type; var $pcg_type;
@ -43,7 +47,8 @@ class AccountancySystem
* *
* @param DoliDB $db handler * @param DoliDB $db handler
*/ */
function __construct($db) { function __construct($db)
{
$this->db = $db; $this->db = $db;
} }
@ -102,7 +107,8 @@ class AccountancySystem
* @param User $user making insert * @param User $user making insert
* @return int if KO, Id of line if OK * @return int if KO, Id of line if OK
*/ */
function create($user) { function create($user)
{
$now = dol_now(); $now = dol_now();
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system"; $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system";
@ -130,4 +136,4 @@ class AccountancySystem
return $result; return $result;
} }
} }

View File

@ -46,8 +46,18 @@ class AccountingAccount extends CommonObject
public $restrictiononfksoc = 1; public $restrictiononfksoc = 1;
var $db; var $db;
var $error;
var $errors; /**
* @var string Error code (or message)
*/
public $error='';
/**
* @var string[] Error codes (or messages)
*/
public $errors = array();
var $id; var $id;
var $rowid; var $rowid;
var $datec; // Creation date var $datec; // Creation date
@ -69,7 +79,8 @@ class AccountingAccount extends CommonObject
* *
* @param DoliDB $db Database handle * @param DoliDB $db Database handle
*/ */
function __construct($db) { function __construct($db)
{
global $conf; global $conf;
$this->db = $db; $this->db = $db;
@ -146,7 +157,8 @@ class AccountingAccount extends CommonObject
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function create($user, $notrigger = 0) { function create($user, $notrigger = 0)
{
global $conf; global $conf;
$error = 0; $error = 0;
$now = dol_now(); $now = dol_now();
@ -297,7 +309,8 @@ class AccountingAccount extends CommonObject
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function checkUsage() { function checkUsage()
{
global $langs; global $langs;
$sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet"; $sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet";
@ -330,7 +343,8 @@ class AccountingAccount extends CommonObject
* @param int $notrigger 0=triggers after, 1=disable triggers * @param int $notrigger 0=triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) { function delete($user, $notrigger = 0)
{
$error = 0; $error = 0;
$result = $this->checkUsage(); $result = $this->checkUsage();
@ -457,7 +471,8 @@ class AccountingAccount extends CommonObject
* @param int $id of record * @param int $id of record
* @return void * @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 = '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 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
$sql .= ' WHERE a.rowid = ' . $id; $sql .= ' WHERE a.rowid = ' . $id;
@ -494,7 +509,8 @@ class AccountingAccount extends CommonObject
* @param int $id Id * @param int $id Id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function account_desactivate($id) { function account_desactivate($id)
{
$result = $this->checkUsage(); $result = $this->checkUsage();
if ($result > 0) { if ($result > 0) {
@ -526,7 +542,8 @@ class AccountingAccount extends CommonObject
* @param int $id Id * @param int $id Id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function account_activate($id) { function account_activate($id)
{
$this->db->begin(); $this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";

View File

@ -46,7 +46,8 @@ class AccountingJournal extends CommonObject
* *
* @param DoliDB $db Database handle * @param DoliDB $db Database handle
*/ */
function __construct($db) { function __construct($db)
{
$this->db = $db; $this->db = $db;
} }
@ -117,7 +118,8 @@ class AccountingJournal extends CommonObject
* *
* @return int <0 if KO, >0 if OK * @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 = "SELECT rowid, code, label, nature, active";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
// Manage filter // Manage filter

View File

@ -88,7 +88,8 @@ class BookKeeping extends CommonObject
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
public function __construct(DoliDB $db) { public function __construct(DoliDB $db)
{
$this->db = $db; $this->db = $db;
} }
@ -99,7 +100,8 @@ class BookKeeping extends CommonObject
* @param bool $notrigger false=launch triggers after, true=disable triggers * @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, Id of created object if OK * @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; global $conf, $langs;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -420,7 +422,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode * @param string $mode Mode
* @return int <0 if KO, Id of created object if OK * @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; global $conf;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -590,7 +593,8 @@ class BookKeeping extends CommonObject
* *
* @return int <0 if KO, 0 if not found, >0 if OK * @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; global $conf;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -687,7 +691,8 @@ class BookKeeping extends CommonObject
* *
* @return int <0 if KO, >=0 if OK * @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; global $conf;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -811,7 +816,8 @@ class BookKeeping extends CommonObject
* *
* @return int <0 if KO, >0 if OK * @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; global $conf;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -1016,7 +1022,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode * @param string $mode Mode
* @return int <0 if KO, >0 if OK * @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; $error = 0;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -1185,7 +1192,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode * @param string $mode Mode
* @return int <0 if KO, >0 if OK * @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); dol_syslog(__METHOD__, LOG_DEBUG);
$error = 0; $error = 0;
@ -1234,7 +1242,8 @@ class BookKeeping extends CommonObject
* @param string $importkey Import key * @param string $importkey Import key
* @return int Result * @return int Result
*/ */
function deleteByImportkey($importkey) { function deleteByImportkey($importkey)
{
$this->db->begin(); $this->db->begin();
// first check if line not yet in bookkeeping // first check if line not yet in bookkeeping
@ -1263,7 +1272,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode * @param string $mode Mode
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function deleteByYearAndJournal($delyear='', $journal='', $mode='') { function deleteByYearAndJournal($delyear='', $journal='', $mode='')
{
global $conf; global $conf;
if (empty($delyear) && empty($journal)) if (empty($delyear) && empty($journal))
@ -1302,7 +1312,8 @@ class BookKeeping extends CommonObject
* @param int $piecenum Piecenum to delete * @param int $piecenum Piecenum to delete
* @return int Result * @return int Result
*/ */
function deleteMvtNum($piecenum) { function deleteMvtNum($piecenum)
{
global $conf; global $conf;
$this->db->begin(); $this->db->begin();
@ -1336,7 +1347,8 @@ class BookKeeping extends CommonObject
* *
* @return int New id of clone * @return int New id of clone
*/ */
public function createFromClone($fromid) { public function createFromClone($fromid)
{
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
global $user; global $user;
@ -1381,7 +1393,8 @@ class BookKeeping extends CommonObject
* *
* @return void * @return void
*/ */
public function initAsSpecimen() { public function initAsSpecimen()
{
global $user; global $user;
$now=dol_now(); $now=dol_now();
@ -1417,7 +1430,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode * @param string $mode Mode
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function fetchPerMvt($piecenum, $mode='') { public function fetchPerMvt($piecenum, $mode='')
{
global $conf; global $conf;
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation"; $sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
@ -1481,7 +1495,8 @@ class BookKeeping extends CommonObject
* @param string $mode Mode * @param string $mode Mode
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetchAllPerMvt($piecenum, $mode='') { function fetchAllPerMvt($piecenum, $mode='')
{
global $conf; global $conf;
$sql = "SELECT rowid, doc_date, doc_type,"; $sql = "SELECT rowid, doc_date, doc_type,";
@ -1539,7 +1554,8 @@ class BookKeeping extends CommonObject
* @param string $model Model * @param string $model Model
* @return int Result * @return int Result
*/ */
function export_bookkeping($model = 'ebp') { function export_bookkeping($model = 'ebp')
{
global $conf; global $conf;
$sql = "SELECT rowid, doc_date, doc_type,"; $sql = "SELECT rowid, doc_date, doc_type,";
@ -1696,7 +1712,8 @@ class BookKeeping extends CommonObject
* @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 * @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 * @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 = '')
{
global $conf; global $conf;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';

View File

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

View File

@ -89,7 +89,7 @@ if ($action == 'clean' || $action == 'validatehistory')
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
$db->rollback(); $db->rollback();
setEventMessage($db->lasterror(), 'errors'); setEventMessages($db->lasterror(), null, 'errors');
} else { } else {
$db->commit(); $db->commit();
} }
@ -415,6 +415,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
} }
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -201,8 +201,9 @@ llxHeader('', $langs->trans("Ventilation"));
if (empty($chartaccountcode)) if (empty($chartaccountcode))
{ {
print $langs->trans("ErrorChartOfAccountSystemNotSelected"); print $langs->trans("ErrorChartOfAccountSystemNotSelected");
llxFooter(); // End of page
$db->close(); llxFooter();
$db->close();
exit; 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 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"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre center nowraponall">'; 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.'">'; 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" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; 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); $formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></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>'; </script>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -86,7 +86,7 @@ if ($action == 'clean' || $action == 'validatehistory')
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
$db->rollback(); $db->rollback();
setEventMessage($db->lasterror(), 'errors'); setEventMessages($db->lasterror(), null, 'errors');
} else { } else {
$db->commit(); $db->commit();
} }
@ -345,5 +345,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '</div>'; print '</div>';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -180,8 +180,9 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation"));
if (empty($chartaccountcode)) if (empty($chartaccountcode))
{ {
print $langs->trans("ErrorChartOfAccountSystemNotSelected"); print $langs->trans("ErrorChartOfAccountSystemNotSelected");
llxFooter(); // End of page
$db->close(); llxFooter();
$db->close();
exit; exit;
} }
@ -308,8 +309,8 @@ if ($result) {
print '<td class="liste_titre"></td>'; 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"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
print '<td class="liste_titre center">'; 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.'">'; 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" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; 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); $formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></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>'; </script>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -76,7 +76,7 @@ if ($conf->accounting->enabled)
print "<br>\n"; print "<br>\n";
$step++; $step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>'); print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print "<br>\n"; print "<br>\n";
$step++; $step++;
@ -163,5 +163,6 @@ else
print $langs->trans("Module10Desc")."<br>\n"; print $langs->trans("Module10Desc")."<br>\n";
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -87,7 +87,7 @@ if ($action == 'clean' || $action == 'validatehistory')
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
$db->rollback(); $db->rollback();
setEventMessage($db->lasterror(), 'errors'); setEventMessages($db->lasterror(), null, 'errors');
} else { } else {
$db->commit(); $db->commit();
} }
@ -342,6 +342,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '</div>'; print '</div>';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -202,8 +202,9 @@ llxHeader('', $langs->trans("SuppliersVentilation"));
if (empty($chartaccountcode)) if (empty($chartaccountcode))
{ {
print $langs->trans("ErrorChartOfAccountSystemNotSelected"); print $langs->trans("ErrorChartOfAccountSystemNotSelected");
llxFooter(); // End of page
$db->close(); llxFooter();
$db->close();
exit; 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"><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"></td>';
print '<td class="liste_titre center nowraponall">'; 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.'">'; 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" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">'; 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); $formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></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>'; </script>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -265,7 +265,6 @@ form_constantes($constantes, 0, $helptext);
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -160,7 +160,6 @@ form_constantes($constantes, 0, $helptext);
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -250,7 +250,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>'; print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.$urlwithroot.'/public/members/new.php'.$entity_qr.'</a>';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -175,8 +175,6 @@ if ($object->id > 0)
} }
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -41,10 +41,16 @@ abstract class ActionsAdherentCardCommon
var $tpl = array(); var $tpl = array();
//! Object container //! Object container
var $object; var $object;
//! Error string /**
var $error; * @var string Error code (or message)
//! Error array */
var $errors=array(); public $error='';
/**
* @var string[] Error codes (or messages)
*/
public $errors = array();
/** /**

View File

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

View File

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

View File

@ -464,7 +464,7 @@ class Adherent extends CommonObject
$action='update'; $action='update';
// Actions on extra fields // 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(); $result=$this->insertExtraFields();
if ($result < 0) if ($result < 0)
@ -2454,6 +2454,7 @@ class Adherent extends CommonObject
* Existing categories are left untouch. * Existing categories are left untouch.
* *
* @param int[]|int $categories Category or categories IDs * @param int[]|int $categories Category or categories IDs
* @return void
*/ */
public function setCategories($categories) public function setCategories($categories)
{ {

View File

@ -142,7 +142,7 @@ class AdherentType extends CommonObject
/** /**
* Met a jour en base donnees du type * 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 * @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO * @return int >0 if OK, < 0 if KO
*/ */
@ -172,7 +172,7 @@ class AdherentType extends CommonObject
$action='update'; $action='update';
// Actions on extra fields // 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(); $result=$this->insertExtraFields();
if ($result < 0) if ($result < 0)

View File

@ -91,7 +91,8 @@ class Members extends DolibarrApi
* *
* @throws RestException * @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; global $db, $conf;
$obj_ret = array(); $obj_ret = array();
@ -293,7 +294,8 @@ class Members extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) { function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);

View File

@ -31,7 +31,7 @@ class MembersTypes extends DolibarrApi
* @var array $FIELDS Mandatory fields, checked when create and update object * @var array $FIELDS Mandatory fields, checked when create and update object
*/ */
static $FIELDS = array( static $FIELDS = array(
'label' 'label',
); );
/** /**
@ -86,7 +86,8 @@ class MembersTypes extends DolibarrApi
* *
* @throws RestException * @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; global $db, $conf;
$obj_ret = array(); $obj_ret = array();
@ -271,7 +272,8 @@ class MembersTypes extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) { function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);

View File

@ -34,7 +34,7 @@ class Subscriptions extends DolibarrApi
'fk_adherent', 'fk_adherent',
'dateh', 'dateh',
'datef', 'datef',
'amount' 'amount',
); );
/** /**
@ -85,7 +85,8 @@ class Subscriptions extends DolibarrApi
* *
* @throws RestException * @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; global $db, $conf;
$obj_ret = array(); $obj_ret = array();

View File

@ -91,7 +91,7 @@ if ($id > 0)
if ($result > 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); $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0; $totalsize=0;
foreach($filearray as $key => $file) foreach($filearray as $key => $file)
@ -170,6 +170,6 @@ else
print $langs->trans("ErrorRecordNotFound"); print $langs->trans("ErrorRecordNotFound");
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -435,6 +435,6 @@ print "</div>";
print '</div></div></div>'; print '</div></div></div>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -221,5 +221,6 @@ else
print '</table>'; print '</table>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -379,7 +379,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall) if ($sall)
{ {
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . implode(', ',$fieldstosearchall); print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
} }
// Filter on categories // Filter on categories
@ -827,6 +827,6 @@ print '</form>';
if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit, 1); if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit, 1);
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -120,6 +120,6 @@ if ($id)
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -143,7 +143,6 @@ print '</table>';
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -309,8 +309,6 @@ if ($mode)
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -229,7 +229,6 @@ print '<div style="clear:both"></div>';
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -330,7 +330,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if (! $error) if (! $error)
{ {
// $db->commit(); $db->commit();
} }
else else
{ {
@ -1108,7 +1108,6 @@ else
print $langs->trans("ErrorRecordNotFound"); print $langs->trans("ErrorRecordNotFound");
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -417,7 +417,6 @@ if ($rowid && $action != 'edit')
print '</div></div></div>'; print '</div></div></div>';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -76,5 +76,6 @@ print '</div>';
dol_fiche_end(); dol_fiche_end();
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -787,7 +787,6 @@ if ($rowid > 0)
} }
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -187,5 +187,6 @@ else
print '</table>'; print '</table>';
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -202,6 +202,6 @@ print "</form>\n";
print "<br>"; print "<br>";
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -85,7 +85,7 @@ dol_fiche_end();
if ($action != 'create' && $action != 'edit') if ($action != 'create' && $action != 'edit')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>"; print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print "</div>"; print "</div>";
} }
@ -98,7 +98,7 @@ if ($action != 'create' && $action != 'edit')
if ($action == 'create') if ($action == 'create')
{ {
print "<br>"; print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute')); print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
@ -117,6 +117,6 @@ if ($action == 'edit' && ! empty($attrname))
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
} }
// End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

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