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

This commit is contained in:
Laurent Destailleur 2025-12-17 14:23:34 +01:00
commit 5b66035f23
59 changed files with 386 additions and 171 deletions

View file

@ -213,6 +213,7 @@ The following changes may create regressions for some external modules, but were
* $conf use into "computed formulae" of etrafields is now deprecated (not yet forbidden). You can replace use of $conf->currency by the new method getCurrency() and $conf->global->xxx by getDolGlobalString('xxx').
* $user->rights->module->perms is also deprecated. You can use $user->hasRight() instead.
* The API endpoint /proposals/{id}/contact/{contactid}/{type}/{source} is now {id}/contact/{contactid}/{type} to match same behaviour than order and invoices.
* The API endpoint /interventions/{id}/reopen hase been removed in favor of /interventions/{id}/settodraft
***** ChangeLog for 22.0.3 compared to 22.0.2 *****

View file

@ -12,12 +12,12 @@ Security report are valid only on any current stable version for the last 5 majo
To report a vulnerability, for a private report, you can:
- Send your report on Vulnerability Disclosure Program (VDP): Link will be updated soon (recommended for everybody)
- Send your report as an issue on https://github.com/Dolibarr/dolibarr/issues or on GitHub Vulnerability Disclosure Program tool (VDP): https://github.com/Dolibarr/dolibarr/security/advisories (recommended for everybody)
<!--
- Send your report on Vulnerability Disclosure Program (VDP) [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
- Or if you have permissions, use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new)
-->
- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary (in such a case, the issue may be created by the developer that will fix the vulnerability or the Release Manager).
## Hunting vulnerabilities on Dolibarr
@ -114,3 +114,8 @@ Scope is the web application (backoffice) and the APIs.
* Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC)
* Physical or social engineering attempts or issues that require physical access to a victim’s computer/device
* Vulnerabilities of type XSS exploited by using javascript into a website page of the website module or by using php code into a website page (being able to set javascript or php code is the expected behaviour in the website module), except if the user does not have the permission to edit page or php code.
## Be informed of a new vulnerability
You can get more information on how to be informed on a new vulnerability on the page https://wiki.dolibarr.org/index.php/Security_information

View file

@ -973,6 +973,18 @@ if ($fh) {
}
fwrite($fh, '</image>'."\n");
// Loop on arrayofalert to remove alerts that are on develop
foreach ($arrayofalerts as $tmpkey => $alert) {
$arrayuniquetmp = array_unique($alert['branch']);
if (count($arrayuniquetmp) == 1 && in_array('develop', $arrayuniquetmp)) {
// The alert has been fixed into develop only, so we discard it for RSS alert
print 'The alert with key '.$tmpkey.' is fixed into branch develop only, so we discard it for RSS'."\n";
unset($arrayofalerts[$tmpkey]);
}
}
// Loop on array of alerts on stable branches
foreach ($arrayofalerts as $alert) {
$alert['url_commit'] = 'https://github.com/Dolibarr/dolibarr/commit/'.$alert['commitid'];

View file

@ -1170,11 +1170,12 @@ if ($mode == 'common' || $mode == 'commonkanban') {
}
$urltogo = $_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&token='.newToken().'&module_position='.$module_position.'&action=set&token='.newToken().'&value='.$modName.'&mode='.$mode.$param;
$popupwidth = 500;
$popupWidth = 500;
$popupHeight = 300;
$codeenabledisable .= '<!-- Message to show: '.$warningmessage.' -->'."\n";
$codeenabledisable .= '<a class="reposition" id="idqualified'.$objMod->numero.'" data-alreadyclicked="0" href="'.$urltogo.'"';
if ($warningmessage) {
$codeenabledisable .= ' onclick="return confirmDolibarr(\''.dol_escape_js($warningmessage).'\', \'idqualified'.$objMod->numero.'\', '.$popupwidth.', '.$disableCancel.');"';
$codeenabledisable .= ' onclick="return confirmDolibarr(\''.dol_escape_js($warningmessage).'\', \'idqualified'.$objMod->numero.'\', '.$popupWidth.', '.$popupHeight.','.$disableCancel.');"';
}
$codeenabledisable .= '>';
$codeenabledisable .= img_picto($langs->trans("Disabled"), 'switch_off');

View file

@ -926,6 +926,8 @@ class ExternalModules
$result = file_put_contents($cache_file, $yaml);
if ($result === false) {
$this->error = 'Failed to create cache file: ' . $cache_file;
} else {
dolChmod($cache_file);
}
}
} else {

View file

@ -145,7 +145,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="page_y" value="">';
print load_fiche_titre($langs->trans("AccountantingProvider"), '', 'accounting', 0, '', '', '', '');
print load_fiche_titre($langs->trans("AccountingProvider"), '', 'accounting', 0, '', '', '', '');
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";

View file

@ -324,6 +324,22 @@ class Documents extends DolibarrApi
$templateused = $doctemplate ? $doctemplate : $tmpobject->model_pdf;
$result = $tmpobject->generateDocument($templateused, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) {
throw new RestException(500, 'Error generating document missing doctemplate parameter');
}
} elseif ($modulepart == 'stock' || $modulepart == 'entrepot') {
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
$tmpobject = new Entrepot($this->db);
$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
if (!$result) {
throw new RestException(404, 'Warehouse not found');
}
$templateused = $doctemplate ? $doctemplate : $tmpobject->model_pdf;
$result = $tmpobject->generateDocument($templateused, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) {
throw new RestException(500, 'Error generating document missing doctemplate parameter');
}
@ -709,6 +725,19 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Contact not found');
}
$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/contact/" . get_exdir(0, 0, 0, 1, $object, 'contact');
} elseif ($modulepart == 'stock') {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
throw new RestException(403);
}
$object = new Entrepot($this->db);
$result = $object->fetch($id, $ref);
if (!$result) {
throw new RestException(404, 'Warehouse not found');
}
$upload_dir = $conf->stock->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'stock');
} else {
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
}

