Merge remote-tracking branch 'Dolibarr/develop' into 14

This commit is contained in:
Francis Appels 2021-06-21 16:51:19 +02:00
commit 5fa5508490
201 changed files with 3935 additions and 2102 deletions

View File

@ -9,6 +9,9 @@ dist: xenial
language: php
git:
depth: 1
# Start on every boot
services:
- memcached
@ -264,24 +267,27 @@ script:
echo
- |
echo "Checking PHP syntax errors"
echo "Checking PHP syntax errors (only 1 version to not overload travis and avoid duplicate tests)"
# Ensure we catch errors
set -e
#parallel-lint --exclude htdocs/includes --blame .
parallel-lint --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
# Exclusions are defined in the ruleset.xml file
if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
fi
set +e
echo
- |
echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)"
echo "Checking coding style (only for Pull Requests builds and 1 version to not overload travis and avoid duplicate tests)"
# Ensure we catch errors
set -e
# Exclusions are defined in the ruleset.xml file
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
fi
set +e
@ -401,8 +407,12 @@ script:
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade13001400.log
php upgrade2.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-2.log
php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log
ls -alrt $TRAVIS_BUILD_DIR/
- |
echo "Enabling new modules"
# Enable modules not enabled into original dump
cd htdocs/install
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log

145
ChangeLog
View File

@ -10,29 +10,16 @@ For users:
NEW: Module Recruitement to follow application to job positions is now stable.
NEW: Feature to make Stock Inventories
NEW: Several security issues after a second private bug hunting campaign.
NEW: Add a security center page with all information and advices related to the security of your instance
NEW: Add a performance center page with all information and advices related to the performance of your instance
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
NEW: All main menu entries are using the picto of the module
NEW: Add a copy to clipboard button on some fields
NEW: Add an example of scheduled job to send email reminder for unpaid invoices
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
NEW: Accountancy - In ledger & journals, show link on bank transaction
NEW: Accountancy - Possibility to filter on journals in balance
NEW: Accountancy - Add a page to list subledger accounts
NEW: add the Channel column into the list of orders
NEW: Add a check to avoid an invoice date in the future
NEW: Add some color and picto for the direction of movement
NEW: add the column "Channel" into the list of orders
NEW: Add the column "alias" of company in the list of proposal, order, invoice
NEW: Add the column "Office phone" and "User mobile" in user list
NEW: Add the column "Price level"in thirdparty list
NEW: Add the column "Price level" in thirdparty list
NEW: Add some company information in the dropdown login menu
NEW: Add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: Add contact tag and bulk email status on the thirdparty + contact create form
NEW: Support down payment on supplier invoice (& somes ajustments)
NEW: Add edit/delete action icons on categories list pages
NEW: Add hidden option to auto load input line extrafield into new lines
NEW: Add import profile to import BOM
@ -40,29 +27,21 @@ NEW: Add link picto to the stock movement on the detail of production
NEW: Add mass action "Set tag" for product/service, user, thirdparty, warehouse, project, bank account, members
NEW: Add bulk action Validate and Set to billed on order list.
NEW: Add possibility to exports userGroups fields on user exports
NEW: Add price min and price min including tax into product export
NEW: Can search on lots or serials into the quick search bar
NEW: Add support for Friday as a non working day
NEW: Add a total in page of margin by user
NEW: Add the total of margin in invoice list
NEW: auto notification with module Notification can use templated emails
NEW: Bank Entries : display user linked to a salary or a taxes
NEW: Can clone a cron job
NEW: Can create a lot from the list view (Look and feel standardization).
NEW: Can filter on extrafields date on lists
NEW: Can filter on rowid in list of blocked logs
NEW: Can hide columns "time consumed" on timesheet per week
NEW: Can set an employee on each social contribution
NEW: Can set a percentage when creating an invoice from another object
NEW: Can set order of execution of hooks
NEW: Can show the leave dates/holidays on the agenda view
NEW: Can toggle FCKeditor on public/private notes
NEW: Check update availability for externals modules using a button on module page
NEW: Choose lines to use while creating intervention card from origin
NEW: Columns shipment method, payment mode, payment term in proposal and order list
NEW: Conf for default actioncomm status
NEW: customer ref for product customer prices
NEW: date and user signature on proposal (Issue 16062) #16980
NEW: Dictionary for availability - Add a column position
NEW: Can set a user related to a social contribution
NEW: ICS Direct debit can be set with a different value for each bank account
@ -70,18 +49,13 @@ NEW: LDAP: usergroup search can be filtered
NEW: Make public bookmarks editable by admin users only
NEW: If main logo not defined, can use the squarred logo on login page
NEW: The manifest file can use the squared image if available
NEW: Add bulk actions for Bank Transfer
NEW: Enhance the multicurrency rate editor
NEW: Multiselect ledger account code filter on book keeping list
NEW: Normalyse Type company field with ajax combobox
NEW: preload product description on selection for customer propal/order/invoice
NEW: Add a ref in product customer price
NEW: Search usergroups & resources
NEW: Set status of all variants when changing status of parent
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
NEW: Show picto of module into the list of dictionaries
NEW: Show the total of payment on the payment confirmation page
NEW: Support color for types of event
NEW: The global setup for Mandatory fields can now be done on combo list too.
NEW: translate in "en_US" to complete PR 16980
NEW: Update the list of taxes available by default for France
@ -89,26 +63,63 @@ NEW: Salary payment request and Salary payment are 2 different steps in workflow
NEW: VAT payment request and VAT payment are now 2 different steps in workflow on VAT payment recording
NEW: VAT report - Optimisation & collapse by rate
NEW: When a doc file is shared, link is visible from the main page of doc.
NEW: #16378 More E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page
NEW: #16378 more E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
Accountancy
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
NEW: Accountancy - In ledger & journals, show link on bank transaction
NEW: Accountancy - Possibility to filter on journals in balance
NEW: Accountancy - Add a page to list subledger accounts
NEW: Multiselect ledger account code filter on book keeping list
Agenda
NEW: add support for Friday as a non working day
NEW: can show the leave dates/holidays on the agenda view
NEW: Support color for types of event
Bank
NEW: Bank Entries : display user linked to a salary or a taxes
NEW: Add bulk actions for Bank Transfer
ECM/GED
NEW: Add db fields note_public and note_private for ECM module
NEW: Can filter files in GED on status Shared/Not shared
NEW: add DB fields note_public and note_private for ECM module
NEW: can filter files in ECM/GED on status Shared / Not shared
Invoices
NEW: add a check to avoid an invoice date in the future
NEW: add the total of margin in invoice list
NEW: can set a percentage when creating an invoice from another object
NEW: Support down payment on supplier invoice (& somes ajustments)
Margin
NEW: add the total of margin in invoice list
NEW: add the total of margin in page by user
Members
NEW: #17292 default subscription amount by adherent type
NEW: Option to automatically create a login/user when a new subscription of a member is done online
NEW: option to automatically create a login/user when a new subscription of a member is done online
NEW: option to select membership type on the online payment page for membership subscription or renewal
Products
NEW: Add price min and price min including tax into product export
NEW: Add a ref in product customer price
NEW: customer ref for product customer prices
NEW: Set status of all variants when changing status of parent
Projects/Tasks
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
NEW: can show the project ref into PDF documents
NEW: when we add contacts/users to a project, ask to also affect them on tasks
NEW: Can hide columns "time consumed" on timesheet per week
Proposals
NEW: add bulk action to set a commercial proposal to status "Refused"
NEW: can set a warehouse in a proposal
NEW: date and user signature on proposal (Issue 16062) #16980
Shipment
NEW: add option in Workflow module to set a shipment as closed
@ -121,18 +132,20 @@ NEW: edit sales lines rights in TakePOS
NEW: option for TakePOS to show the total price without tax
NEW: more permissions in TakePOS (can edit added line, can modify once order sent to kitchen)
Third-Parties
NEW: Can set a Warehouse on a Thirdparty
Third Party / Contacts
NEW: add contact tag and bulk email status on the thirdparty + contact create form
NEW: can set a warehouse on a thirdparty
Tickets
NEW: can use captcha on public page to create a ticket #16347
NEW: can set if a ticket group is visible on public interface or not
Warehouse
NEW: Can make massive stock transfers from a CSV file
NEW: Stock movement list - Add more complete date field
NEW: Can set a Warehouse on a Thirdparty
Warehouse/Stock
NEW: Feature to make Stock Inventories
NEW: can make massive stock transfers from a CSV file
NEW: Stock movement list - add more complete date field
NEW: can set a warehouse in a proposal
NEW: can set a warehouse on a thirdparty
Website Module
NEW: #17113 Can upload a favicon in website module
@ -140,49 +153,63 @@ NEW: add a new permission "Export website"
NEW: add last date of modification for website pages in the list of pages
NEW: Save old page with .old extension on disk when editing a website page
new Modules
Workflows
NEW: add option in Workflow module to set a shipment as closed
for Admins
NEW: Add a security center page with all information and advices related to the security of your instance
NEW: Add a performance center page with all information and advices related to the performance of your instance
Modules
NEW: Module Recruitement is now stable
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
NEW: start new experimental module Workstations Management
NEW: Check update availability for externals modules using a button on module page
Module SimplePOS is deprecated - TakePOS is recommended for the future
new Options
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: Add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
For developers:
---------------
NEW: Can edit an object property in module builder
NEW: hook printFieldListTitle for cabyprodserv.php
NEW: Hook to allow external modules to add their own shortlist of recent objects
NEW: SQL-altering hooks in the turnover by product report
NEW: Add data-eec=1 for EEC countries on select for js interaction
NEW: Add experimental repair script to switch to dynamic row format and utf8mb4 encoding
NEW: add form confirm hook on company card
NEW: Add function showValueWithClipboardCPButton() to add a copy/paste
NEW: Add hook addSectionECMAuto method to add custom diretory into ECM auto files
NEW: Add native compression in rest apis
NEW: Product Variants API, add variant stock to response by parameter
NEW: Upgrade Stripe PHP lib to 7.67.0
NEW: Add link to OpenAPI specifications xml file in REST API module setup: swagger.json file can be included into external tools like redoc
NEW: Support sepa_debit in stripe paymentmethods list
NEW: Update doleditor.class.php for easily activate SCAYT
NEW: Add triggers in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
NEW: Add triggers OBJECT_LINK_INSERT, OBJECT_LINK_UPDATE et OBJECT_LINK_DELETE in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
NEW: Can set a target image in dolcropresize function.
NEW: Can set a label as placeholder for combo lists.
NEW: can set a target image in dolcropresize function
NEW: can set a label as placeholder for combo lists
NEW: Add pagination on Get Products response API
NEW: Add the DefaultValues CRUD class
NEW: Extrafields of documents lines are inside the lines, not any more on separate TR
NEW: unit selection on object edit line
NEW: #13739 #17390 Product API route added to get product stock and product with or without variants
APIs
NEW: API Add option $includeifobjectisused to get a product
NEW: API Get the list of product ids only
NEW: API add option $includeifobjectisused to get a product
NEW: API get the list of product ids only
NEW: add link to OpenAPI specifications XML file in REST API module setup: swagger.json file can be included into external tools like redoc
NEW: add native compression in REST APIs
NEW: Product Variants API, add variant stock to response by parameter
NEW: Product API route added to get product stock and product with or without variants #13739 #17390
Hooks
NEW: hook printFieldListTitle for cabyprodserv.php
NEW: hook to allow external modules to add their own shortlist of recent objects
NEW: SQL-altering hooks in the turnover by product report
NEW: add form confirm hook on company card
NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files
WARNING:
@ -198,6 +225,7 @@ Following changes may create regressions for some external modules, but were nec
* If your database is MySQL or MariaDB, you need at least version 5.1
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
@ -209,6 +237,8 @@ FIX: #17060
FIX: #17192 - With tz < 0, event is show in bad day on calendar views
FIX: #17363
FIX: #17476 releve.php: Fix SQL statement
FIX: #17967
Fix: #17906 : fix access denied
FIX: Accountancy - Import in general ledger
FIX: Accountancy - Quadra export - wrong data on credit
FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries
@ -255,7 +285,6 @@ FIX: test must be === and not ==
FIX: test on link type
FIX: type link extrafield case for advanced target emailing
FIX: Write right on document
>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
***** ChangeLog for 13.0.2 compared to 13.0.1 *****

