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

This commit is contained in:
Lamrani Abdel 2023-08-02 19:35:02 +02:00
commit 52a2d3174c
62 changed files with 741 additions and 373 deletions

View file

@ -19,11 +19,11 @@ NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22
NEW: Accountancy - iSuiteExpert export model
NEW: Accountancy - Quadratus export with attachments in accountancy export
NEW: Accountancy - Can filter on a custom group of accounts. Perf or ledger list.
NEW: Accountancy - Can select the export format during export of journals
NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
NEW: Authentication: #22740 add OpenID Connect impl
NEW: Authentication: add experimental support for Google OAuth2 connexion
NEW: Authentication: can now edit service name for OAuth token
NEW: Add a public virtual card page for each user
NEW: Add a status on supplier price ref (WIP to close a supplier ref)
NEW: add bookmarks in selectable landing pages for users
NEW: Add column ext_payment_site into societe_rib to allow multiple payment mode
@ -35,39 +35,31 @@ NEW: Add filters and sort on product unit column
NEW: Add link to edit VAT list from error message of missing VAT
NEW: add margins in paiement/card.php
NEW: Add mass action delete on VAT
NEW: Add origin info when create a product batch when created from a movement stock
NEW: Add possibility to choose format #21426
NEW: Add SQL contraint on product_stock table to allow only exsting product and warehouse #23543
NEW: Add STRIPE_DEBUG, a way to log Stripe IPN
NEW: An external module can modify the quick search fields
NEW: Auto activate some modules on install (Export/Import/Wysiwyg editor)
NEW: Autofill email form with the email template with status "Default" on
NEW: Bank name no more mandatory on creation. Can be generated if empty.
NEW: Bank: Bank name no more mandatory on creation. Can be generated if empty.
NEW: Bank: Add fields zip, town, country for owner of a bank account
NEW: batch referential objets
NEW: Can add the add now link on date into addfieldvalue()
NEW: Can bin accounting line for a given month
NEW: Can edit account on miscellaneous payment (if not transfered)
NEW: Can edit inline the VAT number from supplier tab
NEW: Can fill date of salary payment with date of start of salary
NEW: Can go back to draft on shipment when stock change not on validate
NEW: Can modify bank account of sepa payment (if file not sent yet)
NEW: Customers: add date due and labels into customer comm card
NEW: Can select the export format during export of journals
NEW: Can set a checkbox in formconfirm by clicking on the label
NEW: Can set flag default value on email templates
NEW: Can set the page "List of opportunities" as landing page
NEW: Can show the sql request used on emailing selection
NEW: Can show the SQL request used on emailing selection
NEW: can stay on edit field when errors occurs
NEW: comment in api_mymodule for seperate methods
NEW: create email substitution variable for intervention signature URL
NEW: Contacts: presend mass action in contact list
NEW: Contacts: hook printFieldListFrom in contact list
NEW: Customers: add date due and labels into customer comm card
NEW: Debug the custom CSS feature to avoid a directory search/scan at
NEW: dev name
NEW: Disable bad reputation product price
NEW: dolExplodeIntoArray can accept regex
NEW: dol_sort_array can sort on alphabetical order even if val is num
NEW: element time integration code + SQL
NEW: Email: autofill email form with the email template with status "Default" on
NEW: Email: don't have closed contact proposed as receiver for the mails
NEW: Email: can set flag default value on email templates
NEW: Email-Collector: add field reply-to in email collector as possible filter
NEW: Email-Collector: substitute date now in email collector
NEW: Email-Collector: operation type in email collector to load or create contact
@ -89,14 +81,15 @@ NEW: GUI: can set background style with MAIN_LOGIN_BACKGROUND_STYLE
NEW: Help: Tooltip to explain how to add a photo on a product
NEW: Help: Possibility to link to German pages in help
NEW: helper functions for dates + small demo case
NEW: hook printFieldListFrom in contact list
NEW: HR - Salary: can fill date of salary payment with date of start of salary
NEW: HR - Salary: can modify the date of payment of a salary (if not reconciled)
NEW: HR - Salary: date for salary payment includes the hour/min
NEW: HR - Salary: adding button Send Email on the salary file
NEW: Import: filter on entity in import
NEW: Import: map table to element for get entity in import
NEW: inc.php: handle parameters from argv
NEW: Invoice - show category of operations
NEW: Installation: Auto activate some modules on install (Export/Import/Wysiwyg editor)
NEW: Invoice: show category of operations
NEW: Keep a link between user created from recruitment and application
NEW: Mass Actions: Better responsive for mass actions
NEW: Members: add numbering modules for members
@ -111,7 +104,8 @@ NEW: No overwrite of optionals during put() contact
NEW: Notifications: add Customer Order delivered (ORDER_NEW) in module Notification
NEW: Notifications: for Sign or Refused Propal from Online Page
NEW: Now we can edit amount on VAT and salaries clone action
NEW: only get openned contact from liste_contact function, to not have acces to closed contact as mail receiver
NEW: only get opened contact from liste_contact function, to not have access to closed contact as mail receiver
NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
NEW: Option to manage deposit slips for more payment modes (not only
NEW: Option to show column for field and line selection on the left
NEW: Orders: add sub total in order list det
@ -120,19 +114,21 @@ NEW: Orders export: allow to export field 'shipment method'
NEW: payment default values when supplier order created from reception
NEW: Payment: manage contracts
NEW: Payment: sepaStripe now creates the payment mode with type pm_ using new API
NEW: presend mass action in contact list
NEW: Payment: add partial payment reason "withholding tax"
NEW: Payment: Can edit account on miscellaneous payment (if not transfered)
NEW: Print PDF: category of operation for crabe PDF model
NEW: Print PDF: Name and date to print on PDF Sign
NEW: Print PDF: Use the more recent PDF templates for documents by default on a fresh install
NEW: Print PDF: Option PDF_SHOW_PHONE_AFTER_USER_CONTACT to show phone after specific assigned contact on PDF
NEW: Print PDF: Option PDF_SHOW_EMAIL_AFTER_USER_CONTACT to show email after specific assigned contact on PDF
NEW: product images on popup are cached
NEW: Products: Add origin info when create a product batch when created from a movement stock
NEW: Products: Add statistics by amount on statistics of products.
NEW: Products: Add SQL contraint on product_stock table to allow only exsting product and warehouse #23543
NEW: Proposals: filter for Signed+Billed in proposals
NEW: Proposals: can modify margin rates in offers like VAT rates
NEW: Proposals: option filter for NoSalesRepresentativeAffected in proposals list
NEW: Proposals: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT
NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key
NEW: Reception: can receive more than qty ordered on reception
NEW: referential objects of batch
NEW: remove keys whose table element is the same as element in map list
@ -153,23 +149,24 @@ NEW: Supplier Invoices: add ability of ODT support to supplier invoices
NEW: Stock limit for alert and desired optimal stock by product and warehouse import
NEW: Stock: Add warehouse create and modify triggers.
NEW: Stock: Can select several warehouses into the view stock at date in past
NEW: Stripe: add STRIPE_DEBUG, a way to log Stripe IPN
NEW: Support different bank account for several direct debit payments
NEW: Support multiselect in the warehouse selection combo box
NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
NEW: Survey: Comment on survey is possible only after vote.
NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...)
NEW: TakePOS: adapt category and product pictures sizes on TakePOS
NEW: TakePOS: limit load products in TakePOS
NEW: The batch for remind on due date can be setup for using validation date
NEW: The refresh link for IMAP collector is always visible
NEW: The upgrade process can be done by creating a file upgrade.unlock
NEW: Third-Party: use an ajax component to switch prospection status on thirdparty list
NEW: Tickets: Send a notification email when ticket assigned
NEW: Tickets: set ticket status to answered if the client has answered from the public interface
NEW: Tickets: added an option to display the progress of tickets on the public interface
NEW: Tickets: add link to thirdparty tickets history
NEW: Tickets: notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR)
NEW: Upgrades: The upgrade process can be done by creating a file upgrade.unlock
NEW: Use a cache file for external RSS in calendar
NEW: Use by default the domain $dolibarr_main_url_root for SMTP HELO
NEW: Users: add a public virtual card page for each user
NEW: VAT can be modified during add of line
NEW: Website Module: Increment website counter on each page access in website module
NEW: write all fields and their properties in asciidoc format
@ -177,8 +174,6 @@ NEW: Can add an array of several links in date selector
NEW: Widgets: Implement MAIN_ACTIVATE_FILECACHE on birthday widget
NEW: Widgets: Add widget "The next upcoming events"
NEW: Widgets: Add widget of open opportunities
NEW: use an ajax component to switch prospection status on thirdparty list
NEW: Add partial payment reason "withholding tax"
@ -188,19 +183,24 @@ For developers or integrators:
NEW: Make it possible to select hours and minutes in form_confirm
NEW: add triggers on mailing
NEW: Add a trigger when create a shipping line batch and fix propagate missing errors
NEW: add function for listiong objects from directory
NEW: add function for listing objects from directory
NEW: add helplist property to describe fields of objects
NEW: Hooks: printFieldListFrom in contact list
NEW: Hooks: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign
NEW: Update lib parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe.
NEW: API: Support contact in post() document API
NEW: API: more APIs (update currency rate, upload of supplier documents, ...)
NEW: Hooks: printFieldListFrom in contact list
NEW: Hooks: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', add hook online sign
NEW: Libraries: Update libs parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe.
NEW: ModuleBuilder: updating in modulbuilder on tab Menu when adding object
NEW: ModuleBuilder: add/edit permissions
NEW: ModuleBuilder: better generated documentation
NEW: add sent info in the parameters provided to the hook sendMailAfter
NEW: add setAsSelectUser into factory for generic setup page
NEW: add option keepspace into dol_string_nospecialchar()
NEW: dol_sort_array can sort on alphabetical order even if val is num
NEW: dolExplodeIntoArray can accept regex
NEW: element time integration code + SQL
NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...)
NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key
WARNING:

