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

This commit is contained in:
florian HENRY
2018-07-12 18:27:22 +02:00
2899 changed files with 43344 additions and 27523 deletions

1
.gitignore vendored
View File

@@ -24,3 +24,4 @@ Thumbs.db
htdocs/includes/autoload.php
htdocs/includes/bin/
htdocs/includes/composer/
/.pydevproject

View File

@@ -207,8 +207,7 @@ before_script:
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
if [ "$DB" = 'postgresql' ]; then
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
#pgloader mysql://root:pass@127.0.0.1/dolibarr_35 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
fi
# TODO: SQLite
@@ -238,8 +237,9 @@ before_script:
- |
echo "Create documents directory and set permissions"
# and admin/temp subdirectory needed for unit tests
mkdir -p documents/admin/temp
echo "first line" > documents/dolibarr.log
mkdir -p $TRAVIS_BUILD_DIR/documents/admin/temp
sudo chmod -R a+rwx $TRAVIS_BUILD_DIR/documents
echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log
echo
@@ -293,7 +293,8 @@ script:
# Ensure we catch errors
set -e
# Exclusions are defined in the ruleset.xml file
phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
set +e
echo
@@ -333,13 +334,12 @@ script:
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
php upgrade2.php 7.0.0 8.0.0 MAIN_MODULE_TICKETSUP > $TRAVIS_BUILD_DIR/upgrade700800-2.log
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
cd -
set +e
echo
#cat $TRAVIS_BUILD_DIR/upgrade400500-2.log
#cat $TRAVIS_BUILD_DIR/upgrade500600.log
#cat $TRAVIS_BUILD_DIR/upgrade500600-2.log
#cat $TRAVIS_BUILD_DIR/upgrade500600-3.log
#cat /tmp/dolibarr_install.log
- |
@@ -347,18 +347,15 @@ script:
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$?
echo "Phpunit return code = $phpunitresult"
set +e
- |
#echo "Output dolibarr.log"
#cat documents/dolibarr.log
after_script:
- |
# Dolibarr log file
#echo "After script"
#cat documents/dolibarr.log
echo "After script - Output 50 latest lines of dolibarr.log"
ls $TRAVIS_BUILD_DIR/documents
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
after_success:
- |
@@ -366,19 +363,24 @@ after_success:
after_failure:
- |
echo Failure
# This part of code seems to be never executed, error or not ???
echo "Debugging informations"
echo Failure detected, so we show samples of log to help diagnose
# This part of code is executed only if previous commande that fails are enclosed with set +e
# Upgrade log files
cat *.log
echo "Debugging informations"
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
do
echo "Debugging informations for file $ficlog"
#cat $ficlog
done
# Apache log file
echo "Debugging informations for file apache error.log"
sudo cat /var/log/apache2/error.log
# Dolibarr log file
cat documents/dolibarr.log
if [ "$DEBUG" = true ]; then
# Dolibarr log file
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
# MariaDB log file
sudo cat /var/log/mysql/error.log
echo "Debugging informations for file mysql error.log"
sudo tail -n 50 /var/log/mysql/error.log
# TODO: PostgreSQL log file
echo
fi

View File

@@ -356,9 +356,9 @@ source_file = htdocs/langs/en_US/supplier_proposal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.ticketsup]
file_filter = htdocs/langs/<lang>/ticketsup.lang
source_file = htdocs/langs/en_US/ticketsup.lang
[dolibarr.ticket]
file_filter = htdocs/langs/<lang>/ticket.lang
source_file = htdocs/langs/en_US/ticket.lang
source_lang = en_US
type = MOZILLAPROPERTIES

209
ChangeLog
View File

