Merge branch 'develop' into cleandeprecated

This commit is contained in:
Frédéric FRANCE 2024-01-04 09:26:29 +01:00 committed by GitHub
commit 2c2fb852d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 390 additions and 174 deletions

View file

@ -1,5 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
/*
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
*
* 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
@ -43,14 +45,23 @@ class Status extends DolibarrApi
*/
public function index()
{
global $conf;
global $dolibarr_main_prod;
return array(
$response = array(
'success' => array(
'code' => 200,
'dolibarr_version' => DOL_VERSION,
'access_locked' => (!getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED') ? '0' : $conf->global->MAIN_ONLY_LOGIN_ALLOWED),
'access_locked' => getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED', '0'),
),
);
if (empty($dolibarr_main_prod)) {
$response['success']['environment'] = 'non-production';
$response['success']['timestamp_now_utc'] = dol_now();
$response['success']['timestamp_php_tz'] = date_default_timezone_get();
$response['success']['date_tz'] = dol_print_date(dol_now('gmt'), 'standard');
}
return $response;
}
}

View file

@ -127,7 +127,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('Asset'), $help_url);
llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_accountancy');
if ($id > 0 || !empty($ref)) {
$head = assetPrepareHead($object);

View file

@ -131,7 +131,7 @@ if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_agenda');
if (isModEnabled('notification')) {
$langs->load("mails");

View file

@ -172,7 +172,7 @@ $formfile = new FormFile($db);
$title = $langs->trans("Asset").' - '.$langs->trans("Card");
$help_url = '';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card');
// Part to create
if ($action == 'create') {

View file

@ -97,7 +97,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('Asset'), $help_url);
llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_depreciation');
if ($id > 0 || !empty($ref)) {
$head = assetPrepareHead($object);

View file

@ -133,7 +133,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('Asset'), $help_url);
llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_depreciation_options');
if ($id > 0 || !empty($ref)) {
$head = assetPrepareHead($object);

View file

@ -88,7 +88,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('Asset'), $help_url);
llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_disposal');
if ($id > 0 || !empty($ref)) {
$object->fetch_thirdparty();

View file

@ -101,7 +101,7 @@ $form = new Form($db);
$title = $langs->trans("Asset").' - '.$langs->trans("Files");
$help_url = '';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_documents');
if ($object->id) {
/*

View file

@ -354,7 +354,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s
// Output page
// --------------------------------------------------------------------
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', '');
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-list');
$arrayofselected = is_array($toselect) ? $toselect : array();

View file

@ -131,7 +131,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('AssetModel'), $help_url);
llxHeader('', $langs->trans('AssetModel'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_accountancy');
if ($id > 0 || !empty($ref)) {
$head = assetModelPrepareHead($object);

View file

@ -137,7 +137,7 @@ if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_agenda');
if (isModEnabled('notification')) {
$langs->load("mails");

View file

@ -144,7 +144,7 @@ $formfile = new FormFile($db);
$title = $langs->trans("AssetModel") . ' - ' . $langs->trans("Card");
$help_url = '';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card');
// Part to create
if ($action == 'create') {

View file

@ -133,7 +133,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('AssetModel'), $help_url);
llxHeader('', $langs->trans('AssetModel'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_depreciation_options');
if ($id > 0 || !empty($ref)) {
$head = assetModelPrepareHead($object);

View file

@ -357,7 +357,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s
// Output page
// --------------------------------------------------------------------
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', '');
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-asset page-model-list');
$arrayofselected = is_array($toselect) ? $toselect : array();

View file

@ -93,7 +93,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('AssetModel'), $help_url);
llxHeader('', $langs->trans('AssetModel'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card_notes');
if ($id > 0 || !empty($ref)) {
$object->fetch_thirdparty();

View file

@ -86,7 +86,7 @@ if (empty($reshook)) {
$form = new Form($db);
$help_url = '';
llxHeader('', $langs->trans('Asset'), $help_url);
llxHeader('', $langs->trans('Asset'), $help_url, '', 0, 0, '', '', '', 'mod-asset page-card_notes');
if ($id > 0 || !empty($ref)) {
$object->fetch_thirdparty();

View file

@ -128,7 +128,7 @@ if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_agenda');
if (isModEnabled('notification')) {
$langs->load("mails");

View file

@ -1646,7 +1646,7 @@ if ($action == 'create') {
}
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card');
$form = new Form($db);
$formfile = new FormFile($db);
@ -2916,7 +2916,7 @@ if ($action == 'create' && $usercancreate) {
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
if (empty($reshook)) {
// Reopen a closed order
if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) {
if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate && (!$object->billed || !getDolGlobalInt('ORDER_DONT_REOPEN_BILLED'))) {
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
}

View file

@ -127,7 +127,7 @@ if ($id > 0 || !empty($ref)) {
$title = $object->ref." - ".$langs->trans('ContactsAddresses');
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_contact');
$head = commande_prepare_head($object);
print dol_get_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order');

View file

@ -100,7 +100,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
*/
$title = $object->ref." - ".$langs->trans('Documents');
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_documents');
$form = new Form($db);

View file

@ -1170,7 +1170,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s
// Output page
// --------------------------------------------------------------------
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-list');
$arrayofselected = is_array($toselect) ? $toselect : array();

View file

@ -83,7 +83,7 @@ if (empty($reshook)) {
*/
$title = $object->ref." - ".$langs->trans('Notes');
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_notes');
$form = new Form($db);

View file

@ -101,7 +101,7 @@ if ($mode == 'supplier') {
$dir = $conf->fournisseur->commande->dir_temp;
}
llxHeader('', $title);
llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-order page-stats');
print load_fiche_titre($title, '', $picto);

View file

@ -71,14 +71,6 @@ if ($user->socid) {
$socid = $user->socid;
}
$allowed = 0;
if ($user->hasRight('accounting', 'chartofaccount')) {
$allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account
}
if (!$allowed) {
$result = restrictedArea($user, 'banque');
}
$diroutputmassaction = $conf->bank->dir_output.'/temp/massgeneration/'.$user->id;
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@ -137,6 +129,15 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
$permissiontoadd = $user->rights->banque->modifier;
$permissiontodelete = $user->rights->banque->configurer;
$allowed = 0;
if ($user->hasRight('accounting', 'chartofaccount')) {
$allowed = 1; // Dictionary with list of banks accounting account allowed to manager of chart account
}
if (!$allowed) {
$result = restrictedArea($user, 'banque');
}
/*
* Actions
*/
@ -181,10 +182,14 @@ if (empty($reshook)) {
$form = new FormCategory($db);
$title = $langs->trans('BankAccounts');
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:M&oacute;dulo_Bancos_y_Cajas';
// Load array of financial accounts (opened by default)
$accounts = array();
// Build and execute select
// --------------------------------------------------------------------
$sql = "SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.currency_code, b.datec as date_creation, b.tms as date_update";
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
@ -196,6 +201,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
$sqlfields = $sql; // $sql fields to remove for count total
@ -270,13 +276,14 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
dol_print_error($db);
}
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
$db->free($resql);
}
// Complete request and execute it with limit
$sql .= $db->order($sortfield, $sortorder);
if ($limit) {
$sql .= $db->plimit($limit + 1, $offset);
@ -298,8 +305,6 @@ if ($resql) {
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:M&oacute;dulo_Bancos_y_Cajas';
llxHeader('', $title, $help_url);
@ -315,6 +320,9 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
}
if ($search_ref != '') {
$param .= '&search_ref='.urlencode($search_ref);
}
@ -330,9 +338,6 @@ if ($search_status != '') {
if ($show_files) {
$param .= '&show_files='.urlencode($show_files);
}
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
}
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
@ -345,7 +350,7 @@ $arrayofmassactions = array(
// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
if ($permissiontodelete) {
if (!empty($permissiontodelete)) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (isModEnabled('category') && $user->hasRight('banque', 'modifier')) {
@ -365,9 +370,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="page_y" value="">';
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
@ -411,11 +416,14 @@ if (empty($reshook)) {
if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
@ -426,7 +434,7 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
print '<tr class="liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
print '<td class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print '</td>';
@ -507,7 +515,7 @@ if (!empty($arrayfields['balance']['checked'])) {
}
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
print '<td class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
@ -520,6 +528,7 @@ $totalarray['nbfield'] = 0;
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
$totalarray['nbfield']++;
@ -578,20 +587,23 @@ if (!empty($arrayfields['balance']['checked'])) {
print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
$totalarray['nbfield']++;
}
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
$totalarray['nbfield']++;
}
print "</tr>\n";
print '</tr>'."\n";
// Loop on record
// --------------------------------------------------------------------
$i = 0;
$savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;
$totalarray['val'] = array('balance'=>0);
$total = array();
$found = 0;
$i = 0;
$lastcurrencycode = '';
$imaxinloop = ($limit ? min($num, $limit) : $num);
@ -619,13 +631,24 @@ foreach ($accounts as $key => $type) {
print '<div class="box-flex-container kanban">';
}
// Output Kanban
print $objecttmp->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected)));
$selected = -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($object->id, $arrayofselected)) {
$selected = 1;
}
}
//print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => $selected));
print $object->getKanbanView('', array('selected' => $selected));
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}
} else {
print '<tr class="oddeven">';
// Show line of result
$j = 0;
print '<tr data-rowid="'.$objecttmp->id.'" class="oddeven">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
@ -637,6 +660,9 @@ foreach ($accounts as $key => $type) {
print '<input id="cb'.$objecttmp->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Ref
if (!empty($arrayfields['b.ref']['checked'])) {
@ -830,12 +856,12 @@ foreach ($accounts as $key => $type) {
print '<input id="cb'.$objecttmp->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}
if (!$i) {
$totalarray['nbfield']++;
if (!$i) {
$totalarray['nbfield']++;
}
}
print '</tr>';
print '</tr>'."\n";
if (empty($total[$objecttmp->currency_code])) {
$total[$objecttmp->currency_code] = $solde;
@ -863,10 +889,10 @@ if ($lastcurrencycode != 'various') { // If there is several currency, $lastcurr
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
}
print '</table>';
print "</div>";
print '</table>'."\n";
print '</div>'."\n";
print "</form>";
print '</form>'."\n";
// End of page
llxFooter();

View file

@ -4304,13 +4304,19 @@ class Form
* @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
* 0 : use default deposit percentage from entry
* > 0 : force deposit percentage (for example, from company object)
* @param int $noprint if set to one we return the html to print, if 0 (default) we print it
* @return void
* @deprecated
*/
public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1)
public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0)
{
// phpcs:enable
print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent);
$out = $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent);
if (empty($noprint)) {
print $out;
} else {
return $out;
}
}

View file

@ -0,0 +1,58 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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/>.
* or see https://www.gnu.org/
*/
/**
* \file htdocs/core/lib/profid.lib.php
* \brief Set of functions for professional identifiers
*/
/**
* Check the validity of a SIREN.
*
* @param string $siren SIREN to check
* @return boolean True if valid, False otherwise
*/
function isValidSiren($siren)
{
$siren = trim($siren);
$siren = preg_replace('/(\s)/', '', $siren);
if (!is_numeric($siren) || dol_strlen($siren) != 9) {
return false;
}
// we take each figure one by one and:
// - if its index is odd then we double its value,
// - if the latter is higher than 9 then we substract 9 from it,
// - anf finally we add the result to the overall sum.
$sum = 0;
for ($index = 0; $index < 9; $index++) {
$number = (int) $siren[$index];
if (($index % 2) != 0) {
if (($number *= 2) > 9) {
$number -= 9;
}
}
$sum += $number;
}
// the siren is valid if the sum is a multiple of 10
return (($sum % 10) == 0) ? true : false;
}

View file

@ -496,8 +496,8 @@ print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortord
print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
//print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
//print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50');
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50 ');
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center tdoverflowmax100 ');
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("CronLastOutput", $_SERVER["PHP_SELF"], "t.lastoutput", "", $param, '', $sortfield, $sortorder);
@ -684,7 +684,7 @@ if ($num > 0) {
print '</td>';
// Next run date
print '<td class="center nowraponall">';
print '<td class="center">';
if (!empty($obj->datenextrun)) {
$datenextrun = $db->jdate($obj->datenextrun);
if (empty($obj->status)) {

View file

@ -173,7 +173,9 @@ if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
llxHeader('', $langs->trans("DonationsSetup"), 'DonConfiguration');
$help_url = '';
llxHeader('', $langs->trans("DonationsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-admin');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup');

View file

@ -63,7 +63,8 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
$textobject = $langs->transnoentitiesnoconv("Donations");
llxHeader('', $langs->trans("DonationsSetup"));
$help_url = '';
llxHeader('', $langs->trans("DonationsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-admin_extrafields');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup');

View file

@ -391,7 +391,7 @@ $title = $langs->trans("Donation");
$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card');
$form = new Form($db);
$formfile = new FormFile($db);

View file

@ -111,7 +111,7 @@ $title = $langs->trans('Donation')." - ".$langs->trans('Documents');
$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card_documents');
if ($object->id) {

View file

@ -56,7 +56,7 @@ $donstatic = new Don($db);
$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
llxHeader('', $langs->trans("Donations"), $help_url);
llxHeader('', $langs->trans("Donations"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-index');
$nb = array();
$somme = array();

View file

@ -69,7 +69,7 @@ $title = $langs->trans('Donation')." - ".$langs->trans('Info');
$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card_info');
$form = new Form($db);
if (isModEnabled('project')) {

View file

@ -208,7 +208,7 @@ if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sea
// Output page
// --------------------------------------------------------------------
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-list'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
// Example : Adding jquery code
// print '<script type="text/javascript">

View file

@ -86,7 +86,7 @@ $title = $langs->trans('Donation')." - ".$langs->trans('Notes');
$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card_notes');
$form = new Form($db);
if (isModEnabled('project')) {

View file

@ -78,8 +78,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('don', '
/*
* View
*/
llxHeader();
$title = $langs->trans("Payment");
llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-donation page-payment_card');
$don = new Don($db);
$form = new Form($db);

View file

@ -139,8 +139,8 @@ if ($action == 'add_payment') {
*/
$form = new Form($db);
llxHeader();
$title = $langs->trans("Payment");
llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-donation page-payment');
$sql = "SELECT sum(p.amount) as total";

View file

@ -58,10 +58,10 @@ $result = restrictedArea($user, 'don');
*/
$form = new Form($db);
$title = $langs->trans("DonationsStatistics");
llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-donation page-stats');
llxHeader();
print load_fiche_titre($langs->trans("StatisticsOfDonations"), $mesg);
print load_fiche_titre($langs->trans("DonationsStatistics"), $mesg);
dol_mkdir($dir);

View file

@ -31,5 +31,130 @@
-- To rebuild sequence for postgresql after insert, by forcing id autoincrement fields:
-- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences();
-- Use unique keys for extrafields
ALTER TABLE llx_actioncomm_extrafields DROP INDEX idx_actioncomm_extrafields;
ALTER TABLE llx_actioncomm_extrafields ADD UNIQUE INDEX uk_actioncomm_extrafields (fk_object);
ALTER TABLE llx_adherent_extrafields DROP INDEX idx_adherent_extrafields;
ALTER TABLE llx_adherent_extrafields ADD UNIQUE INDEX uk_adherent_extrafields (fk_object);
ALTER TABLE llx_adherent_type_extrafields DROP INDEX idx_adherent_type_extrafields;
ALTER TABLE llx_adherent_type_extrafields ADD UNIQUE INDEX uk_adherent_type_extrafields (fk_object);
ALTER TABLE llx_asset_model_extrafields DROP INDEX idx_asset_model_extrafields;
ALTER TABLE llx_asset_model_extrafields ADD UNIQUE INDEX uk_asset_model_extrafields (fk_object);
ALTER TABLE llx_bank_account_extrafields DROP INDEX idx_bank_account_extrafields;
ALTER TABLE llx_bank_account_extrafields ADD UNIQUE INDEX uk_bank_account_extrafields (fk_object);
ALTER TABLE llx_bank_extrafields DROP INDEX idx_bank_extrafields;
ALTER TABLE llx_bank_extrafields ADD UNIQUE INDEX uk_bank_extrafields (fk_object);
ALTER TABLE llx_bom_bom_extrafields DROP INDEX idx_bom_bom_extrafields_fk_object;
ALTER TABLE llx_bom_bom_extrafields ADD UNIQUE INDEX uk_bom_bom_extrafields_fk_object (fk_object);
ALTER TABLE llx_categories_extrafields DROP INDEX idx_categories_extrafields;
ALTER TABLE llx_categories_extrafields ADD UNIQUE INDEX uk_categories_extrafields (fk_object);
ALTER TABLE llx_commande_extrafields DROP INDEX idx_commande_extrafields;
ALTER TABLE llx_commande_extrafields ADD UNIQUE INDEX uk_commande_extrafields (fk_object);
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields DROP INDEX idx_commande_fournisseur_dispatch_extrafields;
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD UNIQUE INDEX uk_commande_fournisseur_dispatch_extrafields (fk_object);
ALTER TABLE llx_commande_fournisseur_extrafields DROP INDEX idx_commande_fournisseur_extrafields;
ALTER TABLE llx_commande_fournisseur_extrafields ADD UNIQUE INDEX uk_commande_fournisseur_extrafields (fk_object);
ALTER TABLE llx_commande_fournisseurdet_extrafields DROP INDEX idx_commande_fournisseurdet_extrafields;
ALTER TABLE llx_commande_fournisseurdet_extrafields ADD UNIQUE INDEX uk_commande_fournisseurdet_extrafields (fk_object);
ALTER TABLE llx_commandedet_extrafields DROP INDEX idx_commandedet_extrafields;
ALTER TABLE llx_commandedet_extrafields ADD UNIQUE INDEX uk_commandedet_extrafields (fk_object);
ALTER TABLE llx_contrat_extrafields DROP INDEX idx_contrat_extrafields;
ALTER TABLE llx_contrat_extrafields ADD UNIQUE INDEX uk_contrat_extrafields (fk_object);
ALTER TABLE llx_contratdet_extrafields DROP INDEX idx_contratdet_extrafields;
ALTER TABLE llx_contratdet_extrafields ADD UNIQUE INDEX uk_contratdet_extrafields (fk_object);
ALTER TABLE llx_delivery_extrafields DROP INDEX idx_delivery_extrafields;
ALTER TABLE llx_delivery_extrafields ADD UNIQUE INDEX uk_delivery_extrafields (fk_object);
ALTER TABLE llx_deliverydet_extrafields DROP INDEX idx_deliverydet_extrafields;
ALTER TABLE llx_deliverydet_extrafields ADD UNIQUE INDEX uk_deliverydet_extrafields (fk_object);
ALTER TABLE llx_ecm_directories_extrafields DROP INDEX idx_ecm_directories_extrafields;
ALTER TABLE llx_ecm_directories_extrafields ADD UNIQUE INDEX uk_ecm_directories_extrafields (fk_object);
ALTER TABLE llx_ecm_files_extrafields DROP INDEX idx_ecm_files_extrafields;
ALTER TABLE llx_ecm_files_extrafields ADD UNIQUE INDEX uk_ecm_files_extrafields (fk_object);
ALTER TABLE llx_entrepot_extrafields DROP INDEX idx_entrepot_extrafields;
ALTER TABLE llx_entrepot_extrafields ADD UNIQUE INDEX uk_entrepot_extrafields (fk_object);
ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields DROP INDEX idx_conferenceorboothattendee_fk_object;
ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD UNIQUE INDEX uk_conferenceorboothattendee_fk_object (fk_object);
ALTER TABLE llx_expedition_extrafields DROP INDEX idx_expedition_extrafields;
ALTER TABLE llx_expedition_extrafields ADD UNIQUE INDEX uk_expedition_extrafields (fk_object);
ALTER TABLE llx_expeditiondet_extrafields DROP INDEX idx_expeditiondet_extrafields;
ALTER TABLE llx_expeditiondet_extrafields ADD UNIQUE INDEX uk_expeditiondet_extrafields (fk_object);
ALTER TABLE llx_expensereport_extrafields DROP INDEX idx_expensereport_extrafields;
ALTER TABLE llx_expensereport_extrafields ADD UNIQUE INDEX uk_expensereport_extrafields (fk_object);
ALTER TABLE llx_facture_extrafields DROP INDEX idx_facture_extrafields;
ALTER TABLE llx_facture_extrafields ADD UNIQUE INDEX uk_facture_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_det_extrafields DROP INDEX idx_facture_fourn_det_extrafields;
ALTER TABLE llx_facture_fourn_det_extrafields ADD UNIQUE INDEX uk_facture_fourn_det_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_det_rec_extrafields DROP INDEX idx_facture_fourn_det_rec_extrafields;
ALTER TABLE llx_facture_fourn_det_rec_extrafields ADD UNIQUE INDEX uk_facture_fourn_det_rec_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_extrafields DROP INDEX idx_facture_fourn_extrafields;
ALTER TABLE llx_facture_fourn_extrafields ADD UNIQUE INDEX uk_facture_fourn_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_rec_extrafields DROP INDEX idx_facture_fourn_rec_extrafields;
ALTER TABLE llx_facture_fourn_rec_extrafields ADD UNIQUE INDEX uk_facture_fourn_rec_extrafields (fk_object);
ALTER TABLE llx_facture_rec_extrafields DROP INDEX idx_facture_rec_extrafields;
ALTER TABLE llx_facture_rec_extrafields ADD UNIQUE INDEX uk_facture_rec_extrafields (fk_object);
ALTER TABLE llx_facturedet_extrafields DROP INDEX idx_facturedet_extrafields;
ALTER TABLE llx_facturedet_extrafields ADD UNIQUE INDEX uk_facturedet_extrafields (fk_object);
ALTER TABLE llx_facturedet_rec_extrafields DROP INDEX idx_facturedet_rec_extrafields;
ALTER TABLE llx_facturedet_rec_extrafields ADD UNIQUE INDEX uk_facturedet_rec_extrafields (fk_object);
ALTER TABLE llx_fichinter_extrafields DROP INDEX idx_ficheinter_extrafields;
ALTER TABLE llx_fichinter_extrafields ADD UNIQUE INDEX uk_ficheinter_extrafields (fk_object);
ALTER TABLE llx_fichinterdet_extrafields DROP INDEX idx_ficheinterdet_extrafields;
ALTER TABLE llx_fichinterdet_extrafields ADD UNIQUE INDEX uk_ficheinterdet_extrafields (fk_object);
ALTER TABLE llx_holiday_extrafields DROP INDEX idx_holiday_extrafields;
ALTER TABLE llx_holiday_extrafields ADD UNIQUE INDEX uk_holiday_extrafields (fk_object);
ALTER TABLE llx_hrm_evaluation_extrafields DROP INDEX idx_evaluation_fk_object;
ALTER TABLE llx_hrm_evaluation_extrafields ADD UNIQUE INDEX uk_evaluation_fk_object (fk_object);
ALTER TABLE llx_hrm_evaluationdet_extrafields DROP INDEX idx_evaluationdet_fk_object;
ALTER TABLE llx_hrm_evaluationdet_extrafields ADD UNIQUE INDEX uk_evaluationdet_fk_object (fk_object);
ALTER TABLE llx_hrm_job_extrafields DROP INDEX idx_job_fk_object;
ALTER TABLE llx_hrm_job_extrafields ADD UNIQUE INDEX uk_job_fk_object (fk_object);
ALTER TABLE llx_hrm_skill_extrafields DROP INDEX idx_skill_fk_object;
ALTER TABLE llx_hrm_skill_extrafields ADD UNIQUE INDEX uk_skill_fk_object (fk_object);
ALTER TABLE llx_inventory_extrafields DROP INDEX idx_inventory_extrafields;
ALTER TABLE llx_inventory_extrafields ADD UNIQUE INDEX uk_inventory_extrafields (fk_object);
ALTER TABLE llx_knowledgemanagement_knowledgerecord_extrafields DROP INDEX idx_knowledgerecord_fk_object;
ALTER TABLE llx_knowledgemanagement_knowledgerecord_extrafields ADD UNIQUE INDEX uk_knowledgerecord_fk_object (fk_object);
ALTER TABLE llx_mrp_mo_extrafields DROP INDEX idx_mrp_mo_fk_object;
ALTER TABLE llx_mrp_mo_extrafields ADD UNIQUE INDEX uk_mrp_mo_fk_object (fk_object);
ALTER TABLE llx_mrp_production_extrafields DROP INDEX idx_mrp_production_fk_object;
ALTER TABLE llx_mrp_production_extrafields ADD UNIQUE INDEX uk_mrp_production_fk_object (fk_object);
ALTER TABLE llx_partnership_extrafields DROP INDEX idx_partnership_extrafields;
ALTER TABLE llx_partnership_extrafields ADD UNIQUE INDEX uk_partnership_extrafields (fk_object);
ALTER TABLE llx_product_extrafields DROP INDEX idx_product_extrafields;
ALTER TABLE llx_product_extrafields ADD UNIQUE INDEX uk_product_extrafields (fk_object);
ALTER TABLE llx_product_fournisseur_price_extrafields DROP INDEX idx_product_fournisseur_price_extrafields;
ALTER TABLE llx_product_fournisseur_price_extrafields ADD UNIQUE INDEX uk_product_fournisseur_price_extrafields (fk_object);
ALTER TABLE llx_product_lot_extrafields DROP INDEX idx_product_lot_extrafields;
ALTER TABLE llx_product_lot_extrafields ADD UNIQUE INDEX uk_product_lot_extrafields (fk_object);
ALTER TABLE llx_projet_extrafields DROP INDEX idx_projet_extrafields;
ALTER TABLE llx_projet_extrafields ADD UNIQUE INDEX uk_projet_extrafields (fk_object);
ALTER TABLE llx_projet_task_extrafields DROP INDEX idx_projet_task_extrafields;
ALTER TABLE llx_projet_task_extrafields ADD UNIQUE INDEX uk_projet_task_extrafields (fk_object);
ALTER TABLE llx_propal_extrafields DROP INDEX idx_propal_extrafields;
ALTER TABLE llx_propal_extrafields ADD UNIQUE INDEX uk_propal_extrafields (fk_object);
ALTER TABLE llx_propaldet_extrafields DROP INDEX idx_propaldet_extrafields;
ALTER TABLE llx_propaldet_extrafields ADD UNIQUE INDEX uk_propaldet_extrafields (fk_object);
ALTER TABLE llx_reception_extrafields DROP INDEX idx_reception_extrafields;
ALTER TABLE llx_reception_extrafields ADD UNIQUE INDEX uk_reception_extrafields (fk_object);
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields DROP INDEX idx_recruitmentcandidature_fk_object;
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD UNIQUE INDEX uk_recruitmentcandidature_fk_object (fk_object);
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields DROP INDEX idx_recruitmentjobposition_fk_object;
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD UNIQUE INDEX uk_recruitmentjobposition_fk_object (fk_object);
ALTER TABLE llx_resource_extrafields DROP INDEX idx_resource_extrafields;
ALTER TABLE llx_resource_extrafields ADD UNIQUE INDEX uk_resource_extrafields (fk_object);
ALTER TABLE llx_salary_extrafields DROP INDEX idx_salary_extrafields;
ALTER TABLE llx_salary_extrafields ADD UNIQUE INDEX uk_salary_extrafields (fk_object);
ALTER TABLE llx_socpeople_extrafields DROP INDEX idx_socpeople_extrafields;
ALTER TABLE llx_socpeople_extrafields ADD UNIQUE INDEX uk_socpeople_extrafields (fk_object);
ALTER TABLE llx_stock_mouvement_extrafields DROP INDEX idx_stock_mouvement_extrafields;
ALTER TABLE llx_stock_mouvement_extrafields ADD UNIQUE INDEX uk_stock_mouvement_extrafields (fk_object);
ALTER TABLE llx_supplier_proposal_extrafields DROP INDEX idx_supplier_proposal_extrafields;
ALTER TABLE llx_supplier_proposal_extrafields ADD UNIQUE INDEX uk_supplier_proposal_extrafields (fk_object);
ALTER TABLE llx_supplier_proposaldet_extrafields DROP INDEX idx_supplier_proposaldet_extrafields;
ALTER TABLE llx_supplier_proposaldet_extrafields ADD UNIQUE INDEX uk_supplier_proposaldet_extrafields (fk_object);
ALTER TABLE llx_ticket_extrafields DROP INDEX idx_ticket_extrafields;
ALTER TABLE llx_ticket_extrafields ADD UNIQUE INDEX uk_ticket_extrafields (fk_object);
ALTER TABLE llx_user_extrafields DROP INDEX idx_user_extrafields;
ALTER TABLE llx_user_extrafields ADD UNIQUE INDEX uk_user_extrafields (fk_object);
ALTER TABLE llx_usergroup_extrafields DROP INDEX idx_usergroup_extrafields;
ALTER TABLE llx_usergroup_extrafields ADD UNIQUE INDEX uk_usergroup_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_actioncomm_extrafields ADD INDEX idx_actioncomm_extrafields (fk_object);
ALTER TABLE llx_actioncomm_extrafields ADD UNIQUE INDEX uk_actioncomm_extrafields (fk_object);

View file

@ -20,4 +20,4 @@
-- ===================================================================
ALTER TABLE llx_adherent_extrafields ADD INDEX idx_adherent_extrafields (fk_object);
ALTER TABLE llx_adherent_extrafields ADD UNIQUE INDEX uk_adherent_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_adherent_type_extrafields ADD INDEX idx_adherent_type_extrafields (fk_object);
ALTER TABLE llx_adherent_type_extrafields ADD UNIQUE INDEX uk_adherent_type_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_bank_account_extrafields ADD INDEX idx_bank_account_extrafields (fk_object);
ALTER TABLE llx_bank_account_extrafields ADD UNIQUE INDEX uk_bank_account_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object);
ALTER TABLE llx_bank_extrafields ADD UNIQUE INDEX uk_bank_extrafields (fk_object);

View file

@ -17,5 +17,4 @@
-- ===================================================================
ALTER TABLE llx_bom_bom_extrafields ADD INDEX idx_bom_bom_extrafields_fk_object (fk_object);
ALTER TABLE llx_bom_bom_extrafields ADD UNIQUE INDEX uk_bom_bom_extrafields_fk_object (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_categories_extrafields ADD INDEX idx_categories_extrafields (fk_object);
ALTER TABLE llx_categories_extrafields ADD UNIQUE INDEX uk_categories_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_commande_extrafields ADD INDEX idx_commande_extrafields (fk_object);
ALTER TABLE llx_commande_extrafields ADD UNIQUE INDEX uk_commande_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD UNIQUE INDEX uk_commande_fournisseur_dispatch_extrafields (fk_object);

View file

@ -16,4 +16,4 @@
--
-- ============================================================================
ALTER TABLE llx_commande_fournisseur_extrafields ADD INDEX idx_commande_fournisseur_extrafields (fk_object);
ALTER TABLE llx_commande_fournisseur_extrafields ADD UNIQUE INDEX uk_commande_fournisseur_extrafields (fk_object);

View file

@ -16,4 +16,4 @@
--
-- ============================================================================
ALTER TABLE llx_commande_fournisseurdet_extrafields ADD INDEX idx_commande_fournisseurdet_extrafields (fk_object);
ALTER TABLE llx_commande_fournisseurdet_extrafields ADD UNIQUE INDEX uk_commande_fournisseurdet_extrafields (fk_object);

View file

@ -21,4 +21,4 @@
-- ===================================================================
ALTER TABLE llx_commandedet_extrafields ADD INDEX idx_commandedet_extrafields (fk_object);
ALTER TABLE llx_commandedet_extrafields ADD UNIQUE INDEX uk_commandedet_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_contrat_extrafields ADD INDEX idx_contrat_extrafields (fk_object);
ALTER TABLE llx_contrat_extrafields ADD UNIQUE INDEX uk_contrat_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object);
ALTER TABLE llx_contratdet_extrafields ADD UNIQUE INDEX uk_contratdet_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_delivery_extrafields ADD INDEX idx_delivery_extrafields (fk_object);
ALTER TABLE llx_delivery_extrafields ADD UNIQUE INDEX uk_delivery_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_deliverydet_extrafields ADD INDEX idx_deliverydet_extrafields (fk_object);
ALTER TABLE llx_deliverydet_extrafields ADD UNIQUE INDEX uk_deliverydet_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
ALTER TABLE llx_ecm_directories_extrafields ADD UNIQUE INDEX uk_ecm_directories_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
ALTER TABLE llx_ecm_files_extrafields ADD UNIQUE INDEX uk_ecm_files_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_entrepot_extrafields ADD INDEX idx_entrepot_extrafields (fk_object);
ALTER TABLE llx_entrepot_extrafields ADD UNIQUE INDEX uk_entrepot_extrafields (fk_object);

View file

@ -15,5 +15,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD INDEX idx_conferenceorboothattendee_fk_object(fk_object);
ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD UNIQUE INDEX uk_conferenceorboothattendee_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_expedition_extrafields ADD INDEX idx_expedition_extrafields (fk_object);
ALTER TABLE llx_expedition_extrafields ADD UNIQUE INDEX uk_expedition_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_expeditiondet_extrafields ADD INDEX idx_expeditiondet_extrafields (fk_object);
ALTER TABLE llx_expeditiondet_extrafields ADD UNIQUE INDEX uk_expeditiondet_extrafields (fk_object);

View file

@ -17,5 +17,5 @@
-- ===================================================================
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
ALTER TABLE llx_expensereport_extrafields ADD UNIQUE INDEX uk_expensereport_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_facture_extrafields ADD INDEX idx_facture_extrafields (fk_object);
ALTER TABLE llx_facture_extrafields ADD UNIQUE INDEX uk_facture_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_facture_fourn_det_extrafields ADD INDEX idx_facture_fourn_det_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_det_extrafields ADD UNIQUE INDEX uk_facture_fourn_det_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_facture_fourn_extrafields ADD INDEX idx_facture_fourn_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_extrafields ADD UNIQUE INDEX uk_facture_fourn_extrafields (fk_object);

View file

@ -16,4 +16,4 @@
-- ===================================================================
ALTER TABLE llx_facture_fourn_rec_extrafields ADD INDEX idx_facture_fourn_rec_extrafields (fk_object);
ALTER TABLE llx_facture_fourn_rec_extrafields ADD UNIQUE INDEX uk_facture_fourn_rec_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (fk_object);
ALTER TABLE llx_facture_rec_extrafields ADD UNIQUE INDEX uk_facture_rec_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_facturedet_extrafields ADD INDEX idx_facturedet_extrafields (fk_object);
ALTER TABLE llx_facturedet_extrafields ADD UNIQUE INDEX uk_facturedet_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object);
ALTER TABLE llx_facturedet_rec_extrafields ADD UNIQUE INDEX uk_facturedet_rec_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_fichinter_extrafields ADD INDEX idx_ficheinter_extrafields (fk_object);
ALTER TABLE llx_fichinter_extrafields ADD UNIQUE INDEX uk_ficheinter_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_fichinterdet_extrafields ADD INDEX idx_ficheinterdet_extrafields (fk_object);
ALTER TABLE llx_fichinterdet_extrafields ADD UNIQUE INDEX uk_ficheinterdet_extrafields (fk_object);

View file

@ -17,5 +17,5 @@
-- ===================================================================
ALTER TABLE llx_holiday_extrafields ADD INDEX idx_holiday_extrafields (fk_object);
ALTER TABLE llx_holiday_extrafields ADD UNIQUE INDEX uk_holiday_extrafields (fk_object);

View file

@ -17,5 +17,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object);
ALTER TABLE llx_hrm_evaluation_extrafields ADD UNIQUE INDEX uk_evaluation_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -17,5 +17,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_object(fk_object);
ALTER TABLE llx_hrm_evaluationdet_extrafields ADD UNIQUE INDEX uk_evaluationdet_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -17,5 +17,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object);
ALTER TABLE llx_hrm_job_extrafields ADD UNIQUE INDEX uk_job_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -15,5 +15,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_knowledgemanagement_knowledgerecord_extrafields ADD INDEX idx_knowledgerecord_fk_object(fk_object);
ALTER TABLE llx_knowledgemanagement_knowledgerecord_extrafields ADD UNIQUE INDEX uk_knowledgerecord_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -15,5 +15,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_mrp_mo_fk_object(fk_object);
ALTER TABLE llx_mrp_mo_extrafields ADD UNIQUE INDEX uk_mrp_mo_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -14,4 +14,4 @@
-- along with this program. If not, see http://www.gnu.org/licenses/.
ALTER TABLE llx_mrp_production_extrafields ADD INDEX idx_mrp_production_fk_object(fk_object);
ALTER TABLE llx_mrp_production_extrafields ADD UNIQUE INDEX uk_mrp_production_fk_object(fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_product_extrafields ADD INDEX idx_product_extrafields (fk_object);
ALTER TABLE llx_product_extrafields ADD UNIQUE INDEX uk_product_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_product_fournisseur_price_extrafields ADD INDEX idx_product_fournisseur_price_extrafields (fk_object);
ALTER TABLE llx_product_fournisseur_price_extrafields ADD UNIQUE INDEX uk_product_fournisseur_price_extrafields (fk_object);

View file

@ -17,5 +17,5 @@
-- ===================================================================
ALTER TABLE llx_product_lot_extrafields ADD INDEX idx_product_lot_extrafields (fk_object);
ALTER TABLE llx_product_lot_extrafields ADD UNIQUE INDEX uk_product_lot_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_projet_extrafields ADD INDEX idx_projet_extrafields (fk_object);
ALTER TABLE llx_projet_extrafields ADD UNIQUE INDEX uk_projet_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_projet_task_extrafields ADD INDEX idx_projet_task_extrafields (fk_object);
ALTER TABLE llx_projet_task_extrafields ADD UNIQUE INDEX uk_projet_task_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_propal_extrafields ADD INDEX idx_propal_extrafields (fk_object);
ALTER TABLE llx_propal_extrafields ADD UNIQUE INDEX uk_propal_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_object);
ALTER TABLE llx_propaldet_extrafields ADD UNIQUE INDEX uk_propaldet_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_object);
ALTER TABLE llx_reception_extrafields ADD UNIQUE INDEX uk_reception_extrafields (fk_object);

View file

@ -15,5 +15,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD INDEX idx_recruitmentcandidature_fk_object(fk_object);
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD UNIQUE INDEX uk_recruitmentcandidature_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -15,5 +15,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD INDEX idx_recruitmentjobposition_fk_object(fk_object);
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD UNIQUE INDEX uk_recruitmentjobposition_fk_object (fk_object);
-- END MODULEBUILDER INDEXES

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_resource_extrafields ADD INDEX idx_resource_extrafields (fk_object);
ALTER TABLE llx_resource_extrafields ADD UNIQUE INDEX uk_resource_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object);
ALTER TABLE llx_salary_extrafields ADD UNIQUE INDEX uk_salary_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
ALTER TABLE llx_socpeople_extrafields ADD UNIQUE INDEX uk_socpeople_extrafields (fk_object);

View file

@ -18,4 +18,4 @@
-- ============================================================================
ALTER TABLE llx_stock_mouvement_extrafields ADD INDEX idx_stock_mouvement_extrafields (fk_object);
ALTER TABLE llx_stock_mouvement_extrafields ADD UNIQUE INDEX uk_stock_mouvement_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_supplier_proposal_extrafields ADD INDEX idx_supplier_proposal_extrafields (fk_object);
ALTER TABLE llx_supplier_proposal_extrafields ADD UNIQUE INDEX uk_supplier_proposal_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_supplier_proposaldet_extrafields ADD INDEX idx_supplier_proposaldet_extrafields (fk_object);
ALTER TABLE llx_supplier_proposaldet_extrafields ADD UNIQUE INDEX uk_supplier_proposaldet_extrafields (fk_object);

View file

@ -20,4 +20,4 @@
-- ===================================================================
ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object);
ALTER TABLE llx_user_extrafields ADD UNIQUE INDEX uk_user_extrafields (fk_object);

View file

@ -17,4 +17,4 @@
-- ===================================================================
ALTER TABLE llx_usergroup_extrafields ADD INDEX idx_usergroup_extrafields (fk_object);
ALTER TABLE llx_usergroup_extrafields ADD UNIQUE INDEX uk_usergroup_extrafields (fk_object);

View file

@ -33,3 +33,4 @@ DONATION_ART978=Show article 978 from CGI if you are concerned
DonationPayment=Donation payment
DonationValidated=Donation %s validated
DonationUseThirdparties=Use the address of an existing thirdparty as the address of the donor
DonationsStatistics=Donation's statistics

View file

@ -1739,8 +1739,12 @@ class Products extends DolibarrApi
throw new RestException(401);
}
if (empty($id) || empty($features) || !is_array($features)) {
throw new RestException(401);
if (empty($id)) {
throw new RestException(400, 'Product ID is mandatory');
}
if (empty($features) || !is_array($features)) {
throw new RestException(400, 'Features is mandatory and should be IDs of attribute values indexed by IDs of attributes');
}
$weight_impact = price2num($weight_impact);
@ -1750,10 +1754,10 @@ class Products extends DolibarrApi
$prodattr_val = new ProductAttributeValue($this->db);
foreach ($features as $id_attr => $id_value) {
if ($prodattr->fetch((int) $id_attr) < 0) {
throw new RestException(401);
throw new RestException(400, 'Invalid attribute ID: '.$id_attr);
}
if ($prodattr_val->fetch((int) $id_value) < 0) {
throw new RestException(401);
throw new RestException(400, 'Invalid attribute value ID: '.$id_value);
}
}

View file

@ -412,7 +412,7 @@ if ($resql) {
dol_print_error($db);
}
if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') || getDolGlobalInt('PROJECT_SHOW_OPEN_PROJECTS_LIST_ON_PROJECT_AREA')) {
if ((!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') || getDolGlobalInt('PROJECT_SHOW_OPEN_PROJECTS_LIST_ON_PROJECT_AREA')) && !getDolGlobalInt('PROJECT_HIDE_OPEN_PROJECTS_LIST_ON_PROJECT_AREA')) {
// This list is surely very long and useless when we are using opportunities, so we hide it for this use case, but we allow to show it if
// we really want it and to allow interface backward compatibility.
print '<br>';

View file

@ -3838,6 +3838,9 @@ class Societe extends CommonObject
// phpcs:enable
global $conf;
// load the library necessary to check the professional identifiers
require_once DOL_DOCUMENT_ROOT.'/core/lib/profid.lib.php';
$ok = 1;
if (getDolGlobalString('MAIN_DISABLEPROFIDRULES')) {
@ -3845,36 +3848,8 @@ class Societe extends CommonObject
}
// Check SIREN if country FR
if ($idprof == 1 && $soc->country_code == 'FR') {
$chaine = trim($this->idprof1);
$chaine = preg_replace('/(\s)/', '', $chaine);
if (!is_numeric($chaine)) {
return -1;
}
if (dol_strlen($chaine) != 9) {
return -1;
}
// on prend chaque chiffre un par un
// si son index (position dans la chaîne en commence à 0 au premier caractère) est impair
// on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9
// on ajoute cette valeur à la somme totale
$sum = 0;
for ($index = 0; $index < 9; $index++) {
$number = (int) $chaine[$index];
if ($index % 2 != 0) {
if (($number *= 2) > 9) {
$number -= 9;
}
}
$sum += $number;
}
// le numéro est valide si la somme des chiffres est multiple de 10
if ($sum % 10 != 0) {
return -1;
}
if ($idprof == 1 && $soc->country_code == 'FR' && !isValidSiren($this->idprof1)) {
return -1;
}
// Verifie SIRET si pays FR

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