View file

@ -4,16 +4,15 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
## Supported Versions for security reports
| Version | Supported |
| ---------- | ---------------------- |
| <= 17.0.0 | :x: |
| >= 17.0.1 | :white_check_mark: |
| >= develop | :white_check_mark: |
Security report are valid only on current stable version (see https://dolibarr.org web site to get current stable version) or on development version (branch "develop" on https://github.com/Dolibarr/dolibarr).
## Reporting a Vulnerability
To report a vulnerability, for a private report, please use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new) (if you have permissions).
Alternatively send an email to security@dolibarr.org (for everybody)
To report a vulnerability, for a private report, you can:
- Send your report on [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
- Or if you have permissions, use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new)
- Or send by email to security@dolibarr.org a clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary
## Hunting vulnerabilities on Dolibarr
@ -39,12 +38,12 @@ We are happy to thank everyone who submits valid reports which help us improve t
You must be the first reporter of the vulnerability (duplicate reports are closed).
You must send a clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommand to install software on your own platform.
You must not leak, manipulate, or destroy any user data of third parties to find your vulnerability.
Reports are processed around once a month.
## Scope for qualified vulnerabilities
ONLY vulnerabilities discovered, when the following setup on test platform is used, are "valid":

View file

@ -3,10 +3,10 @@ QODANA TUTO
This README explains how to use qodana to generate static analytics reports on the code
Install docker
apt install docker
Install qodana
Install qodana into ~/.loca/bin/qodana
curl -fsSL https://jb.gg/qodana-cli/install | bash
To run inspection on CLI
cd ~/git/dirtoscan

View file

@ -0,0 +1,15 @@
= Install SonarQube locally
Check you are using Install Java SDK 17
java --version must show 61
To install java sdk 17 on ubuntu:
sudo apt update
sudo apt install -y openjdk-17-jdk
Unzip the sonar package into a directory
Edit the file conf/sonar.properties to modify port 9000 and 9001 (already used by Eclipse or xdebug) into 9080 and 9081
Launch sonar with
bin/linux*/sonar.sh console

View file