@@ -2,9 +2,174 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** 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 member
NEW: Add a button to create Stripe customer from the 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 website module
NEW: Add a tab to specify accountant/auditor of the company
NEW: Add Date delivery and Availability on Propals List
NEW: Add date in goods reception supplier order table
NEW: Add delivery_time_days of suppliers in export profile
NEW: Add Documents'tab to expedition module
NEW: Use dol_print_phone in thirdparty list page to format phone
NEW: Add entry for the GDPR contact
NEW: Add extrafield type "html"
NEW: Add file number in accountant card and update export filename
NEW: Add files management on products lot
NEW: add filter on project task list
NEW: Add hidden option COMPANY_AQUARIUM_CLEAN_REGEX to clean generated
NEW: add internal stripe payment page for invoice
NEW: Add key __USER_REMOTE_IP__ into available substitution variables
NEW: Add link between credit note invoice and origin
NEW: Add linked file tab to vat
NEW: add link to stripe's info in bank menu
NEW: Add margin filters
NEW: Add mass action enable/disable on cron job list
NEW: Add mass action on project's list to close projects
NEW: Add method to register distributed payments on invoices
NEW: Add multicurrency support for product buy price for supplier propales, orders and invoices
NEW: Add name of day in the timesheet input page per day.
NEW: add new parameters for tcpf encryption
NEW: add optional esign field in pdf propal
NEW: Add option BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD
NEW: Add option CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES
NEW: Add param $dolibarr_main_restrict_ip in config file to limit ips
NEW: add pdf function to check if pdf file is protected/encrypted
NEW: Add pdf template for stock/warehouse module
NEW: Add phone format for a lot of countries
NEW: Add product and product categories filters on customer margins
NEW: Add product categories filter on product margin
NEW: Add romanian chart of accounts
NEW: Add stats in salaries module
NEW: add stripe transaction
NEW: Add tab contact on supplier proposals
NEW: Add total of time spent in timespent page at top of page too.
NEW: Add trigger CONTRACT_MODIFY
NEW: Add triggers on ECM object and add fill src_object_type/id fields
NEW: Add type of website container/page into dictionary
NEW: advance target filtering can be used everywhere with tpl and fk_element
NEW: Allow negative quantity for dispatch (supplier order)
NEW: bank reconcile: checkbox to select all bank operations
NEW: Better performance with openldap
NEW: Can add filter actiontype and notactiontype on event ical export
NEW: Can add product in supplier order/invoice even w/o predefined price
NEW: cancel orders on massaction
NEW: Can crop image files attached in "document" tabs of a member
NEW: Can delete dir content in media and ECM module recursively
NEW: Can dispatch if more than ordered (if hidden option set)
NEW: Can edit the text color for title line of tables
NEW: Can enter time spent from the list of time spent of project
NEW: Can export leave requests
NEW: Can filter on account range in general ledger grouped by account
NEW: Can filter on country and taxid into the binding page
NEW: Can filter on progression in timesheet
NEW: Can fix the bank account of a payment if payment not conciliated
NEW: Can force usage of shared link for photo of products
NEW: Can get template of email from its label
NEW: Can see Unit Purchase Value of product in stock movement
NEW: Can select from the user list into send form email (For field to and CC)
NEW: Can select sample to use when creating a new page
NEW: can send mail from project card
NEW: Can set position of images in module tickets
NEW: Can set the reply-to into email sent
NEW: Can set the start/end date of service line in invoice templates
NEW: Can share any file from the "Document" tab.
NEW: Can sort on priority in task scheduler list
NEW: Can sort order of files in attach tab for leave and expensereport
NEW: Can use setValueFrom without user modification field
NEW: Cat set the encryption algorithm for extrafields of type password
NEW: check idprof1 for country pt
NEW: default add action: new param $backurlforcard to redirect to card
NEW: default warehouse field for products + prefill warehouses when dispatching supplier orders
NEW: Display price HT on all commercial area boards
NEW: display total on contract service list
NEW: display weight volume in proposal
NEW: Edit of extrafields position page on the edit form
NEW: Experimental DAV module provides a public and private directory
NEW: export filter models can be share or not by user
NEW: Externalsite module can accept iframe content.
NEW: Filter export model is now by user
NEW: Finish implementation of option PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES
NEW: generalize use of button to create new element from list
NEW: hidden conf AGENDA_NB_WEEKS_IN_VIEW_PER_USER to set nb weeks to show into per user view
NEW: hidden conf to assign category to thirparty that are neither customer nor prospect or supplier
NEW: hidden conf to set nb weeks to show into user view
NEW: hidden option MAIN_DISABLE_FREE_LINES
NEW: improve way of adding users/sales representative to thirdparty
NEW: Introduce option THIRDPARTY_QUICKSEARCH_ON_FIELDS to personalize fields use to search on quick search.
NEW: Introduce permission "approve" for "leave request" like for "expense report"
NEW: Load product data optional fields to the line -> enables to use "line_options_{extrafield}"
NEW: Look and feel v8 - Show Picto "+" on all links "Add record"
NEW: Look and feel v8: Use a different picto for delete and unlink
NEW: mail templates for projects
NEW: Module variant supported on services
NEW: monthly VAT report show "Claimed for the period" + "Paid during this
NEW: Mutualize code for action="update_extras"
NEW: On invoice card, show accounting account linked
NEW: Online payment of invoice and subscription record the payment
NEW: OnSearchAndListGoOnCustomerOrSupplierCard conf
NEW: Optimize load of hooks classes (save 1-5Kb of memory)
NEW: Option MAIN_SHOW_REGION_IN_STATE renamed into MAIN_SHOW_REGION_IN_STATE_SELECT are more complete
NEW: Option to force all emails recipient
NEW: Hidden option to send to salaries into emails forms
NEW: order minimum amount
NEW: add price in burger menu on mouvement list
NEW: Report a list of leave requests for a month
NEW: Section of files generated by mass action not visible if empty
NEW: send mails from project card
NEW: Show also size in bytes in tooltip if visible unit is not bytes
NEW: Show keyboard shortcut of nav arrow into tooltip
NEW: Show last result code of cron jobs in error in red
NEW: Show region in company info & Global option to show state code MAIN_SHOW_STATE_CODE
NEW: Show total number of records by category
NEW: Show total of time consumed in week in time spent entry page
NEW: Stripe online payments reuse the same stripe customer account
NEW: Suggest link to pay online for customer orders
NEW: supplier credit notes is now supported like for customer credit notes
NEW: supplier order/order lines export: add supplier product ref
NEW: supplier relative discounts
NEW: Support alternative aliases of page name in website
NEW: syslog file autoclean
NEW: thirdparty categ filter on lists
NEW: Use a css style for weekend in time spent
NEW: Use common substitution rule for language to get translation in ODT
NEW: Variable __ONLINE_PAYMENT_URL__ available in email templates
For developers:
NEW: class reposition can also work on POST (not only GET)
NEW: add a hook in dol_print_phone
NEW: The field "visible" on extrafield can accept expression as condition
NEW: Upgrade of Stripe lib to 6.4.1
NEW: work on CommonObject 'array' field typeNew common object array
NEW: method Form::selectArrayFilter() + use in left menu search
NEW: [REST API] Add the possibility to remove a category from a thirdparty
NEW: doActions on categorycard
NEW: add "moreHtmlRef" hook
NEW: add hook for more permissions control
NEW: add hook moreHtmlStatus to complete to status on banners
NEW: Add hook printEmail
NEW: Add hook setContentSecurityPolicy
NEW: Add password_hash as a hash algorithm
NEW: Add dol_is_link function
NEW: Adds a contact to an invoice with REST API
NEW: Adds a payment for the list of invoices given as parameter
NEW: adds billing contacts ids to REST API returns
NEW: Add showempty parameter in country selection
NEW: add printUserListWhere hook
NEW: add "printUserPasswordField" hooks
NEW: Call to trigger on payment social contribution creation
NEW: Call to trigger on social contribution creation
NEW: hook getnomurltooltip is replaced with hook getNomUrl more powerfull
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
@@ -22,9 +187,49 @@ Following changes may create regressions for some external modules, but were nec
* The hook contaxt commcard has been renamed thirdpartycomm
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
* Remove method Categorie:get_nb_categories() that was not used.
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
are now replaced with hook getNomUrl.
***** ChangeLog for 7.0.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 *****
FIX: #8023
FIX: #8259 can't update contact birthday with REST API
@@ -182,7 +387,7 @@ FIX: Use of undefined constant _ROWS_2
FIX: warning when adding ECM files using old photo path
***** ChangeLog for 7.0.0 compared to 6.0.5 *****
***** ChangeLog for 7.0.0 compared to 6.0.7 *****
For users:
NEW: Add a preview icon after files that can be previewed (pdf + images)
NEW: When payment is registered, PDF of invoices are also regenerated so payments

