Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into fix_variants_init
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Oct 12, 2024
2 parents f7be846 + 235d23a commit c107830
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 28 deletions.
4 changes: 2 additions & 2 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ return [
'htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/partnership/lib/partnership.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/partnership/partnership_card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/partnership/partnership_list.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'],
'htdocs/paypal/lib/paypal.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
'htdocs/printing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/printing/lib/printing.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
Expand Down Expand Up @@ -918,7 +918,7 @@ return [
'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'],
'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/user/bank.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/user/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
'htdocs/user/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/user/class/api_users.class.php' => ['PhanTypeMismatchProperty'],
'htdocs/user/class/user.class.php' => ['PhanUndeclaredProperty'],
'htdocs/user/class/usergroup.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
Expand Down
16 changes: 11 additions & 5 deletions htdocs/admin/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,18 @@

print dol_get_fiche_head($head, 'handler', '', -1);

print '<span class="opacitymedium">'.$langs->trans("MenusDesc")."</span><br>\n";
print "<br><br>\n";
print '<div class="opacitymedium justify hideonsmartphone">'.$langs->trans("MenusDesc")."</div>\n";
print '<br class="hideonsmartphone">';
print "<br>\n";


clearstatcache();

// Gestionnaires de menu
// Menu manager choice

print "\n";
print '<div class="div-table-responsive-no-min">';

print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Menu").'</td>';
print '<td>';
Expand All @@ -182,7 +187,7 @@
$formadmin->select_menu(getDolGlobalString('MAIN_MENU_SMARTPHONE_FORCED', getDolGlobalString('MAIN_MENU_SMARTPHONE')), 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), !getDolGlobalString('MAIN_MENU_SMARTPHONE_FORCED') ? '' : ' disabled');

if (getDolGlobalString('MAIN_MENU_SMARTPHONE_FORCED') && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED)
|| (!getDolGlobalString('MAIN_MENU_SMARTPHONE_FORCED') && getDolGlobalString('MAIN_MENU_SMARTPHONE') && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE))) {
|| (!getDolGlobalString('MAIN_MENU_SMARTPHONE_FORCED') && getDolGlobalString('MAIN_MENU_SMARTPHONE') && preg_match('/smartphone/', getDolGlobalString('MAIN_MENU_SMARTPHONE')))) {
print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
}

Expand All @@ -191,14 +196,15 @@
$formadmin->select_menu(getDolGlobalString('MAIN_MENUFRONT_SMARTPHONE_FORCED', getDolGlobalString('MAIN_MENUFRONT_SMARTPHONE')), 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), !getDolGlobalString('MAIN_MENUFRONT_SMARTPHONE_FORCED') ? '' : ' disabled');

if (getDolGlobalString('MAIN_MENU_SMARTPHONE_FORCED') && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)
|| (!getDolGlobalString('MAIN_MENUFRONT_SMARTPHONE_FORCED') && getDolGlobalString('MAIN_MENU_SMARTPHONE') && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE))) {
|| (!getDolGlobalString('MAIN_MENUFRONT_SMARTPHONE_FORCED') && getDolGlobalString('MAIN_MENU_SMARTPHONE') && preg_match('/smartphone/', getDolGlobalString('MAIN_MENUFRONT_SMARTPHONE')))) {
print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
}

print '</td>';
print '</tr>';

print '</table>';
print '</div>';

print dol_get_fiche_end();

Expand Down
3 changes: 2 additions & 1 deletion htdocs/admin/menus/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@

print dol_get_fiche_head($head, 'editor', '', -1);

print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("MenusEditorDesc")."</span><br>\n";
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("MenusEditorDesc")."</span>";
print '<br class="hideonsmartphone">'."\n";
print "<br>\n";


Expand Down
13 changes: 8 additions & 5 deletions htdocs/core/class/html.formadmin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '
continue; // We exclude all menu manager files
}

$filelib = preg_replace('/\.php$/i', '', $file);
$filetoshow = preg_replace('/\.php$/i', '', $file);
$filetoshow = ucfirst(preg_replace('/_menu$/i', '', $filetoshow));
$prefix = '';
// 0=Recommended, 1=Experimental, 2=Development, 3=Other
if (preg_match('/^eldy/i', $file)) {
Expand All @@ -240,10 +241,12 @@ public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '
$morelabel .= ' <span class="opacitymedium">('.$langs->trans("Unstable").')</span>';
}
if ($file == $selected) {
$menuarray[$prefix.'_'.$file] = '<option value="'.$file.'" selected data-html="'.dol_escape_htmltag($filelib.$morelabel).'">'.$filelib.$morelabel;
$menuarray[$prefix.'_'.$file] = '<option value="'.$file.'" selected data-html="'.dol_escape_htmltag($filetoshow.$morelabel).'">';
$menuarray[$prefix.'_'.$file] .= $filetoshow.$morelabel;
$menuarray[$prefix.'_'.$file] .= '</option>';
} else {
$menuarray[$prefix.'_'.$file] = '<option value="'.$file.'" data-html="'.dol_escape_htmltag($filelib.$morelabel).'">'.$filelib.$morelabel;
$menuarray[$prefix.'_'.$file] = '<option value="'.$file.'" data-html="'.dol_escape_htmltag($filetoshow.$morelabel).'">';
$menuarray[$prefix.'_'.$file] .= $filetoshow.$morelabel;
$menuarray[$prefix.'_'.$file] .= '</option>';
}
}
Expand All @@ -256,7 +259,7 @@ public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '
ksort($menuarray);