@ -221,6 +221,7 @@ if (empty($conf->use_javascript_ajax)) {
$editor = new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST : 'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
$editor->Create();
} else {
// CKEditor inline enabled with the contenteditable="true"
print '<div style="border: 1px solid #888;" contenteditable="true">';
print $conf->global->FCKEDITOR_TEST;
print '</div>';

View file

@ -65,6 +65,9 @@ if (empty($reshook)) {
if (!dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type", 'aZ09'), 'chaine', 0, '', $conf->entity)) {
$error++;
}
if (!dolibarr_set_const($db, 'LDAP_USERACCOUNTCONTROL', GETPOST("userAccountControl", 'int'), 'chaine', 0, '', $conf->entity)) {
$error++;
}
if (!dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION", 'aZ09'), 'chaine', 0, '', $conf->entity)) {
$error++;
}
@ -195,6 +198,11 @@ print '<tr class="oddeven"><td>'.$langs->trans("Type").'</td><td>';
print $formldap->selectLdapServerType(getDolGlobalString('LDAP_SERVER_TYPE'), 'type');
print '</td><td>&nbsp;</td></tr>';
// userAccountControl
print '<tr class="oddeven"><td>'.$langs->trans("LDAPUserAccountControl").'</td><td>';
print '<input class="width75" type="text" name="userAccountControl" value="'.getDolGlobalString('LDAP_USERACCOUNTCONTROL', '512').'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPUserAccountControlExample").'</span></td></tr>';
// Version
print '<tr class="oddeven"><td>'.$langs->trans("Version").'</td><td>';
print $formldap->selectLdapServerProtocolVersion(getDolGlobalString('LDAP_SERVER_PROTOCOLVERSION'), 'LDAP_SERVER_PROTOCOLVERSION');

View file

@ -116,14 +116,14 @@ if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
// Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue = array();
$tabfieldvalue[25] = "label,lang,type_template,fk_user,private,position,topic,joinfiles,defaultfortype,content";
$tabfieldvalue[25] = "label,lang,type_template,fk_user,private,position,topic,email_from,joinfiles,defaultfortype,content";
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
$tabfieldvalue[25] .= ',content_lines';
}
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert = array();
$tabfieldinsert[25] = "label,lang,type_template,fk_user,private,position,topic,joinfiles,defaultfortype,content";
$tabfieldinsert[25] = "label,lang,type_template,fk_user,private,position,topic,email_from,joinfiles,defaultfortype,content";
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
$tabfieldinsert[25] .= ',content_lines';
}
@ -168,6 +168,7 @@ $tabhelp[25] = array(
'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"),
'position'=>$langs->trans("PositionIntoComboList"),
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
'email_from'=>$langs->trans('ForceEmailFrom'),
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
'defaultfortype'=>$langs->trans("DefaultForTypeDesc"),
'content'=>'<span class="small">'.$helpsubstit.'</span>',
@ -575,7 +576,7 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu
$morejs = array();
$morecss = array();
$sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, private, position, topic, joinfiles, defaultfortype, content_lines, content, enabled, active";
$sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, private, position, topic, email_from,joinfiles, defaultfortype, content_lines, content, enabled, active";
$sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates";
$sql .= " WHERE entity IN (".getEntity('email_template').")";
if (!$user->admin) {
@ -805,15 +806,18 @@ if ($action == 'create') {
print '<tr class="impair nodrag nodrop nohover"><td colspan="9" class="nobottom">';
// Show fields for topic, join files and body
$fieldsforcontent = array('topic', 'joinfiles', 'content');
$fieldsforcontent = array('topic', 'email_from', 'joinfiles', 'content');
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
$fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines');
$fieldsforcontent = array('topic', 'email_from', 'joinfiles', 'content', 'content_lines');
}
foreach ($fieldsforcontent as $tmpfieldlist) {
// Topic of email
if ($tmpfieldlist == 'topic') {
print '<strong>'.$form->textwithpicto($langs->trans("Topic"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong> ';
}
if ($tmpfieldlist == 'email_from') {
print $form->textwithpicto($langs->trans("MailFrom"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist);
}
if ($tmpfieldlist == 'joinfiles') {
print '<strong>'.$form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong> ';
}
@ -827,6 +831,8 @@ if ($action == 'create') {
// Input field
if ($tmpfieldlist == 'topic') {
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="'.(!empty($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : '').'">';
} elseif ($tmpfieldlist == 'email_from') {
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="'.(!empty($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : '').'">';
} elseif ($tmpfieldlist == 'joinfiles') {
print $form->selectyesno($tmpfieldlist, (isset($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : '0'), 1, false, 0, 1);
} else {
@ -1088,7 +1094,7 @@ if ($num) {
print '<tr class="oddeven nohover'.(in_array($tmpfieldlist, array('topic', 'joinfiles')) ? ' nobottom' : '').'" id="tr-'.$tmpfieldlist.'-'.$rowid.'">';
print '<td colspan="10">';
$fieldsforcontent = array('topic', 'joinfiles', 'content');
$fieldsforcontent = array('topic', 'email_from','joinfiles', 'content');
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
$fieldsforcontent[] = 'content_lines';
}
@ -1106,6 +1112,11 @@ if ($num) {
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'-'.$rowid.'" value="'.(!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '').'">';
print '<br>'."\n";
}
if ($tmpfieldlist == 'email_from') {
print '<strong>'.$form->textwithpicto($langs->trans("MailFrom"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong> ';
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'-'.$rowid.'" value="'.(!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '').'">';
print '<br>'."\n";
}
if ($tmpfieldlist == 'joinfiles') {
print '<strong>'.$form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong> ';
print $form->selectyesno($tmpfieldlist.'-'.$rowid, (isset($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : '0'), 1, false, 0, 1);

View file

@ -208,6 +208,14 @@ print '<input class="flat right width50" name="MAIN_SECURITY_MAX_ATTACHMENT_ON_F
print '</td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MaxNumberOfFailedAuth").'</td><td class="right">';
print '</td>';
print '<td class="nowrap">';
print '<input class="flat right width50" name="MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH" type="text" value="'.getDolGlobalInt("MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH", 100).'"> '.$langs->trans("FailedAuth");
print '</td>';
print '</tr>';
/*
if (empty($conf->global->MAIN_APPLICATION_TITLE)) {
$conf->global->MAIN_APPLICATION_TITLE = "";

View file

@ -21,9 +21,9 @@
*/
/**
* \file admin/availabilities_extrafields.php
* \ingroup bookcal
* \brief Page to setup extra fields of availabilities
* \file htdocs/bookcal/admin/availabilities_extrafields.php
* \ingroup bookcal
* \brief Page to setup extra fields of availabilities
*/
// Load Dolibarr environment
@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}
/*
* Creation of an optional field

View file

@ -21,9 +21,9 @@
*/
/**
* \file admin/booking_extrafields.php
* \ingroup bookcal
* \brief Page to setup extra fields of booking
* \file htdocs/bookcal/admin/booking_extrafields.php
* \ingroup bookcal
* \brief Page to setup extra fields of booking
*/
// Load Dolibarr environment
@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}
/*
* Creation of an optional field

View file

@ -21,9 +21,9 @@
*/
/**
* \file admin/calendar_extrafields.php
* \ingroup bookcal
* \brief Page to setup extra fields of calendar
* \file htdocs/bookcal/admin/calendar_extrafields.php
* \ingroup bookcal
* \brief Page to setup extra fields of calendar
*/
// Load Dolibarr environment

View file

@ -111,7 +111,7 @@ class Booking extends CommonObject
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2,),
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),

View file

@ -966,7 +966,7 @@ class BonPrelevement extends CommonObject
if ($format == 'FRST' && $bac->frstrecur != 'FRST') {
continue;
}
if ($format == 'RCUR' && ($bac->frstrecur != 'RCUR' && $bac->frstrecur != 'RECUR')) {
if ($format == 'RCUR' && $bac->frstrecur != 'RCUR') {
continue;
}
}

View file

@ -72,8 +72,10 @@ $bon = new BonPrelevement($db);
$hookmanager->initHooks(array('withdrawalsreceiptslist'));
$usercancreate = $user->rights->prelevement->bons->creer;
$permissiontodelete = $user->hasRight('prelevement', 'creer');
if ($type == 'bank-transfer') {
$usercancreate = $user->rights->paymentbybanktransfer->create;
$permissiontodelete = $user->hasRight('paymentbybanktransfer', 'create');
}
// Security check
@ -97,6 +99,61 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_amount = "";
}
// Mass actions
// Delete draft
if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) {
$db->begin();
$objecttmp = new BonPrelevement($db);
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
if ($objecttmp->status != $objecttmp::STATUS_DRAFT || $objecttmp->credite > 0 || $objecttmp->date_creation != null) {
$langs->load("errors");
$nbignored++;
$TMsg[] = '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
continue;
}
$result = $objecttmp->delete($user);
if ($result < 0) { // if delete returns is < 0, there is an error, we break and rollback later
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
break;
} else {
$nbok++;
}
} else {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
break;
}
}
if (empty($error)) {
// Message for elements well deleted
if ($nbok > 1) {
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
} elseif ($nbok > 0) {
setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
} else {
setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
}
// Message for elements which can't be deleted
if (!empty($TMsg)) {
sort($TMsg);
setEventMessages('', array_unique($TMsg), 'warnings');
}
$db->commit();
} else {
$db->rollback();
}
$massaction = '';
}
$objectclass = 'BonPrelevement';
$objectlabel = 'BonPrelevement';
$uploaddir = $conf->prelevement->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
/*
* View
@ -194,6 +251,9 @@ $arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
if (!empty($permissiontodelete)) {
$arrayofmassactions['predeletedraft'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@ -221,7 +281,10 @@ if ($usercancreate) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type));
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
$moreforfilter = '';
/*$moreforfilter.='<div class="divsearchfield">';

View file

@ -1552,8 +1552,11 @@ class Contact extends CommonObject
if ($withpicto) {
if ($withpicto < 0) {
$result .= '<!-- picto photo user --><span class="nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).'</span>';
if ($withpicto != 2 && $withpicto != -2) {
$result .= ' ';
}
} else {
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"'), 0, 0, $notooltip ? 0 : 1);
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="pictofixedwidth"' : '') : 'class="'.(($withpicto != 2) ? 'pictofixedwidth ' : '').'"'), 0, 0, $notooltip ? 0 : 1);
}
}
if ($withpicto != 2 && $withpicto != -2) {
@ -2210,7 +2213,7 @@ class Contact extends CommonObject
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) {
$return .= '<div class="info-box-ref opacitymedium tdoverflowmax150">'.$this->thirdparty->getNomUrl(1).'</div>';
$return .= '<div class="info-box-ref tdoverflowmax150">'.$this->thirdparty->getNomUrl(1).'</div>';
}
/*if (property_exists($this, 'phone_pro') && !empty($this->phone_pro)) {
$return .= '<br>'.img_picto($langs->trans("Phone"), 'phone');

View file

@ -1347,7 +1347,7 @@ while ($i < $imaxinloop) {
// (Last) Name
if (!empty($arrayfields['p.lastname']['checked'])) {
print '<td class="middle tdoverflowmax150">';
print $contactstatic->getNomUrl(1);
print $contactstatic->getNomUrl(-1);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;

View file

@ -296,6 +296,14 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
if ($obj) {
$from = dol_string_nospecial($obj->label, ' ', array(",")).' <'.$obj->email.'>';
}
} elseif (preg_match('/from_template_(\d+)/', $fromtype, $reg)) {
$sql = 'SELECT rowid, email_from FROM '.MAIN_DB_PREFIX.'c_email_templates';
$sql .= ' WHERE rowid = '.(int) $reg[1];
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);
if ($obj) {
$from = $obj->email_from;
}
} else {
$from = dol_string_nospecial(GETPOST('fromname'), ' ', array(",")).' <'.GETPOST('frommail').'>';
}

View file

@ -57,12 +57,12 @@ abstract class CommonObject
public $db;
/**
* @var int The object identifier
* @var int The object identifier
*/
public $id;
/**
* @var int The environment ID when using a multicompany module
* @var int The environment ID when using a multicompany module
*/
public $entity;
@ -83,38 +83,38 @@ abstract class CommonObject
public $errors = array();
/**
* @var array To store error results of ->validateField()
* @var array To store error results of ->validateField()
*/
private $validateFieldsErrors = array();
/**
* @var string ID to identify managed object
* @var string ID to identify managed object
*/
public $element;
/**
* @var int The related element
* @var int The related element
*/
public $fk_element;
/**
* @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
* @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
*/
public $element_for_permission;
/**
* @var string Name of table without prefix where object is stored
* @var string Name of table without prefix where object is stored
*/
public $table_element;
/**
* @var string Name of subtable line
* @var string Name of subtable line
*/
public $table_element_line = '';
/**
* @var int 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table
* @var int 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table
*/
public $ismultientitymanaged;
@ -129,7 +129,7 @@ abstract class CommonObject
public $array_options = array();
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array();
@ -174,7 +174,7 @@ abstract class CommonObject
protected $table_ref_field = '';
/**
* @var integer 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* @var integer 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
*/
public $restrictiononfksoc = 0;
@ -204,7 +204,7 @@ abstract class CommonObject
public $fk_project;
/**
* @var Project The related project object
* @var Project The related project object
* @deprecated
* @see project
*/
@ -235,56 +235,57 @@ abstract class CommonObject
public $thirdparty;
/**
* @var User A related user
* @var User A related user
* @see fetch_user()
*/
public $user;
/**
* @var string The type of originating object ('commande', 'facture', ...). Note: on some object this field is called $origin_type
* @var string The type of originating object ('commande', 'facture', ...). Note: on some object this field is called $origin_type
* @see fetch_origin()
*/
public $origin;
/**
* @var int The id of originating object
* @var int The id of originating object
* @see fetch_origin()
*/
public $origin_id;
/**
* @var string The object's reference
* @var string The object's reference
*/
public $ref;
/**
* @var string An external reference for the object
* @var string An external reference for the object
*/
public $ref_ext;
/**
* @var string The object's previous reference
* @var string The object's previous reference
*/
public $ref_previous;
/**
* @var string The object's next reference
* @var string The object's next reference
*/
public $ref_next;
/**
* @var string Ref to store on object to save the new ref to use for example when making a validate() of an object
* @var string Ref to store on object to save the new ref to use for example when making a validate() of an object
*/
public $newref;
/**
* @var int The object's status. Prefer use of status.
* @var int The object's status. Prefer use of status.
* @deprecated
* @see setStatut()
*/
public $statut;
/**
* @var int The object's status
* @var int The object's status
* @see setStatut()
*/
public $status;
@ -370,50 +371,50 @@ abstract class CommonObject
public $barcode_type_coder;
/**
* @var int Payment method ID (cheque, cash, ...)
* @var int Payment method ID (cheque, cash, ...)
* @see setPaymentMethods()
*/
public $mode_reglement_id;
/**
* @var int Payment terms ID
* @var int Payment terms ID
* @see setPaymentTerms()
*/
public $cond_reglement_id;
/**
* @var int Demand reason ID
* @var int Demand reason ID
*/
public $demand_reason_id;
/**
* @var int Transport mode ID (For module intracomm report)
* @var int Transport mode ID (For module intracomm report)
* @see setTransportMode()
*/
public $transport_mode_id;
/**
* @var int Payment terms ID
* @var int Payment terms ID
* @deprecated Kept for compatibility
* @see cond_reglement_id;
*/
public $cond_reglement;
/**
* @var int Delivery address ID
* @var int Delivery address ID
* @see setDeliveryAddress()
* @deprecated
*/
public $fk_delivery_address;
/**
* @var int Shipping method ID
* @var int Shipping method ID
* @see setShippingMethod()
*/
public $shipping_method_id;
/**
* @var string Shipping method label
* @var string Shipping method label
* @see setShippingMethod()
*/
public $shipping_method;
@ -448,31 +449,31 @@ abstract class CommonObject
public $last_main_doc;
/**
* @var int Bank account ID sometimes, ID of record into llx_bank sometimes
* @var int Bank account ID sometimes, ID of record into llx_bank sometimes
* @deprecated
* @see $fk_account
*/
public $fk_bank;
/**
* @var int Bank account ID
* @var int Bank account ID
* @see SetBankAccount()
*/
public $fk_account;
/**
* @var string Open ID
* @var string Open ID
*/
public $openid;
/**
* @var string Public note
* @var string Public note
* @see update_note()
*/
public $note_public;
/**
* @var string Private note
* @var string Private note
* @see update_note()
*/
public $note_private;
@ -484,31 +485,31 @@ abstract class CommonObject
public $note;
/**
* @var float Total amount before taxes
* @var float Total amount before taxes
* @see update_price()
*/
public $total_ht;
/**
* @var float Total VAT amount
* @var float Total VAT amount
* @see update_price()
*/
public $total_tva;
/**
* @var float Total local tax 1 amount
* @var float Total local tax 1 amount
* @see update_price()
*/
public $total_localtax1;
/**
* @var float Total local tax 2 amount
* @var float Total local tax 2 amount
* @see update_price()
*/
public $total_localtax2;
/**
* @var float Total amount with taxes
* @var float Total amount with taxes
* @see update_price()
*/
public $total_ttc;
@ -525,22 +526,22 @@ abstract class CommonObject
public $comments = array();
/**
* @var string The name
* @var string The name
*/
public $name;
/**
* @var string The lastname
* @var string The lastname
*/
public $lastname;
/**
* @var string The firstname
* @var string The firstname
*/
public $firstname;
/**
* @var string The civility code, not an integer
* @var string The civility code, not an integer
*/
public $civility_id;
@ -559,9 +560,10 @@ abstract class CommonObject
* @var integer|string $date_modification;
*/
public $date_modification; // Date last change (tms field)
/**
* @var integer|string $date_modification;
* @deprecated Use date_modification
* @deprecated Use date_modification
*/
public $date_update;
@ -575,11 +577,13 @@ abstract class CommonObject
* @TODO Merge with user_creation
*/
public $user_author;
/**
* @var User|int User author/creation
* @TODO Remove type id
*/
public $user_creation;
/**
* @var int User id author/creation
*/
@ -590,15 +594,18 @@ abstract class CommonObject
* @TODO Merge with user_validation
*/
public $user_valid;
/**
* @var User|int User of validation
* @TODO Remove type id
*/
public $user_validation;
/**
* @var int User id of validation
*/
public $user_validation_id;
/**
* @var int User id closing object
*/
@ -609,6 +616,7 @@ abstract class CommonObject
* @TODO Remove type id
*/
public $user_modification;
/**
* @var int User id last modifier
*/
@ -623,26 +631,26 @@ abstract class CommonObject
public $specimen = 0;
/**
* @var int Id of contact to send object (used by the trigger of module Agenda)
* @var int Id of contact to send object (used by the trigger of module Agenda)
*/
public $sendtoid;
/**
* @var float Amount already paid (used to show correct status)
* @var float Amount already paid (used to show correct status)
*/
public $alreadypaid;
public $labelStatus;
protected $labelStatusShort;
/**
* @var int showphoto_on_popup
* @var int show photo on popup
*/
public $showphoto_on_popup;
/**
* @var array nb used in load_stateboard
* @var array nb used in load_stateboard
*/
public $nb = array();
@ -652,12 +660,12 @@ abstract class CommonObject
public $output;
/**
* @var array extraparams
* @var array extra parameters
*/
public $extraparams = array();
/**
* @var array List of child tables. To test if we can delete object.
* @var array List of child tables. To test if we can delete object.
*/
protected $childtables = array();

View file

@ -999,9 +999,9 @@ class ExtraFields
} elseif ($type == 'radio') {
$morecss = 'width25';
} else {
if (empty($size) || round($size) < 12) {
if (empty($size) || round((float) $size) < 12) {
$morecss = 'minwidth100';
} elseif (round($size) <= 48) {
} elseif (round((float) $size) <= 48) {
$morecss = 'minwidth200';
} else {
$morecss = 'minwidth400';

View file

@ -77,7 +77,7 @@ class HookManager
* Then when a hook executeHooks('aMethod'...) is called, the method aMethod found into class will be executed.
*
* @param string[] $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ...
* @return int|void Always 1
* @return int 0 or 1
*/
public function initHooks($arraycontext)
{
@ -85,7 +85,7 @@ class HookManager
// Test if there is hooks to manage
if (!is_array($conf->modules_parts['hooks']) || empty($conf->modules_parts['hooks'])) {
return;
return 0;
}
// For backward compatibility

View file

@ -753,14 +753,14 @@ class FormCompany extends Form
if ($disabled) {
print ' disabled';
}
print ' selected>' . dol_trunc($obj->name, 24) . '</option>';
print ' selected>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>';
$firstCompany = $obj->rowid;
} else {
print '<option value="' . $obj->rowid . '"';
if ($disabled) {
print ' disabled';
}
print '>' . dol_trunc($obj->name, 24) . '</option>';
print '>' . dol_escape_htmltag($obj->name, 0, 0, '', 0, 1) . '</option>';
}
$i++;
}

View file

@ -75,7 +75,7 @@ class FormExpenseReport
}
foreach ($arrayoflabels as $key => $val) {
if ($selected != '' && $selected == $key) {
$html .= '<option value="'.$key.'" selected>';;
$html .= '<option value="'.$key.'" selected>';
} else {
$html .= '<option value="'.$key.'">';
}

View file

@ -614,6 +614,11 @@ class FormMail extends Form
'global_aliases' => getDolGlobalString('MAIN_INFO_SOCIETE_MAIL_ALIASES'),
);
if (!empty($arraydefaultmessage->email_from)) {
$templatemailfrom = ' &lt;'.$arraydefaultmessage->email_from.'&gt;';
$liste['from_template_'.GETPOST('modelmailselected')] = array('label' => $templatemailfrom, 'data-html' => $templatemailfrom);
}
// Also add robot email
if (!empty($this->fromalsorobot)) {
if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && getDolGlobalString('MAIN_MAIL_EMAIL_FROM') != getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
@ -663,7 +668,7 @@ class FormMail extends Form
// Using combo here make the '<email>' no more visible on list.
//$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 1, '', $disablebademails);
$out .= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 0, '', $disablebademails);
$out .= ' '.$form->selectarray('fromtype', $liste, !empty($arraydefaultmessage->email_from) ? 'from_template_'.GETPOST('modelmailselected') : $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 0, '', $disablebademails);
}
$out .= "</td></tr>\n";
@ -1329,7 +1334,7 @@ class FormMail extends Form
$languagetosearchmain = '';
}
$sql = "SELECT rowid, module, label, type_template, topic, joinfiles, content, content_lines, lang, email_from, email_to, email_tocc, email_tobcc";
$sql = "SELECT rowid, module, label, type_template, topic, email_from, joinfiles, content, content_lines, lang, email_from, email_to, email_tocc, email_tobcc";
$sql .= " FROM ".$dbs->prefix().'c_email_templates';
$sql .= " WHERE (type_template = '".$dbs->escape($type_template)."' OR type_template = 'all')";
$sql .= " AND entity IN (".getEntity('c_email_templates').")";
@ -1388,6 +1393,7 @@ class FormMail extends Form
$ret->content = $obj->content;
$ret->content_lines = $obj->content_lines;
$ret->joinfiles = $obj->joinfiles;
$ret->email_from = $obj->email_from;
break;
} else {

View file

@ -850,7 +850,7 @@ class FormOther
if (!is_array($arrayofcolors) || count($arrayofcolors) < 1) {
// Case of selection of any color
$langs->load("other");
if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax) && getDolGlobalInt('MAIN_USE_HTML5_COLOR_SELECTOR')) {
if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax) && !getDolGlobalInt('MAIN_USE_HTML5_COLOR_SELECTOR')) {
$out .= '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />';
$out .= '<script nonce="'.getNonce().'" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/jpicker-1.1.6.js"></script>';
$out .= '<script nonce="'.getNonce().'" type="text/javascript">

View file

@ -1477,10 +1477,20 @@ class FormTicket
print '<input type="submit" class="button" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
print '</div></td>';
}
// Subject
// Subject/topic
$topic = "";
foreach ($formmail->lines_model as $line) {
if ($this->param['models_id'] == $line->id) {
$topic = $line->topic;
break;
}
}
print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$langs->trans('TicketNewMessage').'" />';
if (empty($topic)) {
print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$langs->trans('TicketNewMessage').'" />';
} else {
print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$topic.'" />';
}
print '</td></tr>';
// Recipients / adressed-to

View file

@ -51,9 +51,9 @@ class DoliDBMysqli extends DoliDB
*
* @param string $type Type of database (mysql, pgsql...)
* @param string $host Address of database server
* @param string $user Nom de l'utilisateur autorise
* @param string $pass Mot de passe
* @param string $name Nom de la database
* @param string $user Name of database user
* @param string $pass Password of database user
* @param string $name Name of database
* @param int $port Port of database server
*/
public function __construct($type, $host, $user, $pass, $name = '', $port = 0)
@ -233,15 +233,16 @@ class DoliDBMysqli extends DoliDB
//mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
// Can also be
// mysqli::init(); mysql::options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0'); mysqli::options(MYSQLI_OPT_CONNECT_TIMEOUT, 5);
// return mysqli::real_connect($host, $user, $pass, $db, $port);
$tmp = false;
try {
if (!class_exists('mysqli')) {
dol_print_error('', 'Driver mysqli for PHP not available');
}
$tmp = new mysqli($host, $login, $passwd, $name, $port);
if (strpos($host, 'ssl://') === 0) {
$tmp = new mysqliDoli($host, $login, $passwd, $name, $port);
} else {
$tmp = new mysqli($host, $login, $passwd, $name, $port);
}
} catch (Exception $e) {
dol_syslog(get_class($this)."::connect failed", LOG_DEBUG);
}
@ -1236,3 +1237,33 @@ class DoliDBMysqli extends DoliDB
return $result;
}
}
/**
* Class to make SSL connection
*/
class mysqliDoli extends mysqli
{
/**
* Constructor.
* This create an opened connexion to a database server and eventually to a database
*
* @param string $host Address of database server
* @param string $user Name of database user
* @param string $pass Password of database user
* @param string $name Name of database
* @param int $port Port of database server
* @param string $socket Socket
*/
public function __construct($host, $user, $pass, $name, $port = 0, $socket = "")
{
$flags = 0;
parent::init();
if (strpos($host, 'ssl://') === 0) {
$host = substr($host, 6);
parent::options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false);
parent::ssl_set(null, null, "", null, null);
$flags = MYSQLI_CLIENT_SSL;
}
parent::real_connect($host, $user, $pass, $name, $port, $socket, $flags);
}
}

