Merge branch 'develop' into loan_schedule

This commit is contained in:
Frédéric FRANCE 2025-01-15 10:28:39 +01:00 committed by GitHub
commit b5aa5d7fd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
579 changed files with 3763 additions and 3049 deletions

View file

@ -26,6 +26,7 @@ The following changes may create regressions for some external modules, but were
For users:
----------
NEW: NEW Module - help to setup OpenID Connect (#30317)
NEW: Module AI moved from experimental to stable
NEW: Add hidden option CONTRACT_HIDE_MYCOMPANY_SIGNATURE_SECTION_PDF
NEW: Add a tab on recurring invoice card to see the list of invoices generated from this recurring invoice (customer and supplier invoices) (#31463)
NEW: #28871 signed_status to commande (#30359)

File diff suppressed because it is too large Load diff

View file

@ -393,100 +393,6 @@ LOCK TABLES `llx_adherent_type_extrafields` WRITE;
/*!40000 ALTER TABLE `llx_adherent_type_extrafields` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_advanced_extrafields`
--
DROP TABLE IF EXISTS `llx_advanced_extrafields`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_advanced_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`entity` int(11) NOT NULL DEFAULT '1',
`elementtype` varchar(64) NOT NULL,
`name` varchar(64) NOT NULL,
`label` varchar(64) NOT NULL,
`format` varchar(8) NOT NULL,
`fieldsize` int(11) DEFAULT NULL,
`maxlength` int(11) DEFAULT NULL,
`options` varchar(255) DEFAULT NULL,
`rang` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`),
UNIQUE KEY `idx_advanced_extrafields_name` (`elementtype`,`entity`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_advanced_extrafields`
--
LOCK TABLES `llx_advanced_extrafields` WRITE;
/*!40000 ALTER TABLE `llx_advanced_extrafields` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_advanced_extrafields` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_advanced_extrafields_options`
--
DROP TABLE IF EXISTS `llx_advanced_extrafields_options`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_advanced_extrafields_options` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fk_extrafields` int(11) NOT NULL,
`value` varchar(255) NOT NULL,
`rang` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_advanced_extrafields_options_fk_advanced_extrafields` (`fk_extrafields`),
CONSTRAINT `fk_advanced_extrafields_options_fk_advanced_extrafields` FOREIGN KEY (`fk_extrafields`) REFERENCES `llx_advanced_extrafields` (`rowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_advanced_extrafields_options`
--
LOCK TABLES `llx_advanced_extrafields_options` WRITE;
/*!40000 ALTER TABLE `llx_advanced_extrafields_options` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_advanced_extrafields_options` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_advanced_extrafields_values`
--
DROP TABLE IF EXISTS `llx_advanced_extrafields_values`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_advanced_extrafields_values` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`entity` int(11) NOT NULL DEFAULT '1',
`datec` datetime DEFAULT NULL,
`datem` datetime DEFAULT NULL,
`fk_element` int(11) NOT NULL,
`fk_extrafields` int(11) NOT NULL,
`value` varchar(255) DEFAULT NULL,
`fk_user_create` int(11) DEFAULT NULL,
`fk_user_modif` int(11) DEFAULT NULL,
PRIMARY KEY (`rowid`),
KEY `idx_advanced_extrafields_values_fk_advanced_extrafields` (`fk_extrafields`,`entity`),
CONSTRAINT `fk_advanced_extrafields_values_fk_advanced_extrafields` FOREIGN KEY (`fk_extrafields`) REFERENCES `llx_advanced_extrafields` (`rowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_advanced_extrafields_values`
--
LOCK TABLES `llx_advanced_extrafields_values` WRITE;
/*!40000 ALTER TABLE `llx_advanced_extrafields_values` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_advanced_extrafields_values` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_bank`
--

View file

@ -86,6 +86,10 @@ espace
methode
datee
# Some string found because part of a text the is html entities escaped into file
tre
activ
# Translation keys
addin
amountin

View file

@ -174,3 +174,4 @@ print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacityme
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.periode", "", $param, '', $sortfield, $sortorder, 'center ');
select#date_startday, select#date_startmonth, select#date_endday, select#date_endmonth, select#reday, select#remonth
select#date_startday, select#date_startmonth, select#date_endday, select#date_endmonth, select#reday, select#remonth,
$sql = "SELECT id_users, nom as name, id_sondage, reponses, tms, date_creation";

View file

@ -188,7 +188,7 @@ return [
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'],

View file

@ -462,6 +462,10 @@ if ($resql) {
print '<br>';
$parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View file

@ -157,7 +157,7 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc
$sql .= $db->plimit(1);
$res = $db->query($sql);
if ($res->num_rows > 0) {
if ($res !== false && $db->num_rows($res) > 0) {
$fiscalYear = $db->fetch_object($res);
$search_date_start = strtotime($fiscalYear->date_start);
$search_date_end = strtotime($fiscalYear->date_end);

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2017-2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Alexandre Janniaux <alexandre.janniaux@gmail.com>
*
* 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
@ -103,6 +104,50 @@ class AccountingJournal extends CommonObject
$this->ismultientitymanaged = 0;
}
/**
* Create a new Accounting Journal.
*
* @param User $user the user that created the journal, currently unused
* @return int Return integer <0 on error, or the ID of the created object
*/
public function create($user)
{
$valid_nature = array(1, 2, 3, 4, 5, 8, 9);
if (!in_array((int) $this->nature, $valid_nature)) {
$this->error = get_class($this)."::Create Error invalid field nature '" . strval($this->nature) . "'";
dol_syslog($this->error, LOG_ERR);
return -1;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_journal";
$sql .= " (entity, code, label, nature, active)";
$sql .= " VALUES ("
. ((int) $this->entity) .",'"
. $this->db->escape($this->code) ."','"
. $this->db->escape($this->label) ."',"
. ((int) $this->nature) .","
. ((int) $this->active) .")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
$this->error = get_class($this)."::Create Error: " . $this->db->lasterror();
dol_syslog($this->error, LOG_ERR);
return -1;
}
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_journal");
if ($id <= 0) {
$this->error = get_class($this)."::Create Error " . $id . ": " . $this->db->lasterror();
dol_syslog($this->error, LOG_ERR);
return -2;
}
$this->id = $id;
$this->rowid = $id;
return $id;
}
/**
* Load an object from database
*
@ -189,9 +234,9 @@ class AccountingJournal extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAccountingJournal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip"';
}

View file

@ -529,9 +529,9 @@ class BookKeeping extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTransaction");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2019-2023 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2019-2023 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* 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
@ -39,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
*/
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
$langs->loadLangs(array("accountancy", "bills", "compta", "exports", "other"));
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'aZ09');
@ -410,7 +411,7 @@ if (empty($current_fiscal_period)) {
// Step 2
$head = array();
$head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
$head[0][1] = $langs->trans("Step").(getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '1' : '2').' - '.$langs->trans("AccountancyClosureStep2");
$head[0][1] = $langs->trans("Step"). ' ' . (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '1' : '2').' - '.$langs->trans("AccountancyClosureStep2");
$head[0][2] = 'step2';
print dol_get_fiche_head($head, 'step2', '', -1, '');
@ -433,7 +434,7 @@ if (empty($current_fiscal_period)) {
// Step 3
$head = array();
$head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
$head[0][1] = $langs->trans("Step").(getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '2' : '3').' - '.$langs->trans("AccountancyClosureStep3");
$head[0][1] = $langs->trans("Step"). ' ' . (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '2' : '3').' - '.$langs->trans("AccountancyClosureStep3");
$head[0][2] = 'step3';
print dol_get_fiche_head($head, 'step3', '', -1, '');

View file

@ -253,22 +253,24 @@ if ($result) {
}
// Load all unbound lines
$sql = "SELECT fk_expensereport, COUNT(erd.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
$sql .= " WHERE erd.fk_code_ventilation <= 0";
$sql .= " AND erd.total_ttc <> 0";
$sql .= " AND fk_expensereport IN (".$db->sanitize(implode(",", array_keys($taber))).")";
$sql .= " GROUP BY fk_expensereport";
$resql = $db->query($sql);
if (!empty($taber)) {
$sql = "SELECT fk_expensereport, COUNT(erd.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
$sql .= " WHERE erd.fk_code_ventilation <= 0";
$sql .= " AND erd.total_ttc <> 0";
$sql .= " AND fk_expensereport IN (".$db->sanitize(implode(",", array_keys($taber))).")";
$sql .= " GROUP BY fk_expensereport";
$resql = $db->query($sql);
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_expensereport] = 'somelinesarenotbound';
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_expensereport] = 'somelinesarenotbound';
}
$i++;
}
$i++;
}
// Bookkeeping Write

View file

@ -399,34 +399,34 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice
}
}
*/
// New way, single query, load all unbound lines
$sql = "
SELECT
fk_facture_fourn,
COUNT(fd.rowid) as nb
FROM
" . MAIN_DB_PREFIX . "facture_fourn_det as fd
WHERE
fd.product_type <= 2
AND fd.fk_code_ventilation <= 0
AND fd.total_ttc <> 0
AND fk_facture_fourn IN (".$db->sanitize(implode(",", array_keys($tabfac))).")
GROUP BY fk_facture_fourn
";
$resql = $db->query($sql);
if (!empty($tabfac)) {
$sql = "
SELECT
fk_facture_fourn,
COUNT(fd.rowid) as nb
FROM
" . MAIN_DB_PREFIX . "facture_fourn_det as fd
WHERE
fd.product_type <= 2
AND fd.fk_code_ventilation <= 0
AND fd.total_ttc <> 0
AND fk_facture_fourn IN (".$db->sanitize(implode(",", array_keys($tabfac))).")
GROUP BY fk_facture_fourn
";
$resql = $db->query($sql);
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
}
$i++;
}
$i++;
}
//var_dump($errorforinvoice);exit;
// Bookkeeping Write
if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'bind', 'write')) {

View file

@ -469,7 +469,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -323,7 +323,7 @@ class Adherent extends CommonObject
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => '1', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 12, 'index' => 1),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20),
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox' => 1),
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox' => 1),
@ -399,6 +399,8 @@ class Adherent extends CommonObject
$this->isextrafieldmanaged = 1;
// les champs optionnels sont vides
$this->array_options = array();
$this->fields['ref_ext']['visible'] = getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT');
}
@ -2382,9 +2384,9 @@ class Adherent extends CommonObject
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$langs->load("users");
$label = $langs->trans("ShowUser");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
}

View file

@ -780,7 +780,7 @@ class AdherentType extends CommonObject
}
}
$linkstart = '<a href="'.$url.'"';
$linkstart .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkstart .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkstart .= $dataparams.' class="'.$classfortooltip.'">';
$linkend = '</a>';

View file