View file

@ -401,6 +401,7 @@ if (GETPOST('action') == 'export' && $user->hasRight('blockedlog', 'read')) { /
// Now add a signature to check integrity at end of file
file_put_contents($tmpfile, 'END - sha256='.$sha256.' - hmac_sha256='.$hmacsha256, FILE_APPEND);
dolChmod($tmpfile);
setEventMessages($langs->trans("FileGenerated"), null);
} else {

View file

@ -354,6 +354,7 @@ if (GETPOST('downloadcsv', 'alpha')) {
// Now add a signature to check integrity at end of file
file_put_contents($tmpfile, 'END - md5='.$md5value, FILE_APPEND);
dolChmod($tmpfile);
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");

View file

@ -431,7 +431,7 @@ class Categorie extends CommonObject
'cat_fk' => (empty($this->MAP_CAT_FK[$mapCode]) ? $mapCode : $this->MAP_CAT_FK[$mapCode]),
'cat_table' => (empty($this->MAP_CAT_TABLE[$mapCode]) ? $mapCode : $this->MAP_CAT_TABLE[$mapCode]),
'obj_class' => (empty($this->MAP_OBJ_CLASS[$mapCode]) ? $mapCode : $this->MAP_OBJ_CLASS[$mapCode]),
'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode])
'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode]),
);
}
@ -469,7 +469,7 @@ class Categorie extends CommonObject
}
$sql = "SELECT rowid, fk_parent, entity, label, description, color, position, fk_soc, visible, type, ref_ext";
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif";
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif, import_key";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie";
if ($id) {
$sql .= " WHERE rowid = ".((int) $id);
@ -502,8 +502,9 @@ class Categorie extends CommonObject
$this->date_modification = $this->db->jdate($res['tms']);
$this->user_creation_id = (int) $res['fk_user_creat'];
$this->user_modification_id = (int) $res['fk_user_modif'];
$this->import_key = $res['import_key'];
// Retrieve all extrafield
// Retrieve all extrafields
// fetch optionals attributes and labels
$this->fetch_optionals();

View file

@ -1286,7 +1286,7 @@ if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_
$formproduct = new FormProduct($db);
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('Warehouse');
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse');
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle, 0, 0, array(), 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= '</div>';
}
$parameters = array();

View file