View File

@@ -22,6 +22,8 @@
* \brief This script create a xml checksum file
*/
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';

View File

@@ -10,6 +10,7 @@
<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
<exclude-pattern type="relative">*.min.css</exclude-pattern>
<!-- List of all tests -->
@@ -82,7 +83,7 @@
<!-- Lines can be 85 chars long, but never show errors -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="1000" />
<property name="lineLimit" value="500" />
<property name="absoluteLineLimit" value="0" />
</properties>
</rule>

View File

@@ -15,7 +15,7 @@ then
echo "This push local files to transifex for project $project."
echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer."
echo " Using -f will overwrite translation but not memory."
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r ".$project.".file] [-f] [--no-interactive]"
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r $project.file] [-f] [--no-interactive]"
exit
fi

View File

@@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","admin","accountancy","salaries"));
$mesg = '';
@@ -225,7 +226,7 @@ if ($resql)
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create">' . $langs->trans("Addanaccount");
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("Addanaccount").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';

View File

@@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm"));
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';

View File

@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$error = 0;
// Load translation files required by the page
$langs->loadLangs(array("bills","accountancy"));
$mesg = '';

View File

@@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$error = 0;
// Load translation files required by the page
$langs->loadLangs(array("bills","accountancy"));
$mesg = '';

View File

@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors","admin","companies","resource","holiday","accountancy","hrm"));
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';

View File

@@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","admin","accountancy","salaries","loan"));
// Security check

View File

@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","admin","accountancy"));
// Security access

View File

@@ -39,6 +39,7 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield="f.rowid"; // Set here default search field
if (! $sortorder) $sortorder="ASC";
// Load translation files required by the page
$langs->loadLangs(array("admin","compta"));
// Security check

View File

@@ -26,6 +26,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin","compta"));
// Security check

View File

@@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin","compta"));
// Security check

View File

@@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","accountancy"));
// Security check

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@@ -32,6 +32,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","admin","accountancy"));
// Security access
@@ -131,6 +132,18 @@ if ($action == 'setdisabledirectinput') {
}
}
if ($action == 'setenabledraftexport') {
$setenabledraftexport = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}
/*
* View
*/
@@ -210,6 +223,19 @@ if (! empty($user->admin))
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '<tr class="oddeven">';

View File

@@ -21,6 +21,7 @@
* \ingroup Advanced accountancy
* \brief Setup page to configure journals
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -30,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin","compta","accountancy"));
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';

View File

@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("companies","compta","accountancy","products"));
// Security check

View File

@@ -34,12 +34,12 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
// Langs
// Load translation files required by the page
$langs->loadLangs(array("accountancy"));
$page = GETPOST("page");
$sortorder = GETPOST("sortorder");
$sortfield = GETPOST("sortfield");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", '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_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 = '';
}
if (GETPOST("exportcsv")) $action = 'export_csv';
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
$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="page" value="'.$page.'">';
$button = '<input type="submit" name="exportcsv" class="butActionNew" 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);
$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, $button, $result, $result, 'title_accountancy', 0);
$moreforfilter = '';

View File

