Merge branch 'Dolibarr:develop' into patch-7

This commit is contained in:
thibdrev 2024-01-28 13:35:30 +01:00 committed by GitHub
commit 94da5b08ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 435 additions and 365 deletions

View file

@ -14,6 +14,17 @@ jobs:
- name: Install required tools
run: sudo apt-get update && sudo apt-get install cppcheck
if: false
# The next uses the git API because there is no clone yet.
# This is faster for a big repo.
- name: Get all changed php files (if PR)
id: changed-php
uses: tj-actions/changed-files@v42
if: github.event_name == 'pull_request'
with:
files: |
**.php
# Checkout git sources to analyze
- uses: actions/checkout@v4
# Action setup-python needs a requirements.txt or pyproject.toml
@ -42,6 +53,24 @@ jobs:
set -o pipefail
pre-commit gc
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
# The next uses git, which is slow for a bit repo.
# - name: Get all changed php files (if PR)
# id: changed-php
# uses: tj-actions/changed-files@v42
# if: github.event_name == 'pull_request'
# with:
# files: |
# **.php
- name: Run some pre-commit hooks on selected changed files only
if: steps.changed-php.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
run: |
set -o pipefail
pre-commit run php-cs ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG}
# If error, we convert log in the checkstyle format
- name: Convert Raw Log to CheckStyle format
if: ${{ failure() }}

View file

@ -3,7 +3,7 @@ exclude: (?x)^( htdocs/includes/ckeditor/.* )
repos:
# Several miscellaneous checks and fix (on yaml files, end of files fix)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: [--branch, develop, --pattern, \d+.0]
@ -87,7 +87,7 @@ repos:
# Check format of yaml files
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
rev: v1.33.0
hooks:
- id: yamllint
args:
@ -97,7 +97,7 @@ repos:
# Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
# Due to a current limitation of configuration files,
@ -142,7 +142,7 @@ repos:
# Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
rev: v0.9.0.6
hooks:
- id: shellcheck
args: [-W, '100']

View file

@ -28,7 +28,6 @@ The following changes may create regressions for some external modules, but were
For users:
----------
NEW: Compatibility with PHP 8.2
NEW: Module for Advanced stock transfer is now stable (#26594)
NEW: Module Workstation (used to enhance the module BOM and Manufacturing Order) is now stable
NEW: Add a confirmation popup when deleting extrafields
NEW: Add type 'icon' type for extrafields
@ -188,10 +187,15 @@ NEW: updating for display Help title when try to delete Don (issue #25314)
NEW: Upgrade in module builder in menu section
NEW: use account address in sepa mandate (#23642)
NEW: VAT rate - Add entity
<<<<<<< HEAD
NEW: webportal site account
NEW: When an user unset the batch management of products, transformation of each batch stock movement in global stock movement
FIX: #25828 wrong odt style naming
=======
NEW: When an user unset the batch management of products, transformation of each batch stock mouvement in global stock mouvement
NEW: PDF Generation for each Human Resource Evaluations.
>>>>>>> branch '19.0' of git@github.com:Dolibarr/dolibarr.git
SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
SEC: Add action confirm_... as sensitive to need a CSRF token
@ -264,6 +268,8 @@ WARNING:
--------
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Recheck the setup of your module Workflow to see if you need to enable the new setting to have shipment set to billed automatically when
an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order), because this setup has changed.
* The hook changeHelpURL is replaced by llxHeader
* The property ->brouillon has been removed from all classes. It was not reliable and was a duplicate of ->status == self::STATUS_DRAFT.
* The duplicated and deprecated property ->date_livraison that was renamed into ->delivery_date has been completely removed.
@ -272,19 +278,18 @@ The following changes may create regressions for some external modules, but were
* The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id.
* The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id.
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
* The duplicate property ->user_creat, ->date_creat, ->date_valid has been removed (use instead user_creation, date_creation, date_validation).
* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation).
* The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead.
* The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog()
* Recheck the setup of your module Workflow to see if you need to enable the new setting to have shipment set to billed automatically when
an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order), because this setup has changed.
* It was possible to use a variable $soc or $right inside a PHP code condition of some extrafields properties, this is no more true (this 2 variables are no more global variables).
* New hook files of modules actions_mymodule.class.php should now "extends CommonHookActions"
* Endpoint for API /partnershipapi and /recruitment has been renamed into /partnerships and /recruitments to follow name conventions.
* Hidden option ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT has been renamed into ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT
* Hidden option ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT has been renamed into ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT
* The delete() method of AdherentType, Contact, Delivery, MultiCurrency, CurrencyRate now need $user as first parameter.
* A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english.
* The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases.
***** ChangeLog for 18.0.4 compared to 18.0.3 *****
FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming
FIX: 16.0 only, backport fix for SQL error on global search product

View file