View file

@ -51,109 +51,134 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
dol_syslog("functions_dolibarr::check_user_password_dolibarr usertotest=".$usertotest." passwordtotest=".preg_replace('/./', '*', $passwordtotest)." entitytotest=".$entitytotest);
// If test username/password asked, we define $test=false if ko and $login var to login if ok, set also $_SESSION["dol_loginmesg"] if ko
$table = MAIN_DB_PREFIX."user";
$usernamecol1 = 'login';
$usernamecol2 = 'email';
$entitycol = 'entity';
$sql = "SELECT rowid, login, entity, pass, pass_crypted, datestartvalidity, dateendvalidity, flagdelsessionsbefore";
$sql .= " FROM ".$table;
$sql .= " WHERE (".$usernamecol1." = '".$db->escape($usertotest)."'";
if (preg_match('/@/', $usertotest)) {
$sql .= " OR ".$usernamecol2." = '".$db->escape($usertotest)."'";
}
$sql .= ") AND ".$entitycol." IN (0,".($entity ? ((int) $entity) : 1).")";
$sql .= " AND statut = 1";
// Order is required to firstly found the user into entity, then the superadmin.
// For the case (TODO: we must avoid that) a user has renamed its login with same value than a user in entity 0.
$sql .= " ORDER BY entity DESC";
// Note: Test on validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method
// Verification number of USER_LOGIN_FAILED
$dateverificationauth = dol_time_plus_duree(dol_now(), -1, 'd');
$userremoteip = getUserRemoteIP();
$nbevents = 0;
$sql = "SELECT COUNT(e.rowid) as nbevent";
$sql .= " FROM ".MAIN_DB_PREFIX."events as e";
$sql .= " WHERE e.type = 'USER_LOGIN_FAILED'";
$sql .= " AND e.ip = '".$db->escape($userremoteip)."'";
$sql .= " AND e.dateevent > '".$db->idate($dateverificationauth)."'";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj) {
$passclear = $obj->pass;
$passcrypted = $obj->pass_crypted;
$passtyped = $passwordtotest;
$nbevents = $obj->nbevent;
}
}
$passok = false;
if ($nbevents <= getDolGlobalInt("MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH", 100)) {
// If test username/password asked, we define $test=false if ko and $login var to login if ok, set also $_SESSION["dol_loginmesg"] if ko
$table = MAIN_DB_PREFIX."user";
$usernamecol1 = 'login';
$usernamecol2 = 'email';
$entitycol = 'entity';
// Check crypted password
$cryptType = '';
if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) {
$cryptType = $conf->global->DATABASE_PWD_ENCRYPTED;
}
$sql = "SELECT rowid, login, entity, pass, pass_crypted, datestartvalidity, dateendvalidity, flagdelsessionsbefore";
$sql .= " FROM ".$table;
$sql .= " WHERE (".$usernamecol1." = '".$db->escape($usertotest)."'";
if (preg_match('/@/', $usertotest)) {
$sql .= " OR ".$usernamecol2." = '".$db->escape($usertotest)."'";
}
$sql .= ") AND ".$entitycol." IN (0,".($entity ? ((int) $entity) : 1).")";
$sql .= " AND statut = 1";
// Order is required to firstly found the user into entity, then the superadmin.
// For the case (TODO: we must avoid that) a user has renamed its login with same value than a user in entity 0.
$sql .= " ORDER BY entity DESC";
// By default, we use default setup for encryption rule
if (!in_array($cryptType, array('auto'))) {
$cryptType = 'auto';
}
// Check crypted password according to crypt algorithm
if ($cryptType == 'auto') {
if ($passcrypted && dol_verifyHash($passtyped, $passcrypted, '0')) {
$passok = true;
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - hash ".$cryptType." of pass is ok");
// Note: Test on validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj) {
$passclear = $obj->pass;
$passcrypted = $obj->pass_crypted;
$passtyped = $passwordtotest;
$passok = false;
// Check crypted password
$cryptType = '';
if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) {
$cryptType = $conf->global->DATABASE_PWD_ENCRYPTED;
}
}
// For compatibility with very old versions
if (!$passok) {
if ((!$passcrypted || $passtyped)
&& ($passclear && ($passtyped == $passclear))) {
$passok = true;
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found old pass in database", LOG_WARNING);
// By default, we use default setup for encryption rule
if (!in_array($cryptType, array('auto'))) {
$cryptType = 'auto';
}
// Check crypted password according to crypt algorithm
if ($cryptType == 'auto') {
if ($passcrypted && dol_verifyHash($passtyped, $passcrypted, '0')) {
$passok = true;
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - hash ".$cryptType." of pass is ok");
}
}
}
// Password ok ?
if ($passok) {
$login = $obj->login;
// For compatibility with very old versions
if (!$passok) {
if ((!$passcrypted || $passtyped)
&& ($passclear && ($passtyped == $passclear))) {
$passok = true;
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found old pass in database", LOG_WARNING);
}
}
// Password ok ?
if ($passok) {
$login = $obj->login;
} else {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE);
sleep(1); // Anti brut force protection. Must be same delay when login is not valid
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
}
// We must check entity
if ($passok && isModEnabled('multicompany')) { // We must check entity
global $mc;
if (!isset($mc)) {
!isModEnabled('multicompany'); // Global not available, disable $conf->multicompany->enabled for safety
} else {
$ret = $mc->checkRight($obj->rowid, $entitytotest);
if ($ret < 0) {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO entity '".$entitytotest."' not allowed for user '".$obj->rowid."'", LOG_NOTICE);
$login = ''; // force authentication failure
if ($mc->db->lasterror()) {
$_SESSION["dol_loginmesg"] = $mc->db->lasterror();
}
}
}
}
} else {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE);
sleep(1); // Anti brut force protection. Must be same delay when login is not valid
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE);
sleep(1); // Anti brut force protection. Must be same delay when password is not valid
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
}
// We must check entity
if ($passok && isModEnabled('multicompany')) { // We must check entity
global $mc;
if (!isset($mc)) {
!isModEnabled('multicompany'); // Global not available, disable $conf->multicompany->enabled for safety
} else {
$ret = $mc->checkRight($obj->rowid, $entitytotest);
if ($ret < 0) {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO entity '".$entitytotest."' not allowed for user '".$obj->rowid."'", LOG_NOTICE);
$login = ''; // force authentication failure
if ($mc->db->lasterror()) {
$_SESSION["dol_loginmesg"] = $mc->db->lasterror();
}
}
}
}
} else {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE);
sleep(1); // Anti brut force protection. Must be same delay when password is not valid
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO db error for '".$usertotest."' error=".$db->lasterror(), LOG_ERR);
sleep(1);
$_SESSION["dol_loginmesg"] = $db->lasterror();
}
} else {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO db error for '".$usertotest."' error=".$db->lasterror(), LOG_ERR);
sleep(1);
$_SESSION["dol_loginmesg"] = $db->lasterror();
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO Too many attempts", LOG_NOTICE);
sleep(1); // Anti brut force protection. Must be same delay when password is not valid
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorTooManyAttempts");
}
}
return $login;
}