@ -240,7 +240,11 @@ if ($mode && !count($data)) {
print '<br>';
} else {
if ($mode == 'memberbycountry') {
print '<span class="opacitymedium">'.$langs->trans("MembersByCountryDesc").'</span><br>';
print '<span class="opacitymedium">'.$langs->trans("MembersByCountryDesc");
if (getDolGlobalString("GOOGLE_SHOW_COUNTRY_GRAPH")) {
print $langs->trans("MembersByCountryDesc2");
}
print '</span><br>';
} elseif ($mode == 'memberbystate') {
print '<span class="opacitymedium">'.$langs->trans("MembersByStateDesc").'</span><br>';
} elseif ($mode == 'memberbytown') {
@ -263,7 +267,7 @@ if ($mode && !count($data)) {
// Show graphics
if (count($arrayjs) && $mode == 'memberbycountry') {
if (getDolGlobalString("GOOGLE_SHOW_COUNTRY_GRAPH") && $mode == 'memberbycountry') {
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
if (is_readable($color_file)) {

View file

@ -1057,7 +1057,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
}
print $langs->trans("NoThirdPartyAssociatedToMember");
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">';
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">';
print $langs->trans("CreateDolibarrThirdParty");
print '</a>)';
}
@ -1087,7 +1087,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
}
print $langs->trans("NoThirdPartyAssociatedToMember");
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">';
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty">';
print $langs->trans("CreateDolibarrThirdParty");
print '</a>)';
}

View file

@ -421,7 +421,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -428,7 +428,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -464,7 +464,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -464,7 +464,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -416,7 +416,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -435,7 +435,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -511,7 +511,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -427,7 +427,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -479,7 +479,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -616,7 +616,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -597,7 +597,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -1272,55 +1272,57 @@ if ($mode == 'marketplace') {
if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
// $options is array with filter criteria
$nbmaxtoshow = $options['per_page'];
$options['per_page']++;
if (getDolGlobalInt('MAIN_ENANLE_OLD_DOLISTORE')) {
$nbmaxtoshow = $options['per_page'];
$options['per_page']++;
$remotestore->getRemoteCategories();
$remotestore->getRemoteProducts($options);
$remotestore->getRemoteCategories();
$remotestore->getRemoteProducts($options);
print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
$previouslink = $remotestore->get_previous_link();
$nextlink = $remotestore->get_next_link();
$previouslink = $remotestore->get_previous_link();
$nextlink = $remotestore->get_next_link();
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$remotestore->url.'">'; ?>
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield">
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>"><br>
</div>
<div class="divsearchfield">
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="buttonreset" href="<?php echo $_SERVER["PHP_SELF"].'?mode=marketplace'; ?>"><?php echo $langs->trans('Reset') ?></a>
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$remotestore->url.'">'; ?>
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield">
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>"><br>
</div>
<div class="divsearchfield">
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="buttonreset" href="<?php echo $_SERVER["PHP_SELF"].'?mode=marketplace'; ?>"><?php echo $langs->trans('Reset') ?></a>
&nbsp;
</div>
<?php
print $previouslink;
print $nextlink;
print '</form>';
&nbsp;
</div>
<?php
print $previouslink;
print $nextlink;
print '</form>';
print '</div></div>';
print '<div class="clearboth"></div>';
?>
print '</div></div>';
print '<div class="clearboth"></div>';
?>
<div id="category-tree-left">
<ul class="tree">
<?php
echo $remotestore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content?>
</ul>
</div>
<div id="category-tree-left">
<ul class="tree">
<?php
echo $remotestore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content?>
</ul>
</div>
<div id="listing-content">
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
<tbody id="listOfModules">
<?php echo $remotestore->get_products($nbmaxtoshow); ?>
</tbody>
</table>
</div>
<?php
<div id="listing-content">
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
<tbody id="listOfModules">
<?php echo $remotestore->get_products($nbmaxtoshow); ?>
</tbody>
</table>
</div>
<?php
}
}
}

View file

@ -425,7 +425,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -126,29 +126,33 @@ if ($action != '') {
* View
*/
$form = new Form($db);
llxHeader();
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("OpenIDconnectSetup"), $linkback, 'title_setup');
print "<br>\n";
$head = openid_connect_prepare_head();
print dol_get_fiche_head($head, 'settings', $langs->trans("Parameters"), 0, 'action');
print dol_get_fiche_head($head, 'settings', $langs->trans("Parameters"), -1, 'action');
print $langs->trans("SeeWikiDocForHelpInSetupOpenIDCOnnect");
print ' - ';
print img_picto('', 'url', 'class="pictofixedwidth"').'<a target="_blank" href="https://wiki.dolibarr.org/index.php?title=Authentication,_SSO_and_SSL#Mode_openid_connect">';
print $langs->trans("SeeHere");
print '</a>';
print dol_get_fiche_end();
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder" width="100%">';
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable noborder liste nobottomiftotal">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'.$langs->trans("Value").'</td>'."\n";
print '<th class="liste_titre">'.$langs->trans("Parameters").'</th>'."\n";
print '<th class="liste_titre"></th>'."\n";
print '<th class="liste_titre"></th>'."\n";
print "</tr>\n";
// MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM
@ -232,6 +236,7 @@ print '<input class="minwidth300" value="'.dol_escape_htmltag(getDolGlobalString
print '</td></tr>' . "\n";
print '</table>'."\n";
print '</div>';
print '<br>';
print '<div align="center">';
@ -242,7 +247,5 @@ print '</form>';
print '<br>';
print dol_get_fiche_end();
llxFooter();
$db->close();

View file

@ -517,7 +517,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -362,7 +362,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"),'generic');
}
print '</td>';

View file

@ -377,7 +377,7 @@ foreach ($dirmodels as $reldir)
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"),'generic');
}
print '</td>';

View file