@@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("bills","compta","accountancy","other"));
// Filter
@@ -71,7 +71,22 @@ if ($result) {
$y = $year_current;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width=150>' . $langs->trans("Label") . '</td><td align="center">' . $langs->trans("JanuaryMin") . '</td><td align="center">' . $langs->trans("FebruaryMin") . '</td><td align="center">' . $langs->trans("MarchMin") . '</td><td align="center">' . $langs->trans("AprilMin") . '</td><td align="center">' . $langs->trans("MayMin") . '</td><td align="center">' . $langs->trans("JuneMin") . '</td><td align="center">' . $langs->trans("JulyMin") . '</td><td align="center">' . $langs->trans("AugustMin") . '</td><td align="center">' . $langs->trans("SeptemberMin") . '</td><td align="center">' . $langs->trans("OctoberMin") . '</td><td align="center">' . $langs->trans("NovemberMin") . '</td><td align="center">' . $langs->trans("DecemberMin") . '</td><td align="center"><b>Total</b></td></tr>';
print '<tr class="liste_titre">';
print '<td width=150>' . $langs->trans("Label") . '</td>';
print '<td align="center">' . $langs->trans("JanuaryMin") . '</td>';
print '<td align="center">' . $langs->trans("FebruaryMin") . '</td>';
print '<td align="center">' . $langs->trans("MarchMin") . '</td>';
print '<td align="center">' . $langs->trans("AprilMin") . '</td>';
print '<td align="center">' . $langs->trans("MayMin") . '</td>';
print '<td align="center">' . $langs->trans("JuneMin") . '</td>';
print '<td align="center">' . $langs->trans("JulyMin") . '</td>';
print '<td align="center">' . $langs->trans("AugustMin") . '</td>';
print '<td align="center">' . $langs->trans("SeptemberMin") . '</td>';
print '<td align="center">' . $langs->trans("OctoberMin") . '</td>';
print '<td align="center">' . $langs->trans("NovemberMin") . '</td>';
print '<td align="center">' . $langs->trans("DecemberMin") . '</td>';
print '<td align="center"><b>Total</b></td>';
print '</tr>';
$sql = "SELECT bk.numero_compte AS 'compte',";
$sql .= " ROUND(SUM(IF(MONTH(bk.doc_date)=1,bk.montant,0)),2) AS 'Janvier',";

View File

@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
// Load translation files required by the page
$langs->loadLangs(array("accountancy", "bills", "compta"));
$action = GETPOST('action','aZ09');
@@ -554,8 +555,9 @@ if ($action == 'create')
*/
print "</table>\n";
print '</div></div>';
print '</div>';
print '</div></div><!-ee-->';
dol_fiche_end();
print '<div style="clear:both"></div>';
@@ -711,5 +713,6 @@ if ($action == 'create')
}
dol_fiche_end();
llxFooter();
$db->close();

View File

@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("accountancy"));
$action = GETPOST('action', 'alpha');
@@ -438,7 +439,7 @@ $button.= '</a>';
$groupby = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param.'">' . $langs->trans("GroupByAccountAccounting") . '</a>';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt");
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("NewAccountingMvt").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';

View File

@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("accountancy"));
$page = GETPOST("page");
@@ -255,7 +256,7 @@ if ($action == 'delbookkeepingyear') {
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
$viewflat = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param.'">' . $langs->trans("ViewFlatList") . '</a>';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt");
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle">' . $langs->trans("NewAccountingMvt").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';

View File

@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta"));
$action = GETPOST('action', 'aZ09');

View File

@@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta"));
$action = GETPOST('action', 'aZ09');

View File

@@ -27,6 +27,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("bills","accountancy"));
$action = GETPOST('action', 'alpha');

View File

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
// Langs
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","main","accountancy"));
// Security check
@@ -66,38 +66,53 @@ $year_current = $year_start;
$action = GETPOST('action','aZ09');
/*
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
@@ -128,26 +143,6 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilCustomer") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';

View File

@@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("bills","compta","accountancy","productbatch"));
$account_parent = GETPOST('account_parent');
@@ -168,9 +169,9 @@ print '<script type="text/javascript">
* Customer Invoice lines
*/
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.type, f.datef, f.ref_client,";
$sql.= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql.= " fd.situation_percent,";
$sql.= " co.label as country, s.tva_intra";
$parameters=array();
@@ -178,7 +179,7 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // N
$sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
@@ -342,8 +343,8 @@ if ($result) {
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->type;
$product_static->label = $objp->product_label;
$product_static->type = $objp->line_type;
print '<tr class="oddeven">';

View File

@@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("bills","compta","accountancy","other","productbatch"));
$action=GETPOST('action','alpha');
@@ -220,9 +220,9 @@ $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND l.product_type <= 2";
// Add search filter like

View File

@@ -31,6 +31,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("bills","accountancy","trips"));
$action = GETPOST('action', 'alpha');

View File

@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
// Langs
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","main","accountancy"));
// Security check
@@ -68,33 +68,48 @@ $action = GETPOST('action','aZ09');
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'expensereport WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "expensereport_det.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd, " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
$sql1 .= " AND erd.fk_code_ventilation = 0";
}
@@ -124,26 +139,6 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("ExpenseReportsVentilation") . "&nbsp;" . $textprevyear . "&nbsp;" . $langs->trans("Year") . "&nbsp;" . $year_start . "&nbsp;" . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilExpenseReport") . '<br>';
print $langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';

View File

@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","accountancy","trips","productbatch"));
$account_parent = GETPOST('account_parent','int');
@@ -101,10 +102,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
$db->begin();
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';

View File