@ -1595,17 +1595,17 @@ if ($action == 'create') {
print '</td>';
print '</tr>';
// Status of generated invoices
// Status of auto generated invoices
print '<tr><td>';
if ($action == 'auto_validate' || $object->frequency > 0) {
print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer'));
print $form->editfieldkey($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer'));
} else {
print $langs->trans("StatusOfGeneratedInvoices");
print $langs->trans("StatusOfAutoGeneratedInvoices");
}
print '</td><td>';
$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
if ($action == 'auto_validate' || $object->frequency > 0) {
print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer'), $select);
print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer'), $select);
}
print '</td>';
// Auto generate documents

View file

@ -7314,10 +7314,8 @@ abstract class CommonObject
$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
}
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1)) {
$out .= '<option value="0">&nbsp;</option>';
}
$tmpselect = '';
$nbchoice = 0;
foreach ($param['options'] as $keyb => $valb) {
if ((string) $keyb == '') {
continue;
@ -7325,11 +7323,18 @@ abstract class CommonObject
if (strpos($valb, "|") !== false) {
list($valb, $parent) = explode('|', $valb);
}
$out .= '<option value="'.$keyb.'"';
$out .= (((string) $value == (string) $keyb) ? ' selected' : '');
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
$out .= '>'.$valb.'</option>';
$nbchoice++;
$tmpselect .= '<option value="'.$keyb.'"';
$tmpselect .= (((string) $value == (string) $keyb) ? ' selected' : '');
$tmpselect .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
$tmpselect .= '>'.$valb.'</option>';
}
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1) || $nbchoice >= 2) {
$out .= '<option value="0">&nbsp;</option>';
}
$out .= $tmpselect;
$out .= '</select>';
} elseif ($type == 'sellist') {
$out = '';
@ -7814,7 +7819,7 @@ abstract class CommonObject
$form = new Form($this->db);
}
$label = empty($val['label']) ? '' : $val['label'];
//$label = empty($val['label']) ? '' : $val['label'];
$type = empty($val['type']) ? '' : $val['type'];
$size = empty($val['css']) ? '' : $val['css'];
$reg = array();
@ -8217,7 +8222,8 @@ abstract class CommonObject
$value = '';
}
} elseif ($type == 'password') {
$value = preg_replace('/./i', '*', $value);
$value = '<span class="opacitymedium">'.$langs->trans("Encrypted").'</span>';
//$value = preg_replace('/./i', '*', $value);
} elseif ($type == 'array') {
$value = implode('<br>', $value);
} else { // text|html|varchar

View file

@ -889,7 +889,7 @@ class FormMail extends Form
//input prompt AI
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
if (isModEnabled('ai') && getDolGlobalConst('AI_CHATGPT_API_KEY')) {
if (isModEnabled('ai') && getDolGlobalString('AI_CHATGPT_API_KEY')) {
$out .= $this->getHtmlForInstruction();
}
// Message

View file

@ -497,8 +497,8 @@ class Menubase
$this->module = 'specimen';
$this->type = 'top';
$this->mainmenu = '';
$this->fk_menu = '0';
$this->position = '';
$this->fk_menu = 0;
$this->position = 0;
$this->url = 'http://dummy';
$this->target = '';
$this->title = 'Specimen menu';
@ -506,8 +506,8 @@ class Menubase
$this->leftmenu = '';
$this->perms = '';
$this->enabled = '';
$this->user = '';
$this->tms = '';
$this->user = 0;
$this->tms = dol_now();
}

View file

@ -647,7 +647,7 @@ function dol_get_last_hour($date, $gm = 'tzserver')
* @param int $date Date GMT
* @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ,
* 'gmt' to compare with GMT date.
* @return int Date for last hour of a given date
* @return int Date for first hour of a given date
*/
function dol_get_first_hour($date, $gm = 'tzserver')
{

View file

@ -966,6 +966,7 @@ function GETPOSTINT($paramname, $method = 0)
* @param string $paramname Name of the $_GET or $_POST parameter
* @param string|int $rounding Type of rounding ('', 'MU', 'MT, 'MS', 'CU', 'CT', integer) {@see price2num()}
* @return float Value converted into float
* @since Dolibarr V20
*/
function GETPOSTFLOAT($paramname, $rounding = '')
{

View file

@ -155,7 +155,7 @@ function isValidTinForBE($str)
$str = trim($str);
$str = preg_replace('/(\s)/', '', $str);
if (preg_match('/(^[0-9]{4}\.[0-9]{3}\.[0-9]{3}$)/', $str)) {
if (preg_match('/(^[0-1]{1}[0-9]{3}\.[0-9]{3}\.[0-9]{3}$)/', $str)) {
return true;
} else {
return false;

View file

@ -38,8 +38,6 @@ class modOpenSurvey extends DolibarrModules
*/
public function __construct($db)
{
global $langs, $conf;
$this->db = $db;
// Id for module (must be unique).
@ -181,8 +179,6 @@ class modOpenSurvey extends DolibarrModules
*/
public function init($options = '')
{
global $conf, $langs;
$result = $this->_load_tables('/install/mysql/', 'opensurvey');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')

View file

@ -40,7 +40,7 @@ class modTakePos extends DolibarrModules
*/
public function __construct($db)
{
global $langs, $conf;
global $conf;
$this->db = $db;
@ -54,7 +54,7 @@ class modTakePos extends DolibarrModules
// It is used to group modules by family in module setup page
$this->family = "portal";
// Module position in the family on 2 digits ('01', '10', '20', ...)
$this->module_position = '60';
$this->module_position = '45';
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
@ -120,8 +120,8 @@ class modTakePos extends DolibarrModules
//1=>array('TAKEPOS_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
);
if (!isset($conf->takepos) || !isset($conf->takepos->enabled)) {
// To avoid warning
if (!isModEnabled('takepos')) {
$conf->takepos = new stdClass();
$conf->takepos->enabled = 0;
}

View file

@ -53,7 +53,7 @@ class modWebPortal extends DolibarrModules
$this->family = "portal";
// Module position in the family on 2 digits ('01', '10', '20', ...)
$this->module_position = '80';
$this->module_position = '47';
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
@ -139,7 +139,7 @@ class modWebPortal extends DolibarrModules
$this->conflictwith = array();
// The language file dedicated to your module
$this->langfiles = array("webportal@webportal");
$this->langfiles = array("website");
// Prerequisites
$this->phpmin = array(7, 0); // Minimum version of PHP required by module
@ -165,7 +165,8 @@ class modWebPortal extends DolibarrModules
'fr_FR:ParentCompany'=>'Maison mère ou revendeur'
)*/
if (!isset($conf->webportal) || !isset($conf->webportal->enabled)) {
// To avoid warnings
if (isModEnabled('webportal')) {
$conf->webportal = new stdClass();
$conf->webportal->enabled = 0;
}
@ -202,7 +203,7 @@ class modWebPortal extends DolibarrModules
$this->dictionaries = array();
/* Example:
$this->dictionaries=array(
'langs'=>'webportal@webportal',
'langs'=>'website',
// List of tables we want to see into dictonnary editor
'tabname'=>array("table1", "table2", "table3"),
// Label of tables
@ -287,7 +288,7 @@ class modWebPortal extends DolibarrModules
'mainmenu' => 'webportal',
'leftmenu' => '',
'url' => getDolGlobalString('WEBPORTAL_ROOT_URL', '/public/webportal/index.php'),
'langs' => 'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs' => 'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 1000 + $r,
'enabled' => 'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled.
'perms' => '1', // Use 'perms'=>'$user->hasRight("webportal", "webportalpropal", "read")' if you want your menu with a permission rules
@ -302,7 +303,7 @@ class modWebPortal extends DolibarrModules
'mainmenu'=>'webportal',
'leftmenu'=>'webportalpropal',
'url'=>'/webportal/webportalindex.php',
'langs'=>'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled.
'perms'=>'$user->hasRight("webportal", "webportalpropal", "read")',
@ -316,7 +317,7 @@ class modWebPortal extends DolibarrModules
'mainmenu'=>'webportal',
'leftmenu'=>'webportal_webportalpropal_list',
'url'=>'/webportal/webportalpropal_list.php',
'langs'=>'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled.
'perms'=>'$user->hasRight("webportal", "webportalpropal", "read")'
@ -330,7 +331,7 @@ class modWebPortal extends DolibarrModules
'mainmenu'=>'webportal',
'leftmenu'=>'webportal_webportalpropal_new',
'url'=>'/webportal/webportalpropal_card.php?action=create',
'langs'=>'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->hasRight("webportal", "webportalpropal", "write")'
@ -349,7 +350,7 @@ class modWebPortal extends DolibarrModules
*/
public function init($options = '')
{
global $conf, $langs;
//global $conf, $langs;
//$result = $this->_load_tables('/install/mysql/', 'webportal');
$result = $this->_load_tables('/webportal/sql/');
@ -360,11 +361,11 @@ class modWebPortal extends DolibarrModules
// Create extrafields during init
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
//$extrafields = new ExtraFields($this->db);
//$result1=$extrafields->addExtraField('webportal_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")');
//$result2=$extrafields->addExtraField('webportal_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")');
//$result3=$extrafields->addExtraField('webportal_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")');
//$result4=$extrafields->addExtraField('webportal_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")');
//$result5=$extrafields->addExtraField('webportal_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")');
//$result1=$extrafields->addExtraField('webportal_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")');
//$result2=$extrafields->addExtraField('webportal_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")');
//$result3=$extrafields->addExtraField('webportal_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")');
//$result4=$extrafields->addExtraField('webportal_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'website', 'isModEnabled("webportal")');
//$result5=$extrafields->addExtraField('webportal_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")');
// Permissions
$this->remove($options);

View file

@ -37,8 +37,6 @@ class modWebsite extends DolibarrModules
*/
public function __construct($db)
{
global $langs, $conf;
$this->db = $db;
$this->numero = 10000;

View file

@ -482,7 +482,7 @@ if (($action == "create") || ($action == "edit")) {
} else {
$input .= ' />';
}
$input .= "<label for=\"frequency_month\">".$langs->trans('Monthly')."</label>";
$input .= "<label for=\"frequency_month\">".$langs->trans('Months')."</label>";
print $input;
print "</td>";

View file

@ -184,6 +184,11 @@ class Cronjob extends CommonObject
*/
public $autodelete;
/**
* @var array Cronjob
*/
public $lines;
const STATUS_DISABLED = 0;
const STATUS_ENABLED = 1;
@ -512,7 +517,6 @@ class Cronjob extends CommonObject
/**
* Load list of cron jobs in a memory array from the database
* @TODO Use object CronJob and not CronJobLine.
*
* @param string $sortorder sort order
* @param string $sortfield sort field

View file

@ -115,9 +115,9 @@ class ActionsDatapolicy extends CommonHookActions
$object->fax = '';
$object->state = '';
$object->country = '';
$object->state_id = '';
$object->state_id = 0;
$object->socialnetworks = '';
$object->country_id = '';
$object->country_id = 0;
$object->note_private = dol_concatdesc($object->note_private, $langs->trans('ANONYMISER_AT', dol_print_date(dol_now())));
if ($object->update($object->id, $user, 0)) {

View file

@ -102,7 +102,7 @@ if ($action == 'add') {
$object->note = GETPOST("note", 'restricthtml');
$object->note_private = GETPOST("note", 'restricthtml');
$object->commande_id = GETPOST("commande_id", 'int');
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->fk_incoterms = GETPOSTINT('incoterm_id');
/* ->entrepot_id seems to not exists
if (!getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && isModEnabled('stock')) {

View file

@ -185,19 +185,19 @@ if (empty($reshook)) {
if (!$error) {
$object->fetch($id);
$object->firstname = (string) GETPOST("firstname", 'alpha');
$object->lastname = (string) GETPOST("lastname", 'alpha');
$object->societe = (string) GETPOST("societe", 'alpha');
$object->address = (string) GETPOST("address", 'alpha');
$object->amount = price2num(GETPOST("amount", 'alpha'), '', 2);
$object->town = (string) GETPOST("town", 'alpha');
$object->zip = (string) GETPOST("zipcode", 'alpha');
$object->country_id = (int) GETPOST('country_id', 'int');
$object->email = (string) GETPOST("email", 'alpha');
$object->firstname = GETPOST("firstname", 'alpha');
$object->lastname = GETPOST("lastname", 'alpha');
$object->societe = GETPOST("societe", 'alpha');
$object->address = GETPOST("address", 'alpha');
$object->amount = GETPOSTFLOAT("amount");
$object->town = GETPOST("town", 'alpha');
$object->zip = GETPOST("zipcode", 'alpha');
$object->country_id = GETPOSTINT('country_id');
$object->email = GETPOST("email", 'alpha');
$object->date = $donation_date;
$object->public = $public_donation;
$object->fk_project = (int) GETPOST("fk_project", 'int');
$object->modepaymentid = (int) GETPOST('modepayment', 'int');
$object->fk_project = GETPOSTINT("fk_project");
$object->modepaymentid = GETPOSTINT('modepayment');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');

View file

@ -1053,14 +1053,14 @@ if ($action == 'create') {
print "</td></tr>";
// Auto validate the invoice
print "<tr><td>" . $langs->trans("StatusOfGeneratedInvoices") . "</td><td>";
print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedInvoices") . "</td><td>";
$select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated'));
print $form->selectarray('auto_validate', $select, GETPOST('auto_validate'));
print "</td></tr>";
// Auto generate document
if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) {
print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedDocuments") . "</td><td>";
print "<tr><td>" . $langs->trans("StatusOfGeneratedDocuments") . "</td><td>";
$select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc'));
print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf'));
print "</td></tr>";
@ -1484,14 +1484,14 @@ if ($action == 'create') {
// Status of generated invoices
print '<tr><td>';
if ($action == 'auto_validate' || $object->frequency > 0) {
print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate);
print $form->editfieldkey($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate);
} else {
print $langs->trans("StatusOfGeneratedInvoices");
print $langs->trans("StatusOfAutoGeneratedInvoices");
}
print '</td><td>';
$select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated');
if ($action == 'auto_validate' || $object->frequency > 0) {
print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select);
print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select);
}
print '</td>';
// Auto generate documents

View file

@ -147,6 +147,7 @@ UPDATE llx_product set stockable_product = 0 WHERE type = 1;
ALTER TABLE llx_prelevement_lignes ADD COLUMN fk_user integer NULL;
ALTER TABLE llx_hrm_evaluation ADD COLUMN last_main_doc varchar(255);
ALTER TABLE llx_hrm_evaluationdet ADD COLUMN comment TEXT;
ALTER TABLE llx_resource ADD COLUMN address varchar(255) DEFAULT NULL AFTER fk_code_type_resource;

View file

@ -208,3 +208,6 @@ ALTER TABLE llx_categorie ADD COLUMN position integer DEFAULT 0 AFTER color;
ALTER TABLE llx_product DROP COLUMN onportal;
ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext;
-- Rename const to add customer categories on not customer/prospect third-party if enabled
UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER';

View file

@ -685,7 +685,7 @@ Module5000Desc=Allows you to manage multiple companies
Module6000Name=Inter-modules Workflow
Module6000Desc=Workflow management between different modules (automatic creation of object and/or automatic status change)
Module10000Name=Websites
Module10000Desc=Create websites (public) with a WYSIWYG editor. This is a webmaster or developer oriented CMS (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name.
Module10000Desc=CMS to create websites with a WYSIWYG editor. This is a webmaster or developer oriented Content Management System (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name.
Module20000Name=Leave Request Management
Module20000Desc=Define and track employee leave requests
Module39000Name=Product Lots

View file

@ -1260,4 +1260,4 @@ AmountSalary=Salary amount
InvoiceSubtype=Invoice subtype
ConfirmMassReverse=Bulk Reverse confirmation
ConfirmMassReverseQuestion=Are you sure you want to reverse the %s selected record(s)?
Encrypted=Encrypted

View file

@ -161,5 +161,76 @@ Visibility=Visibility
Everyone=Everyone
AssignedContacts=Assigned contacts
WebsiteTypeLabel=Type of Web site
WebsiteTypeDolibarrWebsite=Web site (CMS Dolibarr)
WebsiteTypeDolibarrPortal=Native Dolibarr portal
WebsiteTypeDolibarrWebsite=Web site (Module WebSites CMS)
WebsiteTypeDolibarrPortal=Native and ready to use web portal (Module Web Portal)
WebPortalURL=Web portal URL
NewWebsiteAccount=New accounts for websites
ModuleWebPortalName = Web portal
ModuleWebPortalDesc = A ready to use native web portal for customers, suppliers, partners or members
WebPortalDescription = Public web portal module for membership and partnership
WebPortalSetup = WebPortal setup
WebPortalCSS=Web portal CSS
Settings = Settings
WebPortalSetupPage = WebPortal setup page
WEBPORTAL_ROOT_URL = Alternative virtual host URL
WebPortalRootUrlHelp = Public access url (http or https) if you have a virtual host or keep empty
WEBPORTAL_TITLE = Brand name on header of public page
UserAccountForWebPortalAreInThirdPartyTabHelp = Users accounts for WebPortal can be set on each third party card in Website accounts tab
WebPortalAccessHidden = Hidden
WebPortalAccessVisible = Visible
WebPortalAccessEdit = Editable
WEBPORTAL_MEMBER_CARD_ACCESS = Enable access to the membership record
WebPortalMemberCardAccessHelp = Enable access to the membership record (Hidden / Visible or Editable)
WEBPORTAL_PARTNERSHIP_CARD_ACCESS = Enable access to the partnership record
WebPortalPartnerShipCardAccessHelp = Enable access to the partnership record (Hidden / Visible or Editable)
WEBPORTAL_PROPAL_LIST_ACCESS = Enable access to the proposals
WEBPORTAL_ORDER_LIST_ACCESS = Enable access to the orders
WEBPORTAL_INVOICE_LIST_ACCESS = Enable access to the invoices
WEBPORTAL_USER_LOGGED = Select an anonymous user
WebPortalUserLoggedHelp = This user is used to update cards
WebPortalHomeTitle = Welcome
WebPortalHomeDesc = Welcome to the public interface
WebPortalPropalListMenu = Proposals
WebPortalPropalListTitle = List of proposals
WebPortalPropalListDesc = List of proposals
WebPortalPropalListNothing = Proposals not found
WebPortalOrderListMenu = Orders
WebPortalOrderListTitle = List of orders
WebPortalOrderListDesc = List of orders
WebPortalOrderListNothing = Orders not found
WebPortalInvoiceListMenu = Invoices
WebPortalInvoiceListTitle = List of invoices
WebPortalInvoiceListDesc = List of invoices
WebPortalInvoiceListNothing = Invoices not found
WebPortalMemberCardMenu = Member
WebPortalMemberCardTitle = Member card
WebPortalMemberCardDesc = Member card
WebPortalPartnershipCardMenu = Partnership
WebPortalPartnershipCardTitle = Partnership card
WebPortalPartnershipCardDesc = Partnership card
loginWebportalUserName = User name / email
loginWebportalPassword = Password
LoginNow = Login now
RemoveSearchFilters = Remove search filters
WEBPORTAL_PRIMARY_COLOR = Primary color
WEBPORTAL_SECONDARY_COLOR = Secondary color
WEBPORTAL_LOGIN_LOGO_URL = Login logo image URL
WEBPORTAL_MENU_LOGO_URL = Menu logo image URL
WEBPORTAL_MENU_LOGO_URLTooltip = Leave empty to use login logo
WEBPORTAL_LOGIN_BACKGROUND = Background login image URL
WEBPORTAL_BANNER_BACKGROUND = Background for banner
WEBPORTAL_BANNER_BACKGROUND_IS_DARK = Use dark theme for banner
AriaPrevPage = Previous page
AriaNextPage = Next page
AriaPageX = Page %s
WebPortalError404 = Page not found
WebPortalErrorPageNotExist = Page not exist
WebPortalErrorFetchThirdPartyAccountFromLogin = Error when loading third-party account (login : %s)
WebPortalErrorAuthentication = Authentication error
WebPortalErrorFetchLoggedThirdPartyAccount = Error when loading third-party account (login : %s)
WebPortalErrorFetchLoggedUser = Error when loading user (Id : %s)
WebPortalErrorFetchLoggedThirdParty = Error when loading third-party (Id : %s)
WebPortalErrorFetchLoggedMember = Error when loading member (Id : %s)
WebPortalErrorFetchLoggedPartnership = Error when loading partnership (Third-party Id : %s, Member Id : %s)

View file

@ -342,18 +342,18 @@ if (!empty($php_session_save_handler) && $php_session_save_handler == 'db') {
require_once 'core/lib/phpsessionin'.$php_session_save_handler.'.lib.php';
}
// Init session. Name of session is specific to Dolibarr instance.
// Must be done after the include of filefunc.inc.php so global variables of conf file are defined (like $dolibarr_main_instance_unique_id or $dolibarr_main_force_https).
// Note: the function dol_getprefix() is defined into functions.lib.php but may have been defined to return a different key to manage another area to protect.
$prefix = dol_getprefix('');
$sessionname = 'DOLSESSID_'.$prefix;
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
// Init session. Name of session is specific to Dolibarr instance.
// Must be done after the include of filefunc.inc.php so global variables of conf file are defined (like $dolibarr_main_instance_unique_id or $dolibarr_main_force_https).
// Note: the function dol_getprefix() is defined into functions.lib.php but may have been defined to return a different key to manage another area to protect.
$prefix = dol_getprefix('');
$sessionname = 'DOLSESSID_'.$prefix;
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
if (!empty($_COOKIE[$sessiontimeout])) {
ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]);
}
// This create lock, released by session_write_close() or end of page.
// We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
// This create lock, released by session_write_close() or end of page.
// We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
if (!defined('NOSESSION')) {
if (PHP_VERSION_ID < 70300) {
session_set_cookie_params(0, '/', null, ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
@ -375,13 +375,13 @@ if (!defined('NOSESSION')) {
}
// Init the 6 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc, $hookmanager
require_once 'master.inc.php';
// Init the 6 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc, $hookmanager
require_once 'master.inc.php';
// Uncomment this and set session.save_handler = user to use local session storing
// include DOL_DOCUMENT_ROOT.'/core/lib/phpsessionindb.inc.php
// Uncomment this and set session.save_handler = user to use local session storing
// include DOL_DOCUMENT_ROOT.'/core/lib/phpsessionindb.inc.php
// If software has been locked. Only login $conf->global->MAIN_ONLY_LOGIN_ALLOWED is allowed.
// If software has been locked. Only login $conf->global->MAIN_ONLY_LOGIN_ALLOWED is allowed.
if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) {
$ok = 0;
if ((!session_id() || !isset($_SESSION["dol_login"])) && !isset($_POST["username"]) && !empty($_SERVER["GATEWAY_INTERFACE"])) {
@ -411,10 +411,10 @@ if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) {
}
// Activate end of page function
register_shutdown_function('dol_shutdown');
// Activate end of page function
register_shutdown_function('dol_shutdown');
// Load debugbar
// Load debugbar
if (isModEnabled('debugbar') && !GETPOST('dol_use_jmobile') && empty($_SESSION['dol_use_jmobile'])) {
global $debugbar;
include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php';
@ -428,7 +428,7 @@ if (isModEnabled('debugbar') && !GETPOST('dol_use_jmobile') && empty($_SESSION['
$debugbar['time']->startMeasure('pageaftermaster', 'Page generation (after environment init)');
}
// Detection browser
// Detection browser
if (isset($_SERVER["HTTP_USER_AGENT"])) {
$tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
$conf->browser->name = $tmp['browsername'];
@ -443,13 +443,13 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) {
}
}
// If theme is forced
// If theme is forced
if (GETPOST('theme', 'aZ09')) {
$conf->theme = GETPOST('theme', 'aZ09');
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
// Set global MAIN_OPTIMIZEFORTEXTBROWSER (must be before login part)
// Set global MAIN_OPTIMIZEFORTEXTBROWSER (must be before login part)
if (GETPOST('textbrowser', 'int') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks')) { // If we must enable text browser
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 1;
}
@ -498,7 +498,7 @@ if (!defined('NOLOGIN') && !defined('NOIPCHECK') && !empty($dolibarr_main_restri
}
}
// Loading of additional presentation includes
// Loading of additional presentation includes
if (!defined('NOREQUIREHTML')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2)
}
@ -506,13 +506,13 @@ if (!defined('NOREQUIREAJAX')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; // Need 22ko memory
}
// If install or upgrade process not done or not completely finished, we call the install page.
// If install or upgrade process not done or not completely finished, we call the install page.
if (getDolGlobalString('MAIN_NOT_INSTALLED') || getDolGlobalString('MAIN_NOT_UPGRADED')) {
dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING);
header("Location: ".DOL_URL_ROOT."/install/index.php");
exit;
}
// If an upgrade process is required, we call the install page.
// If an upgrade process is required, we call the install page.
if ((getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && ($conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION))
|| (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && getDolGlobalString('MAIN_VERSION_LAST_INSTALL') && ($conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) {
$versiontocompare = !getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') ? $conf->global->MAIN_VERSION_LAST_INSTALL : $conf->global->MAIN_VERSION_LAST_UPGRADE;
@ -530,7 +530,7 @@ if ((getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && ($conf->global->MAIN_VER
}
}
// Creation of a token against CSRF vulnerabilities
// Creation of a token against CSRF vulnerabilities
if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) {
// No token renewal on .css.php, .js.php and .json.php (even if the NOTOKENRENEWAL was not provided)
if (!preg_match('/\.(css|js|json)\.php$/', $_SERVER["PHP_SELF"])) {
@ -550,9 +550,9 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) {
}
}
//dol_syslog("CSRF info: ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha'));
//dol_syslog("CSRF info: ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha'));
// Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page
// Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page
if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) {
// Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request)
$sensitiveget = false;
@ -609,12 +609,12 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
print " into setup).\n";
}
}
die;
die;
}
}
$sessiontokenforthisurl = (empty($_SESSION['token']) ? '' : $_SESSION['token']);
// TODO Get the sessiontokenforthisurl into an array of session token (one array per base URL so we can use the CSRF per page and we keep ability for several tabs per url in a browser)
$sessiontokenforthisurl = (empty($_SESSION['token']) ? '' : $_SESSION['token']);
// TODO Get the sessiontokenforthisurl into an array of session token (one array per base URL so we can use the CSRF per page and we keep ability for several tabs per url in a browser)
if (GETPOSTISSET('token') && GETPOST('token') != 'notrequired' && GETPOST('token', 'alpha') != $sessiontokenforthisurl) {
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referrer=".(empty($_SERVER['HTTP_REFERER'])?'':$_SERVER['HTTP_REFERER']).", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha'), LOG_WARNING);
//dol_syslog("_SESSION['token']=".$sessiontokenforthisurl, LOG_DEBUG);
@ -643,7 +643,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
// Note: There is another CSRF protection into the filefunc.inc.php
}
// Disable modules (this must be after session_start and after conf has been loaded)
// Disable modules (this must be after session_start and after conf has been loaded)
if (GETPOSTISSET('disablemodules')) {
$_SESSION["disablemodules"] = GETPOST('disablemodules', 'alpha');
}
@ -668,8 +668,8 @@ if (!empty($_SESSION["disablemodules"])) {
}
}
// Set current modulepart
$modulepart = explode("/", $_SERVER["PHP_SELF"]);
// Set current modulepart
$modulepart = explode("/", $_SERVER["PHP_SELF"]);
if (is_array($modulepart) && count($modulepart) > 0) {
foreach ($conf->modules as $module) {
if (in_array($module, $modulepart)) {
@ -683,10 +683,10 @@ if (is_array($modulepart)) {
}
/*
* Phase authentication / login
*/
$login = '';
/*
* Phase authentication / login
*/
$login = '';
if (!defined('NOLOGIN')) {
// $authmode lists the different method of identification to be tested in order of preference.
// Example: 'http', 'dolibarr', 'ldap', 'http,forceuser', '...'
@ -1017,10 +1017,10 @@ if (!defined('NOLOGIN')) {
// User validity dates are no more valid
dol_syslog("The user login has a validity between [".$user->datestartvalidity." and ".$user->dateendvalidity."], current date is ".dol_now());
}
session_destroy();
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie
session_name($sessionname);
session_start();
session_destroy();
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie
session_name($sessionname);
session_start();
if ($resultFetchUser == 0) {
$langs->loadLangs(array('main', 'errors'));
@ -1040,23 +1040,23 @@ if (!defined('NOLOGIN')) {
$user->context['audit'] = 'ErrorUserSessionWasInvalidated - login='.$login;
}
// Call trigger
$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
// Call trigger
$result = $user->call_trigger('USER_LOGIN_FAILED', $user);
if ($result < 0) {
$error++;
}
// End call triggers
// End call triggers
// Hooks on failed login
$action = '';
$hookmanager->initHooks(array('login'));
$parameters = array('dol_authmode' => (isset($dol_authmode) ? $dol_authmode : ''), 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
$reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
// Hooks on failed login
$action = '';
$hookmanager->initHooks(array('login'));
$parameters = array('dol_authmode' => (isset($dol_authmode) ? $dol_authmode : ''), 'dol_loginmesg' => $_SESSION["dol_loginmesg"]);
$reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$error++;
}
$paramsurl = array();
$paramsurl = array();
if (GETPOST('textbrowser', 'int')) {
$paramsurl[] = 'textbrowser='.GETPOST('textbrowser', 'int');
}
@ -1067,8 +1067,8 @@ if (!defined('NOLOGIN')) {
$paramsurl[] = 'lang='.GETPOST('lang', 'aZ09');
}
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
exit;
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
exit;
} else {
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('main'));
@ -1273,13 +1273,13 @@ if (!defined('NOLOGIN')) {
}
// Case forcing style from url
// Case forcing style from url
if (GETPOST('theme', 'aZ09')) {
$conf->theme = GETPOST('theme', 'aZ09', 1);
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
// Set javascript option
// Set javascript option
if (GETPOST('nojs', 'int')) { // If javascript was not disabled on URL
$conf->use_javascript_ajax = 0;
} else {
@ -1288,15 +1288,15 @@ if (GETPOST('nojs', 'int')) { // If javascript was not disabled on URL
}
}
// Set MAIN_OPTIMIZEFORTEXTBROWSER for user (must be after login part)
// Set MAIN_OPTIMIZEFORTEXTBROWSER for user (must be after login part)
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = $user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
}
// set MAIN_OPTIMIZEFORCOLORBLIND for user
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND) ? '' : $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
// set MAIN_OPTIMIZEFORCOLORBLIND for user
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND) ? '' : $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
// Set terminal output option according to conf->browser.
// Set terminal output option according to conf->browser.
if (GETPOST('dol_hide_leftmenu', 'int') || !empty($_SESSION['dol_hide_leftmenu'])) {
$conf->dol_hide_leftmenu = 1;
}
@ -1312,7 +1312,7 @@ if (GETPOST('dol_no_mouse_hover', 'int') || !empty($_SESSION['dol_no_mouse_hover
if (GETPOST('dol_use_jmobile', 'int') || !empty($_SESSION['dol_use_jmobile'])) {
$conf->dol_use_jmobile = 1;
}
// If not on Desktop
// If not on Desktop
if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') {
$conf->dol_no_mouse_hover = 1;
}
@ -1329,7 +1329,7 @@ if ((!empty($conf->browser->layout) && $conf->browser->layout == 'phone')
$conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0;
}
}
// Replace themes bugged with jmobile with eldy
// Replace themes bugged with jmobile with eldy
if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) {
$conf->theme = 'eldy';
$conf->css = "/theme/".$conf->theme."/style.css.php";
@ -1411,9 +1411,9 @@ if (empty($conf->browser->firefox)) {
define('ROWS_9', 8);
}
$heightforframes = 50;
$heightforframes = 50;
// Init menu manager
// Init menu manager
if (!defined('NOREQUIREMENU')) {
if (empty($user->socid)) { // If internal user or not defined
$conf->standard_menu = (!getDolGlobalString('MAIN_MENU_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENU_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
@ -1455,7 +1455,7 @@ if (!empty(GETPOST('seteventmessages', 'alpha'))) {
}
}
// Functions
// Functions
if (!function_exists("llxHeader")) {
/**
@ -1541,13 +1541,13 @@ if (!function_exists("llxHeader")) {
}
/**
* Show HTTP header. Called by top_htmlhead().
*
* @param string $contenttype Content type. For example, 'text/html'
* @param int $forcenocache Force disabling of cache for the page
* @return void
*/
/**
* Show HTTP header. Called by top_htmlhead().
*
* @param string $contenttype Content type. For example, 'text/html'
* @param int $forcenocache Force disabling of cache for the page
* @return void
*/
function top_httphead($contenttype = 'text/html', $forcenocache = 0)
{
global $db, $conf, $hookmanager;
@ -2084,22 +2084,22 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
}
/**
* Show an HTML header + a BODY + The top menu bar
*
* @param string $head Lines in the HEAD
* @param string $title Title of web page
* @param string $target Target to use in menu links (Example: '' or '_top')
* @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
* @param int $disablehead Do not output head section
* @param array $arrayofjs Array of js files to add in header
* @param array $arrayofcss Array of css files to add in header
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
* @param string $helppagename Name of wiki page for help ('' by default).
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
* For other external page: http://server/url
* @return void
*/
/**
* Show an HTML header + a BODY + The top menu bar
*
* @param string $head Lines in the HEAD
* @param string $title Title of web page
* @param string $target Target to use in menu links (Example: '' or '_top')
* @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
* @param int $disablehead Do not output head section
* @param array $arrayofjs Array of js files to add in header
* @param array $arrayofcss Array of css files to add in header
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
* @param string $helppagename Name of wiki page for help ('' by default).
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
* For other external page: http://server/url
* @return void
*/
function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = array(), $arrayofcss = array(), $morequerystring = '', $helppagename = '')
{
global $user, $conf, $langs, $db, $form;
@ -2347,13 +2347,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
}
/**
* Build the tooltip on user login
*
* @param int $hideloginname Hide login name. Show only the image.
* @param string $urllogout URL for logout (Will use DOL_URL_ROOT.'/user/logout.php?token=...' if empty)
* @return string HTML content
*/
/**
* Build the tooltip on user login
*
* @param int $hideloginname Hide login name. Show only the image.
* @param string $urllogout URL for logout (Will use DOL_URL_ROOT.'/user/logout.php?token=...' if empty)
* @return string HTML content
*/
function top_menu_user($hideloginname = 0, $urllogout = '')
{
global $langs, $conf, $db, $hookmanager, $user, $mysoc;
@ -2615,11 +2615,11 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
return $btnUser;
}
/**
* Build the tooltip on top menu quick add
*
* @return string HTML content
*/
/**
* Build the tooltip on top menu quick add
*
* @return string HTML content
*/
function top_menu_quickadd()
{
global $conf, $langs;
@ -2642,8 +2642,9 @@ function top_menu_quickadd()
<a accesskey="a" class="dropdown-toggle login-dropdown-a nofocusvisible" data-toggle="dropdown" href="#" title="'.$langs->trans('QuickAdd').' ('.$stringforfirstkey.' a)"><i class="fa fa-plus-circle"></i></a>
<div class="dropdown-menu">'.printDropdownQuickadd().'</div>
</div>';
$html .= '
<!-- Code to show/hide the user drop-down -->
if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) { // This may be set by some pages that use different jquery version to avoid errors
$html .= '
<!-- Code to show/hide the user drop-down for the quick add -->
<script>
jQuery(document).ready(function() {
jQuery(document).on("click", function(event) {
@ -2673,14 +2674,15 @@ function top_menu_quickadd()
});
</script>
';
}
return $html;
}
/**
* Generate list of quickadd items
*
* @return string HTML output
*/
/**
* Generate list of quickadd items
*
* @return string HTML output
*/
function printDropdownQuickadd()
{
global $conf, $user, $langs, $hookmanager;
@ -2855,11 +2857,11 @@ function printDropdownQuickadd()
return $dropDownQuickAddHtml;
}
/**
* Build the tooltip on top menu bookmark
*
* @return string HTML content
*/
/**
* Build the tooltip on top menu bookmark
*
* @return string HTML content
*/
function top_menu_bookmark()
{
global $langs, $conf, $db, $user;
@ -2938,11 +2940,11 @@ function top_menu_bookmark()
return $html;
}
/**
* Build the tooltip on top menu tsearch
*
* @return string HTML content
*/
/**
* Build the tooltip on top menu tsearch
*
* @return string HTML content
*/
function top_menu_search()
{
global $langs, $conf, $db, $user, $hookmanager;
@ -3363,12 +3365,12 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
}
/**
* Begin main area
*
* @param string $title Title
* @return void
*/
/**
* Begin main area
*
* @param string $title Title
* @return void
*/
function main_area($title = '')
{
global $conf, $langs, $hookmanager;
@ -3424,13 +3426,13 @@ function main_area($title = '')
}
/**
* Return helpbaseurl, helppage and mode
*
* @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff,DE:ddd...' or 'http://localpage')
* @param Translate $langs Language
* @return array Array of help urls
*/
/**
* Return helpbaseurl, helppage and mode
*
* @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff,DE:ddd...' or 'http://localpage')
* @param Translate $langs Language
* @return array Array of help urls
*/
function getHelpParamFor($helppagename, $langs)
{
$helpbaseurl = '';
@ -3475,22 +3477,22 @@ function getHelpParamFor($helppagename, $langs)
}
/**
* Show a search area.
* Used when the javascript quick search is not used.
*
* @param string $urlaction Url post
* @param string $urlobject Url of the link under the search box
* @param string $title Title search area
* @param string $htmlmorecss Add more css
* @param string $htmlinputname Field Name input form
* @param string $accesskey Accesskey
* @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page
* @param string $img Image to use
* @param int $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers.
* @param int $autofocus Set autofocus on field
* @return string
*/
/**
* Show a search area.
* Used when the javascript quick search is not used.
*
* @param string $urlaction Url post
* @param string $urlobject Url of the link under the search box
* @param string $title Title search area
* @param string $htmlmorecss Add more css
* @param string $htmlinputname Field Name input form
* @param string $accesskey Accesskey
* @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page
* @param string $img Image to use
* @param int $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers.
* @param int $autofocus Set autofocus on field
* @return string
*/
function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey = '', $prefhtmlinputname = '', $img = '', $showtitlebefore = 0, $autofocus = 0)
{
global $langs, $user;

View file

@ -2,7 +2,7 @@ Module Builder
==============
This is a module to provide embedded tools to develop your own application/features inside Dolibarr ERP CRM software.
It provide tools for module developers to kickstart their project and give an hands-on sample of which features Dolibarr
It provides tools for module developers to kickstart their project and give an hands-on sample of which features Dolibarr
has to offer for module development.
If you don't need to develop your own module/application, you just don't need this.

View file

@ -61,8 +61,6 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
global $langs;
$langs->load("members");
$form = new Form($this->db);
$arraystatus = array(1=>'Option 1', 2=>'Option 2');
$s = '';
@ -104,9 +102,9 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
$target = array();
$j = 0;
$sql = " select rowid as id, label, firstname, lastname";
$sql .= " from ".MAIN_DB_PREFIX."myobject";
$sql .= " where email IS NOT NULL AND email <> ''";
$sql = "SELECT rowid as id, firstname, lastname, email";
$sql .= " FROM ".MAIN_DB_PREFIX."myobject";
$sql .= " WHERE email IS NOT NULL AND email <> ''";
if (GETPOSTISSET('filter') && GETPOST('filter', 'alphanohtml') != 'none') {
$sql .= " AND status = '".$this->db->escape(GETPOST('filter', 'alphanohtml'))."'";
}
@ -118,7 +116,7 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
$num = $this->db->num_rows($result);
$i = 0;
dol_syslog("mailinglist_mymodule_myobject.modules.php: mailing ".$num." targets found");
dol_syslog(__METHOD__.":add_to_target ".$num." targets found");
$old = '';
while ($i < $num) {
@ -126,10 +124,10 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
if ($old != $obj->email) {
$target[$j] = array(
'email' => $obj->email,
'name' => $obj->lastname,
'id' => $obj->id,
'firstname' => $obj->firstname,
'other' => $obj->label,
'lastname' => $obj->lastname,
//'other' => $obj->label,
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_type' => 'myobject@mymodule'
@ -188,7 +186,9 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
*/
public function getNbOfRecipients($sql = '')
{
$sql = "select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''";
$sql = "SELECT COUNT(DISTINCT(email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."myobject as p";
$sql .= " WHERE email IS NOT NULL AND email <> ''";
$a = parent::getNbOfRecipients($sql);

View file

@ -169,7 +169,7 @@ class modMyModule extends DolibarrModules
'fr_FR:ParentCompany'=>'Maison mère ou revendeur'
)*/
if (!isset($conf->mymodule) || !isset($conf->mymodule->enabled)) {
if (!isModEnabled("mymodule")) {
$conf->mymodule = new stdClass();
$conf->mymodule->enabled = 0;
}

View file

@ -23,14 +23,12 @@ llxHeader();
?>
<h2>
This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with<br>
- css (add parameter &amp;theme=newtheme to test another theme or edit css of current theme)<br>
- jmobile (add parameter <a class="wordbreak" href="<?php echo $_SERVER["PHP_SELF"].'?dol_use_jmobile=1&dol_optimize_smallscreen=1'; ?>">dol_use_jmobile=1&amp;dol_optimize_smallscreen=1</a> and switch to small screen < 570 to enable with emulated jmobile)<br>
- no javascript / usage for bind people (add parameter <a class="wordbreak" href="<?php echo $_SERVER["PHP_SELF"].'?nojs=1'; ?>">nojs=1</a> to force disable javascript)<br>
- use with a text browser (add parameter <a class="wordbreak" href="<?php echo $_SERVER["PHP_SELF"].'?textbrowser=1'; ?>">textbrowser=1</a> to force detection of a text browser)<br>
</h2>
<br>
<br><br>
<!-- Output to test html.form.class.php -->
<?php
@ -53,7 +51,7 @@ print $form->selectDate('', 'test1b', 1, 1, 0);
print '<br><br>'."\n";
// Test2: form->selectDate using tzuser date
print "Test 2: We must have here 1970-01-01 00:00:00 selected (fields can be empty)<br>\n";
print "Test 2: We must have here 1970-01-01 selected (fields can be empty)<br>\n";
print $form->selectDate(dol_get_first_day(1970, 1, false), 'test2', 1, 1, 1);
print '<br><br>'."\n";
@ -120,7 +118,7 @@ if (is_file(DOL_DOCUMENT_ROOT.'/includes/flowjs/flow.js')) {
print '<script>
jQuery(document).ready(function() {
var flow = new Flow({
target:"'.DOL_URL_ROOT.'/core/ajax/flowjs-server.php",
target:"'.DOL_URL_ROOT.'/core/ajax/flowjs-server.php",
query:{module:"test", token:"'.newToken().'"},
testChunks:false
});

View file

@ -85,7 +85,7 @@ if (!defined('WEBPORTAL_NOREQUIRETRAN') || (!defined('WEBPORTAL_NOLOGIN') && !em
}
$langs->setDefaultLang($langcode);
}
$langs->loadLangs(array('webportal@webportal', 'main'));
$langs->loadLangs(array('website', 'main'));
}
/*
@ -227,7 +227,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access
$langs = new Translate("", $conf);
$langs->setDefaultLang($logged_thirdparty->default_lang);
}
$langs->loadLangs(array('webportal@webportal', 'main'));
$langs->loadLangs(array('website', 'main'));
}
$context->logged_user = $logged_user;

View file

@ -81,7 +81,7 @@ class SocieteAccount extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1),
'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1),
'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30),
'pass_crypted' => array('type'=>'password', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1),
'pass_crypted' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>31, 'notnull'=>1),
'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth300 widthcentpercentminusxx'),
'site' => array('type'=>'varchar(128)', 'label'=>'WebsiteTypeLabel', 'visible'=>0, 'enabled'=>0, 'position'=>41, 'notnull'=>1, 'default' => '', 'help'=>'Name of the website or service if this is account on an external website or service'),
@ -172,7 +172,7 @@ class SocieteAccount extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs;
global $langs;
$this->db = $db;

View file

@ -1 +1,45 @@
Public web portal module for membership and partnership
Module Web Portal
================
This is a module to provide a ready to use Web Portal for your customers, suppliers, partners or members of the mebership module.
Accounts (login and pass) to acces this portal can be created for any thirdparty (from the tab "Web site accounts").
It is better to have a standalone web server with its own virtual host and domain name to use this module, so using the web portal does not
reaveal the domain and url of your backoffice installation.
It provides an interface to read or modify its data. This is for example, the list of the data than can be read (or modified):
If the Thirdparty module is enabled:
* Read/modify Name, phone, email, addresses of thirdparty
If the Patnership module is enabled:
* Read properties (status, stard date, end date) of its partnership.
If the Proposal module is enabled:
* Read its orders
If the Sale Order module is enabled:
* Read its orders
If the Invoice module is enabled:
* Read its invoices
If the Supplier module is enabled:
* Read its price requests
* Read its orders
* Read its invoices
If module Membership is enabled:
* Read/modify Name, phone, email, addresses of thirdparty
* Read its membership status (start and end date, amount paid)
Documentation
-------------
[Module Web Portal](https://wiki.dolibarr.org/index.php/Module_Web_Portal)

View file

@ -137,7 +137,7 @@ print '</div>';
print '<div class="center">';
print '<input class="button button-save reposition buttonforacesave" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
print '<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
//print '<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
print '</div>';
print '</form>';

View file

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php";
// Translations
$langs->loadLangs(array("admin", "webportal"));
$langs->loadLangs(array("admin", "webportal", "website"));
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('webportalsetup', 'globalsetup'));
@ -38,10 +38,6 @@ $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
if (empty($action)) {
$action = 'edit';
}
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
@ -70,7 +66,7 @@ $item->fieldAttr = array('placeholder' => 'https://');
$item->helpText = $langs->transnoentities('WebPortalRootUrlHelp');
require_once __DIR__ . '/../class/context.class.php';
$context = Context::getInstance();
$item->fieldOutputOverride = '<a target="_blank" href="'.Context::getRootConfigUrl().'" >'.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().'</a>';
//$item->fieldOutputOverride = '<a target="_blank" href="'.Context::getRootConfigUrl().'" >'.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().'</a>';
$formSetup->newItem('WEBPORTAL_TITLE')->defaultFieldValue = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
@ -228,6 +224,7 @@ if (empty($action) || $action == 'update') {
$action = 'edit';
}
/*
* View
*/
@ -248,9 +245,33 @@ print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
$head = webportalAdminPrepareHead();
print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "webportal");
print '<br>';
// URL For webportal
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('WebPortalURL').'</span><br>';
if (isModEnabled('multicompany')) {
$entity_qr = '?entity='.((int) $conf->entity);
} else {
$entity_qr = '';
}
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/webportal/index.php'.$entity_qr.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/webportal/index.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
//print '<a target="_blank" href="'.Context::getRootConfigUrl().'" >'.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().'</a>';
// Setup page goes here
print info_admin($langs->trans("UserAccountForWebPortalAreInThirdPartyTabHelp"));
print '<br>';
if ($action == 'edit') {
print $formSetup->generateOutput(true);
print '<br>';

View file

@ -124,7 +124,7 @@ $head = webportalAdminPrepareHead();
print dol_get_fiche_head($head, 'themesettings', $langs->trans($title), -1, "webportal");
// Setup page goes here
print info_admin($langs->trans("UserAccountForWebPortalAreInThirdPartyTabHelp"));
//print info_admin($langs->trans("UserAccountForWebPortalAreInThirdPartyTabHelp"));
if ($action == 'edit') {
print $formSetup->generateOutput(true);

View file

@ -161,7 +161,7 @@ class FormCardWebPortal
dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php');
// Load translation files required by the page
$langs->loadLangs(array('webportal@webportal', 'other'));
$langs->loadLangs(array('website', 'other'));
// Get parameters
//$id = $id > 0 ? $id : GETPOST('id', 'int');

View file

@ -1,110 +0,0 @@
# Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Generic
#
# Module label 'ModuleWebPortalName'
ModuleWebPortalName = Web portal
# Module description 'ModuleWebPortalDesc'
ModuleWebPortalDesc = Public web portal
WebPortalDescription = Public web portal module for membership and partnership
#
# Admin page
#
WebPortalSetup = WebPortal setup
WebPortalCSS=Web portal CSS
Settings = Settings
WebPortalSetupPage = WebPortal setup page
WEBPORTAL_ROOT_URL = Public access url
WebPortalRootUrlHelp = Public access url (http or https) if you have a virtual host or keep empty
WEBPORTAL_TITLE = Brand name on header of public page
UserAccountForWebPortalAreInThirdPartyTabHelp = Users accounts for WebPortal can be set on each third party card in Website accounts tab
WebPortalAccessHidden = Hidden
WebPortalAccessVisible = Visible
WebPortalAccessEdit = Editable
WEBPORTAL_MEMBER_CARD_ACCESS = Enable access to the membership record
WebPortalMemberCardAccessHelp = Enable access to the membership record (Hidden / Visible or Editable)
WEBPORTAL_PARTNERSHIP_CARD_ACCESS = Enable access to the partnership record
WebPortalPartnerShipCardAccessHelp = Enable access to the partnership record (Hidden / Visible or Editable)
WEBPORTAL_PROPAL_LIST_ACCESS = Enable access to the proposals
WEBPORTAL_ORDER_LIST_ACCESS = Enable access to the orders
WEBPORTAL_INVOICE_LIST_ACCESS = Enable access to the invoices
WEBPORTAL_USER_LOGGED = Select a user
WebPortalUserLoggedHelp = This user is used to update cards
#
# Public pages
#
WebPortalHomeTitle = Welcome
WebPortalHomeDesc = Welcome to the public interface
WebPortalPropalListMenu = Proposals
WebPortalPropalListTitle = List of proposals
WebPortalPropalListDesc = List of proposals
WebPortalPropalListNothing = Proposals not found
WebPortalOrderListMenu = Orders
WebPortalOrderListTitle = List of orders
WebPortalOrderListDesc = List of orders
WebPortalOrderListNothing = Orders not found
WebPortalInvoiceListMenu = Invoices
WebPortalInvoiceListTitle = List of invoices
WebPortalInvoiceListDesc = List of invoices
WebPortalInvoiceListNothing = Invoices not found
WebPortalMemberCardMenu = Member
WebPortalMemberCardTitle = Member card
WebPortalMemberCardDesc = Member card
WebPortalPartnershipCardMenu = Partnership
WebPortalPartnershipCardTitle = Partnership card
WebPortalPartnershipCardDesc = Partnership card
loginWebportalUserName = User name / email
loginWebportalPassword = Password
LoginNow = Login now
RemoveSearchFilters = Remove search filters
#
# Aria accessibility
#
AriaPrevPage = Previous page
AriaNextPage = Next page
AriaPageX = Page %s
#
# Errors
#
WebPortalError404 = Page not found
WebPortalErrorPageNotExist = Page not exist
WebPortalErrorFetchThirdPartyAccountFromLogin = Error when loading third-party account (login : %s)
WebPortalErrorAuthentication = Authentication error
WebPortalErrorFetchLoggedThirdPartyAccount = Error when loading third-party account (login : %s)
WebPortalErrorFetchLoggedUser = Error when loading user (Id : %s)
WebPortalErrorFetchLoggedThirdParty = Error when loading third-party (Id : %s)
WebPortalErrorFetchLoggedMember = Error when loading member (Id : %s)
WebPortalErrorFetchLoggedPartnership = Error when loading partnership (Third-party Id : %s, Member Id : %s)
#
# Color theme settings
#
WEBPORTAL_PRIMARY_COLOR = Primary color
WEBPORTAL_SECONDARY_COLOR = Secondary color
WEBPORTAL_LOGIN_LOGO_URL = Login logo image URL
WEBPORTAL_MENU_LOGO_URL = Menu logo image URL
WEBPORTAL_MENU_LOGO_URLTooltip = Leave empty to use login logo
WEBPORTAL_LOGIN_BACKGROUND = Background login image URL
WEBPORTAL_BANNER_BACKGROUND = Background for banner
WEBPORTAL_BANNER_BACKGROUND_IS_DARK = Use dark theme for banner

View file

@ -35,7 +35,7 @@ function webportalAdminPrepareHead()
// $extrafields = new ExtraFields($db);
// $extrafields->fetch_name_optionals_label('myobject');
$langs->load("webportal@webportal");
$langs->load("website");
$h = 0;
$head = array();
@ -74,9 +74,9 @@ function webportalAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@webportal:/webportal/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'webportal@webportal');
complete_head_from_modules($conf, $langs, null, $head, $h, 'website');
complete_head_from_modules($conf, $langs, null, $head, $h, 'webportal@webportal', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'website', 'remove');
return $head;
}

View file

@ -281,7 +281,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$head = websiteaccountPrepareHead($object);
print dol_get_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, 'websiteaccount@website');
print dol_get_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, $object->picto);
$formconfirm = '';