View File

@ -202,9 +202,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### System Environment / Requirements
- Works with PHP 5.6+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
- PHP
- MariaDB, MySQL or PostgreSQL
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)
### Extending

View File

@ -388,7 +388,7 @@ if ($action != 'export_csv') {
} elseif (empty($tmparrayforrootaccount['label'])) {
// $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent.
// This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent.
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so shoule not show a link to create another account.
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so should not show a link to create another account.
// BUG 2: Adding a link to create a new accounting account here is useless because it is not add as parent of the orphelin.
//$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
}
@ -429,7 +429,7 @@ if ($action != 'export_csv') {
print '<tr class="oddeven">';
print '<td>'.$accounting_account.'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowraponall right">'.price($opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
}
$urlzoom = '';
@ -466,7 +466,7 @@ if ($action != 'export_csv') {
if (!empty($show_subgroup)) {
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
}
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
@ -486,9 +486,9 @@ if ($action != 'export_csv') {
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
} else {
print '<td class="nowrap right">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
}
print "<td></td>\n";
print '</tr>';

View File

@ -12,7 +12,7 @@
* 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/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
@ -124,7 +124,11 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting-
$form = new Form($db);
$formaccounting = new FormAccounting($db);
llxHeader('', $langs->trans("Closure"));
$title = $langs->trans('Closure');
$help_url ='EN:Module_Double_Entry_Accounting';
llxHeader('', $title, $help_url);
if ($action == 'validate_movements') {
$form_question = array();

View File

@ -141,6 +141,9 @@ if ($action == 'validatehistory') {
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
}
$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";

View File

@ -495,7 +495,7 @@ if ($result) {
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
@ -703,13 +703,13 @@ if ($result) {
print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'customer').'</td>';
// Country
print '<td>';
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
print $labelcountry;
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelcountry).'">';
print dol_escape_htmltag($labelcountry);
print '</td>';
// VAT Num
print '<td>'.$objp->tva_intra.'</td>';
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($objp->tva_intra).'">'.dol_escape_htmltag($objp->tva_intra).'</td>';
// Found accounts
print '<td class="small">';

View File

@ -149,6 +149,9 @@ if ($action == 'validatehistory') {
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
}
$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";

View File

@ -482,7 +482,7 @@ if ($result) {
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
print '<td class="liste_titre">';
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1);
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1, null, 1);
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
@ -503,7 +503,7 @@ if ($result) {
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
@ -687,13 +687,13 @@ if ($result) {
print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'supplier').'</td>';
// Country
print '<td>';
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
print $labelcountry;
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelcountry).'">';
print dol_escape_htmltag($labelcountry);
print '</td>';
// VAT Num
print '<td>'.$objp->tva_intra.'</td>';
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($objp->tva_intra).'">'.dol_escape_htmltag($objp->tva_intra).'</td>';
// Found accounts
print '<td class="small">';

View File

@ -1727,15 +1727,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
print '<tr><td>'.$langs->trans("Password").'</td><td>';
if ($object->pass) {
print preg_replace('/./i', '*', $object->pass);
} else {
if ($user->admin) {
print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
} else {
print $langs->trans("Hidden");
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
}
print '<span class="opacitymedium"'.$langs->trans("Hidden").'</span>';
}
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
$langs->load("errors");

View File

@ -92,7 +92,7 @@ class AdherentStats extends Stats
$sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)";
$sql .= " FROM ".$this->from;
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
$sql .= " AND ".$this->where;
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
@ -133,7 +133,7 @@ class AdherentStats extends Stats
$sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")";
$sql .= " FROM ".$this->from;
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
$sql .= " AND ".$this->where;
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
@ -154,7 +154,7 @@ class AdherentStats extends Stats
$sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")";
$sql .= " FROM ".$this->from;
//if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
$sql .= " AND ".$this->where;
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');

View File

@ -144,23 +144,23 @@ print '</td></tr>'."\n";
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
print '<input name="tel" id="phone" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
print '<input name="tel" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
print '</td></tr>'."\n";
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
print '<input name="fax" id="fax" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
print '<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
print '</td></tr>'."\n";
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
print '<input name="mail" id="email" class="minwidth200" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
print '<input name="mail" id="email" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
print '</td></tr>'."\n";
// Web
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
print '<input name="web" id="web" class="minwidth300" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
print '<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
print '</td></tr>'."\n";
// Code

View File

@ -3,6 +3,7 @@
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -158,14 +159,6 @@ print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action
print '<span class="opacitymedium">'.$langs->trans("AgendaExtSitesDesc")."</span><br>\n";
print "<br>\n";
$selectedvalue = $conf->global->AGENDA_DISABLE_EXT;
if ($selectedvalue == 1) {
$selectedvalue = 0;
} else {
$selectedvalue = 1;
}
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
@ -226,15 +219,15 @@ while ($i <= $MAXAGENDA) {
// Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb", $key)."</td>";
// Name
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : $conf->global->$name).'" size="28"></td>';
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : getDolGlobalString($name)).'" size="28"></td>';
// URL
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : $conf->global->$src).'" size="60"></td>';
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : getDolGlobalString($src)).'" size="60"></td>';
// Offset TZ
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ?GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : $conf->global->$offsettz).'" size="2"></td>';
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : getDolGlobalString($offsettz)).'" size="2"></td>';
// Color (Possible colors are limited by Google)
print '<td class="nowrap right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : $conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
print '</td>';
print "</tr>";
$i++;

View File