@ -177,7 +177,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
//var_dump($key.' '.$value.' '.$object->fields[$key]['type'].' '.$object->fields[$key]['notnull']);
$object->$key = $value;
if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && isset($val['default']) && $val['default'] == '(PROV)') {
if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && isset($val['default']) && $val['default'] === '(PROV)') {
$object->$key = '(PROV)';
}
if ($key == 'pass_crypted') {

View file

@ -85,20 +85,27 @@ if ($action === "updatestatusprospect" && $permisstiontoupdate) {
$prospectstatic->client = 2;
$prospectstatic->loadCacheOfProspStatus();
$response = '';
$response = "";
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
$sql .= "fk_stcomm = ".((int) $idstatus);
$sql .= " WHERE rowid = ".((int) $idprospect);
// Load thirdparty
$prospect = new Societe($db);
$result = $prospect->fetch($idprospect);
$resql = $db->query($sql);
if ($result >= 0) {
// Apply new status
$prospect->stcomm_id = $idstatus;
if (!$resql) {
dol_print_error($db);
// Update using business logic (fires COMPANY_MODIFY)
$updateResult = $prospect->update($prospect->id, $user);
if ($updateResult >= 0) {
$response = img_action('', $prospectstatic->cacheprospectstatus[$idstatus]['code'], $prospectstatic->cacheprospectstatus[$idstatus]['picto'], 'class="inline-block valignmiddle paddingright pictoprospectstatus"');
} else {
dol_syslog('Failed to update prospect via update() method', LOG_ERR);
dol_print_error($db);
}
} else {
$num = $db->affected_rows($resql);
$response = img_action('', $prospectstatic->cacheprospectstatus[$idstatus]['code'], $prospectstatic->cacheprospectstatus[$idstatus]['picto'], 'class="inline-block valignmiddle paddingright pictoprospectstatus"');
dol_print_error($db);
}
echo json_encode(array('img' => $response));
}

View file

@ -138,10 +138,12 @@ if ($action == "importSignature") {
}
if (!$error) {
$return = file_put_contents($upload_dir . $filename, $data);
if ($return == false) {
$return = file_put_contents($upload_dir.$filename, $data);
if ($return === false) {
$error++;
$response = 'Error file_put_content: failed to create signature file.';
} else {
dolChmod($upload_dir.$filename);
}
}
@ -353,9 +355,11 @@ if ($action == "importSignature") {
if (!$error) {
$return = file_put_contents($upload_dir . $filename, $data);
if ($return == false) {
if ($return === false) {
$error++;
$response = 'Error file_put_content: failed to create signature file.';
} else {
dolChmod($upload_dir.$filename);
}
}
@ -490,9 +494,11 @@ if ($action == "importSignature") {
if (!$error) {
$return = file_put_contents($upload_dir . $filename, $data);
if ($return == false) {
if ($return === false) {
$error++;
$response = 'Error file_put_content: failed to create signature file.';
} else {
dolChmod($upload_dir.$filename);
}
}
@ -637,9 +643,11 @@ if ($action == "importSignature") {
if (!$error) {
$return = file_put_contents($upload_dir . $filename, $data);
if ($return == false) {
if ($return === false) {
$error++;
$response = 'Error file_put_content: failed to create signature file.';
} else {
dolChmod($upload_dir.$filename);
}
}
@ -834,9 +842,11 @@ if ($action == "importSignature") {
if (!$error) {
$return = file_put_contents($upload_dir . $filename, $data);
if ($return == false) {
if ($return === false) {
$error++;
$response = 'Error file_put_content: failed to create signature file.';
} else {
dolChmod($upload_dir.$filename);
}
}

View file

@ -34,7 +34,7 @@ class box_activity extends ModeleBoxes
public $boxcode = "activity";
public $boximg = "object_bill";
public $boxlabel = 'BoxGlobalActivity';
public $depends = array("facture");
public $depends = array("invoice|propal|order");
public $enabled = 1;

View file

@ -36,7 +36,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
public $boxcode = "customersoutstandingbillreached";
public $boximg = "object_company";
public $boxlabel = "BoxCustomersOutstandingBillReached";
public $depends = array("facture", "societe");
public $depends = array("invoice", "societe");
public $enabled = 1;

View file

@ -34,7 +34,7 @@ class box_factures extends ModeleBoxes
public $boxcode = "lastcustomerbills";
public $boximg = "object_bill";
public $boxlabel = "BoxLastCustomerBills";
public $depends = array("facture");
public $depends = array("invoice");
/**
* Constructor

View file

@ -35,7 +35,7 @@ class box_factures_fourn extends ModeleBoxes
public $boxcode = "lastsupplierbills";
public $boximg = "object_bill";
public $boxlabel = "BoxLastSupplierBills";
public $depends = array("facture", "fournisseur");
public $depends = array("invoice", "fournisseur");
/**
* Constructor

View file

@ -34,7 +34,7 @@ class box_factures_fourn_imp extends ModeleBoxes
public $boxcode = "oldestunpaidsupplierbills";
public $boximg = "object_bill";
public $boxlabel = "BoxOldestUnpaidSupplierBills";
public $depends = array("facture", "fournisseur");
public $depends = array("invoice", "fournisseur");
/**
* Constructor

View file

@ -38,7 +38,7 @@ class box_factures_imp extends ModeleBoxes
public $boxcode = "oldestunpaidcustomerbills";
public $boximg = "object_bill";
public $boxlabel = "BoxOldestUnpaidCustomerBills";
public $depends = array("facture");
public $depends = array("invoice");
/**
* Constructor

View file

@ -35,7 +35,7 @@ class box_ficheinter extends ModeleBoxes
public $boxcode = "ficheinter";
public $boximg = "object_intervention";
public $boxlabel = "BoxFicheInter";
public $depends = array("ficheinter"); // conf->contrat->enabled
public $depends = array("intervention");
/**
* Constructor

View file

@ -33,7 +33,7 @@ class box_graph_product_distribution extends ModeleBoxes
public $boxcode = "productdistribution";
public $boximg = "object_product";
public $boxlabel = "BoxProductDistribution";
public $depends = array("product|service", "facture|propal|commande");
public $depends = array("product|service", "invoice|propal|order");
public $widgettype = 'graph';

View file

@ -37,7 +37,7 @@ class box_produits extends ModeleBoxes
public $boxcode = "lastproducts";
public $boximg = "object_product";
public $boxlabel = "BoxLastProducts";
public $depends = array("produit");
public $depends = array("product");
/**
* Constructor

View file

@ -39,7 +39,7 @@ class box_produits_alerte_stock extends ModeleBoxes
public $boxcode = "productsalertstock";
public $boximg = "object_product";
public $boxlabel = "BoxProductsAlertStock";
public $depends = array("produit");
public $depends = array("product");
/**
* Constructor
@ -49,7 +49,7 @@ class box_produits_alerte_stock extends ModeleBoxes
*/
public function __construct($db, $param = '')
{
global $conf, $user;
global $user;
$this->db = $db;
@ -69,7 +69,7 @@ class box_produits_alerte_stock extends ModeleBoxes
*/
public function loadBox($max = 5)
{
global $user, $langs, $conf, $hookmanager;
global $user, $langs, $hookmanager;
$this->max = $max;

View file

@ -37,7 +37,7 @@ class box_propales extends ModeleBoxes
public $boxcode = "lastpropals";
public $boximg = "object_propal";
public $boxlabel = "BoxLastProposals";
public $depends = array("propal"); // conf->propal->enabled
public $depends = array("propal");
/**
* Constructor

View file

@ -36,7 +36,7 @@ class box_services_contracts extends ModeleBoxes
public $boxcode = "lastproductsincontract";
public $boximg = "object_product";
public $boxlabel = "BoxLastProductsInContract";
public $depends = array("service", "contrat");
public $depends = array("service", "contract");
/**
* Constructor

View file

@ -33,7 +33,7 @@ class box_services_expired extends ModeleBoxes
public $boxcode = "expiredservices"; // id of box
public $boximg = "object_contract";
public $boxlabel = "BoxOldestExpiredServices";
public $depends = array("contrat"); // conf->propal->enabled
public $depends = array("contract");
/**
* Constructor

View file

@ -38,7 +38,7 @@ class box_task extends ModeleBoxes
* @var string
*/
public $boxlabel;
public $depends = array("projet");
public $depends = array("project");
public $enabled = 1;
@ -50,7 +50,7 @@ class box_task extends ModeleBoxes
*/
public function __construct($db, $param = '')
{
global $conf, $user, $langs;
global $user, $langs;
// Load translation files required by the page
$langs->loadLangs(array('boxes', 'projects'));

View file

@ -113,6 +113,7 @@ class DiasporaHandler
if ($cacheDir) {
dol_mkdir($cacheDir);
file_put_contents($cacheFile, $data);
dolChmod($cacheFile);
}
} else {
$this->error = 'Error retrieving URL ' . $urlAPI;

View file

@ -94,7 +94,7 @@ class PricecyField extends CommonField
$out = self::$form->inputType('text', $htmlName, (string) $value, $htmlName, $moreCss, $moreAttrib . $autoFocus);
$out .= self::$form->selectCurrency($currency, $htmlName . 'currency_id');
return $out;
return '<span class="form-select-price-currency-container">'.$out.'</span>';
}
/**

View file

@ -456,6 +456,8 @@ class FileUpload
// Non-multipart uploads (PUT method support)
file_put_contents($file_path, fopen('php://input', 'r'), $append_file ? FILE_APPEND : 0);
}
dolChmod($file_path);
$file_size = dol_filesize($file_path);
if ($file_size === $file->size) {
$file->url = $this->options['upload_url'].urlencode($file->name);

View file

@ -2246,7 +2246,9 @@ class Lessc
$this->importDir = $oldImport;
if ($outFname !== null) {
return file_put_contents($outFname, $out);
$res = file_put_contents($outFname, $out);
dolChmod($outFname);
return $res;
}
return $out;

View file

@ -121,6 +121,7 @@ class MastodonHandler
if ($cacheDir) {
dol_mkdir($cacheDir);
file_put_contents($cacheFile, $data);
dolChmod($cacheFile);
}
} else {
$this->error = 'Error retrieving URL ' . $urlAPI;

View file

@ -170,6 +170,7 @@ class RedditHandler
if ($cacheDir) {
dol_mkdir($cacheDir);
file_put_contents($cacheFile, $data);
dolChmod($cacheFile);
}
} else {
$this->error = 'Error retrieving URL ' . $urlAPI;

View file

@ -570,14 +570,14 @@ function cleanSerialize(expr) {
* Input: msg
* Input: id
* Input: popupWidth
* Input: popupHeight
* Input: disableCancelButton
* Licence: GPL
* See also document_preview() that also maje a dialogforpopup.dialog().
* See also newpopup that use window.open.
*/
function confirmDolibarr(msg, id, popupWidth = 400, disableCancelButton = 0) {
function confirmDolibarr(msg, id, popupWidth = 400, popupHeight = 300, disableCancelButton = 0) {
let alink = document.getElementById(id);
let popupHeight = 200;
let title = '<?php echo dol_escape_js($langs->trans("Note")); ?>';
if (alink.getAttribute("data-alreadyclicked") === "1") {

View file

@ -3565,6 +3565,17 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (isModEnabled('stock')) {
$original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file;
}
} elseif ($modulepart == 'entrepot') {
// Wrapping for stock warehouse
if (empty($entity) || empty($conf->stock->multidir_output[$entity])) {
return array('accessallowed' => 0, 'error' => 'Value entity must be provided');
}
if (($fuser->hasRight('stock', $lire) || $fuser->hasRight('stock', 'movement', $lire) || $fuser->hasRight('stock', 'mouvement', $lire)) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
if (isModEnabled('stock')) {
$original_file = $conf->stock->multidir_output[$entity].'/'.$original_file;
}
} elseif ($modulepart == 'contract' && !empty($conf->contract->multidir_output[$entity])) {
// Wrapping pour les contrats
if ($fuser->hasRight('contrat', $lire) || preg_match('/^specimen/i', $original_file)) {
@ -3815,8 +3826,7 @@ function dol_filecache($directory, $filename, $object)
$cachefile = $directory.$filename;
file_put_contents($cachefile, serialize($object), LOCK_EX);
dolChmod($cachefile, '0644');
dolChmod($cachefile);
}
/**

View file

@ -8928,7 +8928,7 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
/**
* Clean a string to keep only desirable HTML tags.
* Complementary of dol_string_onlythesehtmlattributes().
* WARNING: This also clean HTML comments (because they can be used to obfuscate tag name).
* WARNING: This also clean HTML comments (because they can be used to obfuscate tag names).
*
* @param string $stringtoclean String to clean
* @param int $cleanalsosomestyles Remove absolute/fixed positioning from inline styles
@ -8936,7 +8936,7 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
* @param int $cleanalsojavascript Remove also occurrence of 'javascript:'.
* @param int $allowiframe Allow iframe tags.
* @param string[] $allowed_tags List of allowed tags to replace the default list
* @param int $allowlink Allow "link" tags (for head html section)
* @param int $allowlink Allow "link" and "meta" tags (for head html section when using GETPOST with mode 'restricthtmlallowlinkscript')
* @param int $allowscript Allow "script" tags (for head html section when using GETPOST with mode 'restricthtmlallowlinkscript')
* @param int $allowstyle Allow "style" tags (for head html section when using GETPOST with mode 'restricthtmlallowlinkscript')
* @param int $allowphp Allow "php" tags (Deprecated. Should never be used. If you can add php, you can also print in the php the code to output the other non allowed tags)
@ -8948,9 +8948,9 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1,
{
if (empty($allowed_tags)) {
$allowed_tags = array(
// HTML 4
"html",
"head",
"meta",
"body",
"article",
"a",
@ -8994,12 +8994,14 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1,
"h4",
"h5",
"h6",
"header",
// HTML 5
"footer",
"nav",
"section",
"header",
"menu",
"menuitem" // html5 tags
"menuitem",
"nav",
"section"
);
}
$allowed_tags[] = "comment"; // this tags is added to manage comment <!--...--> that are replaced into <comment>...</comment>
@ -9012,6 +9014,9 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1,
if (!in_array('link', $allowed_tags)) {
$allowed_tags[] = "link";
}
if (!in_array('meta', $allowed_tags)) {
$allowed_tags[] = "meta";
}
}
if ($allowscript) {
if (!in_array('script', $allowed_tags)) {
@ -9088,6 +9093,7 @@ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes
{
if (is_null($allowed_attributes)) {
$allowed_attributes = array(
// HTML 4
"allow",
"allowfullscreen",
"alt",
@ -9109,13 +9115,14 @@ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes
"title",
"type",
"width",
// HTML5
"header",
"footer",
"nav",
"section",
"header",
"menu",
"menuitem"
"menuitem",
"nav",
"section"
);
}
// Always add content and http-equiv for meta tags, required to force encoding and keep html content in utf8 by load/saveHTML functions.

View file

@ -156,6 +156,7 @@ function dol_setcache($memoryid, $data, $expire = 0, $filecache = 0, $replace =
$cachejson = dolEncrypt(json_encode($cachedata));
if (!dol_is_file($pathcache.'/'.$memoryid.'.cache') || $replace > 0) {
$result = file_put_contents($pathcache.'/'.$memoryid.'.cache', $cachejson);
dolChmod($pathcache.'/'.$memoryid.'.cache');
} else {
return 0;
}

View file

@ -846,12 +846,14 @@ function deletePropsAndPermsFromDoc($file, $objectname)
$search = '/' . preg_quote($start, '/') . '(.*?)' . preg_quote($end, '/') . '/s';
$new_contents = preg_replace($search, '', $str);
file_put_contents($file, $new_contents);
dolChmod($file);
//perms If Exist
$perms = "|*".strtolower($objectname)."*|";
$search_pattern_perms = '/' . preg_quote($perms, '/') . '.*?\n/';
$new_contents = preg_replace($search_pattern_perms, '', $new_contents);
file_put_contents($file, $new_contents);
dolChmod($file);
}
}
@ -1038,6 +1040,7 @@ function addObjectsToApiFile($srcfile, $file, $objects, $modulename)
$allContent = implode("", $content);
file_put_contents($file, $allContent);
dolChmod($file);
// Add methods for each object
$allContent = getFromFile($srcfile, '/* BEGIN MODULEBUILDER API MYOBJECT */', '/* END MODULEBUILDER API MYOBJECT */');
@ -1107,6 +1110,7 @@ function removeObjectFromApiFile($file, $objects, $objectname)
$allContent = implode("", $content);
file_put_contents($file, $allContent);
dolChmod($file);
// for delete methods of object
$begin = '/* BEGIN MODULEBUILDER API '.strtoupper($objectname).' */';

View file

@ -989,9 +989,14 @@ function checkPHPCode(&$phpfullcodestringold, &$phpfullcodestring)
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities
}
if (!getDolGlobalString('WEBSITE_PHP_ALLOW_WRITE')) { // If option is not on, we disallow functions to write files
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_decode", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "flock", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
}
if (getDolGlobalString('WEBSITE_PHP_DISALLOW_READ')) { // If option is not on, we disallow functions to read files
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_decode")); // more dolibarr functions
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("file", "fopen", "file_get_contents", "fgets", "fgetscsv", "fgetss", "fread"));
}
//$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include"));
$forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function

View file

@ -674,14 +674,14 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
<?php
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { ?>
$("input[name='np_marginRate']:first").blur(function(e) {
console.log("np_marginRate blur");
console.log("np_marginRate blur, call checkFreeLine");
return checkFreeLine(e, "np_marginRate");
});
<?php
}
if (getDolGlobalString('DISPLAY_MARK_RATES')) { ?>
$("input[name='np_markRate']:first").blur(function(e) {
console.log("np_markRate blur");
console.log("np_markRate blur, call checkFreeLine");
return checkFreeLine(e, "np_markRate");
});
<?php
@ -698,15 +698,13 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
if (rate.val() == '')
return true;
if (! $.isNumeric(rate.val().replace(',','.')))
{
if (! $.isNumeric(rate.val().replace(',','.'))) { // TODO Use price2numjs ?
alert('<?php echo dol_escape_js($langs->trans("rateMustBeNumeric")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
if (npRate == "np_markRate" && rate.val() >= 100)
{
if (npRate == "np_markRate" && rate.val() >= 100) { // TODO Use price2numjs ?
alert('<?php echo dol_escape_js($langs->trans("markRateShouldBeLesserThan100")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
@ -714,14 +712,15 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
}
var price = 0;
remisejs=price2numjs(remise.val());
remisejs = price2numjs(remise.val());
if (remisejs != 100) // If a discount not 100 or no discount
{
if (remisejs == '') remisejs=0;
if (remisejs != 100) { // If there is a discount that is not 100 or if no discount at all (most common case)
if (remisejs == '') {
remisejs=0;
}
bpjs=price2numjs(buying_price.val());
ratejs=price2numjs(rate.val());
bpjs = price2numjs(buying_price.val());
ratejs = price2numjs(rate.val());
if (npRate == "np_marginRate")
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
@ -729,7 +728,8 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formatted value
// $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formatted value
$("input[name='price_ht']:first").val(pricejs(price));
return true;
}

View file

@ -504,6 +504,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
?>
$("input[name='np_marginRate']:first").blur(function(e) {
console.log("np_marginRate blur, call checkFreeLine");
return checkFreeLine(e, "np_marginRate");
});
<?php
@ -511,6 +512,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
?>
$("input[name='np_markRate']:first").blur(function(e) {
console.log("np_markRate blur, call checkFreeLine");
return checkFreeLine(e, "np_markRate");
});
<?php
@ -528,15 +530,13 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
return true;
var ratejs = price2numjs(rate.val());
if (! $.isNumeric(ratejs))
{
if (! $.isNumeric(rate.val().replace(',','.'))) { // TODO Use price2numjs ?
alert('<?php echo dol_escape_js($langs->transnoentities("rateMustBeNumeric")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
return false;
}
if (npRate == "np_markRate" && rate.val() >= 100)
{
if (npRate == "np_markRate" && rate.val() >= 100) { // TODO Use price2numjs ?
alert('<?php echo dol_escape_js($langs->transnoentities("markRateShouldBeLesserThan100")); ?>');
e.stopPropagation();
setTimeout(function () { rate.focus() }, 50);
@ -546,7 +546,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
var price = 0;
remisejs = price2numjs(remise.val());
if (remisejs != 100) { // If a discount not 100 or no discount
if (remisejs != 100) { // If there is a discount that is not 100 or if no discount at all (most common case)
if (remisejs == '') {
remisejs = 0;
}
@ -559,7 +559,9 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) {
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formatted value
// $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formatted value
$("input[name='price_ht']:first").val(pricejs(price));
return true;
}

View file

@ -3903,6 +3903,7 @@ class EmailCollector extends CommonObject
$destination = dol_sanitizePathName($destination);
file_put_contents($destination, $data);
dolChmod($destination);
}
}
@ -4019,12 +4020,15 @@ class EmailCollector extends CommonObject
$quality = $tmparraysize['quality'];
file_put_contents($destdir.'/'.$filename, $content);
dolChmod($destdir.'/'.$filename);
if (image_format_supported($filename) == 1) {
// Create thumbs
vignette($destdir.'/'.$filename, $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
// Create mini thumbs for image (Ratio is near 16/9)
vignette($destdir.'/'.$filename, $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
}
addFileIntoDatabaseIndex($destdir, $filename);
}

View file

@ -190,6 +190,8 @@ function saveAttachment($path, $filename, $data)
$i++;
}
file_put_contents($filepath, $data);
dolChmod($filepath);
return $filepath;
}

View file

@ -2051,7 +2051,7 @@ if ($action == 'create' && $usercancreate) {
print '<!-- Case warehouse already known or product not a predefined product -->';
//ship from preselected location
$stock = + (isset($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0); // Convert to number
if ($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) {
if (($line->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) || $product->stockable_product == Product::DISABLED_STOCK) {
$deliverableQty = $quantityToBeDelivered;
} else {
$deliverableQty = min($quantityToBeDelivered, $stock);

View file

@ -474,43 +474,6 @@ class Interventions extends DolibarrApi
);
}
/**
* Reopen an intervention
*
* @since 22.0.0 Initial implementation
*
* @param int $id Intervention ID
*
* @url POST {id}/reopen
*
* @return Object
*
* @throws RestException
*/
public function reopen($id)
{
if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'creer')) {
throw new RestException(403, "Insufficiant rights");
}
$result = $this->fichinter->fetch($id);
if (!$result) {
throw new RestException(404, 'Intervention not found');
}
if (!DolibarrApi::_checkAccessToResource('fichinter', $this->fichinter->id)) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$result = $this->fichinter->setDraft(DolibarrApiAccess::$user);
if ($result == 0) {
throw new RestException(304, 'Error nothing done. May be object is already set as draft');
}
if ($result < 0) {
throw new RestException(500, 'Error when closing Intervention: '.$this->fichinter->error);
}
$this->fichinter->fetchObjectLinked();
return $this->_cleanObjectDatas($this->fichinter);
}
/**
* Validate an intervention
*
@ -651,27 +614,29 @@ class Interventions extends DolibarrApi
}
/**
* Sets an interventional as draft
* Sets an intervention as draft
*
* @param int $id interventional ID
* @since 23.0.0 Initial implementation
*
* @param int $id ID of intervention
*
* @return Object Object with cleaned properties
*
* @url POST {id}/settodraft
* @url POST {id}/settodraft
*
* @throws RestException 304
* @throws RestException 401
* @throws RestException 403
* @throws RestException 404
* @throws RestException 500 System error
*/
public function settodraft($id)
{
if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'creer')) {
throw new RestException(403);
throw new RestException(403, "Insufficiant rights");
}
$result = $this->fichinter->fetch($id);
if (!$result) {
throw new RestException(404, 'Interventional not found');
throw new RestException(404, 'Intervention not found');
}
if (!DolibarrApi::_checkAccessToResource('ficheinter', $this->fichinter->id)) {
@ -680,17 +645,13 @@ class Interventions extends DolibarrApi
$result = $this->fichinter->setDraft(DolibarrApiAccess::$user);
if ($result == 0) {
throw new RestException(304, 'Nothing done.');
throw new RestException(304, 'Nothing done. . May be object is already set as draft.');
}
if ($result < 0) {
throw new RestException(500, 'Error : '.$this->fichinter->error);
}
$result = $this->fichinter->fetch($id);
if (!$result) {
throw new RestException(404, 'Interventional not found');
throw new RestException(500, 'Error when closing intervention: '.$this->fichinter->error);
}
$this->fichinter->fetchObjectLinked();
return $this->_cleanObjectDatas($this->fichinter);
}

View file

@ -1336,7 +1336,7 @@ CompanyFundationDesc=Edit the information of your company/organization. Click on
MoreNetworksAvailableWithModule=More social networks may be available by enabling the module "Social networks".
Subcontractors=Subcontractors
SubcontractorsDesc=If the management of your application is subcontracted to external service providers (an accountant/bookkeeper and/or an IT service provider), you can enter here their information so it won't be lost in case of a substition of the administrator.
AccountantingProvider=Accounting service provider
AccountingProvider=Accounting service provider
ITProvider=IT service prodiver
AccountantFileNumber=Accountant code
DisplayDesc=Parameters affecting the look and presentation of the application can be modified here.

View file

@ -1334,7 +1334,7 @@ CompanyFundationDesc=Modifiez les informations de votre société/organisation.
MoreNetworksAvailableWithModule=Plus de réseaux sociaux peuvent être disponible en activant le module "Réseaux Sociaux".
Subcontractors=sous-traitants
SubcontractorsDesc=Si la gestion de votre application est sous-traitée à des prestataires externes (un comptable/expert-comptable/un prestataire informatique), vous pouvez saisir ici leurs informations afin qu'elles ne soient pas perdues en cas de remplacement de l'administrateur.
AccountantingProvider=Fournisseur Comptabilité service
AccountingProvider=Fournisseur Comptabilité service
ITProvider=Fournisseur IT service
AccountantFileNumber=Code comptable
DisplayDesc=Les paramètres affectant l'apparence et la présentation de l'application peuvent être modifiés ici.

View file

@ -428,7 +428,8 @@ if ($dirins && $action == 'initmodule' && $modulename /* && $user->hasRight("mod
if (getDolGlobalString('MODULEBUILDER_SPECIFIC_README')) {
setEventMessages($langs->trans("ContentOfREADMECustomized"), null, 'warnings');
dol_delete_file($destdir.'/README.md');
file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README);
file_put_contents($destdir.'/README.md', getDolGlobalString("MODULEBUILDER_SPECIFIC_README"));
dolChmod($destdir.'/README.md');
}
// for create file to add properties
// file_put_contents($destdir.'/'.strtolower($modulename).'propertycard.php','');

View file

@ -269,14 +269,13 @@ class Productlots extends DolibarrApi
$result = $this->productlot->fetch($id);
if ($result) {
$this->productlot->fetch_optionals();
$this->productlot->fetch_userassigned();
$this->productlot->oldcopy = clone $this->productlot; // @phan-suppress-current-line PhanTypeMismatchProperty
}
if (!$result) {
throw new RestException(404, 'productlot not found');
}
if (!DolibarrApi::_checkAccessToResource('productlot', $this->productlot->id, 'productlot', '', 'fk_soc', 'id')) {
if (!DolibarrApi::_checkAccessToResource('productlot', $this->productlot->id, 'product_lot', '', 'fk_soc', 'rowid')) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach ($request_data as $field => $value) {
@ -298,7 +297,7 @@ class Productlots extends DolibarrApi
$this->productlot->$field = $this->_checkValForAPI($field, $value, $this->productlot);
}
if ($this->productlot->update(DolibarrApiAccess::$user, 1) > 0) {
if ($this->productlot->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id);
}
@ -334,12 +333,12 @@ class Productlots extends DolibarrApi
throw new RestException(404, 'Product lot not found');
}
if (!DolibarrApi::_checkAccessToResource('productlot', $this->productlot->id, 'productlot', '', 'fk_soc', 'id')) {
if (!DolibarrApi::_checkAccessToResource('productlot', $this->productlot->id, 'product_lot', '', 'fk_soc', 'rowid')) {
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (!$this->productlot->delete(DolibarrApiAccess::$user)) {
throw new RestException(500, 'Error when delete Product lot : '.$this->productlot->error);
if ($this->productlot->delete(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, 'Error when delete Product lot : '.implode(',', $this->productlot->errors));
}
return array(

View file

@ -0,0 +1,117 @@
:root{
--form-input-margin-bottom : calc(var(--form-element-spacing-vertical)*3);
}
/**
* STARS INPUT
*/
.star-selection {
font-size: 1rem;
cursor: pointer;
display: flex;
white-space: nowrap;
}
.star {
color: #ccc;
transition: color 0.4s;
}
.star:hover, .star.active {
color: var(--butactionbg);
}
/**
* SELECT 2
*/
.select2-container, .select2-container .selection, .select2-selection.select2-selection--single{
height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important;
}
.select2.select2-container{
margin-bottom: var(--form-input-margin-bottom);
}
.select2-selection--single .select2-selection__rendered, .select2-selection__arrow{
line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important;
height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important;
}
.select2-selection--multiple .select2-selection__rendered{
line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) + var(--border-width) * 2) !important;
height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 3 + var(--border-width) * 2 ) !important;
}
.select2-search__field[type="search"] {
margin-bottom: 3px;
}
.select2-search.select2-search--dropdown{
border-bottom : 1px solid rgba(0,0,0,0.1);
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border :var(--border-width) solid var(--border-color) !important; /* fix select 2 to be compatible pico css */
}
.select2-container--default.select2-container--focus .select2-selection--multiple{
--border-color: var(--primary);
}
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: block !important; /* fix select 2 to be compatible pico css */
overflow: auto;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice{
border: 0px solid #aaa !important; /* fix select 2 to be compatible pico css */
}
/**
* DATE
*/
[class*="fieldname_options_"] > input {
width: auto;
max-width: none;
box-sizing: border-box; /* pour que padding/border ne débordent pas */
}
[class*="fieldname_options_"] .nowraponall {
display: inline-flex;
align-items: center;
gap: 0.25rem;
}
[class*="fieldname_options_"] .dpInvisibleButtons{
display: inline-block;
width: auto;
vertical-align: baseline;
}
/**
* Inlines forms
*/
.nowraponall :is(input:not([type=checkbox], [type=radio]), select, textarea){
margin-bottom: 0;
}
.nowraponall:has(input:not([type=checkbox], [type=radio]), select, textarea){
margin-bottom: var(--form-input-margin-bottom);
}
/**
* Form currency
*/
.form-select-price-currency-container {
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
gap: 0.25rem;
margin-bottom: var(--form-input-margin-bottom);
}
.form-select-price-currency-container > input {
text-align: right;
}

View file

@ -102,6 +102,7 @@ if (empty($dolibarr_nocache)) {
@import "card.css";
@import "dialog.css";
@import "btn.css";
@import "form-input-special.css";
/**
This file can overwrite default pico css
*/

View file

@ -48,6 +48,13 @@ session_cache_limiter('public');
require_once __DIR__.'/../../webportal.main.inc.php';
dol_include_once('/webportal/class/webPortalTheme.class.php');
/**
* @var Conf $conf
* @var HookManager $hookmanager
* @var Translate $langs
* @var Context $context
*/
// Define css type
top_httphead('text/css');
/*
@ -85,5 +92,10 @@ $webPortalTheme = new WebPortalTheme();
}
<?php
$hookmanager->initHooks(array('webPortalCustomCss'));
$parameters = array();
$hookmanager->executeHooks('webPortalCustomCss', $parameters, $webPortalTheme);
print $hookmanager->resPrint;
print '/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS */'."\n";
print getDolGlobalString('WEBPORTAL_CUSTOM_CSS');

View file

@ -18,6 +18,7 @@
/**
* @var Context $context Object context for webportal
* @var HookManager $hookmanager
* @var Translate $langs
* @@var string[] $vars['body-class'] more CSS classes for body
* @@var string[] $vars['body-theme'] theme css to apply default is custom
@ -101,8 +102,13 @@ top_httphead();
$bodyAttributes['class'] = $vars['body-class'];
}
$bodyCompiledAttributes = commonHtmlAttributeBuilder($bodyAttributes);
$parameters = array(
'bodyAttributes' => &$bodyAttributes
);
$hookmanager->executeHooks('webPortalHeader', $parameters, $context);
print $hookmanager->resPrint;
$bodyCompiledAttributes = commonHtmlAttributeBuilder($bodyAttributes);
?>
</head>
<body <?php print empty($bodyCompiledAttributes) ? '' : implode(' ', $bodyCompiledAttributes); ?> >

View file

@ -3796,6 +3796,7 @@ div.vmenu, td.vmenu {
.vmenu {
width: <?php echo $leftmenuwidth; ?>px;
margin-left: 8px;
text-transform: capitalize;
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
display: none;
<?php } ?>
@ -5965,6 +5966,11 @@ button.ui-button-icon-only.ui-dialog-titlebar-close {
.ui-dialog .ui-dialog-content, .ui-dialog .ui-dialog-titlebar.ui-widget-header {
padding-left: 1em !important;
}
/*
.ui-dialog .ui-dialog-content {
text-align: justify;
}
*/
/* ============================================================================== */

View file

@ -5877,6 +5877,14 @@ div#dialogforpopup {
.ui-dialog .ui-dialog-buttonpane {
padding: .5em 1em .3em .4em;
}
.ui-dialog .ui-dialog-content, .ui-dialog .ui-dialog-titlebar.ui-widget-header {
padding-left: 1em !important;
}
/*
.ui-dialog .ui-dialog-content {
text-align: justify;
}
*/
/* ============================================================================== */

View file

@ -1670,4 +1670,19 @@ class FormWebPortal extends Form
return $html;
}
/**
* Retourne la liste des devises, dans la langue de l'utilisateur
*
* @param string $selected Preselected currency code
* @param string $htmlname Name of HTML select list
* @param int $mode 0 = Add currency symbol into label, 1 = Add 3 letter iso code, 2 = Add both symbol and code
* @param string $useempty '1'=Allow empty value
* @return string HTML component
*/
public function selectCurrency($selected = '', $htmlname = 'currency_id', $mode = 0, $useempty = '')
{
return '<span class="form-select-currency-container">'.parent::selectCurrency($selected, $htmlname, $mode, $useempty).'</span>';
}
}

View file

@ -279,6 +279,7 @@ class Website extends CommonObject
$stringtodolibarrfile .= "param=value\n";
//print $conf->website->dir_output.'/'.$this->ref.'/.dolibarr';exit;
file_put_contents($pathofwebsite.'/.dolibarr', $stringtodolibarrfile);
dolChmod($pathofwebsite.'/.dolibarr');
$filelicense = $pathofwebsite.'/LICENSE';
if (!dol_is_file($filelicense)) {
@ -1898,34 +1899,6 @@ class Website extends CommonObject
}
}
/**
* check previous state for file
* @param string $pathname path of file
* @return array|mixed
*/
public function checkPreviousState($pathname)
{
if (!file_exists($pathname)) {
if (touch($pathname)) {
dolChmod($pathname, '0664');
}
return [];
}
return unserialize(file_get_contents($pathname));
}
/**
* Save state for File
* @param mixed $etat state
* @param string $pathname path of file
* @return int|false
*/
public function saveState($etat, $pathname)
{
return file_put_contents($pathname, serialize($etat));
}
/**
* Compare two files has not same name but same content
* @param string $dossierSource filepath of folder source
@ -2156,7 +2129,10 @@ class Website extends CommonObject
// Reindex the table keys
$contentDest = array_values($contentDest);
$stringreplacement = implode("\n", $contentDest);
file_put_contents($inplaceFile, $stringreplacement);
dolChmod($inplaceFile);
foreach ($differences['lignes_dont_change'] as $linechanged => $line) {
if (in_array($linechanged, $contentDest)) {
dolReplaceInFile($inplaceFile, array($linechanged => $line));

View file

@ -5981,7 +5981,8 @@ if ((empty($action) || $action == 'preview' || $action == 'createfromclone' || $
print $out;
/*file_put_contents($filetpl, $out);
/*
file_put_contents($filetpl, $out);
dolChmod($filetpl);
// Output file on browser