@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("bills","compta","accountancy","other","trips","productbatch"));
$action=GETPOST('action','alpha');
@@ -193,7 +193,7 @@ $sql.= " aa.rowid as aarowid";
$sql.= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
// Add search filter like
if (strlen(trim($search_expensereport))) {

View File

@@ -26,6 +26,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
// Security check
@@ -75,7 +76,7 @@ if ($conf->accounting->enabled)
print "<br>\n";
$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";
$step++;

View File

@@ -56,6 +56,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT . '/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT . '/loan/class/paymentloan.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies","other","compta","banks","bills","donations","loan","accountancy","trips","salaries","hrm"));
// Multi journal
@@ -843,7 +844,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("FinanceJournal"));
$nom = $langs->trans("FinanceJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nom = $langs->trans("FinanceJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
$builddate=dol_now();
//$description = $langs->trans("DescFinanceJournal") . '<br>';
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
@@ -881,7 +882,7 @@ if (empty($action) || $action == 'view') {
print '<div class="tabsAction tabsActionNoBottom">';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if ($in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
else print '<a class="butActionRefused" name="writebookkeeping">' . $langs->trans("WriteBookKeeping") . '</a>';
print '</div>';

View File

@@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
// Load translation files required by the page
$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","trips","errors"));
$id_journal = GETPOST('id_journal', 'int');
@@ -525,7 +526,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("ExpenseReportsJournal"));
$nom = $langs->trans("ExpenseReportsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nom = $langs->trans("ExpenseReportsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
$nomlink = '';
$periodlink = '';
$exportlink = '';

View File

@@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
// Load translation files required by the page
$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors"));
$id_journal = GETPOST('id_journal', 'int');
@@ -712,7 +713,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("PurchasesJournal"));
$nom = $langs->trans("PurchasesJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nom = $langs->trans("PurchasesJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
$nomlink = '';
$periodlink = '';
$exportlink = '';
@@ -737,7 +738,7 @@ if (empty($action) || $action == 'view') {
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}

View File

@@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
// Load translation files required by the page
$langs->loadLangs(array("commercial", "compta","bills","other","accountancy","errors"));
$id_journal = GETPOST('id_journal', 'int');
@@ -643,7 +644,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("SellsJournal"));
$nom = $langs->trans("SellsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nom = $langs->trans("SellsJournal") . ' | ' . $accountingjournalstatic->getNomUrl(0,1,1,'',1);
$nomlink = '';
$periodlink = '';
$exportlink = '';
@@ -667,7 +668,7 @@ if (empty($action) || $action == 'view') {
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}

View File

@@ -31,6 +31,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("bills","accountancy"));
$action = GETPOST('action', 'alpha');

View File

@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
// Langs
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","main","accountancy"));
// Security check
@@ -69,33 +69,48 @@ $action = GETPOST('action','aZ09');
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture_fourn WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
@@ -125,26 +140,6 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . "&nbsp;" . $langs->trans("Year") . "&nbsp;" . $year_start . "&nbsp;" . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilSupplier") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';

View File

@@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","accountancy","productbatch"));
$account_parent = GETPOST('account_parent');
@@ -169,20 +170,19 @@ print '<script type="text/javascript">
* Supplier Invoice lines
*/
$sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql.= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql.= " aa.label, aa.account_number, ";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql.= " AND aa.rowid = l.fk_code_ventilation";
if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1);
}
@@ -348,8 +348,8 @@ if ($result) {
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->type;
$product_static->label = $objp->product_label;
$product_static->type = $objp->line_type;
print '<tr class="oddeven">';

View File

@@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("bills","compta","accountancy","other","productbatch"));
$action=GETPOST('action','alpha');
@@ -221,7 +221,7 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND l.product_type <= 2";
// Add search filter like

View File

@@ -151,7 +151,7 @@ if ($object->id > 0)
$newcardbutton = '';
if (! empty($conf->agenda->enabled))
{
$newcardbutton.='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction");
$newcardbutton.='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'"><span class="valignmiddle">'.$langs->trans("AddAction").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}

View File

@@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("companies","bills","members","users","other"));
$action=GETPOST('action','alpha');

View File