@ -422,7 +422,7 @@ foreach ($boxactivated as $key => $box) {
$hasnext = ($key < (count($boxactivated) - 1));
$hasprevious = ($key != 0);
print '<td class="center">'.($key + 1).'</td>';
print '<td class="center">';
print '<td class="center nowraponall">';
print ($hasnext ? '<a class="reposition" href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key + 1]->rowid.'">'.img_down().'</a>&nbsp;' : '');
print ($hasprevious ? '<a class="reposition" href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key - 1]->rowid.'">'.img_up().'</a>' : '');
print '</td>';

View File

@ -418,7 +418,7 @@ print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SO
// Country
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
print $form->select_country($mysoc->country_id, 'country_id');
print $form->select_country($mysoc->country_id, 'country_id', '', 0);
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
@ -441,25 +441,25 @@ print '</td></tr>'."\n";
// Phone
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
print '<input name="tel" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('tel') ? GETPOST('tel', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL : ''))).'"></td></tr>';
print '<input class="maxwidth150 widthcentpercentminusx" name="tel" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('tel') ? GETPOST('tel', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL : ''))).'"></td></tr>';
print '</td></tr>'."\n";
// Fax
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
print '<input name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX : ''))).'"></td></tr>';
print '<input class="maxwidth150" name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX : ''))).'"></td></tr>';
print '</td></tr>'."\n";
// Email
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
print '<input class="maxwidth150" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
print '</td></tr>'."\n";
// Web
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
print '<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
print '</td></tr>'."\n";
// Barcode
@ -467,19 +467,19 @@ if (!empty($conf->barcode->enabled)) {
print '<tr class="oddeven"><td>';
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
print '<span class="fa paddingright fa-barcode"></span>';
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag((GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE : ''))).'"></td></tr>';
print '<input name="barcode" id="barcode" class="minwidth150 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE : ''))).'"></td></tr>';
print '</td></tr>';
}
// Logo
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo" id="logo" accept="image/*">';
print '</div>';
if (!empty($mysoc->logo_small)) {
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
print '<img style="max-height: 80px; max-width: 200px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
print '</div>';
} elseif (!empty($mysoc->logo)) {
if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
@ -487,10 +487,12 @@ if (!empty($mysoc->logo_small)) {
}
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_small', $quality);
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
print '<img style="max-height: 80px; max-width: 200px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
print '</div>';
}
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
print '<div class="inline-block valignmiddle marginrightonly">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a>';
print '</div>';
} elseif (!empty($mysoc->logo)) {
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
print '<div class="inline-block valignmiddle">';
@ -508,8 +510,8 @@ print '</td></tr>';
// Logo (squarred)
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
print '<div class="centpercent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo_squarred" id="logo_squarred" accept="image/*">';
print '</div>';
if (!empty($mysoc->logo_squarred_small)) {
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) {
@ -551,20 +553,21 @@ print '</table>';
print '<br>';
// IDs of the company (country-specific)
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield wordbreak">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
$langs->load("companies");
// Managing Director(s)
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
// GDPR contact
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
print '</td><td>';
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'nohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'nohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
// Capital
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
@ -656,6 +659,7 @@ print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows=
print '</td></tr>';
print '</table>';
print '</div>';
// Fiscal year start

View File

@ -104,6 +104,8 @@ print '<input type="hidden" name="action" value="update">';
// Social networks
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
@ -116,17 +118,18 @@ foreach ($listofnetworks as $key => $value) {
print '<td><label for="'.$key.'url">'.$langs->trans(ucfirst($key)).'</label></td>';
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
print '<td class="nowraponall"><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ? dol_escape_htmltag($conf->global->$networkconstname) : '').'">';
print '</td><td>';
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.(!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : '').'">';
print '</td>';
print '<td>'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
print '<td class="nowraponall">'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
print '</tr>'."\n";
}
}
print "</table>";
print '</div>';
print '<br>';

View File

@ -86,13 +86,14 @@ print '<td class="center" width="20">&nbsp;</td>';
print '<td class="center" width="100"></td>'."\n";
print '</tr>';
// Example with a yes / no select
/* No more need for this, you can set that a profile is public when saving it.
print '<tr class="oddeven">';
print '<td>'.$langs->trans("EXPORTS_SHARE_MODELS").'</td>';
print '<td class="center" width="20">&nbsp;</td>';
print '<td class="center" width="100">';
print ajax_constantonoff('EXPORTS_SHARE_MODELS');
print '</td></tr>';
*/
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';

View File

@ -476,7 +476,7 @@ $disabled = '';
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
$disabled = ' disabled="disabled"';
}
print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground"'.$disabled.'>';
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"'.$disabled.'>';
if ($disabled) {
print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
}
@ -484,7 +484,7 @@ if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
print ' &nbsp; ';
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
}
} else {
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';

View File

@ -255,11 +255,13 @@ print '<td colspan="3">'.$langs->trans("ForANonAnonymousAccess").'</td>';
print "</tr>\n";
// DNAdmin
print '<!-- LDAP_ADMIN_DN -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPAdminDn").'</td><td>';
print '<input size="25" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
// Pass
print '<!-- LDAP_ADMIN_PASS -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test

View File

@ -155,14 +155,16 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeContacts").'</td>';
print "</tr>\n";
// DN Pour les contacts
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPContactDn").'</span></td><td>';
print '<!-- LDAP_CONTACT_DN -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPContactDn").'</span></td><td>';
print '<input size="48" type="text" name="contactdn" value="'.$conf->global->LDAP_CONTACT_DN.'">';
print '</td><td>'.$langs->trans("LDAPContactDnExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPContactObjectClassList").'</span></td><td>';
print '<!-- LDAP_CONTACT_OBJECT_CLASS -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPContactObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_CONTACT_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPContactObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
@ -173,7 +175,7 @@ print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
print "</tr>\n";

View File

@ -99,6 +99,8 @@ if ($action == 'setvalue' && $user->admin) {
* View
*/
$form = new Form($db);
llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:M&oacute;dulo_LDAP');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
@ -121,8 +123,6 @@ print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$form = new Form($db);
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -130,20 +130,23 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeGroups").'</td>';
print "</tr>\n";
// DN pour les groupes
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPGroupDn").'</span></td><td>';
print '<!-- LDAP_GROUP_DN -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPGroupDn").'</span></td><td>';
print '<input size="48" type="text" name="group" value="'.$conf->global->LDAP_GROUP_DN.'">';
print '</td><td>'.$langs->trans("LDAPGroupDnExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPGroupObjectClassList").'</span></td><td>';
print '<!-- LDAP_GROUP_OBJECT_CLASS -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPGroupObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_GROUP_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPGroupObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Filter, used to filter search
print '<!-- LDAP_GROUP_FILTER -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
print '<input size="48" type="text" name="filter" value="'.$conf->global->LDAP_GROUP_FILTER.'">';
print '</td><td>'.$langs->trans("LDAPGroupFilterExample").'</td>';
@ -151,11 +154,13 @@ print '<td></td>';
print '</tr>';
print '</table>';
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
print "</tr>\n";

View File

@ -200,20 +200,23 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeMembers").'</td>';
print "</tr>\n";
// DN Pour les adherents
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberDn").'</span></td><td>';
print '<!-- LDAP_MEMBER_DN -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberDn").'</span></td><td>';
print '<input size="48" type="text" name="user" value="'.$conf->global->LDAP_MEMBER_DN.'">';
print '</td><td>'.$langs->trans("LDAPMemberDnExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberObjectClassList").'</span></td><td>';
print '<!-- LDAP_MEMBER_OBJECT_CLASS -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_MEMBER_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPMemberObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Filter, used to filter search
print '<!-- LDAP_MEMBER_FILTER -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_MEMBER_FILTER.'">';
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
@ -225,7 +228,7 @@ print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
print "</tr>\n";

View File

@ -124,25 +124,29 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeMembersTypes").'</td>';
print "</tr>\n";
// DN pour les types de membres
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeDn").'</span></td><td>';
print '<!-- LDAP_MEMBER_TYPE_DN -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeDn").'</span></td><td>';
print '<input size="48" type="text" name="membertype" value="'.$conf->global->LDAP_MEMBER_TYPE_DN.'">';
print '</td><td>'.$langs->trans("LDAPMemberTypepDnExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeObjectClassList").'</span></td><td>';
print '<!-- LDAP_MEMBER_TYPE_OBJECT_CLASS -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPMemberTypeObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
print '</table>';
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
print "</tr>\n";

View File

@ -190,20 +190,23 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeUsers").'</td>';
print "</tr>\n";
// DN Pour les utilisateurs
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPUserDn").'</span></td><td>';
print '<!-- LDAP_USER_DN -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserDn").'</span></td><td>';
print '<input size="48" type="text" name="user" value="'.$conf->global->LDAP_USER_DN.'">';
print '</td><td>'.$langs->trans("LDAPUserDnExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPUserObjectClassList").'</span></td><td>';
print '<!-- LDAP_USER_OBJECT_CLASS -->';
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_USER_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPUserObjectClassListExample").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
// Filter, used to filter search
print '<!-- LDAP_FILTER_CONNECTION -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_FILTER_CONNECTION.'">';
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
@ -215,7 +218,7 @@ print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
print "</tr>\n";

View File

@ -314,14 +314,14 @@ if ($conf->use_javascript_ajax) {
$entry .= '<a class="editfielda marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
$entry .= '<a class="marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
$entry .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
$entry .= '&nbsp; &nbsp; &nbsp;';
$entry .= '&nbsp; ';
$entry .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
$entry .= '</td></tr></table>';
$buttons = '<a class="editfielda marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
$buttons .= '<a class="marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
$buttons .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
$buttons .= '&nbsp; &nbsp; &nbsp;';
$buttons .= '&nbsp; ';
$buttons .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
$data[] = array(

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/admin/perms.php
* \ingroup core
* \brief Page d'administration/configuration des permissions par defaut
* \brief Page to setup default permissions of a new user
*/
require '../main.inc.php';
@ -64,6 +64,7 @@ if ($action == 'remove') {
*/
$wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
llxHeader('', $langs->trans("DefaultRights"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
@ -121,15 +122,15 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Module").'</td>';
print '<td class="center">'.$langs->trans("Default").'</td>';
print '<td class="center">&nbsp;</td>';
print '<td class="center" width="24">&nbsp;</td>';
print '<td>'.$langs->trans("Permissions").'</td>';
if ($user->admin) {
print '<td class="right">'.$langs->trans("ID").'</td>';
print '<td class="right"></td>';
}
print '</tr>'."\n";
//print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS;
$sql = "SELECT r.id, r.libelle as label, r.module, r.module_position, r.perms, r.subperms, r.bydefault";
$sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault";
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
$sql .= " AND r.entity = ".((int) $entity);
@ -147,21 +148,32 @@ if ($result) {
while ($i < $num) {
$obj = $db->fetch_object($result);
// If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it
// If line is for a module that does not exist anymore (absent of includes/module), we ignore it
if (empty($modules[$obj->module])) {
$i++;
continue;
}
// Save field module_position in database if value is still zero
if (empty($obj->module_position)) {
$objMod = $modules[$obj->module];
// Save field module_position in database if value is wrong
if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) {
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) {
// TODO Define familyposition
$family = (!empty($modules[$obj->module]->family_position) ? $modules[$obj->module]->family_position : '');
//$familyposition = $modules[$obj->module]->family_position;
$familyposition = 0;
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $modules[$obj->module]->module_position).",";
$newmoduleposition = $modules[$obj->module]->module_position;
// Correct $newmoduleposition position for external modules
$objMod = $modules[$obj->module];
if (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $newmoduleposition < 100000) {
$newmoduleposition += 100000;
}
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $newmoduleposition).",";
$sqlupdate .= " family_position = ".((int) $familyposition);
$sqlupdate .= " WHERE module_position = 0 AND module = '".$db->escape($obj->module)."'";
$sqlupdate .= " WHERE module_position = ".((int) $obj->module_position)." AND module = '".$db->escape($obj->module)."'";
$db->query($sqlupdate);
}
}
@ -203,12 +215,12 @@ if ($result) {
print '</tr>'."\n";
}
$perm_libelle = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label));
print '<!-- '.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : '').' -->'."\n";
print '<tr class="oddeven">';
// Picto and label of module
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">';
//print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName();
print '</td>';
// Tick
@ -235,11 +247,24 @@ if ($result) {
}
// Permission and tick
print '<td>'.$perm_libelle.'</td>';
$permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label)));
print '<td>';
print $permlabel;
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (preg_match('/_advance$/', $obj->perms)) {
print ' <span class="opacitymedium">('.$langs->trans("AdvancedModeOnly").')</span>';
}
}
print '</td>';
// Permission id
if ($user->admin) {
print '<td class="right"><span class="opacitymedium">'.$obj->id.'</span></td>';
print '<td class="right">';
$htmltext = $langs->trans("ID").': '.$obj->id;
$htmltext .= '<br>'.$langs->trans("Permission").': user->rights->'.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : '');
print $form->textwithpicto('', $htmltext);
//print '<span class="opacitymedium">'.$obj->id.'</span>';
print '</td>';
}
print '</tr>'."\n";
@ -252,6 +277,12 @@ if ($result) {
print '</table>';
print '</div>';
$parameters = array();
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
print dol_get_fiche_end();
// End of page

View File

@ -39,9 +39,11 @@ if (!$user->admin) {
// Allow/Disallow change to clear passwords once passwords are crypted
$allow_disable_encryption = true;
/*
* Actions
*/
if ($action == 'setgeneraterule') {
if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $_GET["value"], 'chaine', 0, '', $conf->entity)) {
dol_print_error($db);
@ -215,6 +217,7 @@ if (is_resource($handle)) {
}
asort($arrayhandler);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("RuleForGeneratedPasswords").'</td>';
@ -266,6 +269,8 @@ foreach ($arrayhandler as $key => $module) {
}
}
print '</table>';
print '</div>';
print '</form>';
//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
@ -273,45 +278,47 @@ print '</form>';
if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
$tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="3"> '.$langs->trans("PasswordPatternDesc").'</td>';
print '<td colspan="2"> '.$langs->trans("PasswordPatternDesc").'</td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MinLength")."</td>";
print '<td colspan="2"><input type="number" value="'.$tabConf[0].'" id="minlenght" min="1"></td>';
print '<td><input type="number" value="'.$tabConf[0].'" id="minlenght" min="1"></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NbMajMin")."</td>";
print '<td colspan="2"><input type="number" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
print '<td><input type="number" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NbNumMin")."</td>";
print '<td colspan="2"><input type="number" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
print '<td><input type="number" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NbSpeMin")."</td>";
print '<td colspan="2"><input type="number" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
print '<td><input type="number" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NbIteConsecutive")."</td>";
print '<td colspan="2"><input type="number" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
print '<td><input type="number" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NoAmbiCaracAutoGeneration")."</td>";
print '<td colspan="2"><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
print '<td><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
print '</tr>';
print '</table>';

View File

@ -180,10 +180,10 @@ if (!$defaultsyslogfacility) {
if (!$defaultsyslogfile) {
$defaultsyslogfile = 'dolibarr.log';
}
if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) {
$optionmc = '';
if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) {
print '<div class="error">'.$langs->trans("ContactSuperAdminForChange").'</div>';
$option = 'disabled';
$optionmc = 'disabled';
}
@ -199,7 +199,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Value").'</td>';
print '<td class="right" colspan="2"><input type="submit" class="button" '.$option.' value="'.$langs->trans("Modify").'"></td>';
print '<td class="right" colspan="2"><input type="submit" class="button" '.$optionmc.' value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";
foreach ($syslogModules as $moduleName) {
@ -279,11 +279,11 @@ print '<input type="hidden" name="action" value="setlevel">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>';
print '<td class="right"><input type="submit" class="button" '.$option.' value="'.$langs->trans("Modify").'"></td>';
print '<td class="right"><input type="submit" class="button" '.$optionmc.' value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";
print '<tr class="oddeven"><td width="140">'.$langs->trans("SyslogLevel").'</td>';
print '<td colspan="2"><select class="flat" name="level" '.$option.'>';
print '<td colspan="2"><select class="flat" name="level" '.$optionmc.'>';
print '<option value="'.LOG_EMERG.'" '.($conf->global->SYSLOG_LEVEL == LOG_EMERG ? 'SELECTED' : '').'>LOG_EMERG ('.LOG_EMERG.')</option>';
print '<option value="'.LOG_ALERT.'" '.($conf->global->SYSLOG_LEVEL == LOG_ALERT ? 'SELECTED' : '').'>LOG_ALERT ('.LOG_ALERT.')</option>';
print '<option value="'.LOG_CRIT.'" '.($conf->global->SYSLOG_LEVEL == LOG_CRIT ? 'SELECTED' : '').'>LOG_CRIT ('.LOG_CRIT.')</option>';

View File

@ -172,7 +172,8 @@ jQuery(document).ready(function() {
var compphpstring;
getphpurl = $.ajax({
type: "GET",
url: \''.DOL_URL_ROOT.'/index.php\',
data: { token: \''.currentToken().'\' },
url: \''.DOL_URL_ROOT.'/public/notice.php\',
cache: false,
/* async: false, */
/* crossDomain: true,*/
@ -211,10 +212,11 @@ jQuery(document).ready(function() {
var compcssstring;
getcssurl = $.ajax({
type: "GET",
data: { token: \'notrequired\' },
url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\',
cache: false,
/* async: false, */
/*crossDomain: true, */
/* crossDomain: true, */
success: function () {
cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\');
/* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */
@ -250,10 +252,11 @@ jQuery(document).ready(function() {
var compcssphpstring;
getcssphpurl = $.ajax({
type: "GET",
data: { token: \''.currentToken().'\' },
url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\',
cache: false,
/* async: false, */
/*crossDomain: true,*/
/* crossDomain: true,*/
success: function () {
cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\');
/* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */
@ -289,10 +292,11 @@ jQuery(document).ready(function() {
var compimgstring;
getimgurl = $.ajax({
type: "GET",
data: { token: \'notrequired\' },
url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\',
cache: false,
/* async: false, */
/*crossDomain: true,*/
/* crossDomain: true,*/
success: function () {
cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\');
/* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */
@ -328,6 +332,7 @@ jQuery(document).ready(function() {
var compjsstring;
getjsurl = $.ajax({
type: "GET",
data: { token: \'notrequired\' },
url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
cache: false,
/* async: false, */
@ -367,6 +372,7 @@ jQuery(document).ready(function() {
var compjsphpstring;
getjsphpurl = $.ajax({
type: "GET",
data: { token: \''.currentToken().'\' },
url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
cache: false,
/* async: false, */

View File

@ -329,6 +329,7 @@ $securityevent = new Events($db);
$eventstolog = $securityevent->eventstolog;
print '<strong>'.$langs->trans("AuditedSecurityEvents").'</strong>: ';
$out = '';
if (!empty($eventstolog) && is_array($eventstolog)) {
// Loop on each event type
$i = 0;
@ -338,18 +339,22 @@ if (!empty($eventstolog) && is_array($eventstolog)) {
$value = empty($conf->global->$key) ? '' : $conf->global->$key;
if ($value) {
if ($i > 0) {
print ', ';
$out .= ', ';
}
print '<span class="opacitymedium">'.$key.'</span>';
$out .= '<span class="opacitymedium">'.$key.'</span>';
$i++;
}
}
}
print '<br>';
} else {
print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'<br>';
print $out;
}
if (empty($out)) {
print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security").' - '.$langs->transnoentities("Audit")).'<br>';
}
print '<br>';
// Modules/Applications

View File

@ -296,19 +296,8 @@ if ($mode == 'overwrite') {
print '</td><td>';
print '<input type="text" class="quatrevingtpercent"'.$disablededit.' name="transvalue" id="transvalue" value="'.(!empty($transvalue) ? $transvalue : "").'">';
print '</td>';
// Limit to superadmin
/*if (! empty($conf->multicompany->enabled) && !$user->entity)
{
print '<td>';
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
print '</td>';
print '<td class="center">';
}
else
{*/
print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
//}
print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add" title="'.dol_escape_htmltag($langs->trans("YouMustEnabledTranslationOverwriteBefore")).'">';
print "</td>\n";
print '</tr>';
@ -500,7 +489,7 @@ if ($mode == 'searchkey') {
//}
print '</td>';
// Action column
print '<td class="nowrap right">';
print '<td class="nowraponall">';
$searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1);
print $searchpicto;
print '</td>';

View File

@ -109,6 +109,7 @@ if ($action == 'set_default') {
}
}
/*
* View
*/
@ -267,7 +268,7 @@ foreach ($dirmodels as $reldir) {
// Defaut
print '<td class="center">';
if ($conf->global->USER_ADDON_PDF == $name) {
if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;token='.newToken().'&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';

View File

@ -613,8 +613,10 @@ jQuery(document).ready(function () {
var fk_block = $(this).attr("data-blockid");
$.ajax({
url:"../ajax/block-info.php?id="+fk_block
,dataType:"html"
method: "GET",
data: { token: \''.currentToken().'\' },
url: "'.DOL_URL_ROOT.'/blockedlog/ajax/block-info.php?id="+fk_block,
dataType: "html"
}).done(function(data) {
jQuery("#dialogforpopup").html(data);
});
@ -630,10 +632,11 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->glob
<script type="text/javascript">
$.ajax({
url : "<?php echo dol_buildpath('/blockedlog/ajax/check_signature.php', 1) ?>"
,dataType:"html"
method: "GET",
data: { token: '<?php echo currentToken() ?>' },
url: '<?php echo DOL_URL_ROOT.'/blockedlog/ajax/check_signature.php' ?>',
dataType: 'html'
}).done(function(data) {
if(data == 'hashisok') {
$('#blockchainstatus').html('<?php echo $langs->trans('AuthorityReconizeFingerprintConformity').' '.img_picto($langs->trans('SignatureOK'), 'on') ?>');
}

View File

@ -738,6 +738,11 @@ class ActionComm extends CommonObject
{
global $langs;
if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) {
dol_syslog(get_class($this)."::fetch Bad parameters", LOG_WARNING);
return -1;
}
$sql = "SELECT a.id,";
$sql .= " a.ref as ref,";
$sql .= " a.entity,";

View File

@ -363,9 +363,9 @@ if ($action == 'show_day') {
//print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour');
/*$title = $langs->trans("DoneAndToDoActions");
if ($status == 'done') $title = $langs->trans("DoneActions");
if ($status == 'todo') $title = $langs->trans("ToDoActions");
*/
if ($status == 'done') $title = $langs->trans("DoneActions");
if ($status == 'todo') $title = $langs->trans("ToDoActions");
*/
$param = '';
if ($actioncode || GETPOSTISSET('search_actioncode')) {
@ -454,13 +454,13 @@ $param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
/*$tabactive = '';
if ($action == 'show_month') $tabactive = 'cardmonth';
if ($action == 'show_week') $tabactive = 'cardweek';
if ($action == 'show_day') $tabactive = 'cardday';
if ($action == 'show_list') $tabactive = 'cardlist';
if ($action == 'show_pertuser') $tabactive = 'cardperuser';
if ($action == 'show_pertype') $tabactive = 'cardpertype';
*/
if ($action == 'show_month') $tabactive = 'cardmonth';
if ($action == 'show_week') $tabactive = 'cardweek';
if ($action == 'show_day') $tabactive = 'cardday';
if ($action == 'show_list') $tabactive = 'cardlist';
if ($action == 'show_pertuser') $tabactive = 'cardperuser';
if ($action == 'show_pertype') $tabactive = 'cardpertype';
*/
$paramnoaction = preg_replace('/action=[a-z_]+/', '', $param);
$paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate);
@ -502,14 +502,12 @@ $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="p
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewPerUser").'</span></a>';
$viewmode .= '<span class="marginrightonly"></span>';
// Add more views from hooks
$parameters = array(); $object = null;
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
@ -519,6 +517,8 @@ if (empty($reshook)) {
$viewmode = $hookmanager->resPrint;
}
$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools
$newcardbutton = '';
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
@ -925,13 +925,13 @@ if ($showbirthday) {
$eventarray[$daykey][] = $event;
/*$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
if ($daykey > $event->date_end_in_calendar) $loop = false;
} while ($loop);
*/
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
if ($daykey > $event->date_end_in_calendar) $loop = false;
} while ($loop);
*/
$i++;
}
} else {
@ -1543,13 +1543,13 @@ if (empty($action) || $action == 'show_month') { // View by month
echo " </td>\n";
/*
echo ' <div class="tagtr">';
echo ' <div class="tagtd width100"></div>';
echo ' <div class="tagtd center">';
echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1);
echo ' </div>'."\n";
echo " </div>\n";
*/
echo ' <div class="tagtr">';
echo ' <div class="tagtd width100"></div>';
echo ' <div class="tagtd center">';
echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1);
echo ' </div>'."\n";
echo " </div>\n";
*/
echo '</table>';
print '</div>';
@ -1793,7 +1793,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
} else {
if ($user->rights->agenda->allactions->create ||
(($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
$cssclass .= " movable cursormove";
$cssclass .= " movable cursormove";
} else {
$cssclass .= " unmovable";
}

View File

@ -493,22 +493,44 @@ class Mailing extends CommonObject
/**
* Delete emailing
*
* @param int $rowid id du mailing a supprimer
* @return int 1 en cas de succes
* @param int $rowid Id if emailing to delete
* @param int $notrigger Disable triggers
* @return int >0 if OK, <0 if KO
*/
public function delete($rowid)
public function delete($rowid, $notrigger = 0)
{
global $user;
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
$sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog("Mailing::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
return $this->delete_targets();
$res = $this->delete_targets();
if ($res <= 0) {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
}
} else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
}
if (!$notrigger) {
$result = $this->call_trigger('MAILING_DELETE', $user);
if ($result < 0) {
$this->db->rollback();
return -1;
}
}
$this->db->commit();
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/comm/mailing/index.php
* \ingroup mailing
* \brief Page accueil de la zone mailing
* \brief Home page for emailing area
*/
require '../../main.inc.php';
@ -34,8 +34,9 @@ $hookmanager = new HookManager($db);
$hookmanager->initHooks(array('mailingindex'));
// Load translation files required by the page
$langs->loadLangs(array('commercial', 'orders'));
$langs->loadLangs(array('commercial', 'orders', 'mails'));
$object = new Mailing($db);
// Security check
$result = restrictedArea($user, 'mailing');
@ -46,9 +47,11 @@ $result = restrictedArea($user, 'mailing');
*/
$help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing';
llxHeader('', 'EMailing', $help_url);
$title = $langs->trans('MailingArea');
print load_fiche_titre($langs->trans("MailingArea"));
llxHeader('', $title, $help_url);
print load_fiche_titre($title);
//print '<table class="notopnoleftnoright" width="100%">';
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
@ -190,19 +193,9 @@ if ($result) {
}
//print '</td></tr></table>';
print '</div></div></div>';
if ($langs->file_exists("html/spam.html", 0)) {
print "<br><br><br><br>".$langs->trans("Note")."<br>";
print '<div style="padding: 4px; background: #FAFAFA; border: 1px solid #BBBBBB;" >';
dol_print_file($langs, "html/spam.html", 0);
print '</div>';
print '<br>';
}
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardEmailings', $parameters, $object); // Note that $action and $object may have been modified by hook

View File

@ -2347,6 +2347,10 @@ class Commande extends CommonOrder
// For triggers
$line->fetch($lineid);
// Memorize previous line for triggers
$staticline = clone $line;
$line->oldline = $staticline;
if ($line->delete($user) > 0) {
$result = $this->update_price(1);

View File

@ -170,7 +170,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva, t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';

View File

@ -130,7 +130,7 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
$permissiontoadd = $user->rights->banque->modifier;
$permissiontodelete = $user->rights->banque->supprimer;
$permissiontodelete = $user->rights->banque->configurer;
/*
* Actions
@ -538,7 +538,7 @@ foreach ($accounts as $key => $type) {
// Label
if (!empty($arrayfields['b.label']['checked'])) {
print '<td>'.$objecttmp->label.'</td>';
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->label).'">'.dol_escape_htmltag($objecttmp->label).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -556,7 +556,7 @@ foreach ($accounts as $key => $type) {
// Number
if (!empty($arrayfields['b.number']['checked'])) {
print '<td>'.$objecttmp->number.'</td>';
print '<td>'.dol_escape_htmltag($objecttmp->number).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -613,7 +613,7 @@ class FactureRec extends CommonInvoice
}
return 1;
} else {
$this->error = 'Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql;
$this->error = 'Bill with id '.$rowid.' or ref '.$ref.' not found';
dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR);
return -2;
}

View File

@ -392,7 +392,7 @@ if ($resql) {
print "</td>\n";
// Third party
print '<td>';
print '<td class="tdoverflowmax150">';
print $thirdpartystatic->getNomUrl(1);
print '</td>';

View File

@ -39,7 +39,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
<br>
<form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="action" value="add">
<?php if ($this->control->tpl['company_id']) { ?>

View File

@ -39,7 +39,7 @@ echo $this->control->tpl['ajax_selectcountry'];
<br>
<form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST('id', 'int'); ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="id" value="<?php echo GETPOST('id', 'int'); ?>">
<input type="hidden" name="action" value="update">

View File

@ -539,6 +539,7 @@ class Contact extends CommonObject
$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
// Clean parameters
$this->ref_ext = trim($this->ref_ext);
$this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname);
$this->firstname = trim($this->firstname);
$this->email = trim($this->email);
@ -559,18 +560,19 @@ class Contact extends CommonObject
}
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET";
if ($this->socid > 0) {
$sql .= " fk_soc='".$this->db->escape($this->socid)."',";
$sql .= " fk_soc = ".((int) $this->socid).",";
} elseif ($this->socid == -1) {
$sql .= " fk_soc=null,";
$sql .= " fk_soc = NULL,";
}
$sql .= " civility='".$this->db->escape($this->civility_code)."'";
$sql .= " civility='".$this->db->escape($this->civility_code)."'";
$sql .= ", lastname='".$this->db->escape($this->lastname)."'";
$sql .= ", firstname='".$this->db->escape($this->firstname)."'";
$sql .= ", address='".$this->db->escape($this->address)."'";
$sql .= ", zip='".$this->db->escape($this->zip)."'";
$sql .= ", town='".$this->db->escape($this->town)."'";
$sql .= ", ref_ext = ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "NULL");
$sql .= ", fk_pays=".($this->country_id > 0 ? $this->country_id : 'NULL');
$sql .= ", fk_departement=".($this->state_id > 0 ? $this->state_id : 'NULL');
$sql .= ", poste='".$this->db->escape($this->poste)."'";
@ -579,11 +581,11 @@ class Contact extends CommonObject
$sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'";
$sql .= ", photo='".$this->db->escape($this->photo)."'";
$sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
$sql .= ", note_private = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null");
$sql .= ", phone = ".(isset($this->phone_pro) ? "'".$this->db->escape($this->phone_pro)."'" : "null");
$sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "null");
$sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "null");
$sql .= ", note_private = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "NULL");
$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "NULL");
$sql .= ", phone = ".(isset($this->phone_pro) ? "'".$this->db->escape($this->phone_pro)."'" : "NULL");
$sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "NULL");
$sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "NULL");
$sql .= ", priv = '".$this->db->escape($this->priv)."'";
$sql .= ", fk_prospectcontactlevel = '".$this->db->escape($this->fk_prospectlevel)."'";
if (isset($this->stcomm_id)) {

View File

@ -375,13 +375,13 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_stcommcontact as st ON st.id = p.fk_stcommcontact";
if (!empty($search_categ)) {
if (!empty($search_categ) && $search_categ != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cc ON p.rowid = cc.fk_socpeople"; // We need this table joined to the select in order to filter by categ
}
if (!empty($search_categ_thirdparty)) {
if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ
}
if (!empty($search_categ_supplier)) {
if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc"; // We need this table joined to the select in order to filter by categ
}
if (!$user->rights->societe->client->voir && !$socid) {

View File

@ -27,6 +27,15 @@
//var_dump($upload_dirold);
// Protection to understand what happen when submitting files larger than post_max_size
if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) {
dol_syslog("The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty.");
$langs->loadLangs(array("errors", "install"));
print $langs->trans("ErrorFileSizeTooLarge").' ';
print $langs->trans("ErrorGoBackAndCorrectParameters");
die;
}
// Submit file/link
if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) {
if (!empty($_FILES)) {

View File

@ -1053,9 +1053,9 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
$newlang = $objecttmp->thirdparty->default_lang;
}
//elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty
// $newlang = $objecttmp->thirdparty->default_lang;
//}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);

View File

@ -54,8 +54,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call
$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", 'aZ09comma');
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
$page = 0;
@ -82,8 +82,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call
//exit;
}
}
} else // For no ajax call
{
} else {
// For no ajax call
$rootdirfordoc = $conf->ecm->dir_output;
$ecmdir = new EcmDirectory($db);
@ -376,7 +376,7 @@ if ($type == 'directory') {
// When we show list of files for ECM files, $filearray contains file list, and directory is defined with modulepart + section into $param
// When we show list of files for a directory, $filearray ciontains file list, and directory is defined with modulepart + $relativepath
//var_dump("section=".$section." title=".$title." modulepart=".$modulepart." useinecm=".$useinecm." perm=".$perm." relativepath=".$relativepath." param=".$param." url=".$url);
$formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm);
$formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm, '', $sortfield, $sortorder);
}
}
@ -430,6 +430,7 @@ if ($useajax || $action == 'delete') {
}
if ($useajax) {
print '<!-- ajaxdirpreview.php: js to manage preview of doc -->'."\n";
print '<script type="text/javascript">';
// Enable jquery handlers on new generated HTML objects (same code than into lib_footer.js.php)

View File

@ -48,9 +48,7 @@ $hash_algo = GETPOST('hash_algo', 'alpha');
// Security check
if (!empty($user->socid)) {
$socid = $user->socid;
}
// None.
$now = dol_now();

View File

@ -91,9 +91,9 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->write) {
$perm = 1;
} elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fourn->commande->creer) {
} elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fournisseur->commande->creer) {
$perm = 1;
} elseif ($table_element_line == 'facture_fourn_det' && $user->rights->fourn->facture->creer) {
} elseif ($table_element_line == 'facture_fourn_det' && $user->rights->fournisseur->facture->creer) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
$perm = 1;

View File

@ -148,14 +148,14 @@ class box_actions extends ModeleBoxes
$label = empty($objp->label) ? $objp->type_label : $objp->label;
$this->info_box_contents[$line][0] = array(
'td' => '',
'td' => 'class="tdoverflowmax200"',
'text' => $actionstatic->getNomUrl(1),
'text2'=> $late,
'asis' => 1
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'td' => 'class="tdoverflowmax100"',
'text' => ($societestatic->id > 0 ? $societestatic->getNomUrl(1) : ''),
'asis' => 1
);

View File

@ -128,7 +128,7 @@ class box_clients extends ModeleBoxes
$thirdpartystatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
'td' => '',
'td' => 'class="tdoverflowmax150"',
'text' => $thirdpartystatic->getNomUrl(1),
'asis' => 1,
);

View File

@ -138,7 +138,7 @@ class box_ficheinter extends ModeleBoxes
);
$this->info_box_contents[$i][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'td' => 'class="tdoverflowmax150"',
'text' => $thirdpartystatic->getNomUrl(1),
'asis' => 1,
);

View File

@ -120,7 +120,7 @@ class box_goodcustomers extends ModeleBoxes
$nbimpaye = $objp->nbfact - $objp->nbfactpaye;
$this->info_box_contents[$line][] = array(
'td' => '',
'td' => 'class="tdoverflowmax150"',
'text' => $thirdpartystatic->getNomUrl(1),
'asis' => 1,
);

View File

@ -129,7 +129,7 @@ class box_prospect extends ModeleBoxes
$thirdpartystatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
'td' => '',
'td' => 'class="tdoverflowmax150"',
'text' => $thirdpartystatic->getNomUrl(1),
'asis' => 1,
);

View File

@ -489,7 +489,7 @@ abstract class CommonDocGenerator
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
);
if (method_exists($object, 'getTotalDiscount')) {
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
$resarray[$array_key.'_total_discount_ht_locale'] = price($object->getTotalDiscount(), 0, $outputlangs);
$resarray[$array_key.'_total_discount_ht'] = price2num($object->getTotalDiscount());
} else {
@ -532,10 +532,10 @@ abstract class CommonDocGenerator
}
// @GS: Calculate total up and total discount percentage
// Note that this added fields correspond to nothing in Dolibarr (Dolibarr manage discount on lines not globally)
// Note that this added fields does not match a field into database in Dolibarr (Dolibarr manage discount on lines not as a global property of object)
$resarray['object_total_up'] = $totalUp;
$resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs);
if (method_exists($object, 'getTotalDiscount')) {
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
$totalDiscount = $object->getTotalDiscount();
} else {
$totalDiscount = 0;

View File

@ -4334,37 +4334,41 @@ abstract class CommonObject
/**
* Function that returns the total amount HT of discounts applied for all lines.
*
* @return float
* @return float|string Total amout of discount
*/
public function getTotalDiscount()
{
$total_discount = 0.00;
if (!empty($this->table_element_line) ) {
$total_discount = 0.00;
$sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element."det";
$sql .= " WHERE ".$this->fk_element." = ".$this->id;
$sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element_line;
$sql .= " WHERE ".$this->fk_element." = ".$this->id;
dol_syslog(get_class($this).'::getTotalDiscount', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
dol_syslog(get_class($this).'::getTotalDiscount', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
$pu_ht = $obj->pu_ht;
$qty = $obj->qty;
$total_ht = $obj->total_ht;
$pu_ht = $obj->pu_ht;
$qty = $obj->qty;
$total_ht = $obj->total_ht;
$total_discount_line = floatval(price2num(($pu_ht * $qty) - $total_ht, 'MT'));
$total_discount += $total_discount_line;
$total_discount_line = floatval(price2num(($pu_ht * $qty) - $total_ht, 'MT'));
$total_discount += $total_discount_line;
$i++;
$i++;
}
}
//print $total_discount; exit;
return price2num($total_discount);
}
//print $total_discount; exit;
return price2num($total_discount);
return null;
}

View File

@ -1613,7 +1613,7 @@ class ExtraFields
if (!empty($extrafieldsobjectkey)) {
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
$size = (int) $this->attributes[$extrafieldsobjectkey]['size'][$key];
$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
@ -1911,7 +1911,7 @@ class ExtraFields
} elseif ($type == 'password') {
$value = dol_trunc(preg_replace('/./i', '*', $value), 8, 'right', 'UTF-8', 1);
} else {
$showsize = round($size);
$showsize = round((float) $size);
if ($showsize > 48) {
$showsize = 48;
}

View File

@ -957,7 +957,7 @@ class Form
if ($row['code_iso']) {
$labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>';
if (empty($hideflags)) {
$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium marginrightonly"');
$tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"');
$labeltoshow = $tmpflag.' '.$labeltoshow;
}
}
@ -978,7 +978,7 @@ class Form
// Make select dynamic
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox('select'.$htmlname);
$out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve');
return $out;
}
@ -4682,7 +4682,7 @@ class Form
{
global $langs, $conf;
$more = '<!-- formconfirm for page='.dol_escape_htmltag($page).' -->';
$more = '<!-- formconfirm before calling page='.dol_escape_htmltag($page).' -->';
$formconfirm = '';
$inputok = array();
$inputko = array();
@ -8494,7 +8494,7 @@ class Form
*/
public function showFilterButtons()
{
$out = '<div class="nowrap">';
$out = '<div class="nowraponall">';
$out .= '<button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
$out .= '<button type="submit" class="liste_titre button_removefilter" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
$out .= '</div>';
@ -8628,14 +8628,11 @@ class Form
if ($("select[name='.$target.']").val() == '.$obj->id.') {
// get price of kilometer to fill the unit price
var data = '.json_encode($params).';
data.fk_c_exp_tax_cat = $(this).val();
$.ajax({
method: "POST",
dataType: "json",
data: data,
url: "'.(DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php').'",
data: { fk_c_exp_tax_cat: $(this).val(), token: \''.currentToken().'\' },
url: "'.(DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.$params).'",
}).done(function( data, textStatus, jqXHR ) {
console.log(data);
if (typeof data.up != "undefined") {

View File

@ -77,12 +77,13 @@ class FormFile
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
* @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*')
* @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be)
* @param int $usewithoutform 0=Default, 1=Disable <form> and style to use in existing area
* @param int $usewithoutform 0=Default, 1=Disable <form> and <input hidden> to use in existing form area, 2=Disable the tag <form> only
* @param int $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept.
* @param int $disablemulti 0=Default, 1=Disable multiple file upload
* @return int <0 if KO, >0 if OK
* @param int $nooutput 0=Output result with print, 1=Return result
* @return int|string <0 if KO, >0 if OK, or string if $noouput=1
*/
public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0, $disablemulti = 0)
public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0, $disablemulti = 0, $nooutput = 0)
{
// phpcs:enable
global $conf, $langs, $hookmanager;
@ -102,11 +103,16 @@ class FormFile
// TODO: Check this works with GED module, otherwise, force useajax to 0
// TODO: This does not support option savingdocmask
// TODO: This break feature to upload links too
// TODO: Thisdoes not work when param nooutput=1
return $this->_formAjaxFileUpload($object);
} else {
//If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed
if (!$perm && !empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) {
return 1;
if ($nooutput) {
return '';
} else {
return 1;
}
}
$out = "\n\n".'<!-- Start form attach new file --><div class="formattachnewfile">'."\n";
@ -122,12 +128,14 @@ class FormFile
// Add a param as GET parameter to detect when POST were cleaned by PHP because a file larger than post_max_size
$url .= (strpos($url, '?') === false ? '?' : '&').'uploadform=1';
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">';
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">';
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">';
$out .= '<input type="hidden" name="sortfield" value="'.GETPOST('sortfield', 'aZ09comma').'">';
$out .= '<input type="hidden" name="sortorder" value="'.GETPOST('sortorder', 'aZ09').'">';
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">'."\n";
}
if (empty($usewithoutform) || $usewithoutform == 2) {
$out .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">'."\n";
$out .= '<input type="hidden" name="sortfield" value="'.GETPOST('sortfield', 'aZ09comma').'">'."\n";
$out .= '<input type="hidden" name="sortorder" value="'.GETPOST('sortorder', 'aZ09comma').'">'."\n";
}
$out .= '<table class="nobordernopadding centpercent">';
@ -218,9 +226,10 @@ class FormFile
if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
if ($perm) {
$menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Security");
$langs->load('other');
$out .= ' ';
$out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow), 1);
$out .= info_admin($langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow), 1);
}
} else {
$out .= ' ('.$langs->trans("UploadDisabled").')';
@ -300,13 +309,15 @@ class FormFile
$parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm, 'options'=>$options);
$res = $hookmanager->executeHooks('formattachOptions', $parameters, $object);
if (empty($res)) {
print '<div class="'.($usewithoutform ? 'inline-block valignmiddle' : 'attacharea attacharea'.$htmlname).'">';
print $out;
print '</div>';
$out = '<div class="'.($usewithoutform ? 'inline-block valignmiddle' : 'attacharea attacharea'.$htmlname).'">'.$out.'</div>';
}
print $hookmanager->resPrint;
$out .= $hookmanager->resPrint;
return 1;
if ($nooutput) {
return $out;
} else {
return 1;
}
}
}
@ -345,7 +356,7 @@ class FormFile
* Return a string to show the box with list of available documents for object.
* This also set the property $this->numoffiles
*
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:nameofsubmodule', 'mymodule_temp', ...)
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:myobject', 'mymodule_temp', ...)
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
* @param string $filedir Directory to scan
* @param string $urlsource Url of origin page (for return)
@ -667,7 +678,7 @@ class FormFile
$res = include_once $file;
}
$class = 'ModelePDF'.$submodulepart;
$class = 'ModelePDF'.ucfirst($submodulepart);
if (class_exists($class)) {
$modellist = call_user_func($class.'::liste_modeles', $this->db);
@ -729,7 +740,7 @@ class FormFile
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && !empty($conf->global->MAIN_MULTILANGS) && !$forcenomultilang && (!empty($modellist) || $showempty)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
$defaultlang = $codelang ? $codelang : $langs->getDefaultLang();
$defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang();
$morecss = 'maxwidth150';
if ($conf->browser->layout == 'phone') {
$morecss = 'maxwidth100';
@ -859,7 +870,7 @@ class FormFile
// Show share link
$out .= '<td class="nowrap">';
if ($file['share']) {
if (!empty($file['share'])) {
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file

View File

@ -110,7 +110,7 @@ class FormOther
* @param string $htmlname Nom de la zone select
* @param string $type Type des modeles recherches
* @param int $useempty Show an empty value in list
* @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on)
* @param int $fk_user User we want templates
* @return void
*/
public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null)
@ -121,8 +121,8 @@ class FormOther
$sql = "SELECT rowid, label, fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."export_model";
$sql .= " WHERE type = '".$this->db->escape($type)."'";
if (!empty($fk_user)) {
$sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model
if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
$sql .= " AND fk_user IN (0, ".((int) $fk_user).")";
}
$sql .= " ORDER BY label";
$result = $this->db->query($sql);
@ -132,6 +132,8 @@ class FormOther
print '<option value="-1">&nbsp;</option>';
}
$tmpuser = new User($this->db);
$num = $this->db->num_rows($result);
$i = 0;
while ($i < $num) {
@ -140,8 +142,7 @@ class FormOther
$label = $obj->label;
if ($obj->fk_user == 0) {
$label .= ' <span class="opacitymedium">('.$langs->trans("Everybody").')</span>';
} elseif (!empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) {
$tmpuser = new User($this->db);
} elseif ($obj->fk_user > 0) {
$tmpuser->fetch($obj->fk_user);
$label .= ' <span class="opacitymedium">('.$tmpuser->getFullName($langs).')</span>';
}
@ -171,7 +172,7 @@ class FormOther
* @param string $htmlname Nom de la zone select
* @param string $type Type des modeles recherches
* @param int $useempty Affiche valeur vide dans liste
* @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on)
* @param int $fk_user User that has created the template
* @return void
*/
public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0, $fk_user = null)
@ -182,10 +183,10 @@ class FormOther
$sql = "SELECT rowid, label, fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."import_model";
$sql .= " WHERE type = '".$this->db->escape($type)."'";
if (!empty($fk_user)) {
$sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model
if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner.
$sql .= " AND fk_user IN (0, ".((int) $fk_user).")";
}
$sql .= " ORDER BY rowid";
$sql .= " ORDER BY label";
$result = $this->db->query($sql);
if ($result) {
print '<select class="flat minwidth200" name="'.$htmlname.'" id="'.$htmlname.'">';
@ -193,6 +194,8 @@ class FormOther
print '<option value="-1">&nbsp;</option>';
}
$tmpuser = new User($this->db);
$num = $this->db->num_rows($result);
$i = 0;
while ($i < $num) {
@ -201,8 +204,7 @@ class FormOther
$label = $obj->label;
if ($obj->fk_user == 0) {
$label .= ' <span class="opacitymedium">('.$langs->trans("Everybody").')</span>';
} elseif (!empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) {
$tmpuser = new User($this->db);
} elseif ($obj->fk_user > 0) {
$tmpuser->fetch($obj->fk_user);
$label .= ' <span class="opacitymedium">('.$tmpuser->getFullName($langs).')</span>';
}
@ -1177,7 +1179,7 @@ class FormOther
$selectboxlist .= '<input type="hidden" name="userid" value="'.$user->id.'">';
$selectboxlist .= '<input type="hidden" name="areacode" value="'.$areacode.'">';
$selectboxlist .= '<input type="hidden" name="boxorder" value="'.$boxorder.'">';
$selectboxlist .= Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1);
$selectboxlist .= Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone hideonprint', 0, 'hidden selected', 0, 1);
if (empty($conf->use_javascript_ajax)) {
$selectboxlist .= ' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
}

View File

@ -22,6 +22,10 @@
/**
* \file htdocs/core/class/ldap.class.php
* \brief File of class to manage LDAP features
*
* Note:
* LDAP_ESCAPE_FILTER is to escape char array('\\', '*', '(', ')', "\x00")
* LDAP_ESCAPE_DN is to escape char array('\\', ',', '=', '+', '<', '>', ';', '"', '#')
*/
/**
@ -132,6 +136,7 @@ class Ldap
$this->ldapProtocolVersion = $conf->global->LDAP_SERVER_PROTOCOLVERSION;
$this->dn = $conf->global->LDAP_SERVER_DN;
$this->serverType = $conf->global->LDAP_SERVER_TYPE;
$this->domain = $conf->global->LDAP_SERVER_DN;
$this->searchUser = $conf->global->LDAP_ADMIN_DN;
$this->searchPassword = $conf->global->LDAP_ADMIN_PASS;
@ -953,7 +958,7 @@ class Ldap
}
// Define filter
if (!empty($activefilter)) {
if (!empty($activefilter)) { // Use a predefined trusted filter (defined into setup by admin).
if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter) {
$filter = '('.$this->filter.')';
} elseif (((string) $activefilter == 'group') && $this->filtergroup ) {
@ -961,11 +966,11 @@ class Ldap
} elseif (((string) $activefilter == 'member') && $this->filter) {
$filter = '('.$this->filtermember.')';
} else {
// If this->filter is empty, make fiter on * (all)
$filter = '('.$useridentifier.'=*)';
// If this->filter/this->filtergroup is empty, make fiter on * (all)
$filter = '('.ldap_escape($useridentifier, '', LDAP_ESCAPE_FILTER).'=*)';
}
} else {
$filter = '('.$useridentifier.'='.$search.')';
} else { // Use a filter forged using the $search value
$filter = '('.ldap_escape($useridentifier, '', LDAP_ESCAPE_FILTER).'='.ldap_escape($search, '', LDAP_ESCAPE_FILTER).')';
}
if (is_array($attributeArray)) {

View File

@ -198,7 +198,9 @@ print '
{
if (this.href)
{
console.log("We click on tag with .reposition class. this.ref was "+this.href);
var hrefarray = this.href.split("#", 2);
hrefarray[0]=hrefarray[0].replace(/&page_y=(\d+)/, \'\'); /* remove page_y param if already present */
this.href=hrefarray[0]+\'&page_y=\'+page_y;
console.log("We click on tag with .reposition class. this.ref is now "+this.href);
}

View File

@ -153,7 +153,7 @@ if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP
// Update status of all notifications we sent on browser (listofreminderids)
console.log("Flag notification as done for listofreminderids="+listofreminderids);
$.ajax("<?php print DOL_URL_ROOT.'/core/ajax/check_notifications.php?action=stopreminder&listofreminderids='; ?>"+listofreminderids, {
type: "post", // Usually post or get
type: "POST", // Usually post or get
async: true,
data: { time_js_next_test: time_js_next_test, token: 'notrequired' }
});

View File

@ -715,10 +715,7 @@ function getCountriesInEEC()
global $conf, $db;
$country_code_in_EEC = array();
if (!empty($conf->global->MAIN_COUNTRIES_IN_EEC)) {
// For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK'
$country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC);
} elseif (!empty($conf->cache['country_code_in_EEC'])) {
if (!empty($conf->cache['country_code_in_EEC'])) {
// Use of cache to reduce number of database requests
$country_code_in_EEC = $conf->cache['country_code_in_EEC'];
} else {
@ -1616,8 +1613,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
'contact_id'=>$obj->fk_contact,
'socpeopleassigned' => $contactaction->socpeopleassigned,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'lastname' => empty($obj->lastname) ? '' : $obj->lastname,
'firstname' => empty($obj->firstname) ? '' : $obj->firstname,
'fk_element'=>$obj->fk_element,
'elementtype'=>$obj->elementtype,
// Type of event

View File

@ -294,32 +294,36 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l
/**
* Generate a SQL string to make a filter into a range (for second of date until last second of date)
* Generate a SQL string to make a filter into a range (for second of date until last second of date).
* This method allows to maje SQL request that will deal correctly the timezone of server.
*
* @param string $datefield Name of SQL field where apply sql date filter
* @param int $day_date Day date
* @param int $month_date Month date
* @param int $year_date Year date
* @param int $excludefirstand Exclude first and
* @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ.
* Note: In database, dates are always fot the server TZ.
* @return string $sqldate String with SQL filter
*/
function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0)
function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false)
{
global $db;
$sqldate = "";
if ($month_date > 0) {
if ($year_date > 0 && empty($day_date)) {
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, false));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, false))."'";
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'";
} elseif ($year_date > 0 && !empty($day_date)) {
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date));
$sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'";
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date, $gm));
$sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date, $gm))."'";
} else {
// This case is not reliable on TZ, but we should not need it.
$sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%c') = '".$db->escape($month_date)."'";
}
} elseif ($year_date > 0) {
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'";
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, $gm));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, $gm))."'";
}
return $sqldate;
}

View File

@ -1473,21 +1473,23 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
$out = '<a class="button bordertransp button_'.$name.'"'.$disabled.' title="'.dol_escape_htmltag($label).'">'.$buttonstring.'</a>';
$out .= '<!-- Add js code to open dialog popup on dialog -->';
$out .= '<script language="javascript">
jQuery(document).ready(function () {
jQuery(".button_'.$name.'").click(function () {
var $dialog = $(\'<div></div>\').html(\'<iframe class="iframedialog" style="border: 0px;" src="'.DOL_URL_ROOT.$url.'" width="100%" height="98%"></iframe>\')
.dialog({
autoOpen: false,
modal: true,
height: (window.innerHeight - 150),
width: \'80%\',
title: "'.dol_escape_js($label).'"
});
$dialog.dialog(\'open\');
});
});
</script>';
jQuery(document).ready(function () {
jQuery(".button_'.$name.'").click(function () {
console.log("Open popup with jQuery(...).dialog() on URL '.dol_escape_js(DOL_URL_ROOT.$url).'")
var $dialog = $(\'<div></div>\').html(\'<iframe class="iframedialog" style="border: 0px;" src="'.DOL_URL_ROOT.$url.'" width="100%" height="98%"></iframe>\')
.dialog({
autoOpen: false,
modal: true,
height: (window.innerHeight - 150),
width: \'80%\',
title: "'.dol_escape_js($label).'"
});
$dialog.dialog(\'open\');
});
});
</script>';
return $out;
}
@ -3510,7 +3512,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'label', 'language', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lot', 'long-arrow-alt-right',
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
'off', 'on', 'order',
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip',
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip',
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
@ -5809,12 +5811,12 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
/**
* Function that return vat rate of a product line (according to seller, buyer and product vat rate)
* Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle.
* Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle.
* Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
* Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier ou entreprise sans num TVA intra) alors TVA par defaut=TVA du produit vendu. Fin de regle
* Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise avec num TVA) intra alors TVA par defaut=0. Fin de regle
* Sinon TVA proposee par defaut=0. Fin de regle.
* VATRULE 1: Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle.
* VATRULE 2: Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle.
* VATRULE 3: Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
* VATRULE 4: Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle
* VATRULE 5: Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise) alors TVA par defaut=0. Fin de regle
* VATRULE 6: Sinon TVA proposee par defaut=0. Fin de regle.
*
* @param Societe $thirdparty_seller Objet societe vendeuse
* @param Societe $thirdparty_buyer Objet societe acheteuse
@ -5843,9 +5845,19 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer,
// If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm)
// we use the buyer VAT.
if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) {
if ($seller_in_cee && $buyer_in_cee && !$thirdparty_buyer->isACompany()) {
//print 'VATRULE 0';
return get_product_vat_for_country($idprod, $thirdparty_buyer, $idprodfournprice);
if ($seller_in_cee && $buyer_in_cee) {
$isacompany = $thirdparty_buyer->isACompany();
if ($isacompany && !empty($conf->global->MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!isValidVATID($thirdparty_buyer)) {
$isacompany = 0;
}
}
if (!$isacompany) {
//print 'VATRULE 0';
return get_product_vat_for_country($idprod, $thirdparty_buyer, $idprodfournprice);
}
}
}
@ -5865,36 +5877,41 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer,
}
// Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
// Not supported
// 'VATRULE 3' - Not supported
// Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise) alors TVA par defaut=0. Fin de regle
// Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle
if (($seller_in_cee && $buyer_in_cee)) {
$isacompany = $thirdparty_buyer->isACompany();
if ($isacompany) {
if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!isValidVATID($thirdparty_buyer)) {
//print 'VATRULE 6';
return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice);
}
if ($isacompany && !empty($conf->global->MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!isValidVATID($thirdparty_buyer)) {
$isacompany = 0;
}
//print 'VATRULE 3';
return 0;
} else {
}
if (!$isacompany) {
//print 'VATRULE 4';
return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice);
} else {
//print 'VATRULE 5';
return 0;
}
}
// Si (vendeur en France et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle
if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) {
return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice);
// Si (vendeur dans Communaute europeene et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle
// I don't see any use case that need this rule.
if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee)) {
$isacompany = $thirdparty_buyer->isACompany();
if (!$isacompany) {
return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice);
//print 'VATRULE extra';
}
}
// Sinon la TVA proposee par defaut=0. Fin de regle.
// Rem: Cela signifie qu'au moins un des 2 est hors Communaute europeenne et que le pays differe
//print 'VATRULE 5';
//print 'VATRULE 6';
return 0;
}

View File

@ -248,6 +248,12 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '</div>';
}
if (!empty($conf->global->TICKET_IMAGE_PUBLIC_INTERFACE)) {
print '<div class="backimagepublicticket">';
print '<img id="idRECRUITMENT_IMAGE_PUBLIC_INTERFACE" src="'.$conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION.'">';
print '</div>';
}
print '</div>';
print '<div class="ticketlargemargin">';

View File

@ -162,10 +162,9 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset
print "\n".'<li '.(!empty($tab[$x]['statut']) ? ' class="liuseractive"' : 'class="liuserdisabled"').'>';
if ($showfk) {
print '<table class="nobordernopadding centpercent"><tr><td>';
print '<strong> &nbsp; ';
print $tab[$x]['title'];
print '&nbsp; (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')';
print '</td><td class="right">';
print '<span class="paddingleftonly">'.$tab[$x]['title'].'</span>';
print '&nbsp; <span class="opacitymedium">(fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')</span>';
print '</td><td class="right nowraponall">';
print $tab[$x]['buttons'];
print '</td></tr></table>';
} else {

View File

@ -72,9 +72,9 @@ class pdf_ban extends ModeleBankAccountDoc
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_codeproduitservice = 1; // Display product-service code
// Retrieves transmitter
$this->emetteur = $mysoc;

View File

@ -75,9 +75,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_codeproduitservice = 1; //Display product-service code
// Retrieves transmitter
$this->emetteur = $mysoc;

View File

@ -186,6 +186,11 @@ class modPhpbarcode extends ModeleBarCode
global $conf, $filebarcode;
dol_mkdir($conf->barcode->dir_temp);
if (!is_writable($conf->barcode->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
$file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';

View File

@ -158,6 +158,12 @@ class modTcpdfbarcode extends ModeleBarCode
global $conf, $_GET;
dol_mkdir($conf->barcode->dir_temp);
if (!is_writable($conf->barcode->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
$file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
$tcpdfEncoding = $this->getTcpdfEncodingType($encoding);

View File

@ -278,7 +278,11 @@ class doc_generic_bom_odt extends ModelePDFBom
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->bom->dir_temp);
if (!is_writable($conf->bom->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->bom->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on order, we use it
$usecontact = false;

View File

@ -3,7 +3,7 @@
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -85,13 +85,13 @@ class doc_generic_order_odt extends ModelePDFCommandes
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -290,7 +290,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->commande->dir_temp);
if (!is_writable($conf->commande->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->commande->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on order, we use it
$usecontact = false;

View File

@ -84,13 +84,13 @@ class doc_generic_contract_odt extends ModelePDFContract
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva CONTRACT_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat CONTRACT_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -278,7 +278,11 @@ class doc_generic_contract_odt extends ModelePDFContract
//print "conf->contrat->dir_temp=".$conf->contrat->dir_temp;
dol_mkdir($conf->contrat->dir_temp);
if (!is_writable($conf->contrat->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->contrat->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on contract, we use it
$usecontact = false;

View File

@ -3,7 +3,7 @@
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -86,13 +86,13 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva EXPEDITION_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option EXPEDITION_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -290,7 +290,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->expedition->dir_temp);
if (!is_writable($conf->expedition->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->expedition->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If SHIPMENT contact defined on invoice, we use it
$usecontact = false;

View File

@ -139,7 +139,7 @@ class pdf_espadon extends ModelePdfExpedition
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1;
$this->option_logo = 1; // Display logo
// Get source company
$this->emetteur = $mysoc;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2016-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Francis Appels <francis.appels@z-application.com>
* Copyright (C) 2019 Markus Welters <markus@welters.de>
@ -151,13 +151,13 @@ class pdf_standard extends ModeleExpenseReport
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -85,13 +85,13 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -291,7 +291,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->facture->dir_temp);
if (!is_writable($conf->facture->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->facture->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If BILLING contact defined on invoice, we use it
$usecontact = false;

View File

@ -81,13 +81,13 @@ class doc_generic_member_odt extends ModelePDFMember
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva MEMBER_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -279,7 +279,11 @@ class doc_generic_member_odt extends ModelePDFMember
//print "conf->adherent->dir_temp=".$conf->adherent->dir_temp;
dol_mkdir($conf->adherent->dir_temp);
if (!is_writable($conf->adherent->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->adherent->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on member, we use it
$usecontact = false;

View File

@ -101,7 +101,7 @@ class modSalaries extends DolibarrModules
$r++;
$this->rights[$r][0] = 511;
$this->rights[$r][1] = 'Read payments of employee salaries (yours and your subordinates)';
$this->rights[$r][1] = 'Read employee salaries and payments (yours and your subordinates)';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'read';
@ -125,7 +125,7 @@ class modSalaries extends DolibarrModules
$r++;
$this->rights[$r][0] = 517;
$this->rights[$r][1] = 'Read payments of salariests of every employee';
$this->rights[$r][1] = 'Read salaries and payments of all employees';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'readall';

View File

@ -137,12 +137,12 @@ class pdf_stdandard extends ModelePDFMovement
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_codestockservice = 0; // Affiche code stock-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display stock-service code
$this->option_multilang = 1; // Available in several languages
$this->option_freetext = 0; // Support add of a personalised text
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined

View File

@ -3,7 +3,7 @@
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -85,18 +85,18 @@ class doc_generic_mo_odt extends ModelePDFMo
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@ -175,7 +175,7 @@ class doc_generic_mo_odt extends ModelePDFMo
$texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
// Show list of found files
foreach ($listoffiles as $file) {
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=mrps&file=invoices/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>';
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=mrps/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>';
}
$texte .= '</div>';
}
@ -284,8 +284,12 @@ class doc_generic_mo_odt extends ModelePDFMo
//print "file=".$file;
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->bom->dir_temp);
dol_mkdir($conf->mrp->dir_temp);
if (!is_writable($conf->mrp->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->mrp->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on order, we use it
$usecontact = false;
@ -342,11 +346,13 @@ class doc_generic_mo_odt extends ModelePDFMo
dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
// [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by
// [!-- BEGIN lines --]*[!-- END lines --]
//print html_entity_decode($odfHandler->__toString());
//print exit;
/*
// Make substitutions into odt of freetext
@ -379,20 +385,22 @@ class doc_generic_mo_odt extends ModelePDFMo
foreach ($tmparray as $key => $value) {
try {
if (preg_match('/logo$/', $key)) { // Image
if (preg_match('/logo$/', $key)) {
// Image
if (file_exists($value)) {
$odfHandler->setImage($key, $value);
} else {
$odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
} else // Text
{
} else {
// Text
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
} catch (OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
try {
$foundtagforlines = 1;
@ -403,6 +411,7 @@ class doc_generic_mo_odt extends ModelePDFMo
$foundtagforlines = 0;
dol_syslog($e->getMessage(), LOG_INFO);
}
if ($foundtagforlines) {
$linenumber = 0;
foreach ($object->lines as $line) {
@ -445,14 +454,14 @@ class doc_generic_mo_odt extends ModelePDFMo
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
*/
// Write new file
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
dol_syslog($e->getMessage(), LOG_INFO);
dol_syslog('Error in exportAsAttachedPDF: '.$e->getMessage(), LOG_INFO);
return -1;
}
} else {
@ -460,7 +469,7 @@ class doc_generic_mo_odt extends ModelePDFMo
$odfHandler->saveToDisk($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
dol_syslog($e->getMessage(), LOG_INFO);
dol_syslog('Error in saveToDisk: '.$e->getMessage(), LOG_INFO);
return -1;
}
}

View File

@ -52,7 +52,7 @@ abstract class ModelePDFMo extends CommonDocGenerator
// phpcs:enable
global $conf;
$type = 'mo';
$type = 'mrp';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -83,18 +83,18 @@ class doc_generic_product_odt extends ModelePDFProduct
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva PRODUCT_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option PRODUCT_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@ -302,7 +302,11 @@ class doc_generic_product_odt extends ModelePDFProduct
//print "conf->product->dir_temp=".$conf->product->dir_temp;
dol_mkdir($conf->product->dir_temp);
if (!is_writable($conf->product->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->product->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on product, we use it
$usecontact = false;

View File

@ -137,12 +137,12 @@ class pdf_standard extends ModelePDFProduct
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_logo = 1; // Display logo
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_freetext = 0; // Support add of a personalised text
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined

View File

@ -120,18 +120,18 @@ class doc_generic_project_odt extends ModelePDFProjects
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->pays_code) {
$this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
@ -574,6 +574,11 @@ class doc_generic_project_odt extends ModelePDFProjects
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->projet->dir_temp);
if (!is_writable($conf->projet->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If PROJECTLEADER contact defined on project, we use it
$usecontact = false;

View File

@ -121,21 +121,21 @@ class doc_generic_task_odt extends ModelePDFTask
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 0; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 0; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->pays_code) {
$this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
$this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined
}
}
@ -524,6 +524,11 @@ class doc_generic_task_odt extends ModelePDFTask
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->projet->dir_temp);
if (!is_writable($conf->task->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->task->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
$socobject = $project->thirdparty;

View File

@ -82,18 +82,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva PROPALE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@ -318,7 +318,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
//print "conf->propal->dir_temp=".$conf->propal->dir_temp;
dol_mkdir($conf->propal->multidir_temp[$object->entity]);
if (!is_writable($conf->propal->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->propal->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on proposal, we use it
$usecontact = false;

View File

@ -80,18 +80,18 @@ class doc_generic_reception_odt extends ModelePdfReception
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva RECEPTION_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option RECEPTION_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@ -282,7 +282,11 @@ class doc_generic_reception_odt extends ModelePdfReception
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->reception->dir_temp);
if (!is_writable($conf->reception->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->reception->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If BILLING contact defined on invoice, we use it
$usecontact = false;

View File

@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
*/
class pdf_squille extends ModelePdfReception
{
public $emetteur; // Objet societe qui emet
/**
* Issuer
* @var Societe object that emits
*/
public $emetteur;
/**
@ -58,7 +62,7 @@ class pdf_squille extends ModelePdfReception
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1;
$this->option_logo = 1; // Display logo
// Get source company
$this->emetteur = $mysoc;

View File

@ -76,12 +76,12 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_logo = 1; // Display logo
// Retrieves transmitter
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
}
}
@ -266,6 +266,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc
//exit;
dol_mkdir($conf->societe->multidir_temp[$object->entity]);
if (!is_writable($conf->societe->multidir_temp[$object->entity])) {
$this->error = "Failed to write in temp directory ".$conf->societe->multidir_temp[$object->entity];
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// Open and load template
require_once ODTPHP_PATH.'odf.php';

View File

@ -82,18 +82,18 @@ class doc_generic_stock_odt extends ModelePDFStock
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva STOCK_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option STOCK_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@ -291,7 +291,11 @@ class doc_generic_stock_odt extends ModelePDFStock
//print "conf->product->dir_temp=".$conf->product->dir_temp;
dol_mkdir($conf->product->dir_temp);
if (!is_writable($conf->product->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->product->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on stock, we use it
$usecontact = false;

View File

@ -137,12 +137,12 @@ class pdf_standard extends ModelePDFStock
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_codestockservice = 0; // Affiche code stock-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_freetext = 0; // Support add of a personalised text
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined

View File

@ -86,13 +86,13 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -280,8 +280,12 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
//print "file=".$file;
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->commande->dir_temp);
dol_mkdir($conf->fournisseur->commande->dir_temp);
if (!is_writable($conf->fournisseur->commande->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->fournisseur->commande->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If CUSTOMER contact defined on order, we use it
$usecontact = false;

View File

@ -148,13 +148,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; //Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -84,13 +84,13 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$this->marge_haute = 0;
$this->marge_basse = 0;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 0; // Gere option tva PROPALE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement
$this->option_condreg = 0; // Affiche conditions reglement
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION
$this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
@ -315,7 +315,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
//print "conf->propal->dir_temp=".$conf->propal->dir_temp;
dol_mkdir($conf->supplier_proposal->dir_temp);
if (!is_writable($conf->supplier_proposal->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->supplier_proposal->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
// If BILLING contact defined on invoice, we use it
$usecontact = false;

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