View file

@ -357,7 +357,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
$pdf->Rect(80, $posY, 5, 5);
$pdf->SetXY(80, $posY);
if ($object->frstrecur == 'RECUR') {
if ($object->frstrecur == 'RCUR') {
$pdf->MultiCell(5, 3, 'X', 0, 'L');
}
$pdf->SetXY(86, $posY);

View file

@ -363,8 +363,8 @@ class ExportExcel2007 extends ModeleExports
if ($typefield == 'Text' || $typefield == 'TextAuto') {
// If $newvalue start with an equal sign we don't want it to be interpreted as a formula, so we add a '. Such transformation should be
// done by SetCellValueByColumnAndRow but it is not, so we do it ourself.
$newvalue = (dol_substr($newvalue, 0, 1) === '=' ? '\'' : '') . (string) $newvalue;
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, (string) $newvalue);
$newvalue = (dol_substr($newvalue, 0, 1) === '=' ? '\'' : '') . $newvalue;
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $newvalue);
$coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
$this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT);

View file

@ -89,8 +89,8 @@ class modBom extends DolibarrModules
'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
'css' => array('/bom/css/bom.css.php'), // Set this to relative path of css file if module has its own css file
'js' => array('/bom/js/bom.js.php'), // Set this to relative path of js file if module must load a js on all pages
'css' => array('/bom/css/bom.css.php'), // Set this to relative path of css file if module has its own css file
'js' => array('/bom/js/bom.js.php'), // Set this to relative path of js file if module must load a js on all pages
'hooks' => array('data'=>array('hookcontext1','hookcontext2'), 'entity'=>'0'), // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
'moduleforexternal' => 0 // Set this to 1 if feature of module are opened to external users
*/

View file

@ -259,32 +259,32 @@ class modBookCal extends DolibarrModules
$r = 0;
// Add here entries to declare new permissions
/* BEGIN MODULEBUILDER PERMISSIONS */
$this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 0 + 1);
$this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 1);
$this->rights[$r][1] = 'Read objects of BookCal';
$this->rights[$r][4] = 'availabilities';
$this->rights[$r][5] = 'read';
$r++;
$this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 1 + 1);
$this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 2);
$this->rights[$r][1] = 'Create/Update objects of BookCal';
$this->rights[$r][4] = 'availabilities';
$this->rights[$r][5] = 'write';
$r++;
$this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 2 + 1);
$this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 3);
$this->rights[$r][1] = 'Delete objects of BookCal';
$this->rights[$r][4] = 'availabilities';
$this->rights[$r][5] = 'delete';
$r++;
$this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 0 + 1);
$this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 1);
$this->rights[$r][1] = 'Read Calendar object of BookCal';
$this->rights[$r][4] = 'calendar';
$this->rights[$r][5] = 'read';
$r++;
$this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 1 + 1);
$this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 2);
$this->rights[$r][1] = 'Create/Update Calendar object of BookCal';
$this->rights[$r][4] = 'calendar';
$this->rights[$r][5] = 'write';
$r++;
$this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 2 + 1);
$this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 3);
$this->rights[$r][1] = 'Delete Calendar object of BookCal';
$this->rights[$r][4] = 'calendar';
$this->rights[$r][5] = 'delete';

View file