@@ -592,6 +592,7 @@ class Adherent extends CommonObject
$error++;
}
}
}
if (! $error && ! $notrigger)
{
@@ -600,7 +601,6 @@ class Adherent extends CommonObject
if ($result < 0) { $error++; }
// End call triggers
}
}
if (! $error)
{
@@ -2159,9 +2159,10 @@ class Adherent extends CommonObject
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf,$langs;
@@ -2180,7 +2181,7 @@ class Adherent extends CommonObject
$modelpath = "core/modules/member/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
@@ -2417,6 +2418,34 @@ class Adherent extends CommonObject
}
}
/**
* Return number of mass Emailing received by this member with its email
*
* @return int Number of EMailings
*/
function getNbOfEMailings()
{
$sql = "SELECT count(mc.email) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
$sql.= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes
$resql=$this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);
$nb=$obj->nb;
$this->db->free($resql);
return $nb;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/**
* Sets object to supplied categories.
*
@@ -2540,7 +2569,7 @@ class Adherent extends CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$adherent = new Adherent($this->db);
$formmail=new FormMail($db);
$formmail = new FormMail($this->db);
$i=0;
$nbok = 0;

View File

@@ -353,7 +353,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->adherent->creer)
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/card.php?action=create">'.$langs->trans('NewMember');
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewMember').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
@@ -379,7 +379,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
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

View File

@@ -189,7 +189,7 @@ if ($result)
$newcardbutton='';
if ($user->rights->adherent->cotisation->creer)
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/list.php?status=-1,1">'.$langs->trans('NewSubscription');
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/list.php?status=-1,1"><span class="valignmiddle">'.$langs->trans('NewSubscription').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}

View File

@@ -231,7 +231,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
$newcardbutton='';
if ($user->rights->adherent->configurer)
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/type.php?action=create">'.$langs->trans('NewMemberType');
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/type.php?action=create"><span class="valignmiddle">'.$langs->trans('NewMemberType').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}

View File

@@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$action=GETPOST('action','aZ09');
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminaccoutant'; // To manage different context of search
$langs->load("admin");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies'));
if (! $user->admin) accessforbidden();
@@ -90,7 +90,7 @@ $formcompany=new FormCompany($db);
$countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
print $langs->trans("AccountantDesc")."<br>\n";
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
print "<br>\n";
if ($action == 'edit' || $action == 'updateedit')

View File

@@ -31,9 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("agenda");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'agenda'));
$action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha');

View File

@@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("agenda");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'agenda'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@@ -86,7 +85,7 @@ dol_fiche_end();
if ($action != 'create' && $action != 'edit')
{
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>";
}
@@ -99,7 +98,7 @@ if ($action != 'create' && $action != 'edit')
if ($action == 'create')
{
print "<br>";
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';

View File

@@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (!$user->admin) accessforbidden();
$langs->load("agenda");
$langs->load("admin");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array('agenda', 'admin', 'other'));
$def = array();
$actiontest=GETPOST('test','alpha');

View File

@@ -34,9 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("agenda");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'agenda'));
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');

View File

@@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
if (!$user->admin)
accessforbidden();
// Load translation files required by the page
$langs->loadLangs(array("admin","other","agenda"));
$action = GETPOST('action','alpha');

View File

@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if (!$user->admin)
accessforbidden();
// Load translation files required by the page
$langs->loadLangs(array("admin","other","agenda"));
$def = array();

View File

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","companies","bills","other","banks"));
if (!$user->admin)

View File

@@ -30,8 +30,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("banks");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array('banks', 'admin'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@@ -82,7 +82,7 @@ dol_fiche_end();
if ($action != 'create' && $action != 'edit')
{
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>";
}
@@ -95,7 +95,7 @@ if ($action != 'create' && $action != 'edit')
if ($action == 'create')
{
print "<br>";
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';

View File

@@ -28,6 +28,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
// Load translation files required by the page
$langs->load("admin");
if (!$user->admin) accessforbidden();
@@ -368,7 +369,6 @@ if ($conf->produit->enabled)
}
$modBarCode = new $file();
$var = !$var;
print '<tr class="oddeven">';
print '<td>'.(isset($modBarCode->name)?$modBarCode->name:$modBarCode->nom)."</td><td>\n";

View File

@@ -28,8 +28,8 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
$langs->load("boxes");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'boxes'));
if (! $user->admin) accessforbidden();

View File

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","companies","bills","other","banks"));
if (!$user->admin)

View File

@@ -26,6 +26,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->load("admin");
if (!$user->admin) accessforbidden();

View File

@@ -36,10 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("orders");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'orders', 'other'));
if (! $user->admin) accessforbidden();

View File

@@ -40,8 +40,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$action=GETPOST('action','aZ09');
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search
$langs->load("admin");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies'));
if (! $user->admin) accessforbidden();
@@ -300,7 +300,7 @@ $head = company_admin_prepare_head();
dol_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company');
print $langs->trans("CompanyFundationDesc")."<br>\n";
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Modify"), $langs->transnoentities("Save"))."</span><br>\n";
print "<br>\n";
if ($action == 'edit' || $action == 'updateedit')

View File

@@ -29,9 +29,8 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load('admin');
$langs->load('compta');
$langs->load('accountancy');
// Load translation files required by the page
$langs->loadLangs(array('admin', 'compta', 'accountancy'));
if (!$user->admin)
accessforbidden();

View File

@@ -29,9 +29,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
$langs->load("admin");
$langs->load("sendings");
$langs->load("deliveries");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'sendings', 'deliveries'));
if (!$user->admin)
accessforbidden();

View File

@@ -27,6 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->load("admin");
if (! $user->admin)
@@ -36,11 +37,11 @@ $rowid=GETPOST('rowid','int');
$entity=GETPOST('entity','int');
$action=GETPOST('action','alpha');
$update=GETPOST('update','alpha');
$delete=GETPOST('delete'); // Do not use alpha here
$delete=GETPOST('delete','none'); // Do not use alpha here
$debug=GETPOST('debug','int');
$consts=GETPOST('const','array');
$constname=GETPOST('constname','alpha');
$constvalue=GETPOST('constvalue');
$constvalue=GETPOST('constvalue','none'); // We shoul dbe able to send everything here
$constnote=GETPOST('constnote','alpha');

View File

@@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","errors","contracts"));
if (!$user->admin) accessforbidden();

View File

@@ -25,6 +25,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("admin","other","agenda"));
if (!$user->admin)

View File

@@ -26,19 +26,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$langs->load("companies");
$langs->load("products");
$langs->load("admin");
$langs->load("sms");
$langs->load("other");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('companies', 'products', 'admin', 'sms', 'other', 'errors'));
if (!$user->admin) accessforbidden();
$id=GETPOST('rowid','int');
$action=GETPOST('action','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');

View File

@@ -27,6 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->load("admin");
if (! $user->admin) accessforbidden();

View File

@@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions"));
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
@@ -182,7 +183,7 @@ $tabsql[10]= "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.l
$tabsql[11]= "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = " . getEntity($tabname[12]);
$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = " . getEntity($tabname[13]);
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, label, accountancy_code, active FROM ".MAIN_DB_PREFIX."c_type_fees";
@@ -260,7 +261,7 @@ $tabfield[10]= "country_id,country,code,taux,localtax1_type,localtax1,localtax2_
$tabfield[11]= "element,source,code,libelle,position";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity";
$tabfield[13]= "code,libelle,type,entity";
$tabfield[14]= "code,libelle,price,organization,country_id,country";
$tabfield[14]= "code,label,price,organization,country";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle,sortorder";
$tabfield[17]= "code,label,accountancy_code";
@@ -299,7 +300,7 @@ $tabfieldvalue[10]= "country,code,taux,localtax1_type,localtax1,localtax2_type,l
$tabfieldvalue[11]= "element,source,code,libelle,position";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder";
$tabfieldvalue[13]= "code,libelle,type";
$tabfieldvalue[14]= "code,libelle,price,organization,country";
$tabfieldvalue[14]= "code,label,price,organization,country";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle,sortorder";
$tabfieldvalue[17]= "code,label,accountancy_code";
@@ -338,7 +339,7 @@ $tabfieldinsert[10]= "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,
$tabfieldinsert[11]= "element,source,code,libelle,position";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity";
$tabfieldinsert[13]= "code,libelle,type,entity";
$tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[14]= "code,label,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label,sortorder";
$tabfieldinsert[17]= "code,label,accountancy_code";
@@ -418,7 +419,7 @@ $tabcond[10]= true;
$tabcond[11]= (! empty($conf->societe->enabled));
$tabcond[12]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled));
$tabcond[13]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled));
$tabcond[14]= (! empty($conf->product->enabled) && ! empty($conf->ecotax->enabled));
$tabcond[14]= (! empty($conf->product->enabled) && (! empty($conf->ecotax->enabled) || ! empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
$tabcond[15]= true;
$tabcond[16]= (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
$tabcond[17]= (! empty($conf->deplacement->enabled) || ! empty($conf->expensereport->enabled));

View File

@@ -25,6 +25,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->load("admin");
if (! $user->admin) accessforbidden();

View File

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
if (!$user->admin)
accessforbidden();
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("users","admin","other"));
$action=GETPOST('action','aZ09');

View File

@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin", "sendings", "deliveries", "other"));
if (! $user->admin)

View File

@@ -35,10 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("sendings");
$langs->load("deliveries");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'sendings', 'deliveries'));
$extrafields = new ExtraFields($db);
@@ -89,7 +87,7 @@ dol_fiche_end();
if ($action != 'create' && $action != 'edit')
{
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>";
}
@@ -102,7 +100,7 @@ if ($action != 'create' && $action != 'edit')
if ($action == 'create')
{
print "<br>";
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';

View File

@@ -37,9 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("sendings");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'sendings'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@@ -89,7 +88,7 @@ dol_fiche_end();
if ($action != 'create' && $action != 'edit')
{
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>";
}
@@ -102,7 +101,7 @@ if ($action != 'create' && $action != 'edit')
if ($action == 'create')
{
print "<br>";
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';

View File

@@ -34,10 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("trips");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
if (! $user->admin) accessforbidden();

View File

@@ -33,10 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("errors");
$langs->load("trips");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
@@ -85,7 +83,7 @@ dol_fiche_end();
if ($action != 'create' && $action != 'edit')
{
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>";
}
@@ -98,7 +96,7 @@ if ($action != 'create' && $action != 'edit')
if ($action == 'create')
{
print "<br>";
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';

View File

@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","trips","errors","other","dict"));
if (!$user->admin) accessforbidden();

View File

@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","other","trips","errors","dict"));
if (!$user->admin) accessforbidden();

View File

@@ -31,9 +31,8 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
$langs->load("exports");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'exports'));
$langs->load('other');

View File

@@ -31,6 +31,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/rssparser.class.php';
// Load translation files required by the page
$langs->load("admin");
// Security check

View File

@@ -33,10 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("admin");
$langs->load("errors");
$langs->load('other');
$langs->load('bills');
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'other', 'bills'));
if (! $user->admin) accessforbidden();

View File

@@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/doleditor.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->load("admin");
$langs->load("fckeditor");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'fckeditor'));
$action = GETPOST('action','alpha');
// Possible modes are:

View File

@@ -34,10 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("interventions");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'interventions', 'other'));
if (! $user->admin) accessforbidden();

View File

@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php';
if (!$user->admin)
accessforbidden();
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","errors"));
$action = GETPOST('action','aZ09');

521
htdocs/admin/holiday.php Normal file
View File

@@ -0,0 +1,521 @@
<?php
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/contract.php
* \ingroup contract
* \brief Setup page of module Contracts
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("holiday");
if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='contract';
if (empty($conf->global->HOLIDAY_ADDON))
{
$conf->global->HOLIDAY_ADDON='mod_holiday_madona';
}
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask')
{
$maskconst = GETPOST('maskconstholidaty','alpha');
$maskvalue = GETPOST('maskholiday','alpha');
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
else if ($action == 'specimen') // For contract
{
$modele= GETPOST('module','alpha');
$contract = new Contrat($db);
$contract->initAsSpecimen();
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir)
{
$file=dol_buildpath($reldir."core/modules/holiday/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
if ($filefound)
{
require_once $file;
$module = new $classname($db);
if ($module->write_file($contract,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");
return;
}
else
{
setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
else
{
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
}
// Activate a model
else if ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
else if ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->HOLIDAY_ADDON_PDF == "$value") dolibarr_del_const($db, 'HOLIDAY_ADDON_PDF',$conf->entity);
}
}
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->HOLIDAY_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
else if ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity);
}
else if ($action == 'set_other')
{
$freetext= GETPOST('HOLIDAY_FREE_TEXT','none'); // No alpha here, we want exact string
$res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$draft= GETPOST('HOLIDAY_DRAFT_WATERMARK','alpha');
$res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res1 > 0 || ! $res2 > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/*
* View
*/
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader();
$form=new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("HolidaySetup"),$linkback,'title_setup');
$head=holiday_admin_prepare_head();
dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday');
/*
* Holiday Numbering model
*/
print load_fiche_titre($langs->trans("HolidaysNumberingModules"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/holiday/");
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 12) == 'mod_holiday_' && substr($file, dol_strlen($file)-3, 3) == 'php')
{
$file = substr($file, 0, dol_strlen($file)-4);
require_once $dir.$file.'.php';
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->isEnabled())
{
print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
// Show example of numbering model
print '<td class="nowrap">';
$tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; }
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
else print $tmp;
print '</td>'."\n";
print '<td align="center">';
if ($conf->global->HOLIDAY_ADDON == "$file")
{
print img_picto($langs->trans("Activated"),'switch_on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a>';
}
print '</td>';
$holiday=new Holiday($db);
$holiday->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$contract);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) {
if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>';
} else {
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
}
}
}
closedir($handle);
}
}
}
print '</table><br>';
/*
* Documents models for Contracts
*/
print load_fiche_titre($langs->trans("TemplatePDFHolidays"),'','');
// Defini tableau def des modeles
$def = array();
$sql = "SELECT nom";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql);
if ($resql)
{
$i = 0;
$num_rows=$db->num_rows($resql);
while ($i < $num_rows)
{
$array = $db->fetch_array($resql);
array_push($def, $array[0]);
$i++;
}
}
else
{
dol_print_error($db);
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
{
$dir = dol_buildpath($reldir."core/modules/holiday".$valdir);
if (is_dir($dir))
{
$handle=opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
$filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{
if (file_exists($dir.'/'.$file))
{
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
require_once $dir.'/'.$file;
$module = new $classname($db);
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{
$var = !$var;
print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print '</td>';
// Active
if (in_array($name, $def))
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print '</td>';
}
else
{
print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Defaut
print '<td align="center">';
if ($conf->global->HOLIDAY_ADDON_PDF == $name)
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf')
{
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
}
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'contract').'</a>';
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print "</tr>\n";
}
}
}
}
}
}
}
}
print '</table>';
print "<br>";
/*
* Other options
*
*/
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_other">';
print load_fiche_titre($langs->trans("OtherOptions"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=true;
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';
$var=! $var;
print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
print '<br>';
$variablename='HOLIDAY_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
}
else
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
print $doleditor->Create();
}
print '</td></tr>'."\n";
//Use draft Watermark
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
print '</td><td>';
print '<input size="50" class="flat" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
print '</table>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
dol_fiche_end();
llxFooter();
$db->close();