@ -494,7 +494,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -429,7 +429,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -664,7 +664,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -481,7 +481,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'generic').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -483,7 +483,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -258,27 +258,27 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '</td>';
}
if ($arrayfields['name']['checked']) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_name" size="8" value="'.dol_escape_htmltag($search_name).'">';
print '<td class="liste_titre">';
print '<input class="flat width100" type="text" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
print '</td>';
}
if ($arrayfields['version']['checked']) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_version" size="6" value="'.dol_escape_htmltag($search_version).'">';
print '<td class="liste_titre">';
print '<input class="flat width50" type="text" name="search_version" value="'.dol_escape_htmltag($search_version).'">';
print '</td>';
}
if ($arrayfields['id']['checked']) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_id" size="6" value="'.dol_escape_htmltag($search_id).'">';
print '<td class="liste_titre center">';
print '<input class="flat width50" type="text" name="search_id" value="'.dol_escape_htmltag($search_id).'">';
print '</td>';
}
if ($arrayfields['permission']['checked']) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_permission" size="8" value="'.dol_escape_htmltag($search_permission).'">';
print '<td class="liste_titre">';
print '<input class="flat width100" type="text" name="search_permission" value="'.dol_escape_htmltag($search_permission).'">';
print '</td>';
}
if ($arrayfields['module_position']['checked']) {
print '<td class="liste_titre left">';
print '<td class="liste_titre">';
print '</td>';
}
// Action column
@ -302,13 +302,13 @@ if ($arrayfields['version']['checked']) {
print_liste_field_titre($arrayfields['version']['label'], $_SERVER["PHP_SELF"], "version", "", "", "", $sortfield, $sortorder);
}
if ($arrayfields['id']['checked']) {
print_liste_field_titre($arrayfields['id']['label'], $_SERVER["PHP_SELF"], "id", "", "", "", $sortfield, $sortorder, 'nowraponall ');
print_liste_field_titre($arrayfields['id']['label'], $_SERVER["PHP_SELF"], "id", "", "", "", $sortfield, $sortorder, 'nowraponall center ');
}
if ($arrayfields['permission']['checked']) {
print_liste_field_titre($arrayfields['permission']['label'], $_SERVER["PHP_SELF"], "permission", "", "", "", $sortfield, $sortorder);
}
if ($arrayfields['module_position']['checked']) {
print_liste_field_titre($arrayfields['module_position']['label'], $_SERVER["PHP_SELF"], "module_position", "", "", "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['module_position']['label'], $_SERVER["PHP_SELF"], "module_position", "", "", "", $sortfield, $sortorder, "right ");
}
// Fields from hook
@ -363,7 +363,7 @@ if ($sortfield == "name" && $sortorder == "asc") {
} elseif ($sortfield == "permission" && $sortorder == "desc") {
usort($moduleList, "comparePermissionIdsDesc");
} else {
$moduleList = dol_sort_array($moduleList, 'module_position');
$moduleList = dol_sort_array($moduleList, 'module_position', $sortorder);
}
foreach ($moduleList as $module) {
@ -376,16 +376,16 @@ foreach ($moduleList as $module) {
if ($arrayfields['name']['checked']) {
print '<td width="300" class="nowrap">';
print $module->picto;
print ' '.$module->name;
print ' '.dolPrintHTML($module->name);
print "</td>";
}
if ($arrayfields['version']['checked']) {
print '<td class="nowraponall">'.$module->version.'</td>';
print '<td class="nowraponall">'.dolPrintHTML($module->version).'</td>';
}
if ($arrayfields['id']['checked']) {
print '<td class="center">'.$module->id.'</td>';
print '<td class="center">'.dolPrintHTML($module->id).'</td>';
}
if ($arrayfields['permission']['checked']) {
@ -409,7 +409,7 @@ foreach ($moduleList as $module) {
}
if ($arrayfields['module_position']['checked']) {
print '<td class="center">'.$module->module_position.'</td>';
print '<td class="right">'.dolPrintHTML($module->module_position).'</td>';
}
// Action column

View file

@ -83,7 +83,7 @@ print "<br>\n";
print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong><br>';
print '<div class="divsection">';
$test = !function_exists('xdebug_is_enabled');
$test = !function_exists('xdebug_is_debugger_active');
if ($test) {
print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {

View file

@ -48,7 +48,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-system_xdebug');
print load_fiche_titre("XDebug", '', 'title_setup');
if (!function_exists('xdebug_is_enabled')) {
if (!function_exists('xdebug_is_debugger_active')) {
print "<br>\n";
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
llxFooter();
@ -62,8 +62,8 @@ print '</span>';
print '<br><br>';
if (function_exists('socket_create')) {
$address = ini_get('xdebug.remote_host') ? ini_get('xdebug.remote_host') : '127.0.0.1';
$port = ini_get('xdebug.remote_port') ? ini_get('xdebug.remote_port') : 9000;
$address = ini_get('xdebug.client_host') ? ini_get('xdebug.client_host') : '127.0.0.1';
$port = ini_get('xdebug.client_port') ? (int) ini_get('xdebug.client_port') : 9000;
print "<strong>Current xdebug setup:</strong><br>\n";
print "* Remote debug setup:<br>\n";

View file

@ -489,7 +489,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -163,9 +163,9 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserMailRequired").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td class="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">';
print '<td class="center" width="100">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('USER_MAIL_REQUIRED');
} else {
@ -181,9 +181,9 @@ print '</td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserHideInactive").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td class="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">';
print '<td class="center" width="100">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX');
} else {
@ -325,7 +325,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -244,7 +244,7 @@ foreach ($dirmodels as $reldir) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -474,7 +474,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'generic').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -281,7 +281,9 @@ if ($action == 'edit' || $action == 'deleteproperty') {
$out .= '</tr>';
$out .= '<tr class="oddeven">';
$out .= '<td class="col-setup-title">';
$out .= '<span id="prePrompt" class="spanforparamtooltip">'.$langs->trans("Pre-Prompt").'</span>';
$out .= '<span id="prePrompt" class="spanforparamtooltip">';
$out .= $form->textwithpicto($langs->trans("Pre-Prompt"), $langs->trans("Pre-PromptHelp"));
$out .= '</span>';
$out .= '</td>';
$out .= '<td>';
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="prePromptInput" name="prePrompt" rows="3"></textarea>';
@ -289,7 +291,9 @@ if ($action == 'edit' || $action == 'deleteproperty') {
$out .= '</tr>';
$out .= '<tr class="oddeven">';
$out .= '<td class="col-setup-title">';
$out .= '<span id="postPrompt" class="spanforparamtooltip">'.$langs->trans("Post-Prompt").'</span>';
$out .= '<span id="postPrompt" class="spanforparamtooltip">';
$out .= $form->textwithpicto($langs->trans("Post-Prompt"), $langs->trans("Post-PromptHelp"));
$out .= '</span>';
$out .= '</td>';
$out .= '<td>';
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="postPromptInput" name="postPrompt" rows="3"></textarea>';
@ -297,7 +301,9 @@ if ($action == 'edit' || $action == 'deleteproperty') {
$out .= '</tr>';
$out .= '<tr class="oddeven">';
$out .= '<td class="col-setup-title">';
$out .= '<span id="blacklists" class="spanforparamtooltip">'.$langs->trans("BlackListWords").' '.img_help(1, 'Words must be separated by a coma (",")').'</span>';
$out .= '<span id="blacklists" class="spanforparamtooltip">';
$out .= $form->textwithpicto($langs->trans("BlackListWords"), $langs->trans("BlackListWordsAIHelp").'.<br>'.$langs->trans("BlackListWordsHelp"));
$out .= '</span>';
$out .= '</td>';
$out .= '<td>';
$out .= '<textarea class="flat minwidth500 quatrevingtpercent" id="blacklistsInput" name="blacklists" rows="3"></textarea>';

View file

@ -447,7 +447,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($module->type == 'pdf') {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
}
print '</td>';

View file

@ -1408,9 +1408,9 @@ class Asset extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAsset");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -619,9 +619,9 @@ class AssetModel extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAssetModel");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -1159,9 +1159,9 @@ class BOM extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBillOfMaterials");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -387,9 +387,9 @@ class BOMLine extends CommonObjectLine
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBillOfMaterialsLine");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -756,9 +756,9 @@ class Availabilities extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAvailabilities");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -742,9 +742,9 @@ class Calendar extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowCalendar");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -319,9 +319,9 @@ class Bookmark extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBookmark");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -298,7 +298,7 @@ class Categorie extends CommonObject
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,),
'fk_parent' => array('type' => 'integer', 'label' => 'Fkparent', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',),
'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Refext', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 0, 'alwayseditable' => 1,),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 0, 'alwayseditable' => 1,),
'type' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'position' => 35, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'color' => array('type' => 'varchar(8)', 'label' => 'Color', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
@ -1811,9 +1811,9 @@ class Categorie extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.' '.$forced_color.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ' class="'.$forced_color.($morecss ? ' '.$morecss : '').'"';

View file

@ -1397,7 +1397,7 @@ if ($action == 'create') {
}
// Title
print '<tr><td'.(!getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
print '<tr><td'.(getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? '' : ' class="fieldrequired titlefieldcreate"').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td>';
@ -1430,10 +1430,11 @@ if ($action == 'create') {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 2, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
print '</td></tr>';
print '<tr><td></td><td>';
// Recurring event
$userepeatevent = (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 ? 1 : 0);
if ($userepeatevent) {
print '<tr><td></td><td>';
// Repeat
//print ' &nbsp; &nbsp; &nbsp; &nbsp; ';
print '<div class="opacitymedium inline-block small">';
@ -1514,9 +1515,8 @@ if ($action == 'create') {
});
</script>';
print '</div>';
//print '</td></tr>';
print '</td></tr>';
}
print '</td></tr>';
print '<tr><td class="">&nbsp;</td><td></td></tr>';

View file

@ -1658,6 +1658,7 @@ class ActionComm extends CommonObject
$datas['note'] .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
$datas['note'] .= '</div>';
}
// show categories for this record only in ajax to not overload lists
if (isModEnabled('category') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
@ -1767,6 +1768,7 @@ class ActionComm extends CommonObject
$tooltip .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
$tooltip .= '</div>';
}
$linkclose = '';
$classfortooltip = 'classfortooltip';
$dataparams = '';
@ -1784,9 +1786,9 @@ class ActionComm extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAction");
$linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($tooltip).'"';
}
$linkclose .= ($tooltip ? ' title="'.dol_escape_htmltag($tooltip, 1).'"' : ' title="tocomplete"');
$linkclose .= ($tooltip ? ' title="'.dolPrintHTMLForAttribute($tooltip).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classname.' '.$classfortooltip.'"';
} else {
$linkclose .= ' class="'.$classname.'"';

View file

@ -1693,28 +1693,28 @@ if ($object->id > 0) {
if (isModEnabled("propal") && $user->hasRight('propal', 'creer') && $object->status == 1) {
$langs->load("propal");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a></div>';
}
if (isModEnabled('order') && $user->hasRight('commande', 'creer') && $object->status == 1) {
$langs->load("orders");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a></div>';
}
if ($user->hasRight('contrat', 'creer') && $object->status == 1) {
$langs->load("contracts");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a></div>';
}
if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'creer') && $object->status == 1) {
$langs->load("interventions");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a></div>';
}
// Add invoice
if (isModEnabled('deplacement') && $object->status == 1) {
$langs->load("trips");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&action=create">'.$langs->trans("AddTrip").'</a></div>';
}
if (isModEnabled('invoice') && $object->status == 1) {

View file

@ -852,9 +852,9 @@ class Mailing extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowEMailing");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -452,7 +452,9 @@ class Propal extends CommonObject
$this->socid = $socid;
$this->id = $propalid;
$this->duree_validite = getDolGlobalInt('PROPALE_VALIDITY_DURATION', 0);
$this->duree_validite = getDolGlobalInt('PROPALE_VALIDITY_DURATION');
$this->fields['ref_ext']['visible'] = getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT');
}
@ -3831,9 +3833,9 @@ class Propal extends CommonObject
if (empty($notooltip) && $user->hasRight('propal', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Proposal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}

View file

@ -426,6 +426,8 @@ class Commande extends CommonOrder
$this->ismultientitymanaged = 1;
$this->isextrafieldmanaged = 1;
$this->fields['ref_ext']['visible'] = getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT');
}
/**
@ -3899,9 +3901,9 @@ class Commande extends CommonOrder
if (empty($notooltip) && $user->hasRight('commande', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Order");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
$target_value = array('_self', '_blank', '_parent', '_top');

View file

@ -102,6 +102,7 @@ $search_all = trim(GETPOST('search_all', 'alphanohtml'));
$search_product_category = GETPOST('search_product_category', 'intcomma');
$search_id = GETPOST('search_id', 'int');
$search_ref = GETPOST('search_ref', 'alpha') != '' ? GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
$search_ref_ext = GETPOST('search_ref_ext', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
$search_company_alias = GETPOST('search_company_alias', 'alpha');
@ -201,6 +202,7 @@ $checkedtypetiers = 0;
$arrayfields = array(
'c.rowid' => array('label' => "ID", 'checked' => 1, 'enabled' => getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID'), 'position' => 1),
'c.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 5, 'searchall' => 1),
'c.ref_ext' => array('label' => "RefExt", 'checked' => 1, 'position' => 5, 'visible' => 0, 'searchall' => 1),
'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => -1, 'position' => 10, 'searchall' => 1),
'p.ref' => array('label' => "ProjectRef", 'checked' => -1, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 20),
'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 25),
@ -309,6 +311,7 @@ if (empty($reshook)) {
$search_product_category = '';
$search_id = '';
$search_ref = '';
$search_ref_ext = '';
$search_ref_customer = '';
$search_company = '';
$search_company_alias = '';
@ -715,6 +718,9 @@ if (empty($reshook)) {
if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref);
}
if ($search_ref_ext) {
$param .= '&search_ref_ext='.urlencode($search_ref_ext);
}
if ($search_company) {
$param .= '&search_company='.urlencode($search_company);
}
@ -897,7 +903,7 @@ $sql .= " s2.nom as name2,";
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= " country.code as country_code,";
$sql .= ' c.rowid, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.ref_client, c.fk_user_author,';
$sql .= ' c.rowid, c.ref, c.ref_ext, c.total_ht, c.total_tva, c.total_ttc, c.ref_client, c.fk_user_author,';
$sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,';
$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as delivery_date, c.fk_statut, c.facture as billed,';
$sql .= ' c.date_creation as date_creation, c.tms as date_modification, c.date_cloture as date_cloture,';
@ -931,7 +937,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label']) && is_arra
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)";
}
if ($search_all) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid = pd.fk_commande';
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON c.fk_user_author = u.rowid';
@ -961,6 +967,9 @@ if ($search_id > 0) {
if ($search_ref) {
$sql .= natural_search('c.ref', $search_ref);
}
if ($search_ref_ext) {
$sql .= natural_search('c.ref_ext', $search_ref_ext);
}
if ($search_ref_customer) {
$sql .= natural_search('c.ref_client', $search_ref_customer);
}
@ -1316,6 +1325,9 @@ if ($search_id) {
if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref);
}
if ($search_ref_ext) {
$param .= '&search_ref_ext='.urlencode($search_ref_ext);
}
if ($search_company) {
$param .= '&search_company='.urlencode($search_company);
}
@ -1647,6 +1659,12 @@ if (!empty($arrayfields['c.ref']['checked'])) {
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
}
// Ref ext
if (!empty($arrayfields['c.ref_ext']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref_ext).'">';
print '</td>';
}
// Ref customer
if (!empty($arrayfields['c.ref_client']['checked'])) {
print '<td class="liste_titre" align="left">';
@ -1944,6 +1962,10 @@ if (!empty($arrayfields['c.ref']['checked'])) {
print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['c.ref_ext']['checked'])) {
print_liste_field_titre($arrayfields['c.ref_ext']['label'], $_SERVER["PHP_SELF"], 'c.ref_ext', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['c.ref_client']['checked'])) {
print_liste_field_titre($arrayfields['c.ref_client']['label'], $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
@ -2283,6 +2305,16 @@ while ($i < $imaxinloop) {
}
}
// Ref customer
if (!empty($arrayfields['c.ref_ext']['checked'])) {
print '<td class="nowrap tdoverflowmax75" title="'.dol_escape_htmltag($obj->ref_ext).'">';
print dol_escape_htmltag($obj->ref_ext);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Ref customer
if (!empty($arrayfields['c.ref_client']['checked'])) {
print '<td class="nowrap tdoverflowmax150" title="'.dol_escape_htmltag($obj->ref_client).'">';
@ -2704,7 +2736,7 @@ while ($i < $imaxinloop) {
// Date creation
if (!empty($arrayfields['c.datec']['checked'])) {
print '<td align="center" class="nowrap">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {
@ -2714,7 +2746,7 @@ while ($i < $imaxinloop) {
// Date modification
if (!empty($arrayfields['c.tms']['checked'])) {
print '<td align="center" class="nowrap">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_modification), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {
@ -2724,7 +2756,7 @@ while ($i < $imaxinloop) {
// Date cloture
if (!empty($arrayfields['c.date_cloture']['checked'])) {
print '<td align="center" class="nowrap">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_cloture), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {

View file

@ -1597,9 +1597,9 @@ class Account extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("BankAccount");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -724,9 +724,9 @@ class PaymentVarious extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -463,9 +463,9 @@ class CashControl extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -2907,7 +2907,7 @@ if (empty($reshook)) {
$percent = $line->get_prev_progress($object->id);
}
if ((float) $all_progress < (float) $percent) {
$mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent");
$mesg = $langs->trans("Line").' '.$line->rang.' : '.$langs->trans("CantBeLessThanMinPercent");
setEventMessages($mesg, null, 'warnings');
$result = -1;
} else {
@ -5908,9 +5908,9 @@ if ($action == 'create') {
print dolGetButtonAction($langs->trans('DoPayment'), '', 'default', '#', '', false, $params);
} else {
// Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done)
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&amp;action=create&amp;accountid='.$object->fk_account.'">'.$langs->trans('DoPayment').'</a>';
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&action=create&accountid='.$object->fk_account.'">'.$langs->trans('DoPayment').'</a>';
unset($params['attr']['title']);
print dolGetButtonAction($langs->trans('DoPayment'), '', 'default', DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&amp;action=create'.($object->fk_account > 0 ? '&amp;accountid='.$object->fk_account : ''), '', true, $params);
print dolGetButtonAction($langs->trans('DoPayment'), '', 'default', DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&action=create'.($object->fk_account > 0 ? '&accountid='.$object->fk_account : ''), '', true, $params);
}
}
}
@ -5925,7 +5925,7 @@ if ($action == 'create') {
if ($resteapayer == 0) {
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPaymentBack').'</span>';
} else {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&amp;action=create&amp;accountid='.$object->fk_account.'">'.$langs->trans('DoPaymentBack').'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&action=create&accountid='.$object->fk_account.'">'.$langs->trans('DoPaymentBack').'</a>';
}
}
@ -5978,7 +5978,7 @@ if ($action == 'create') {
if ($objectidnext) {
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ClassifyCanceled').'</span>';
} else {
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&amp;action=canceled">'.$langs->trans('ClassifyCanceled').'</a>';
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=canceled">'.$langs->trans('ClassifyCanceled').'</a>';
}
}
}
@ -5987,7 +5987,7 @@ if ($action == 'create') {
// Create a credit note
if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && !getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) || $object->type == Facture::TYPE_PROFORMA) && $object->status > 0 && $usercancreate) {
if (!$objectidnext) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&fac_avoir='.$object->id.'&action=create&type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').($object->entity > 0 ? '&originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
}
}
@ -6001,7 +6001,7 @@ if ($action == 'create') {
&& getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE')
) {
if ($usercanunvalidate) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;invoiceAvoirWithLines=1&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').'">'.$langs->trans("CreateCreditNote").'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&fac_avoir='.$object->id.'&invoiceAvoirWithLines=1&action=create&type=2'.($object->fk_project > 0 ? '&projectid='.$object->fk_project : '').'">'.$langs->trans("CreateCreditNote").'</a>';
} else {
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateCreditNote").'</span>';
}
@ -6017,7 +6017,7 @@ if ($action == 'create') {
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->status == 0 && $usercancreate) {
if (!$objectidnext && count($object->lines) > 0) {
unset($params['attr']['title']);
print dolGetButtonAction($langs->trans('ChangeIntoRepeatableInvoice'), '', 'default', DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$object->id.'&amp;action=create', '', true, $params);
print dolGetButtonAction($langs->trans('ChangeIntoRepeatableInvoice'), '', 'default', DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$object->id.'&action=create', '', true, $params);
}
}
@ -6031,7 +6031,7 @@ if ($action == 'create') {
&& $usercanunvalidate
) {
if (($object->total_ttc - $totalcreditnotes) == 0) {
print '<a id="butSituationOut" class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&amp;action=situationout">'.$langs->trans("RemoveSituationFromCycle").'</a>';
print '<a id="butSituationOut" class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=situationout">'.$langs->trans("RemoveSituationFromCycle").'</a>';
} else {
print '<a id="butSituationOutRefused" class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("DisabledBecauseNotEnouthCreditNote").'" >'.$langs->trans("RemoveSituationFromCycle").'</a>';
}
@ -6040,7 +6040,7 @@ if ($action == 'create') {
// Create next situation invoice
if ($usercancreate && ($object->type == 5) && ($object->status == 1 || $object->status == 2)) {
if ($object->is_last_in_cycle() && $object->situation_final != 1) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=create&amp;type=5&amp;origin=facture&amp;originid='.$object->id.'&amp;socid='.$object->socid.'" >'.$langs->trans('CreateNextSituationInvoice').'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=create&type=5&origin=facture&originid='.$object->id.'&socid='.$object->socid.'" >'.$langs->trans('CreateNextSituationInvoice').'</a>';
} elseif (!$object->is_last_in_cycle()) {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("DisabledBecauseNotLastInCycle").'">'.$langs->trans('CreateNextSituationInvoice').'</a>';
} else {

View file

@ -324,7 +324,7 @@ class Facture extends CommonInvoice
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 5),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 20, 'index' => 1),
'ref_client' => array('type' => 'varchar(255)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 10),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 12),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 12),
'type' => array('type' => 'smallint(6)', 'label' => 'Type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15),
'subtype' => array('type' => 'smallint(6)', 'label' => 'InvoiceSubtype', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 15),
//'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
@ -2109,9 +2109,9 @@ class Facture extends CommonInvoice
if (empty($notooltip) && $user->hasRight("facture", "read")) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Invoice");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}

File diff suppressed because it is too large Load diff

View file

@ -964,9 +964,9 @@ class RemiseCheque extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowCheckReceipt");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -1415,9 +1415,9 @@ class Paiement extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Payment");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -688,9 +688,9 @@ class ChargeSociales extends CommonObject
if (empty($notooltip) && $user->hasRight("facture", "read")) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("SocialContribution");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip"';
}

View file

@ -783,9 +783,9 @@ class Tva extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -92,7 +92,7 @@ class Contact extends CommonObject
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 30, 'index' => 1),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 3, 'position' => 35),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 35),
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => 3, 'position' => 40),
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 45, 'showoncombobox' => 1, 'searchall' => 1),
'name_alias' => array('type' => 'varchar(255)', 'label' => 'Name alias', 'enabled' => 1, 'visible' => -1, 'position' => 46, 'searchall' => 1),
@ -386,6 +386,8 @@ class Contact extends CommonObject
$this->ismultientitymanaged = 1;
$this->isextrafieldmanaged = 1;
$this->fields['ref_ext']['visible'] = getDolGlobalInt('MAIN_LIST_SHOW_REF_EXT');
if (!isModEnabled('mailing')) {
$this->fields['no_email']['enabled'] = 0;
}
@ -662,7 +664,7 @@ class Contact extends CommonObject
$sql .= ", phone = ".(isset($this->phone_pro) ? "'".$this->db->escape($this->phone_pro)."'" : "NULL");
$sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "NULL");
$sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "NULL");
$sql .= ", priv = '".$this->db->escape($this->priv)."'";
$sql .= ", priv = ".((int) $this->priv);
$sql .= ", fk_prospectlevel = '".$this->db->escape($this->fk_prospectlevel)."'";
if (isset($this->stcomm_id)) {
$sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0");
@ -1571,9 +1573,9 @@ class Contact extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowContact");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -12,7 +12,7 @@
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -79,6 +79,7 @@ $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('se
$search_phone = GETPOST("search_phone", 'alpha');
$search_id = GETPOST("search_id", "intcomma");
$search_ref_ext = GETPOST("search_ref_ext", "alpha");
$search_firstlast_only = GETPOST("search_firstlast_only", 'alpha');
$search_lastname = GETPOST("search_lastname", 'alpha');
$search_firstname = GETPOST("search_firstname", 'alpha');
@ -367,6 +368,7 @@ if (empty($reshook)) {
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_all = "";
$search_id = '';
$search_ref_ext = '';
$search_firstlast_only = "";
$search_lastname = "";
$search_firstname = "";
@ -482,7 +484,7 @@ if ($resql) {
// Build and execute select
// --------------------------------------------------------------------
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias as alias,";
$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.birthday,";
$sql .= " p.rowid, p.ref_ext, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.birthday,";
$sql .= " p.socialnetworks, p.photo,";
$sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_modification,";
$sql .= " p.import_key, p.fk_stcommcontact as stcomm_id, p.fk_prospectlevel,";
@ -661,6 +663,9 @@ if (strlen($search_firstlast_only)) {
if ($search_id > 0) {
$sql .= natural_search('p.rowid', $search_id, 1);
}
if ($search_ref_ext) {
$sql .= natural_search('p.ref_ext', $search_ref_ext);
}
if ($search_lastname) {
$sql .= natural_search('p.lastname', $search_lastname);
}
@ -859,7 +864,10 @@ if ($search_all != '') {
$param .= '&search_all='.urlencode($search_all);
}
if ($search_id > 0) {
$param .= "&search_id=".urlencode((string) ($search_id));
$param .= "&search_id=".((int) $search_id);
}
if ($search_ref_ext) {
$param .= "&search_ref_ext=".urlencode($search_ref_ext);
}
if ($search_lastname != '') {
$param .= '&search_lastname='.urlencode($search_lastname);
@ -1082,32 +1090,37 @@ if (!empty($arrayfields['p.rowid']['checked'])) {
}
if (!empty($arrayfields['p.lastname']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_lastname" size="6" value="'.dol_escape_htmltag($search_lastname).'">';
print '<input class="flat width75" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'">';
print '</td>';
}
if (!empty($arrayfields['p.firstname']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_firstname" size="6" value="'.dol_escape_htmltag($search_firstname).'">';
print '<input class="flat width75" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'">';
print '</td>';
}
if (!empty($arrayfields['p.ref_ext']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat width50" type="text" name="search_ref_ext" value="'.dol_escape_htmltag($search_ref_ext).'">';
print '</td>';
}
if (!empty($arrayfields['p.poste']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).'">';
print '<input class="flat width50" type="text" name="search_poste" value="'.dol_escape_htmltag($search_poste).'">';
print '</td>';
}
if (!empty($arrayfields['p.address']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_address" size="6" value="'.dol_escape_htmltag($search_address).'">';
print '<input class="flat width50" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).'">';
print '</td>';
}
if (!empty($arrayfields['p.zip']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_zip" size="3" value="'.dol_escape_htmltag($search_zip).'">';
print '<input class="flat width50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'">';
print '</td>';
}
if (!empty($arrayfields['p.town']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_town" size="5" value="'.dol_escape_htmltag($search_town).'">';
print '<input class="flat width50" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'">';
print '</td>';
}
@ -1279,6 +1292,10 @@ if (!empty($arrayfields['p.firstname']['checked'])) {
print_liste_field_titre($arrayfields['p.firstname']['label'], $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.ref_ext']['checked'])) {
print_liste_field_titre($arrayfields['p.ref_ext']['label'], $_SERVER["PHP_SELF"], "p.ref_ext", $begin, $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.poste']['checked'])) {
print_liste_field_titre($arrayfields['p.poste']['label'], $_SERVER["PHP_SELF"], "p.poste", $begin, $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
@ -1405,9 +1422,10 @@ while ($i < $imaxinloop) {
}
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
$contactstatic->id = $obj->rowid;
$contactstatic->ref_ext = $obj->ref_ext;
$contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname;
$contactstatic->id = $obj->rowid;
$contactstatic->statut = $obj->statut;
$contactstatic->poste = $obj->poste;
$contactstatic->email = $obj->email;
@ -1483,7 +1501,7 @@ while ($i < $imaxinloop) {
// (Last) Name
if (!empty($arrayfields['p.lastname']['checked'])) {
print '<td class="middle tdoverflowmax150">';
print '<td class="middle tdoverflowmax150" title="'.dolPrintHTMLForAttribute($contactstatic->lastname).'">';
if ($contextpage == 'poslist') {
print $contactstatic->lastname;
} else {
@ -1497,7 +1515,19 @@ while ($i < $imaxinloop) {
// Firstname
if (!empty($arrayfields['p.firstname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.dol_escape_htmltag($obj->firstname).'</td>';
print '<td class="tdoverflowmax150" title="'.dolPrintHTMLForAttribute($obj->firstname).'">';
print dolPrintHTML($obj->firstname);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Ref ext
if (!empty($arrayfields['p.ref_ext']['checked'])) {
print '<td class="middle tdoverflowmax100" title="'.dolPrintHTMLForAttribute($contactstatic->ref_ext).'">';
print dolPrintHTML($contactstatic->ref_ext);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View file

@ -268,7 +268,7 @@ class Contrat extends CommonObject
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20),
'ref_customer' => array('type' => 'varchar(50)', 'label' => 'RefCustomer', 'enabled' => 1, 'visible' => -1, 'position' => 25, 'searchall' => 1),
'ref_supplier' => array('type' => 'varchar(50)', 'label' => 'RefSupplier', 'enabled' => 1, 'visible' => -1, 'position' => 26, 'searchall' => 1),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 30, 'index' => 1),
@ -2133,9 +2133,9 @@ class Contrat extends CommonObject
if (empty($notooltip) && $user->hasRight('contrat', 'lire')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowContract");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}
$linkstart = '<a href="'.$url.'"';

View file

@ -450,7 +450,7 @@ class ContratLigne extends CommonObjectLine
}
$link = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'"';
$link .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$link .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$link .= $dataparams.' class="'.$classfortooltip.'">';
$linkend = '</a>';

View file

@ -61,13 +61,14 @@ if ($type == 'select') {
$extrasize = '';
}
// List of reserved words for databases
$listofreservedwords = array(
'ADD', 'ALL', 'ALTER', 'ANALYZE', 'AND', 'AS', 'ASENSITIVE', 'BEFORE', 'BETWEEN', 'BINARY', 'BLOB', 'BOTH', 'CALL', 'CASCADE', 'CASE', 'CHANGE', 'CHAR', 'CHARACTER', 'CHECK', 'COLLATE', 'COLUMN', 'CONDITION', 'CONSTRAINT', 'CONTINUE', 'CONVERT', 'CREATE', 'CROSS', 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER',
'CURSOR', 'DATABASE', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DETERMINISTIC', 'DISTINCT', 'DISTINCTROW', 'DOUBLE', 'DROP', 'DUAL',
'EACH', 'ELSE', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXISTS', 'EXPLAIN', 'FALSE', 'FETCH', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FORCE', 'FOREIGN', 'FULLTEXT', 'GRANT', 'GROUP', 'HAVING', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE', 'HOUR_SECOND',
'IGNORE', 'IGNORE_SERVER_IDS', 'INDEX', 'INFILE', 'INNER', 'INOUT', 'INSENSITIVE', 'INSERT', 'INT', 'INTEGER', 'INTERVAL', 'INTO', 'ITERATE',
'KEYS', 'KEYWORD', 'LEADING', 'LEAVE', 'LEFT', 'LIKE', 'LIMIT', 'LINES', 'LOCALTIME', 'LOCALTIMESTAMP', 'LONGBLOB', 'LONGTEXT', 'MASTER_SSL_VERIFY_SERVER_CERT', 'MATCH', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT', 'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MODIFIES', 'NATURAL', 'NOT', 'NO_WRITE_TO_BINLOG', 'NUMERIC',
'OFFSET', 'ON', 'OPTION', 'OPTIONALLY', 'OUTER', 'OUTFILE',
'OFFSET', 'ON', 'OPTION', 'OPTIONALLY', 'OUTER', 'OUTFILE', 'OVER',
'PARTITION', 'POSITION', 'PRECISION', 'PRIMARY', 'PROCEDURE', 'PURGE', 'RANGE', 'READS', 'READ_WRITE', 'REAL', 'REFERENCES', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REQUIRE', 'RESTRICT', 'RETURN', 'REVOKE', 'RIGHT', 'RLIKE',
'SCHEMAS', 'SECOND_MICROSECOND', 'SENSITIVE', 'SEPARATOR', 'SIGNAL', 'SMALLINT', 'SPATIAL', 'SPECIFIC', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN',
'TABLE', 'TERMINATED', 'TINYBLOB', 'TINYINT', 'TINYTEXT', 'TRAILING', 'TRIGGER', 'UNDO', 'UNIQUE', 'UNSIGNED', 'UPDATE', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'VALUES', 'VARBINARY', 'VARCHAR', 'VARYING',

View file

@ -58,13 +58,13 @@ if ($action == 'update' && !empty($arrayofparameters) && is_array($arrayofparame
foreach ($arrayofparameters as $key => $val) {
// Modify constant only if key was posted (avoid resetting key to the null value)
if (GETPOSTISSET($key)) {
if (!empty($val['type']) && preg_match('/category:/', $val['type'])) {
if (isset($val['type']) && preg_match('/category:/', $val['type'])) {
if (GETPOSTINT($key) == '-1') {
$val_const = '';
} else {
$val_const = GETPOSTINT($key);
}
} elseif ($val['type'] == 'html') {
} elseif (isset($val['type']) && $val['type'] == 'html') {
$val_const = GETPOST($key, 'restricthtml');
} else {
$val_const = GETPOST($key, 'alpha');

View file

@ -10360,7 +10360,11 @@ abstract class CommonObject
}
if (array_key_exists('pass_crypted', $fieldvalues) && property_exists($this, 'pass')) {
// @phan-suppress-next-line PhanUndeclaredProperty
$fieldvalues['pass_crypted'] = dol_hash($this->pass);
$tmparray = dol_hash($this->pass, '0', 0, 1);
$fieldvalues['pass_crypted'] = $tmparray['pass_encrypted'];
if (array_key_exists('pass_encoding', $fieldvalues) && property_exists($this, 'pass_encoding')) {
$fieldvalues['pass_encoding'] = $tmparray['pass_encoding'];
}
}
if (array_key_exists('ref', $fieldvalues)) {
$fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data

View file

@ -355,9 +355,9 @@ class Fiscalyear extends CommonObject
if (empty($notooltip) && $user->hasRight('accounting', 'fiscalyear', 'write')) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("FiscalPeriod");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' title="'.dolPrintHTMLForAttribute($label).'"';
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
}

View file

@ -1037,7 +1037,7 @@ class Form
} else {
$out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">';
}
$out .= $labeltoshow;
$out .= dol_string_nohtmltag($labeltoshow);
$out .= '</option>' . "\n";
}
}
@ -6591,7 +6591,7 @@ class Form
$num = $this->num;
if ($num == 0) {
$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $addcontact . '</a>';
print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>';
}
print '</td>';
print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>';
@ -6713,7 +6713,7 @@ class Form
} else {
$out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">';
}
$out .= $labeltoshow;
$out .= dol_string_nohtmltag($labeltoshow);
$out .= '</option>';
}
$out .= '</select>';
@ -7287,7 +7287,7 @@ class Form
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
$usecalendar = 'combo';
if (!empty($conf->use_javascript_ajax) && (!getDolGlobalString('MAIN_POPUP_CALENDAR') || getDolGlobalString('MAIN_POPUP_CALENDAR') != "none")) {
$usecalendar = ((!getDolGlobalString('MAIN_POPUP_CALENDAR') || getDolGlobalString('MAIN_POPUP_CALENDAR') == 'eldy') ? 'jquery' : $conf->global->MAIN_POPUP_CALENDAR);
$usecalendar = ((!getDolGlobalString('MAIN_POPUP_CALENDAR') || getDolGlobalString('MAIN_POPUP_CALENDAR') == 'eldy') ? 'jquery' : getDolGlobalString("MAIN_POPUP_CALENDAR"));
}
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
// If we use a text browser or screen reader, we use the 'combo' date selector
@ -7317,7 +7317,7 @@ class Form
if (!$disabled) {
$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"';
$base = DOL_URL_ROOT . '/core/';
$retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"';
$retstringbuttom .= ' onClick="showDP(\'' . dol_escape_js($base) . '\',\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\',\'' . dol_escape_js($langs->defaultlang) . '\');"';
$retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>';
} else {
$retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>';
@ -7364,7 +7364,7 @@ class Form
// Input area to enter date manually
$retstring .= '<div class="nowraponall inline-block divfordateinput">';
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="'.($usecalendar == 'html' ? "date" : "text").'" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"';
$retstring .= ($disabled ? ' disabled' : '');
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
@ -11663,7 +11663,7 @@ class Form
foreach ($buttons as $button) {
$addclass = empty($button['addclass']) ? '' : $button['addclass'];
$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->transnoentities($button['label_key'])) . '">';
}
$retstring .= $withoutdiv ? '' : '</div>';

View file

@ -906,8 +906,8 @@ class FormSetupItem
} elseif ($this->type == 'yesno') {
if (!empty($conf->use_javascript_ajax)) {
$input = $this->fieldParams['input'] ?? array();
$revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0;
$forcereload = $this->fieldParams['forcereload'] ? 1 : 0;
$revertonoff = isset($this->fieldParams['revertonoff']) ? 1 : 0;
$forcereload = isset($this->fieldParams['forcereload']) ? 1 : 0;
$out .= ajax_constantonoff($this->confKey, $input, $this->entity, $revertonoff, 0, $forcereload);
} else {

View file

@ -757,9 +757,9 @@ class TimeSpent extends CommonObject
if (empty($notooltip)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTimeSpent");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
}
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');

View file

@ -682,14 +682,6 @@ class Translate
}
}
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because
// we want to keep '"' '<b>' '</b>' '<strong' '</strong>' '<a ' '</a>' '<br>' '< ' '<span' '</span>' that are reliable HTML tags inside translation strings.
$str = str_replace(
array('"', '<b>', '</b>', '<u>', '</u>', '<i', '</i>', '<center>', '</center>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__tagb__', '__tagbend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__ltspace__', '__gt__'),
$str
);
if (strpos($key, 'Format') !== 0) {
try {
// @phan-suppress-next-line PhanPluginPrintfVariableFormatString
@ -699,13 +691,21 @@ class Translate
}
}
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because
// we want to keep '"' '<b>' '</b>' '<u>' '</u>' '<i>' '</i>' '<center> '</center>' '<strong' '</strong>' '<a ' '</a>' '<br>' '<span' '</span>' '< ' that are reliable HTML tags inside translation strings.
$str = str_replace(
array('"', '<b>', '</b>', '<u>', '</u>', '<i>', '</i>', '<center>', '</center>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__tagb__', '__tagbend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__ltspace__', '__gt__'),
$str
);
// Encode string into HTML
$str = htmlentities($str, ENT_COMPAT, $this->charset_output); // Do not convert simple quotes in translation (strings in html are embraced by "). Use dol_escape_htmltag around text in HTML content
// Restore reliable HTML tags into original translation string
$str = str_replace(
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__ltspace__', '__gt__'),
array('"', '<b>', '</b>', '<u>', '</u>', '<i', '</i>', '<center>', '</center>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'),
array('"', '<b>', '</b>', '<u>', '</u>', '<i>', '</i>', '<center>', '</center>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'),
$str
);
@ -759,10 +759,28 @@ class Translate
* @param string $param5 chaine de param5
* @return string Translated string
*/
public function tr($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '')
{
return $this->transnoentitiesnoconv($key, $param1, $param2, $param3, $param4, $param5);
}
/**
* Return translated value of a text string. Alias of tr() for backward compatibility.
* If there is no match for this text, we look in alternative file and if still not found,
* it is returned as is.
* No conversion to encoding charset of lang object is done.
* Parameters of this method must not contains any HTML tags.
*
* @param string $key Key to translate
* @param string $param1 chaine de param1
* @param string $param2 chaine de param2
* @param string $param3 chaine de param3
* @param string $param4 chaine de param4
* @param string $param5 chaine de param5
* @return string Translated string
*/
public function transnoentitiesnoconv($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '')
{
global $conf;
if (!empty($this->tab_translate[$key])) { // Translation is available
$str = $this->tab_translate[$key];

View file

@ -1127,7 +1127,7 @@ function purgeSessions($mysessionid)
$sessValues = file_get_contents($fullpath); // get raw session data
if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity
(preg_match('/dol_entity\|i:('.$conf->entity.')/', $sessValues) || preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues)) && // limit to current entity
preg_match('/dol_company\|s:([0-9]+):"(' . getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name
$tmp = explode('_', $file);
$idsess = $tmp[1];

View file

@ -899,7 +899,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$newcardbutton = '';
if (isModEnabled('project') && $user->hasRight('projet', 'creer') && empty($nocreatelink)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";
@ -1296,7 +1296,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$newcardbutton = '';
if ($user->hasRight('societe', 'contact', 'creer')) {
$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
$newcardbutton .= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";

View file

@ -179,7 +179,7 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $
$newcardbutton = '';
if (isModEnabled('project') && $user->hasRight('projet', 'creer') && empty($nocreatelink)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";

View file

@ -1,4 +1,5 @@
<?php
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2024 Laurent Destailleur <eldy@users.sourceforge.net>
@ -21,7 +22,7 @@
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Lenin Rivas <lenin.rivas777@gmail.com>
* Copyright (C) 2024 Josep Lluís Amador Teruel <joseplluis@lliuretic.cat>
* Copyright (C) 2024 Benoît PASCAL <contact@p-ben.com>
@ -2010,6 +2011,7 @@ function dolPrintText($s)
/**
* Return a string (that can be on several lines) ready to be output on a HTML page.
* To output a text inside an attribute, you can use dolPrintHTMLForAttribute() or dolPrintHTMLForTextArea() inside a textarea
* With dolPrintHTML(), only content not already in HTML is encoded with HTML.
*
* @param string $s String to print
* @param int $allowiframe Allow iframe tags
@ -2023,6 +2025,7 @@ function dolPrintHTML($s, $allowiframe = 0)
/**
* Return a string ready to be output on an HTML attribute (alt, title, data-html, ...)
* With dolPrintHTMLForAttribute(), the content is HTML encode, even if it is already HTML content.
*
* @param string $s String to print
* @return string String ready for HTML output
@ -2032,7 +2035,23 @@ function dolPrintHTMLForAttribute($s)
{
// The dol_htmlentitiesbr will convert simple text into html
// The dol_escape_htmltag will escape html chars.
return dol_escape_htmltag(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 0, 0, 0, array('br', 'b', 'font', 'span')), 1, -1, '', 0, 1);
return dol_escape_htmltag(dol_string_onlythesehtmltags(dol_htmlentitiesbr($s), 1, 0, 0, 0, array('br', 'b', 'font', 'hr', 'span')), 1, -1, '', 0, 1);
}
/**
* Return a string ready to be output on a href attribute (this one need a special because we need content is HTML with no way to detect it is HTML).
* With dolPrintHTMLForAttribute(), the content is HTML encode, even if it is already HTML content.
*
* @param string $s String to print
* @return string String ready for HTML output
* @see dolPrintHTML(), dolPrintHTMLFortextArea()
*/
function dolPrintHTMLForAttributeUrl($s)
{
// The dol_htmlentitiesbr has been removed compared to dolPrintHTMLForAttribute because we know content is a HTML URL string (even if we have no way to detect it automatically)
// The dol_escape_htmltag will escape html chars.
$escapeonlyhtmltags = 1;
return dol_escape_htmltag(dol_string_onlythesehtmltags($s, 1, 1, 1, 0, array()), 0, 0, '', $escapeonlyhtmltags, 1);
}
/**
@ -2071,7 +2090,7 @@ function dolPrintPassword($s)
* @param string $stringtoescape String to escape
* @param int $keepb 1=Replace b tags with escaped value (except if in $noescapetags), 0=Remove them completely
* @param int $keepn 1=Preserve \r\n strings, 0=Replace them with escaped value, -1=Remove them. Set to 1 when escaping for a <textarea>.
* @param string $noescapetags ''= or 'common' or list of tags to not escape.
* @param string $noescapetags '' (escape all html tags) or 'common' (do not escape some common tags) or list of tags to not escape.
* @param int $escapeonlyhtmltags 1=Escape only html tags, not the special chars like accents.
* @param int $cleanalsojavascript Clean also javascript. @TODO switch this option to 1 by default.
* @return string Escaped string
@ -2092,8 +2111,32 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta
if ($escapeonlyhtmltags) {
$tmp = htmlspecialchars_decode((string) $stringtoescape, ENT_COMPAT);
} else {
$tmp = html_entity_decode((string) $stringtoescape, ENT_COMPAT, 'UTF-8'); // This decode &egrave; into è so string is UTF8 (but &#39; is not decoded).
$tmp = str_ireplace('&#39;', '__SIMPLEQUOTE', $tmp);
// We make a manipulation by calling the html_entity_decode() to convert content into NON HTML UTF8 string.
// Because content can be or not already HTML.
// For example, this decode &egrave; into è so string is UTF8 (but numbers entities like &#39; is not decoded).
// In a future, we should not need this
$tmp = (string) $stringtoescape;
// We protect the 6 special entities that we don't want to decode.
$tmp = str_ireplace('&lt', '__DONOTDECODELT', $tmp);
$tmp = str_ireplace('&gt', '__DONOTDECODEGT', $tmp);
$tmp = str_ireplace('&amp', '__DONOTDECODEAMP', $tmp);
$tmp = str_ireplace('&quot', '__DONOTDECODEQUOT', $tmp);
$tmp = str_ireplace('&apos', '__DONOTDECODEAPOS', $tmp);
$tmp = str_ireplace('&#39', '__DONOTDECODE39', $tmp);
$tmp = html_entity_decode((string) $tmp, ENT_COMPAT, 'UTF-8'); // Convert entities into UTF8
// We restore the 6 special entities that we don't want to have been decoded by previous command
$tmp = str_ireplace('__DONOTDECODELT', '&lt', $tmp);
$tmp = str_ireplace('__DONOTDECODEGT', '&gt', $tmp);
$tmp = str_ireplace('__DONOTDECODEAMP', '&amp', $tmp);
$tmp = str_ireplace('__DONOTDECODEQUOT', '&quot', $tmp);
$tmp = str_ireplace('__DONOTDECODEAPOS', '&apos', $tmp);
$tmp = str_ireplace('__DONOTDECODE39', '&#39', $tmp);
$tmp = str_ireplace('&#39;', '__SIMPLEQUOTE', $tmp); // HTML 4
}
if (!$keepb) {
$tmp = strtr($tmp, array("<b>" => '', '</b>' => '', '<strong>' => '', '</strong>' => ''));
@ -2105,13 +2148,15 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta
}
if ($escapeonlyhtmltags) {
return htmlspecialchars($tmp, ENT_COMPAT, 'UTF-8');
$tmp = htmlspecialchars($tmp, ENT_COMPAT, 'UTF-8');
return $tmp;
} else {
// Escape tags to keep
// Now we protect all the tags we want to keep
$tmparrayoftags = array();
if ($noescapetags) {
$tmparrayoftags = explode(',', $noescapetags);
}
if (count($tmparrayoftags)) {
$reg = array();
$tmp = str_ireplace('__DOUBLEQUOTE', '', $tmp); // The keyword DOUBLEQUOTE is forbidden. Reserved, so we removed it if we find it.
@ -2147,8 +2192,13 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta
$diff = strcmp($tmpold, $tmp);
} while ($diff);
}
$tmp = str_ireplace('&quot', '__DOUBLEQUOT', $tmp);
$tmp = str_ireplace('&lt', '__LESSTAN', $tmp);
$tmp = str_ireplace('&gt', '__GREATERTHAN', $tmp);
}
// Warning: htmlentities encode HTML tags like <abc>, but not &lt; &gt; &quotes; &apos; &#39; &amp; that remains untouched.
$result = htmlentities($tmp, ENT_COMPAT, 'UTF-8'); // Convert & into &amp; and more...
//print $result;
@ -2171,6 +2221,10 @@ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0, $noescapeta
$result = str_ireplace('__SIMPLEQUOTE', '&#39;', $result);
$result = str_ireplace('__DOUBLEQUOT', '&quot', $result);
$result = str_ireplace('__LESSTAN', '&lt', $result);
$result = str_ireplace('__GREATERTHAN', '&gt', $result);
//$result="\n\n\n".var_export($tmp, true)."\n\n\n".var_export($result, true);
return $result;
@ -7946,8 +8000,6 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
*/
function dol_mkdir($dir, $dataroot = '', $newmask = '')
{
global $conf;
dol_syslog("functions.lib::dol_mkdir: dir=".$dir, LOG_INFO);
$dir = dol_sanitizePathName($dir, '_', 0);
@ -7985,17 +8037,17 @@ function dol_mkdir($dir, $dataroot = '', $newmask = '')
if ($ccdir) {
$ccdir_osencoded = dol_osencode($ccdir);
if (!@is_dir($ccdir_osencoded)) {
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' does not exists or is outside open_basedir PHP setting.", LOG_DEBUG);
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' is not found (does not exists or is outside open_basedir PHP setting).", LOG_DEBUG);
umask(0);
$dirmaskdec = octdec((string) $newmask);
if (empty($newmask)) {
$dirmaskdec = !getDolGlobalString('MAIN_UMASK') ? octdec('0755') : octdec($conf->global->MAIN_UMASK);
$dirmaskdec = octdec(getDolGlobalString('MAIN_UMASK', '0755'));
}
$dirmaskdec |= octdec('0111'); // Set x bit required for directories
if (!@mkdir($ccdir_osencoded, $dirmaskdec)) {
// If the is_dir has returned a false information, we arrive here
dol_syslog("functions.lib::dol_mkdir: Fails to create directory '".$ccdir."' or directory already exists.", LOG_WARNING);
dol_syslog("functions.lib::dol_mkdir: Fails to create directory '".$ccdir."' (no permission to write into parent or directory already exists).", LOG_WARNING);
$nberr++;
} else {
dol_syslog("functions.lib::dol_mkdir: Directory '".$ccdir."' created", LOG_DEBUG);
@ -8493,7 +8545,8 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
// See options at https://tidy.sourceforge.net/docs/quickref.html
$config = array(
'clean' => false,
'quote-marks' => false, // do not replace " that are used for real text content (not a string symbol for html attribute) into &quot;
// Best will be to set 'quote-marks' to false to not replace " that are used for real text content (not a string symbol for html attribute) into &quot;
'quote-marks' => false,
'doctype' => 'strict',
'show-body-only' => true,
"indent-attributes" => false,
@ -8651,9 +8704,9 @@ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UT
$newstring = preg_replace('/<br>$/i', '', $newstring); // Remove last <br> (remove only last one)
}
$newstring = preg_replace('/[\x{200B}-\x{200D}\x{FEFF}]/u', ' ', $newstring);
$newstring = strtr($newstring, array('&' => '__and__', '<' => '__lt__', '>' => '__gt__', '"' => '__dquot__'));
$newstring = strtr($newstring, array('&' => '__PROTECTand__', '<' => '__PROTECTlt__', '>' => '__PROTECTgt__', '"' => '__PROTECTdquot__'));
$newstring = dol_htmlentities($newstring, ENT_COMPAT, $pagecodefrom); // Make entity encoding
$newstring = strtr($newstring, array('__and__' => '&', '__lt__' => '<', '__gt__' => '>', '__dquot__' => '"'));
$newstring = strtr($newstring, array('__PROTECTand__' => '&', '__PROTECTlt__' => '<', '__PROTECTgt__' => '>', '__PROTECTdquot__' => '"'));
} else {
if ($removelasteolbr) {
$newstring = preg_replace('/(\r\n|\r|\n)$/i', '', $newstring); // Remove last \n (may remove several)
@ -9634,9 +9687,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
* $mesg = make_substitutions($mesg, $substitutionarray, $langs);
*
* @param string $text Source string in which we must do substitution
* @param array<string,string> $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...)
* @param array<string,null|string|float|int> $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...)
* @param ?Translate $outputlangs Output language
* @param int $converttextinhtmlifnecessary 0=Convert only value into HTML if text is already in HTML
* @param int<0,1> $converttextinhtmlifnecessary 0=Convert only value into HTML if text is already in HTML
* 1=Will also convert initial $text into HTML if we try to insert one value that is HTML
* @return string Output string after substitutions
* @see complete_substitutions_array(), getCommonSubstitutionArray()
@ -9684,7 +9737,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
$msgishtml = 1;
}
} else {
$value = dol_nl2br("$value");
$value = dol_nl2br((string) $value);
}
$text = preg_replace('/__\('.preg_quote($reg[1], '/').'\)__/', $value, $text);
@ -9715,7 +9768,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
$msgishtml = 1;
}
} else {
$value = dol_nl2br("$value");
$value = dol_nl2br((string) $value);
}
$text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $value, $text);
@ -9733,7 +9786,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
}
if (empty($converttextinhtmlifnecessary)) {
$text = str_replace("$key", "$value", $text); // We must keep the " to work when value is 123.5 for example
$text = str_replace((string) $key, (string) $value, $text); // Cast to string is needed when value is 123.5 for example
} else {
if (! $msgishtml) {
$valueishtml = dol_textishtml($value, 1);
@ -9743,9 +9796,9 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
$msgishtml = 1;
}
} else {
$value = dol_nl2br("$value");
$value = dol_nl2br((string) $value);
}
$text = str_replace("$key", "$value", $text); // We must keep the " to work when value is 123.5 for example
$text = str_replace((string) $key, (string) $value, $text); // Cast to string is needed 123.5 for example
}
}
@ -9768,7 +9821,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
if (isset($lazy_load_arr[1]) && !empty($lazy_load_arr[1])) {
$key_to_substitute = $lazy_load_arr[1];
if (preg_match('/' . preg_quote($key_to_substitute, '/') . '/', $text)) {
$param_arr = explode(':', $value);
$param_arr = explode(':', (string) $value);
// path:class:method:id
if (count($param_arr) == 4) {
$path = $param_arr[0];
@ -9803,7 +9856,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
$valuetouseforsubstitution = $tmpobj->$method($id, $key_to_substitute, true);
}
$text = str_replace("$key_to_substitute", "$valuetouseforsubstitution", $text); // We must keep the " to work when value is 123.5 for example
$text = str_replace((string) $key_to_substitute, (string) $valuetouseforsubstitution, $text); // Cast to string in case value is 123.5 for example
}
}
}
@ -10613,9 +10666,9 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
// Check if there is dynamic call (first we use black list patterns)
if (preg_match('/\$[\w]*\s*\(/', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (mode '.$onlysimplestring.', found a call using of "$abc(" or "$abc (" instead of using the direct name of the function): '.$s;
return 'Bad string syntax to evaluate (mode '.$onlysimplestring.', found a call using "$abc(" or "$abc (" instead of using the direct name of the function): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (mode '.$onlysimplestring.', found a call using of "$abc(" or "$abc (" instead of using the direct name of the function): '.$s, LOG_WARNING);
dol_syslog('Bad string syntax to evaluate (mode '.$onlysimplestring.', found a call using "$abc(" or "$abc (" instead of using the direct name of the function): '.$s, LOG_WARNING);
return '';
}
}
@ -12792,12 +12845,16 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
unset($attr['href']);
}
// escape all attribute
$attr = array_map('dol_escape_htmltag', $attr);
// escape all attributes
$TCompiledAttr = array();
foreach ($attr as $key => $value) {
$TCompiledAttr[] = $key.'= "'.$value.'"';
if ($key == 'href') {
$value = dolPrintHTMLForAttributeUrl($value);
} else {
$value = dolPrintHTMLForAttribute($value);
}
$TCompiledAttr[] = $key.'="'.$value.'"'; // $value has been escaped by the dolPrintHTMLForAttribute... just before
}
$compiledAttributes = empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr);

View file

@ -249,7 +249,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '', $amount = 0)
* @param string $ref Ref of object
* @param int|float $amount Amount of money to request for
* @param string $freetag Free tag (required and used for $type='free' only)
* @param int $localorexternal 0=Url for browser, 1=Url for external access
* @param int|string $localorexternal 0=Url of current browsing, 1=Url for external access, or string with virtual host url
* @return string Url string
*/
function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'your_tag', $localorexternal = 1)
@ -266,8 +266,10 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y
$urltouse = DOL_MAIN_URL_ROOT; // Should be "https://www.mydomain.com/mydolibarr" for example
//dol_syslog("getOnlinePaymentUrl DOL_MAIN_URL_ROOT=".DOL_MAIN_URL_ROOT);
if ($localorexternal) {
if ((string) $localorexternal == '1') {
$urltouse = $urlwithroot;
} elseif ((string) $localorexternal != '0') {
$urltouse = $localorexternal;
}
if ($type == 'free') {

View file

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2008-2021 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -234,21 +235,38 @@ function dolDecrypt($chain, $key = '')
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorithm is something else than 'password_hash').
*
* @param string $chain String to hash
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4': for OpenLdap, '5':sha256, '6':password_hash).
* Use 'md5' if hash is not needed for security purpose. For security need, prefer 'auto'.
* @param 'auto'|'0'|'sha1'|'1'|'sha1md5'|'2'|'md5'|'3'|'openldap'|'4'|'sha256'|'5'|'password_hash'|'6' $type Type of hash:
* 'auto' or '0': will use MAIN_SECURITY_HASH_ALGO else md5
* 'sha1' or '1': sha1
* 'sha1md5' or '2': sha1md5
* 'md5' or '3': md5
* 'openldapxxx' or '4': for OpenLdap
* 'sha256' or '5': sha256
* 'password_hash' or '6': password_hash
* Use 'md5' if hash is not needed for security purpose. For security need, prefer 'auto'.
* @param int $nosalt Do not include any salt
* @return string Hash of string
* @param int $mode 0=Return encoded password, 1=Return array with encoding password + encoding algorithm
* @return string|array{pass_encrypted:string,pass_encoding:string} Hash of string or array with pass_encrypted and pass_encoding
* @see getRandomPassword(), dol_verifyHash()
*/
function dol_hash($chain, $type = '0', $nosalt = 0)
function dol_hash($chain, $type = '0', $nosalt = 0, $mode = 0)
{
// No need to add salt for password_hash
if (($type == '0' || $type == 'auto') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_hash')) {
if (($type == '0' || $type == 'auto') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_hash')) {
if (strpos($chain, "\0") !== false) {
// String contains a null character that can't be encoded. Return an error instead of fatal error.
return 'Invalid string to encrypt. Contains a null character.';
if ($mode == 1) {
return array('pass_encrypted' => 'Invalid string to encrypt. Contains a null character', 'pass_encoding' => '');
} else {
return 'Invalid string to encrypt. Contains a null character.';
}
}
if ($mode == 1) {
return array('pass_encrypted' => password_hash($chain, PASSWORD_DEFAULT), 'pass_encoding' => 'password_hash');
} else {
return password_hash($chain, PASSWORD_DEFAULT);
}
return password_hash($chain, PASSWORD_DEFAULT);
}
// Salt value
@ -257,25 +275,61 @@ function dol_hash($chain, $type = '0', $nosalt = 0)
}
if ($type == '1' || $type == 'sha1') {
return sha1($chain);
if ($mode == 1) {
return array('pass_encrypted' => sha1($chain), 'pass_encoding' => 'sha1');
} else {
return sha1($chain);
}
} elseif ($type == '2' || $type == 'sha1md5') {
return sha1(md5($chain));
if ($mode == 1) {
return array('pass_encrypted' => sha1(md5($chain)), 'pass_encoding' => 'sha1md5');
} else {
return sha1(md5($chain));
}
} elseif ($type == '3' || $type == 'md5') { // For hashing with no need of security
return md5($chain);
if ($mode == 1) {
return array('pass_encrypted' => md5($chain), 'pass_encoding' => 'md5');
} else {
return md5($chain);
}
} elseif ($type == '4' || $type == 'openldap') {
return dolGetLdapPasswordHash($chain, getDolGlobalString('LDAP_PASSWORD_HASH_TYPE', 'md5'));
if ($mode == 1) {
return array('pass_encrypted' => dolGetLdapPasswordHash($chain, getDolGlobalString('LDAP_PASSWORD_HASH_TYPE', 'md5')), 'pass_encoding' => 'ldappasswordhash'.getDolGlobalString('LDAP_PASSWORD_HASH_TYPE', 'md5'));
} else {
return dolGetLdapPasswordHash($chain, getDolGlobalString('LDAP_PASSWORD_HASH_TYPE', 'md5'));
}
} elseif ($type == '5' || $type == 'sha256') {
return hash('sha256', $chain);
if ($mode == 1) {
return array('pass_encrypted' => hash('sha256', $chain), 'pass_encoding' => 'sha256');
} else {
return hash('sha256', $chain);
}
} elseif ($type == '6' || $type == 'password_hash') {
return password_hash($chain, PASSWORD_DEFAULT);
if ($mode == 1) {
return array('pass_encrypted' => password_hash($chain, PASSWORD_DEFAULT), 'pass_encoding' => 'password_hash');
} else {
return password_hash($chain, PASSWORD_DEFAULT);
}
} elseif (getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'sha1') {
return sha1($chain);
if ($mode == 1) {
return array('pass_encrypted' => sha1($chain), 'pass_encoding' => 'sha1');
} else {
return sha1($chain);
}
} elseif (getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'sha1md5') {
return sha1(md5($chain));
if ($mode == 1) {
return array('pass_encrypted' => sha1(md5($chain)), 'pass_encoding' => 'sha1md5');
} else {
return sha1(md5($chain));
}
}
// No particular encoding defined, use default
return md5($chain);
if ($mode == 1) {
return array('pass_encrypted' => md5($chain), 'pass_encoding' => 'md5');
} else {
return md5($chain);
}
}
/**
@ -292,7 +346,8 @@ function dol_hash($chain, $type = '0', $nosalt = 0)
*/
function dol_verifyHash($chain, $hash, $type = '0')
{
if ($type == '0' && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_verify')) {
if ($type == '0' && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_verify')) {
// Try to autodetect which algo we used
if (! empty($hash[0]) && $hash[0] == '$') {
return password_verify($chain, $hash);
} elseif (dol_strlen($hash) == 32) {

View file

@ -33,7 +33,7 @@
*/
function dolStripPhpCode($str, $replacewith = '')
{
$str = str_replace('<?=', '<?php', $str);
$str = str_replace('<?=', '<?php echo', $str); // replace a bad practive
$newstr = '';
@ -77,9 +77,9 @@ function dolStripPhpCode($str, $replacewith = '')
*/
function dolKeepOnlyPhpCode($str)
{
$str = str_replace('<?=', '<?php', $str);
$str = str_replace('<?=', '<?php echo', $str);
$str = str_replace('<?php', '__LTINTPHP__', $str);
$str = str_replace('<?', '<?php', $str); // replace the short_open_tag. It is recommended to set this is Off in php.ini
$str = str_replace('<?', '<?php', $str); // replace the short_open_tag. It is recommended to set this to Off in php.ini
$str = str_replace('__LTINTPHP__', '<?php', $str);
$newstr = '';
@ -1354,7 +1354,9 @@ function getImageFromHtmlContent($htmlContent, $imageNumber = 1)
}
// Load HTML content into object
$dom->loadHTML($htmlContent);
// We add the @ to avoid verbose warnings logsin the error.log file. For example:
// "PHP message: PHP Warning: DOMDocument::loadHTML(): Tag section invalid in Entity, line: ...", etc.
@$dom->loadHTML($htmlContent);
// Re-enable HTML load errors
libxml_clear_errors();

View file

@ -164,6 +164,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
$shortlangcode = substr($objectpage->lang, 0, 2); // en_US or en-US -> en
}
if (empty($shortlangcode)) {
// Take the language of website
$shortlangcode = substr($object->lang, 0, 2); // en_US or en-US -> en
}
@ -186,7 +187,8 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
if (getDolGlobalString('WEBSITE_FORCE_DOCTYPE_HTML5')) {
$tplcontent .= "<!DOCTYPE html>\n";
}
$tplcontent .= '<html'.($shortlangcode ? ' lang="'.$shortlangcode.'"' : '').'>'."\n";
// If a language was forced on page, we use it, else we use the lang of visitor else the lang of web site
$tplcontent .= '<html'.($objectpage->lang ? ' lang="'.substr($objectpage->lang, 0, 2).'"' : '<?php echo $weblangs->shortlang ? \' lang="\'.$weblangs->shortlang.\'"\' : \'\' ?>').'>'."\n";
$tplcontent .= '<head>'."\n";
$tplcontent .= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n";
$tplcontent .= '<meta charset="utf-8">'."\n";
@ -200,7 +202,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
$tplcontent .= '<meta name="dolibarr:pageid" content="'.dol_string_nohtmltag((string) $objectpage->id).'" />'."\n";
// Add favicon
if ($objectpage->id == $object->fk_default_home) {
if (in_array($objectpage->type_container, array('page', 'blogpost'))) {
$tplcontent .= '<link rel="icon" type="image/png" href="/favicon.png" />'."\n";
}

View file

@ -731,9 +731,9 @@ function print_end_menu_array()
* @param int<0,1> $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all). If value come being '', we change it to value in session and 'none' if not defined in session.
* @param ?array<string,string> $moredata An array with more data to output
* @param ?array{searchform?:string,bookmarks?:string} $moredata An array with more data to output
* @param int<0,1> $type_user 0=Menu for backoffice, 1=Menu for front office
* @return int Nb of menu entries
* @return int<0,max> Nb of menu entries
*/
function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null, $type_user = 0)
{
@ -1275,7 +1275,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
$langs->load("commercial");
$newmenu->add("/societe/list.php?type=p&amp;leftmenu=prospects", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects', 5);
$newmenu->add("/societe/card.php?leftmenu=prospects&amp;action=create&amp;type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer'));
$newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer'));
}
// Customers/Prospects
@ -1283,7 +1283,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
$langs->load("commercial");
$newmenu->add("/societe/list.php?type=c&amp;leftmenu=customers", $langs->trans("Customers"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'customers', 10);
$newmenu->add("/societe/card.php?leftmenu=customers&amp;action=create&amp;type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer'));
$newmenu->add("/societe/card.php?leftmenu=customers&action=create&type=c", $langs->trans("MenuNewCustomer"), 3, $user->hasRight('societe', 'creer'));
}
// Suppliers
@ -1291,7 +1291,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
$langs->load("suppliers");
$newmenu->add("/societe/list.php?type=f&amp;leftmenu=suppliers", $langs->trans("Suppliers"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers', 15);
$newmenu->add("/societe/card.php?leftmenu=suppliers&amp;action=create&amp;type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')));
$newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')));
}
// Categories
@ -1317,7 +1317,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
// Contacts
$newmenu->add("/societe/index.php?leftmenu=thirdparties", (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")), 0, $user->hasRight('societe', 'contact', 'lire'), '', $mainmenu, 'contacts', 0, '', '', '', img_picto('', 'contact', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/contact/card.php?leftmenu=contacts&amp;action=create", (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer'));
$newmenu->add("/contact/card.php?leftmenu=contacts&action=create", (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->hasRight('societe', 'contact', 'creer'));
$newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->hasRight('societe', 'contact', 'lire'));
if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) {
$newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'contact', 'lire'));
@ -1514,7 +1514,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
if (isModEnabled('societe') && isModEnabled('supplier_invoice') && !getDolGlobalString('SUPPLIER_INVOICE_MENU_DISABLED')) {
$langs->load("bills");
$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&amp;action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create');
$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list');
if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
@ -1558,7 +1558,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
$langs->load("donations");
$newmenu->add("/don/index.php?leftmenu=donations&amp;mainmenu=billing", $langs->trans("Donations"), 0, $user->hasRight('don', 'lire'), '', $mainmenu, 'donations', 0, '', '', '', img_picto('', 'donation', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "donations") {
$newmenu->add("/don/card.php?leftmenu=donations&amp;action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer'));
$newmenu->add("/don/card.php?leftmenu=donations&action=create", $langs->trans("NewDonation"), 1, $user->hasRight('don', 'creer'));
$newmenu->add("/don/list.php?leftmenu=donations", $langs->trans("List"), 1, $user->hasRight('don', 'lire'));
$newmenu->add("/don/paiement/list.php?leftmenu=donations", $langs->trans("Payments"), 1, $user->hasRight('don', 'lire'));
$newmenu->add("/don/stats/index.php", $langs->trans("Statistics"), 1, $user->hasRight('don', 'lire'));
@ -2000,12 +2000,12 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
// Assets
if (isModEnabled('asset')) {
$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/asset/card.php?leftmenu=asset&amp;action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write'));
$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read'));
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write'));
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read'));
$newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model');
if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) {
$newmenu->add("/asset/model/card.php?leftmenu=asset_model&amp;action=create", $langs->trans("MenuNewAssetModel"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write')));
$newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write')));
$newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read')));
}
}
@ -2113,8 +2113,8 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
// Products
if (isModEnabled('product')) {
$newmenu->add("/product/index.php?leftmenu=product", $langs->trans("Products"), 0, $user->hasRight('product', 'read'), '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=product&amp;action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer'));
$newmenu->add("/product/list.php?leftmenu=product&amp;type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read'));
$newmenu->add("/product/card.php?leftmenu=product&action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer'));
$newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read'));
if (isModEnabled('stock')) {
$newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'));
}
@ -2141,8 +2141,8 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
// Services
if (isModEnabled('service')) {
$newmenu->add("/product/index.php?leftmenu=service", $langs->trans("Services"), 0, $user->hasRight('service', 'read'), '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer'));
$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read'));
$newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer'));
$newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read'));
if (isModEnabled('stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, $user->hasRight('service', 'read') && $user->hasRight('stock', 'lire'));
@ -2222,7 +2222,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
// Receptions
if (isModEnabled('reception')) {
$langs->load("receptions");
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth", style="text-align: right;"'));
$newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer'));
$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
@ -2259,7 +2259,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$langs->load("mrp");
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom', 0, '', '', '', img_picto('', 'bom', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom');
$newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->hasRight('bom', 'write'), '', $mainmenu, 'bom');
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->hasRight('bom', 'read'), '', $mainmenu, 'bom');
}
@ -2267,7 +2267,7 @@ function get_left_menu_mrp($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$langs->load("mrp");
$newmenu->add("", $langs->trans("MenuMRP"), 0, $user->hasRight('mrp', 'read'), '', $mainmenu, 'mrp', 0, '', '', '', img_picto('', 'mrp', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/mrp/mo_card.php?leftmenu=mo&amp;action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, '');
$newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->hasRight('mrp', 'write'), '', $mainmenu, '');
$newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->hasRight('mrp', 'read'), '', $mainmenu, '');
}
}
@ -2485,7 +2485,7 @@ function get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu
$titlenew .= ' | '.$langs->trans("NewSMSing");
}
$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $titleindex, 0, $user->hasRight('mailing', 'lire'), '', $mainmenu, 'mailing', 0, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&amp;action=create", $titlenew, 1, $user->hasRight('mailing', 'creer'));
$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $titlenew, 1, $user->hasRight('mailing', 'creer'));
$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $titlelist, 1, $user->hasRight('mailing', 'lire'));
}
@ -2525,16 +2525,16 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
// Load translation files required by the page
$langs->loadLangs(array("members", "compta"));
$newmenu->add("/adherents/index.php?leftmenu=members&amp;mainmenu=members", $langs->trans("Members"), 0, $user->hasRight('adherent', 'read'), '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'member', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/adherents/card.php?leftmenu=members&amp;action=create", $langs->trans("NewMember"), 1, $user->hasRight('adherent', 'write'));
$newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Members"), 0, $user->hasRight('adherent', 'read'), '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'member', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/adherents/card.php?leftmenu=members&action=create", $langs->trans("NewMember"), 1, $user->hasRight('adherent', 'write'));
$newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1", $langs->trans("MenuMembersValidated"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=waitingsubscription", $langs->trans("WaitingSubscription"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=-2", $langs->trans("MenuMembersExcluded"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=waitingsubscription", $langs->trans("WaitingSubscription"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&statut=-2", $langs->trans("MenuMembersExcluded"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export'));
@ -2554,7 +2554,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
// Type
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members", $langs->trans("MembersTypes"), 0, $user->hasRight('adherent', 'configurer'), '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members&amp;action=create", $langs->trans("New"), 1, $user->hasRight('adherent', 'configurer'));
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members&action=create", $langs->trans("New"), 1, $user->hasRight('adherent', 'configurer'));
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'configurer'));
}
}

View file

@ -148,9 +148,9 @@ class MenuManager
* Show menu.
* Menu defined in sql tables were stored into $this->tabMenu BEFORE this is called.
*
* @param string $mode 'top', 'topnb', 'left', 'leftdropdown', 'jmobile' (used to get full xml ul/li menu)
* @param ?array<string,mixed> $moredata An array with more data to output
* @return int 0 or nb of top menu entries if $mode = 'topnb'
* @param 'top'|'topnb'|'left'|'leftdropdown'|'jmobile' $mode 'top', 'topnb', 'left', 'leftdropdown', 'jmobile' (used to get full xml ul/li menu)
* @param ?array<string,string> $moredata An array with more data to output
* @return int<0,max> 0 or nb of top menu entries if $mode = 'topnb'
*/
public function showmenu($mode, $moredata = null)
{

View file

@ -1876,34 +1876,39 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$val = '';
}
$sql = "SELECT count(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."const";
$sql .= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'";
$sql .= " AND entity = ".((int) $entity);
if (!empty($name)) {
$sql = "SELECT count(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."const";
$sql .= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'";
$sql .= " AND entity = ".((int) $entity);
$result = $this->db->query($sql);
if ($result) {
$row = $this->db->fetch_row($result);
$result = $this->db->query($sql);
if ($result) {
$row = $this->db->fetch_row($result);
if ($row[0] == 0) { // If not found
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note,visible,entity)";
$sql .= " VALUES (";
$sql .= $this->db->encrypt($name);
$sql .= ",'".$this->db->escape($type)."'";
$sql .= ",".(($val != '') ? $this->db->encrypt($val) : "''");
$sql .= ",".($note ? "'".$this->db->escape($note)."'" : "null");
$sql .= ",'".$this->db->escape($visible)."'";
$sql .= ",".$entity;
$sql .= ")";
if ($row[0] == 0) { // If not found
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name, type, value, note, visible, entity)";
$sql .= " VALUES (";
$sql .= $this->db->encrypt($name);
$sql .= ", '".$this->db->escape($type)."'";
$sql .= ", ".(($val != '') ? $this->db->encrypt($val) : "''");
$sql .= ", ".($note ? "'".$this->db->escape($note)."'" : "null");
$sql .= ", '".$this->db->escape($visible)."'";
$sql .= ", ".((int) $entity);
$sql .= ")";
if (!$this->db->query($sql)) {
$err++;
if (!$this->db->query($sql)) {
$err++;
} else {
// Set also the variable in running environment
$conf->global->$name = $val;
}
} else {
dol_syslog(__METHOD__." constant '".$name."' already exists", LOG_DEBUG);
}
} else {
dol_syslog(__METHOD__." constant '".$name."' already exists", LOG_DEBUG);
$err++;
}
} else {
$err++;
}
}
@ -2748,8 +2753,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$tmpfieldsofline = explode(';', $line);
$modulekey = strtolower($tmpfieldsofline[0]);
$conf->cache['noncompliantmodules'][$modulekey]['name'] = $tmpfieldsofline[0];
$conf->cache['noncompliantmodules'][$modulekey]['id'] = $tmpfieldsofline[1];
$conf->cache['noncompliantmodules'][$modulekey]['signature'] = $tmpfieldsofline[2];
$conf->cache['noncompliantmodules'][$modulekey]['id'] = (isset($tmpfieldsofline[1]) ? $tmpfieldsofline[1] : '');
$conf->cache['noncompliantmodules'][$modulekey]['signature'] = (isset($tmpfieldsofline[2]) ? $tmpfieldsofline[2] : '');
$conf->cache['noncompliantmodules'][$modulekey]['message'] = $langs->trans(empty($tmpfieldsofline[3]) ? 'WarningModuleAffiliatedToAReportedCompany' : $tmpfieldsofline[3]);
if (!empty($tmpfieldsofline[4])) {
$message2 = $langs->trans("WarningModuleAffiliatedToAPiratPlatform", '{s}');

View file

@ -238,7 +238,11 @@ class pdf_standard_asset extends ModelePDFAsset
// Set path to the background PDF File
if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
$logodir = $conf->mycompany->dir_output;
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
$logodir = $conf->mycompany->multidir_output[$object->entity];
}
$pagecount = $pdf->setSourceFile($logodir .'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
$tplidx = $pdf->importPage(1);
}

View file

@ -1,8 +1,7 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -39,6 +38,9 @@ class mod_asset_standard extends ModeleNumRefAsset
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
/**
* @var string prefix
*/
public $prefix = 'ASSET';
/**

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -37,6 +37,9 @@ class mod_bom_standard extends ModeleNumRefBoms
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
/**
* @var string prefix
*/
public $prefix = 'BOM';
/**

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