@ -86,6 +86,7 @@ class modLdap extends DolibarrModules
12=>array('LDAP_FIELD_FAX', 'chaine', 'facsimiletelephonenumber', '', 0),
13=>array('LDAP_FIELD_MOBILE', 'chaine', 'mobile', '', 0),
14=>array('LDAP_GROUP_FILTER', 'chaine', '&(objectClass=groupOfNames)', '', 0),
15=>array('LDAP_USERACCOUNTCONTROL', 'int', 512, '', 0),
);
// Boxes

View file

@ -143,7 +143,8 @@ if ($permission) {
<div class="tagtd nowrap noborderbottom">
<?php
$selectedCompany = GETPOSTISSET("newcompany") ? GETPOST("newcompany", 'int') : (empty($object->socid) ? 0 : $object->socid);
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); // This also print the select component
?>
</div>
<div class="tagtd noborderbottom minwidth500imp">
<?php

View file

@ -89,6 +89,11 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info);
//For compatibility with Samba 4 AD
if ($ldap->serverType == "activedirectory") {
$info['userAccountControl'] = $conf->global->LDAP_USERACCOUNTCONTROL;
}
$result = $ldap->add($dn, $info, $user);
}
@ -210,6 +215,33 @@ class InterfaceLdapsynchro extends DolibarrTriggers
}
} elseif ($action == 'USER_ENABLEDISABLE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (intval($conf->global->LDAP_SYNCHRO_ACTIVE) === Ldap::SYNCHRO_DOLIBARR_TO_LDAP && $conf->global->LDAP_SERVER_TYPE == "activedirectory") {
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result > 0) {
$info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info);
$search = "(" . $object->_load_ldap_dn($info, 2) . ")";
$uAC = $ldap->getAttributeValues($search, "userAccountControl");
if ($uAC["count"] == 1) {
$userAccountControl = intval($uAC[0]);
$enabledBitMask = 0x2;
$isEnabled = ($userAccountControl & $enabledBitMask) === 0;
if ($isEnabled && intval($object->statut) === 1) {
$userAccountControl += 2;
} elseif (!$isEnabled && intval($object->statut) === 0) {
$userAccountControl -= 2;
}
$info['userAccountControl'] = $userAccountControl;
$resUpdate = $ldap->update($dn, $info, $user, $dn);
if ($resUpdate < 0) {
$this->error = "ErrorLDAP " . $ldap->error;
}
}
} else {
$this->error = "ErrorLDAP " . $ldap->error;
}
}
} elseif ($action == 'USER_DELETE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE) && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') === Ldap::SYNCHRO_DOLIBARR_TO_LDAP) {
@ -311,9 +343,18 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
}
// Avoid Ldap error due to empty member
if (isset($info['member']) && empty($info['member'])) {
unset($info['member']);
}
$result = $ldap->add($dn, $info, $user);
}
if ($ldap->serverType == "activedirectory") {
$info['sAMAccountName'] = $object->name;
}
if ($result < 0) {
$this->error = "ErrorLDAP ".$ldap->error;
}

View file

@ -78,7 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('doncard', 'globalcard'));
$hookmanager->initHooks(array($object->element.'card', 'globalcard'));
$upload_dir = $conf->don->dir_output;

View file