View File

@@ -32,16 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$langs->load("admin");
$langs->load("languages");
$langs->load("other");
$langs->load("companies");
$langs->load("products");
$langs->load("members");
$langs->load("projects");
$langs->load("hrm");
$langs->load("agenda");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'projects', 'hrm', 'agenda'));
if (! $user->admin) accessforbidden();

View File

@@ -24,8 +24,8 @@
require '../main.inc.php';
$langs->load("admin");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies'));
if (!$user->admin) accessforbidden();

View File

@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
// Load translation files required by the page
$langs->load("admin");
if (!$user->admin)

View File

@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","errors"));
if (!$user->admin)

View File

@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin","errors"));
if (!$user->admin)

View File

@@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
$langs->load("admin");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors'));
if (!$user->admin)
accessforbidden();

View File

@@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
$langs->load("admin");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors'));
if (!$user->admin)
accessforbidden();

View File

@@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
$langs->load("admin");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors'));
if (!$user->admin)
accessforbidden();

View File

@@ -26,9 +26,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
$langs->load("companies");
$langs->load("products");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array('companies', 'products', 'admin'));
if (! $user->admin) accessforbidden();

View File

@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
// Load traductions files requiredby by page
// Load translation files required by the page
$langs->loadLangs(array("admin", "sendings", "deliveries", "other"));
if (!$user->admin) accessforbidden();

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