// Output combo list of menus
print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
print '<select class="flat minwidth150" id="'.$htmlname.'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
$oldprefix = '';
foreach ($menuarray as $key => $val) {
$tab = explode('_', $key);
Expand Down Expand Up @@ -287,7 +290,7 @@ public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '
$oldprefix = $newprefix;
}

print $val."\n"; // Show menu entry ($val contains the <option> tags
print $val."\n"; // Show menu entry ($val contains the <option> tags)
}
print '</select>';

Expand Down
12 changes: 10 additions & 2 deletions htdocs/core/class/html.formsetup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ class FormSetupItem
*/
public $cssClass = '';


/**
* Constructor
*
Expand Down Expand Up @@ -904,7 +905,11 @@ public function generateInputField()
$out .= $this->generateInputFieldColor();
} elseif ($this->type == 'yesno') {
if (!empty($conf->use_javascript_ajax)) {
$out .= ajax_constantonoff($this->confKey);
$input = $this->fieldParams['input'] ?? array();
$revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0;
$forcereload = $this->fieldParams['forcereload'] ? 1 : 0;

$out .= ajax_constantonoff($this->confKey, $input, $this->entity, $revertonoff, 0, $forcereload);
} else {
$out .= $this->form->selectyesno($this->confKey, $this->fieldValue, 1);
}
Expand Down Expand Up @@ -1218,7 +1223,10 @@ public function generateOutputField()
$out .= $this->generateOutputFieldColor();
} elseif ($this->type == 'yesno') {
if (!empty($conf->use_javascript_ajax)) {
$out .= ajax_constantonoff($this->confKey, array(), $this->entity); // TODO possibility to add $input parameter
$revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0;
$forcereload = $this->fieldParams['forcereload'] ? 1 : 0;

$out .= ajax_constantonoff($this->confKey, array(), $this->entity, $revertonoff, 0, $forcereload);
} else {
if ($this->fieldValue == 1) {
$out .= $langs->trans('yes');
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ function dol_escape_php($stringtoescape, $stringforquotes = 2)
}

/**
* Returns text escaped for all protocols (so only alpha chars and numbers
* Returns text escaped for all protocols (so only alpha chars and numbers)
*
* @param string $stringtoescape String to escape
* @return string Escaped string for XML content.
Expand Down Expand Up @@ -12450,7 +12450,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* ],
* ]
* // phpcs:enable
* @return string html button
* Example: array('attr' => array('class' => 'reposition'))
* @return string html button
*/
function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array())
{
Expand Down
5 changes: 2 additions & 3 deletions htdocs/core/menus/standard/auguria.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
$classname = 'class="tmenu menuhider nohover"';
$idsel = 'menu';

$menu->add('#', (getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE') == 1 ? '<span class="fa fa-bars"></span>' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
$menu->add('#', (getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE') == 1 ? '<span class="fa fa-bars"></span>' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname, '<span class="fas fa-bars size12x"></span>');
}

$num = count($newTabMenu);
Expand Down Expand Up @@ -239,15 +239,14 @@ function print_start_menu_entry_auguria($idsel, $classname, $showmode)
*/
function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())
{
global $langs, $conf;
global $langs;

$classnameimg = str_replace('class="', 'class="tmenuimage ', $classname);
$classnametxt = str_replace('class="', 'class="tmenulabel ', $classname);

if ($showmode == 1) {
print '<a '.$classnameimg.' tabindex="-1" href="'.$url.'"'.($atarget ? ' target="'.$atarget.'"' : '').' title="'.dol_escape_htmltag($text).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage">';

if (!empty($menuval['prefix']) && strpos($menuval['prefix'], '<span') === 0) {
print $menuval['prefix'];
} elseif (!empty($menuval['prefix']) && strpos($menuval['prefix'], 'fa-') === 0) {
Expand Down
2 changes: 2 additions & 0 deletions htdocs/install/mysql/migration/20.0.0-21.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ ALTER TABLE llx_societe ADD COLUMN ip varchar(250);
ALTER TABLE llx_recruitment_recruitmentcandidature ADD COLUMN ip varchar(250);
ALTER TABLE llx_socpeople ADD COLUMN ip varchar(250);

ALTER TABLE llx_webhook_target ADD COLUMN trigger_stack text;

ALTER TABLE llx_recruitment_recruitmentcandidature MODIFY fk_user_creat integer NULL;

ALTER TABLE llx_ecm_files ADD COLUMN agenda_id integer;
Expand Down
1 change: 1 addition & 0 deletions htdocs/install/mysql/tables/llx_webhook_target-webhook.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ CREATE TABLE llx_webhook_target(
connection_method varchar(255) NULL, -- to store the way to authenticate to the webhook
connection_data varchar(255) NULL, -- to store the data to use to authenticate to the webhook
trigger_codes text NULL -- list of selected trigger that must call the webhook
trigger_stack text, -- json object to store trigger to be send manually
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/admin.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,7 @@ WarningModuleHasChangedLastVersionCheckParameter=Warning: the module %s has set
WarningModuleHasChangedSecurityCsrfParameter=Warning: the module %s has disabled the CSRF security of your instance. This action is suspect and your installation may no more be secured. Please contact the author of the module for explanation.
EMailsInGoingDesc=Incoming emails are managed by the module %s. You must enable and configure it if you need to support ingoing emails.
MAIN_IMAP_USE_PHPIMAP=Use the PHP-IMAP library for IMAP instead of native PHP IMAP. This also allows the use of an OAuth2 connection for IMAP (module OAuth must also be activated).
MAIN_CHECKBOX_LEFT_COLUMN=Show the column for field and line selection on the left (on the right by default)
MAIN_CHECKBOX_LEFT_COLUMN=Show the column for field and line selection on the left (on the right is disabled)
NotAvailableByDefaultEnabledOnModuleActivation=Not created by default. Created on module activation only.
CSSPage=CSS Style
Defaultfortype=Default
Expand Down
5 changes: 3 additions & 2 deletions htdocs/partnership/partnership_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <[email protected]>
* Copyright (C) 2021 NextGestion <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -790,9 +791,9 @@
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} elseif ($key == 'country') {
print $form->select_country($search[$key], 'search_country', '', 0, 'minwidth100imp maxwidth100');
print $form->select_country(in_array($key, $search) ? $search[$key] : 0, 'search_country', '', 0, 'minwidth100imp maxwidth100');
} else {
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/class/product.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ class Product extends CommonObject
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
//'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
//'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
);

/**
Expand Down
4 changes: 4 additions & 0 deletions htdocs/public/payment/paymentok.php
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,10 @@
print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."<br><br>\n";
}

print '<center>';
print img_picto('', 'tick', 'class="green fa-2x"');
print '</center>';

// Show a custom message
$key = 'ONLINE_PAYMENT_MESSAGE_OK';
if (getDolGlobalString($key)) {
Expand Down
2 changes: 0 additions & 2 deletions htdocs/theme/eldy/dropdown.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,6 @@

.quickadd-item {
font-size: 1.1em;
padding-top: 6px;
padding-bottom: 6px;
}

.quickadd-item:before {
Expand Down
11 changes: 10 additions & 1 deletion htdocs/user/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@
$dir = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'user').'/photos';

dol_mkdir($dir);
$mesgs = null;

if (@is_dir($dir)) {
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
Expand Down Expand Up @@ -2964,7 +2965,15 @@
$genallowed = $user->hasRight("user", "user", "read");
$delallowed = $user->hasRight("user", "user", "write");

print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', !is_object($soc) || empty($soc->default_lang) ? '' : $soc->default_lang);

if ($object->socid) {
$societe = new Societe($db);
$societe->fetch($object->socid);
} else {
$societe = null;
}

print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', !is_object($societe) || empty($societe->default_lang) ? '' : $societe->default_lang);
$somethingshown = $formfile->numoffiles;

// Show links to link elements
Expand Down
8 changes: 7 additions & 1 deletion htdocs/webhook/class/target.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class Target extends CommonObject
'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'default' => '1', 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'Enabled'), 'validate' => 1,),
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'default' => '1', 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Disabled', '1' => 'AutomaticTrigger', '2' => 'ManualTrigger'), 'validate' => 1,),
"trigger_stack" => array("type" => "text", "label" => "TriggerStack", "enabled" => "1", 'position' => 59, 'notnull' => 0, "visible" => "0",),
);
public $rowid;
public $ref;
Expand All @@ -123,6 +124,11 @@ class Target extends CommonObject
* @var string List of trigger codes separated by a comma. Example: 'BILL_VALIDATE,PROPAL_DELETE,...'
*/
public $trigger_codes;

/**
* @var string Json array to store manual trigger that needs to be send
*/
public $trigger_stack;
// END MODULEBUILDER PROPERTIES


Expand Down

0 comments on commit c107830

Please sign in to comment.