@ -38,6 +38,7 @@ $action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'defineholidaylist';
$massaction = GETPOST('massaction', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('optioncss', 'aZ');
$search_name = GETPOST('search_name', 'alpha');
$search_supervisor = GETPOST('search_supervisor', 'int');
@ -85,6 +86,13 @@ if (empty($user->rights->holiday->read)) {
accessforbidden();
}
$arrayfields = array(
'cp.rowid'=>array('label'=>$langs->trans("Employee"), 'checked'=>1, 'position'=>20),
'cp.fk_user'=>array('label'=>$langs->trans("Supervisor"), 'checked'=>1, 'position'=>30),
'cp.nbHoliday'=>array('label'=>$langs->trans("MenuConfCP"), 'checked'=>1, 'position'=>40),
'cp.note_public'=>array('label'=>$langs->trans("Note"), 'checked'=>1, 'position'=>50),
);
/*
* Actions
@ -157,8 +165,6 @@ if (empty($reshook)) {
if ($result < 0) {
setEventMessages($holiday->error, $holiday->errors, 'errors');
$error++;
} elseif ($result == 0) {
setEventMessages($langs->trans("HolidayQtyNotModified", $user->login), null, 'warnings');
}
// Update of the days of the employee
@ -184,6 +190,10 @@ if (empty($reshook)) {
}
}
if (!$error && !$nbok) {
setEventMessages($langs->trans("HolidayQtyNotModified", $user->login), null, 'warnings');
}
if (!$error) {
$db->commit();
@ -302,6 +312,7 @@ if (is_numeric($listUsers) && $listUsers < 0) {
$i = 0;
if (count($typeleaves) == 0) {
//print '<div class="info">';
print $langs->trans("NoLeaveWithCounterDefined")."<br>\n";
@ -315,62 +326,93 @@ if (count($typeleaves) == 0) {
$moreforfilter = '';
$selectedfields = '';
if ($massactionbutton) {
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields .= ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
}
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
print '<tr class="liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch center">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}
// User
print '<td class="liste_titre">';
print '<input type="text" name="search_name" value="'.dol_escape_htmltag($search_name).'" class="maxwidth100">';
print '</td>';
if (!empty($arrayfields['cp.rowid']['checked'])) {
print '<td class="liste_titre">';
print '<input type="text" name="search_name" value="'.dol_escape_htmltag($search_name).'" class="maxwidth100">';
print '</td>';
}
// Supervisor
print '<td class="liste_titre">';
print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, null, 0, null, null, 0, 0, 0, '', 0, '', 'maxwidth150');
print '</td>';
if (!empty($arrayfields['cp.fk_user']['checked'])) {
print '<td class="liste_titre">';
print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, null, 0, null, null, 0, 0, 0, '', 0, '', 'maxwidth150');
print '</td>';
}
// Type of leave request
if (count($typeleaves)) {
foreach ($typeleaves as $key => $val) {
print '<td class="liste_titre" style="text-align:center"></td>';
if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
if (count($typeleaves)) {
foreach ($typeleaves as $key => $val) {
print '<td class="liste_titre" style="text-align:center"></td>';
}
} else {
print '<td class="liste_titre"></td>';
}
} else {
}
if (!empty($arrayfields['cp.note_public']['checked'])) {
print '<td class="liste_titre"></td>';
}
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
// Action column
print '<td class="liste_titre maxwidthsearch center">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch center">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre('Employee', $_SERVER["PHP_SELF"]);
print_liste_field_titre('Supervisor', $_SERVER["PHP_SELF"]);
if (count($typeleaves)) {
foreach ($typeleaves as $key => $val) {
$labeltype = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
print_liste_field_titre($labeltype, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'center ');
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
}
if (!empty($arrayfields['cp.rowid']['checked'])) {
print_liste_field_titre('Employee', $_SERVER["PHP_SELF"]);
}
if (!empty($arrayfields['cp.fk_user']['checked'])) {
print_liste_field_titre('Supervisor', $_SERVER["PHP_SELF"]);
}
if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
if (count($typeleaves)) {
foreach ($typeleaves as $key => $val) {
$labeltype = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
print_liste_field_titre($labeltype, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'center ');
}
} else {
print_liste_field_titre('NoLeaveWithCounterDefined', $_SERVER["PHP_SELF"], '', '', '', '');
}
} else {
print_liste_field_titre('NoLeaveWithCounterDefined', $_SERVER["PHP_SELF"], '', '', '', '');
}
print_liste_field_titre((empty($user->rights->holiday->define_holiday) ? '' : 'Note'), $_SERVER["PHP_SELF"]);
if (!empty($arrayfields['cp.note_public']['checked'])) {
print_liste_field_titre((empty($user->rights->holiday->define_holiday) ? '' : 'Note'), $_SERVER["PHP_SELF"]);
}
print_liste_field_titre('');
$selectedfields = '';
if ($massactionbutton) {
$selectedfields = $form->showCheckAddButtons('checkforselect', 1);
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print '</tr>';
$usersupervisor = new User($db);
foreach ($listUsers as $users) {
@ -398,46 +440,67 @@ if (count($typeleaves) == 0) {
print '<tr class="oddeven">';
// User
print '<td>';
print $userstatic->getNomUrl(-1);
print '</td>';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
// Supervisor
print '<td>';
if ($userstatic->fk_user > 0) {
print $usersupervisor->getNomUrl(-1);
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($userstatic->id, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}
// User
if (!empty($arrayfields['cp.rowid']['checked'])) {
print '<td>';
print $userstatic->getNomUrl(-1);
print '</td>';
}
// Supervisor
if (!empty($arrayfields['cp.fk_user']['checked'])) {
print '<td>';
if ($userstatic->fk_user > 0) {
print $usersupervisor->getNomUrl(-1);
}
print '</td>';
}
print '</td>';
// Amount for each type
if (count($typeleaves)) {
foreach ($typeleaves as $key => $val) {
$nbtoshow = '';
if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') {
$nbtoshow = price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5);
}
if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
if (count($typeleaves)) {
foreach ($typeleaves as $key => $val) {
$nbtoshow = '';
if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') {
$nbtoshow = price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5);
}
//var_dump($users['rowid'].' - '.$val['rowid']);
print '<td style="text-align:center">';
if ($canedit) {
print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' value="'.$nbtoshow.'" name="nb_holiday_'.$val['rowid'].'['.$users['rowid'].']" class="width75 center" />';
} else {
print $nbtoshow;
//var_dump($users['rowid'].' - '.$val['rowid']);
print '<td style="text-align:center">';
if ($canedit) {
print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' value="'.$nbtoshow.'" name="nb_holiday_'.$val['rowid'].'['.$users['rowid'].']" class="width75 center" />';
} else {
print $nbtoshow;
}
//print ' '.$langs->trans('days');
print '</td>'."\n";
}
//print ' '.$langs->trans('days');
print '</td>'."\n";
} else {
print '<td></td>';
}
} else {
print '<td></td>';
}
// Note
print '<td>';
if ($canedit) {
print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' class="maxwidthonsmartphone" value="" name="note_holiday['.$users['rowid'].']" size="30"/>';
if (!empty($arrayfields['cp.note_public']['checked'])) {
print '<td>';
if ($canedit) {
print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' class="maxwidthonsmartphone" value="" name="note_holiday['.$users['rowid'].']" size="30"/>';
}
print '</td>';
}
print '</td>';
// Button modify
print '<td class="center">';
@ -445,21 +508,42 @@ if (count($typeleaves) == 0) {
print '<input type="submit" name="update_cp['.$users['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Save")).'" class="button smallpaddingimp"/>';
}
print '</td>'."\n";
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($userstatic->id, $arrayofselected)) {
$selected = 1;
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($userstatic->id, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
print '</td>';
}
print '</td>';
print '</tr>';
$i++;
}
if (count($listUsers) <= 0) {
$colspan = 2;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
if ($key == 'cp.nbHoliday') {
foreach ($typeleaves as $key => $val) {
$colspan++;
}
} else {
$colspan++;
}
}
}
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
}
print '</table>';
print '</div>';
}

View file

@ -44,6 +44,11 @@ class Import
*/
public $errors = array();
/**
* @var string DB Error number
*/
public $errno;
public $array_import_module;
public $array_import_perms;
public $array_import_icon;

View file

@ -102,6 +102,7 @@ UPDATE llx_holiday SET fk_user_approve = fk_user_valid WHERE statut = 3 AND fk_u
ALTER TABLE llx_inventory ADD COLUMN categories_product VARCHAR(255) DEFAULT NULL AFTER fk_product;
ALTER TABLE llx_societe ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
ALTER TABLE llx_user ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN lastresult text;
ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN port varchar(10) DEFAULT '993';

View file

@ -36,4 +36,6 @@
-- V19
ALTER TABLE llx_ticket ADD COLUMN fk_contract integer DEFAULT 0 after fk_project;
UPDATE llx_product_lot SET manufacturing_date = datec WHERE manufacturing_date IS NULL
UPDATE llx_product_lot SET manufacturing_date = datec WHERE manufacturing_date IS NULL;
UPDATE llx_societe_rib SET frstrecur = 'RCUR' WHERE frstrecur = 'RECUR';

View file

@ -19,7 +19,6 @@ ALTER TABLE llx_bookcal_booking ADD INDEX idx_bookcal_booking_rowid (rowid);
ALTER TABLE llx_bookcal_booking ADD INDEX idx_bookcal_booking_ref (ref);
ALTER TABLE llx_bookcal_booking ADD INDEX idx_bookcal_booking_fk_soc (fk_soc);
ALTER TABLE llx_bookcal_booking ADD INDEX idx_bookcal_booking_fk_project (fk_project);
ALTER TABLE llx_bookcal_booking ADD CONSTRAINT llx_bookcal_booking_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
ALTER TABLE llx_bookcal_booking ADD INDEX idx_bookcal_booking_status (status);
-- END MODULEBUILDER INDEXES

View file

@ -25,7 +25,7 @@ CREATE TABLE llx_bookcal_booking(
note_private text,
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_creat integer,
fk_user_modif integer,
last_main_doc varchar(255),
import_key varchar(14),

View file

@ -79,6 +79,7 @@ create table llx_user
note_public text,
note_private text DEFAULT NULL,
model_pdf varchar(255) DEFAULT NULL,
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
datelastlogin datetime,
datepreviouslogin datetime,
datelastpassvalidation datetime, -- last date we change password or we made a disconnect all

View file

@ -2399,3 +2399,4 @@ DefaultForTypeDesc=Template used by default when creating a new email for the te
OptionXShouldBeEnabledInModuleY=Option "<b>%s</b>" should be enabled into module <b>%s</b>
OptionXIsCorrectlyEnabledInModuleY=Option "<b>%s</b>" is enabled into module <b>%s</b>
AtBottomOfPage=At bottom of page
FailedAuth=Failed authentications

View file

@ -386,3 +386,4 @@ BadSetupOfField = Error bad setup of field
BadSetupOfFieldClassNotFoundForValidation = Error bad setup of field : Class not found for validation
BadSetupOfFieldFileNotFound = Error bad setup of field : File not found for inclusion
BadSetupOfFieldFetchNotCallable = Error bad setup of field : Fetch not callable on class
ErrorTooManyAttempts= Too many attempts, please try again later

View file

@ -164,3 +164,4 @@ TaxUndefinedForThisCategory = Taxe undefined for this category
ErrorRecordNotFound=Record not found
errorComputeTtcOnMileageExpense=Error on computing mileage expense
ErrorBadValueForParameter=Error bad value for parameter %s
ErrorOnlyDraftStatusCanBeDeletedInMassAction=Error only draft status can be deleted in mass action

View file

@ -28,4 +28,6 @@ PasswordOfUserInLDAP=Password of user in LDAP
LDAPPasswordHashType=Password hash type
LDAPPasswordHashTypeExample=Type of password hash used on the server
SupportedForLDAPExportScriptOnly=Only supported by an ldap export script
SupportedForLDAPImportScriptOnly=Only supported by an ldap import script
SupportedForLDAPImportScriptOnly=Only supported by an ldap import script
LDAPUserAccountControl = userAccountControl on creation (active directory)
LDAPUserAccountControlExample = 512 Normal Account / 546 Normal Account + No Passwd + Disabled (see : https://fr.wikipedia.org/wiki/Active_Directory)

View file

@ -3332,7 +3332,7 @@ if ($module == 'initmodule') {
}
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabobj='.$objectname;
$head3[$h][1] = img_picto('', $pictoname, 'class="pictofixedwidth"').$objectname;
$head3[$h][1] = img_picto('', $pictoname, 'class="pictofixedwidth valignmiddle"').$objectname;
$head3[$h][2] = $objectname;
$h++;
}
@ -3562,7 +3562,7 @@ if ($module == 'initmodule') {
//print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtopicto).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
} elseif (!empty($tmpobject)) {
print '<span class="fa fa-file-image-o"></span> '.$langs->trans("Image").' : '.img_picto('', $tmpobject->picto, 'class="pictofixedwidth"').$tmpobject->picto;
print '<span class="fa fa-file-image-o"></span> '.$langs->trans("Image").' : '.img_picto('', $tmpobject->picto, 'class="pictofixedwidth valignmiddle"').$tmpobject->picto;
print '<br>';
}
@ -3777,10 +3777,10 @@ if ($module == 'initmodule') {
print '<td class="center"><input type="text" class="maxwidth50" name="propcss" value="'.dol_escape_htmltag(GETPOST('propcss', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="maxwidth50" name="propcssview" value="'.dol_escape_htmltag(GETPOST('propcssview', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="maxwidth50" name="propcsslist" value="'.dol_escape_htmltag(GETPOST('propcsslist', 'alpha')).'"></td>';
print '<td><input type="text" size="2" name="prophelp" value="'.dol_escape_htmltag(GETPOST('prophelp', 'alpha')).'"></td>';
print '<td><input type="text" class="maxwidth50" name="prophelp" value="'.dol_escape_htmltag(GETPOST('prophelp', 'alpha')).'"></td>';
print '<td class="center"><input type="text" class="center maxwidth50" name="propshowoncombobox" value="'.dol_escape_htmltag(GETPOST('propshowoncombobox', 'alpha')).'"></td>';
//print '<td class="center"><input type="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth100" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth50" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
print '<td><input class="text maxwidth100" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment', 'alpha')).'"></td>';
print '<td class="center tdstickyright tdstickyghostwhite">';
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
@ -4649,6 +4649,7 @@ if ($module == 'initmodule') {
}
if ($action != 'editfile' || empty($file)) {
print '<!-- Tab to manage permissions -->'."\n";
print '<span class="opacitymedium">';
$htmlhelp = $langs->trans("PermissionsDefDescTooltip", '{s1}');
$htmlhelp = str_replace('{s1}', '<a target="adminbis" class="nofocusvisible" href="'.DOL_URL_ROOT.'/admin/perms.php">'.$langs->trans('DefaultRights').'</a>', $htmlhelp);
@ -4675,24 +4676,17 @@ if ($module == 'initmodule') {
print '<tr class="liste_titre">';
print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
print_liste_field_titre("CRUD", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
print_liste_field_titre("Object", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
print_liste_field_titre("CRUD", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, "center");
print "</tr>\n";
//form for add new right
print '<tr class="small">';
print '<td><input type="hidden" readonly name="id" class="width75" value="0"></td>';
print '<td><input type="hidden" readonly name="id" class="width75" value="0"></td>';
print '<td><select class="maxwidth" name="crud" id="crud">';
print '<option value=""></option>';
foreach ($crud as $key => $val) {
print '<option value="'.$key.'">'.$langs->trans($val).'</option>';
}
print '</td>';
print '<td><select name="permissionObj" id="permissionObj">';
print '<td><select class="minwidth100" name="permissionObj" id="permissionObj">';
print '<option value=""></option>';
foreach ($objects as $obj) {
if ($obj != 'myobject') {
@ -4701,8 +4695,15 @@ if ($module == 'initmodule') {
}
print '</select></td>';
print '<td><select class="maxwidth" name="crud" id="crud">';
print '<option value=""></option>';
foreach ($crud as $key => $val) {
print '<option value="'.$key.'">'.$langs->trans($val).'</option>';
}
print '</td>';
print '<td >';
print '<input type="text" name="label" id="label">';
print '<input type="text" name="label" id="label" class="minwidth200">';
print '</td>';
print '<td class="center tdstickyright tdstickyghostwhite">';
@ -4726,7 +4727,6 @@ if ($module == 'initmodule') {
print '<input type="hidden" name="action" value="update_right">';
print '<input type="hidden" name="counter" value="'.$i.'">';
print '<input type="hidden" name="permskey" value="'.$perm[0].'">';
print '<td class="tdsticky tdstickygray">';
@ -4761,6 +4761,7 @@ if ($module == 'initmodule') {
print '</form>';
print '</tr>';
} else {
// $perm can be module->object->crud or module->crud
print '<tr class="oddeven">';
print '<td>';
@ -4768,11 +4769,19 @@ if ($module == 'initmodule') {
print '</td>';
print '<td>';
print ($perm[5] == 'write' ? $langs->trans($crud['write']): ucfirst($langs->trans($perm[5])));
if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) {
print dol_escape_htmltag(ucfirst($perm[4]));
} else {
print ''; // No particular object
}
print '</td>';
print '<td>';
print dol_escape_htmltag(ucfirst($perm[4]));
if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) {
print ucfirst($langs->trans($perm[5]));
} else {
print ucfirst($langs->trans($perm[4]));
}
print '</td>';
print '<td>';
@ -4800,7 +4809,7 @@ if ($module == 'initmodule') {
function updateInputField() {
value1 = $("#crud").val();
value2 = $("#permissionObj").val();
// Vérifie si les deux sélections sont faites
if ($("#label").val() == "" && value1 && value2) {
switch(value1.toLowerCase()){
@ -4818,7 +4827,7 @@ if ($module == 'initmodule') {
}
}
}
$("#crud, #permissionObj").change(updateInputField);
updateInputField();
</script>';
@ -5624,7 +5633,7 @@ if ($module == 'initmodule') {
print '</tr>';
}
} else {
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
print '<tr><td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print '</table>';

View file

@ -269,26 +269,24 @@ class modMyModule extends DolibarrModules
$r = 0;
// Add here entries to declare new permissions
/* BEGIN MODULEBUILDER PERMISSIONS */
/*$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
/*
$o = 1;
$this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 1); // Permission id (must not be already used)
$this->rights[$r][1] = 'Read objects of MyModule'; // Permission label
$this->rights[$r][4] = 'myobject';
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->hasRight('mymodule', 'myobject', 'read'))
$r++;
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
$this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 2); // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/Update objects of MyModule'; // Permission label
$this->rights[$r][4] = 'myobject';
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->hasRight('mymodule', 'myobject', 'write'))
$r++;
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
$this->rights[$r][0] = $this->numero . sprintf("%02d", ($o * 10) + 3); // Permission id (must not be already used)
$this->rights[$r][1] = 'Delete objects of MyModule'; // Permission label
$this->rights[$r][4] = 'myobject';
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->delete)
$r++;*/
$r++;
*/
/* END MODULEBUILDER PERMISSIONS */
// Main menu entries to add

View file

@ -121,7 +121,7 @@ if (!$sortorder) {
$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectagenda', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($object->element.'agenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View file

@ -105,7 +105,7 @@ if (!empty($backtopagejsfields)) {
$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectcard', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View file

@ -71,7 +71,7 @@ $action = GETPOST('action', 'aZ09');
$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectcontact', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($object->element.'contact', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View file

@ -111,7 +111,7 @@ if (!$sortfield) {
$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectdocument', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($object->element.'document', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View file

@ -89,7 +89,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectnote', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($object->element.'note', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View file

@ -551,6 +551,7 @@ print '<tr class="liste_titre">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
foreach ($object->fields as $key => $val) {
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);

View file

@ -49,7 +49,7 @@ class CompanyBankAccount extends Account
public $default_rib;
/**
* Value 'FRST' or 'RCUR' (For SEPA mandate). Warning, in database, we store 'RECUR'.
* Value 'FRST' or 'RCUR' (For SEPA mandate)
*
* @var string
*/

View file

@ -1937,7 +1937,7 @@ if ($socid && $action == 'edit' && $permissiontoaddupdatepaymentinformation) {
print '<td>'.$form->selectDate($date_rum ? $date_rum : $companybankaccount->date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'</td></tr>';
print '<tr><td>'.$langs->trans("WithdrawMode").'</td><td>';
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR"));
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RCUR" => $langs->trans("RECUR"));
print $form->selectarray("frstrecur", $tblArraychoice, dol_escape_htmltag(GETPOST('frstrecur', 'alpha') ?GETPOST('frstrecur', 'alpha') : $companybankaccount->frstrecur), 0);
print '</td></tr>';
@ -2102,7 +2102,7 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
print '<td colspan="4">'.$form->selectDate($date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'</td></tr>';
print '<tr><td>'.$langs->trans("WithdrawMode").'</td><td>';
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR"));
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RCUR" => $langs->trans("RECUR"));
print $form->selectarray("frstrecur", $tblArraychoice, (GETPOSTISSET('frstrecur') ? GETPOST('frstrecur') : 'FRST'), 0);
print '</td></tr>';

View file

@ -15,7 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// This page return an image of a photo
// This page return an image of public photos of a category or product.
// Test to check image can be publically viewed is done inside the viewimage.php wrapper.
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
@ -45,6 +46,9 @@ $w = GETPOST('w', 'int');
$h = GETPOST('h', 'int');
$query = GETPOST('query', 'alpha');
if (!isModEnabled('takepos')) {
accessforbidden('Module not enabled');
}
/*

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2020 Andreu Bisquerra <jove@bisquerra.com>
* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -15,7 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// This page return an image of a QR code
// This page return an image of a QR code of a public link
// Note: Generating a QR code from a string, like done by this script, can be done with any online tool.
if (!defined("NOLOGIN")) {
define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
@ -46,6 +48,10 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php';
$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
if (!isModEnabled('takepos')) {
accessforbidden('Module not enabled');
}
/*
* View

View file

@ -382,7 +382,7 @@ if (empty($reshook)) {
}
// Mark as Read
if ($action == "mark_ticket_read" && $permissiontoadd) {
if ($action == "set_read" && $permissiontoadd) {
$object->fetch('', '', GETPOST("track_id", 'alpha'));
if ($object->markAsRead($user) > 0) {

View file

@ -417,9 +417,9 @@ class ActionsTicket
print '<div class="inline-block center marginbottomonly">';
if ($status == 1) {
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_read&token='.newToken(); // To set as read, we use a dedicated action
} else {
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=confirm_set_status&token='.newToken().'&new_status='.$status;
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=confirm_set_status&token='.newToken().'&new_status='.((int) $status);
}
print '<a class="butAction butStatus marginbottomonly" href="'.$urlforbutton.'">';

View file

@ -3303,6 +3303,7 @@ if (!GETPOST('hide_websitemenu')) {
print '<div class="inline-block marginrightonly">'; // Button edit inline
print '<span id="switchckeditorinline">'."\n";
// Enable CKEditor inline with js on section and div with conteneditable=true
print '<!-- Code to enabled edit inline ckeditor -->'."\n";
print '<script type="text/javascript">
$(document).ready(function() {
@ -3321,25 +3322,52 @@ if (!GETPOST('hide_websitemenu')) {
if (! isEditingEnabled || forceenable)
{
console.log("Enable inline edit");
jQuery(\'section[contenteditable="true"],div[contenteditable="true"]\').each(function(idx){
var idtouse = $(this).attr(\'id\');
console.log("Enable inline edit for "+idtouse);
CKEDITOR.inline(idtouse, {
// Allow some non-standard markup that we used in the introduction.
extraAllowedContent: \'span(*);cite(*);q(*);dl(*);dt(*);dd(*);ul(*);li(*);header(*);button(*);h1(*);h2(*);\',
//extraPlugins: \'sourcedialog\',
removePlugins: \'flash,stylescombo,exportpdf,scayt,wsc,pagebreak,iframe,smiley\',
// Show toolbar on startup (optional).
// startupFocus: true
});
if (idtouse !== undefined) {
var inlineditor = CKEDITOR.inline(idtouse, {
// Allow some non-standard markup that we used in the introduction.
// + a[target];div{float,display} ?
extraAllowedContent: \'span(*);cite(*);q(*);dl(*);dt(*);dd(*);ul(*);li(*);header(*);button(*);h1(*);h2(*);\',
//extraPlugins: \'sourcedialog\',
removePlugins: \'flash,stylescombo,exportpdf,scayt,wsc,pagebreak,iframe,smiley\',
// Show toolbar on startup (optional).
// startupFocus: true
});
// Custom bar tool
// Note the Source tool does not work on inline
inlineditor.config.toolbar = [
[\'Templates\',\'NewPage\'],
[\'Save\'],
[\'Maximize\',\'Preview\'],
[\'PasteText\'],
[\'Undo\',\'Redo\',\'-\',\'Find\',\'Replace\',\'-\',\'SelectAll\',\'RemoveFormat\'],
[\'CreateDiv\',\'ShowBlocks\'],
[\'Form\', \'Checkbox\', \'Radio\', \'TextField\', \'Textarea\', \'Select\', \'Button\', \'ImageButton\', \'HiddenField\'],
[\'Bold\',\'Italic\',\'Underline\',\'Strike\',\'Superscript\'],
[\'NumberedList\',\'BulletedList\',\'-\',\'Outdent\',\'Indent\',\'Blockquote\'],
[\'JustifyLeft\',\'JustifyCenter\',\'JustifyRight\',\'JustifyBlock\'],
[\'Link\',\'Unlink\'],
[\'Image\',\'Table\',\'HorizontalRule\'],
[\'Styles\',\'Format\',\'Font\',\'FontSize\'],
[\'TextColor\',\'BGColor\']
];
// Start editor
//inlineditor.on(\'instanceReady\', function () {
// ...
//});
}
})
isEditingEnabled = true;
}
else {
} else {
console.log("Disable inline edit");
for(name in CKEDITOR.instances)
{
for(name in CKEDITOR.instances) {
CKEDITOR.instances[name].destroy(true);
}
isEditingEnabled = false;