Merge branch 'develop' into export_field_name_alias

This commit is contained in:
Noé Cendrier 2024-12-04 15:09:27 +01:00 committed by GitHub
commit ff694634ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 227 additions and 251 deletions

View file

@ -19,7 +19,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install GitHub CLI
run: |
@ -36,7 +36,10 @@ jobs:
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: |
# shellcheck disable=2086
echo "GH_TOKEN=$GH_TOKEN"
# shellcheck disable=2086
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
# shellcheck disable=2086
gh pr edit $pr_number --add-reviewer "$REVIEWER"
continue-on-error: true

View file

@ -18696,12 +18696,6 @@ parameters:
count: 4
path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php
-
message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php
-
message: '#^Variable \$text might not be defined\.$#'
identifier: variable.undefined
@ -18768,12 +18762,6 @@ parameters:
count: 1
path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php
-
message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php
-
message: '#^Variable \$from might not be defined\.$#'
identifier: variable.undefined
@ -20946,42 +20934,6 @@ parameters:
count: 1
path: ../../htdocs/fourn/commande/document.php
-
message: '#^Variable \$badgeStatus0 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/fourn/commande/index.php
-
message: '#^Variable \$badgeStatus1 might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/fourn/commande/index.php
-
message: '#^Variable \$badgeStatus4 might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/fourn/commande/index.php
-
message: '#^Variable \$badgeStatus6 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/fourn/commande/index.php
-
message: '#^Variable \$badgeStatus9 might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/fourn/commande/index.php
-
message: '#^Variable \$socid might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../htdocs/fourn/commande/index.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
@ -21585,42 +21537,6 @@ parameters:
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 2
path: ../../htdocs/holiday/card.php
-
message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
identifier: argument.type
count: 8
path: ../../htdocs/holiday/card.php
-
message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
identifier: argument.type
count: 8
path: ../../htdocs/holiday/card.php
-
message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
identifier: argument.type
count: 8
path: ../../htdocs/holiday/card.php
-
message: '#^Variable \$canread might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/holiday/card.php
-
message: '#^Variable \$endhalfdaykey might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/holiday/card.php
-
message: '#^Variable \$starthalfdaykey might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/holiday/card.php
@ -24462,12 +24378,6 @@ parameters:
count: 1
path: ../../htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
-
message: '#^Parameter \#3 \$tab_height of method pdf_standard_myobject\:\:_tableau\(\) expects int, float given\.$#'
identifier: argument.type
count: 6
path: ../../htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
-
message: '#^Property pdf_standard_myobject\:\:\$cols \(array\<string, array\{rank\: int, width\: float\|int, status\: bool, title\: array\{textkey\: string, label\: string, align\: string, padding\: array\{float, float, float, float\}\}, content\: array\{align\: string, padding\: array\{float, float, float, float\}\}\}\>\) does not accept non\-empty\-array\<string, array\{rank\: 0, width\: false, status\: true, title\: array\{textkey\: ''Designation'', align\: ''L'', padding\: array\{0\.5, 0\.5, 0\.5, 0\.5\}\}, content\: array\{align\: ''L'', padding\: array\{1, 0\.5, 1, 1\.5\}\}\}\|array\{rank\: int, width\: float\|int, status\: bool, title\: array\{textkey\: string, label\: string, align\: string, padding\: array\{float, float, float, float\}\}, content\: array\{align\: string, padding\: array\{float, float, float, float\}\}\}\>\.$#'
identifier: assign.propertyType
@ -24528,12 +24438,6 @@ parameters:
count: 1
path: ../../htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
-
message: '#^Variable \$object might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
@ -27792,12 +27696,6 @@ parameters:
count: 1
path: ../../htdocs/projet/admin/project.php
-
message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/projet/admin/website.php
-
message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType

View file

@ -425,10 +425,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$formquestion = array();
if (isModEnabled('bom')) {
$langs->load("mrp");
$forcecombo = 0;
if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
}
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
@ -453,10 +449,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$formquestion = array();
if (isModEnabled('bom')) {
$langs->load("mrp");
$forcecombo = 0;
if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
}
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
@ -482,10 +474,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (isModEnabled('bom')) {
$langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$forcecombo = 0;
if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
}
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
@ -580,9 +568,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Common attributes
$keyforbreak = 'duration';
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
$object->calculateCosts();
print '<tr><td>'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td><td><span class="amount">'.price($object->total_cost).'</span></td></tr>';
print '<tr><td>'.$langs->trans("UnitCost").'</td><td>'.price($object->unit_cost).'</td></tr>';
// Manufacturing cost
print '<tr><td>'.$form->textwithpicto($langs->trans("ManufacturingCost"), $langs->trans("BOMTotalCost")).'</td><td><span class="amount">';
print price($object->total_cost);
print '</span>';
if ($object->total_cost != $object->unit_cost) {
print '&nbsp; &nbsp; <span class="opacitymedium">('.$form->textwithpicto(price($object->unit_cost), $langs->trans("ManufacturingUnitCost"), 1, 'help', '').')</span>';
}
print '</td></tr>';
// Find sell price of generated product. We suppose we sell it to a company like ours (same country...).
$object->fetch_product();
$manufacturedvalued = '';
if (!empty($object->product)) {
$tmparray = $object->product->getSellPrice($mysoc, $mysoc);
$manufacturedvalued = $tmparray['pu_ht'] * $object->qty;
}
print '<tr><td>'.$langs->trans("ManufacturingGeneratedValue").'</td><td>'.price($manufacturedvalued).'</td></tr>';
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@ -658,7 +661,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Services
$filtertype = 1;
$res = $object->fetchLinesbytypeproduct(1); // Load all lines services into ->lines
$res = $object->fetchLinesbytypeproduct($filtertype); // Load all lines services into ->lines
$object->calculateCosts();
print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service');

View file

@ -188,8 +188,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$keyforbreak = 'duration';
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
print '<tr><td>'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td><td><span class="amount">'.price($object->total_cost).'</span></td></tr>';
print '<tr><td>'.$langs->trans("UnitCost").'</td><td>'.price($object->unit_cost).'</td></tr>';
// Manufacturing cost
print '<tr><td>'.$form->textwithpicto($langs->trans("ManufacturingCost"), $langs->trans("BOMTotalCost")).'</td><td><span class="amount">';
print price($object->total_cost);
print '</span>';
if ($object->total_cost != $object->unit_cost) {
print '&nbsp; &nbsp; <span class="opacitymedium">('.$form->textwithpicto(price($object->unit_cost), $langs->trans("ManufacturingUnitCost"), 1, 'help', '').')</span>';
}
print '</td></tr>';
// Find sell price of generated product. We suppose we sell it to a company like ours (same country...).
$object->fetch_product();
$manufacturedvalued = '';
if (!empty($object->product)) {
global $mysoc;
$tmparray = $object->product->getSellPrice($mysoc, $mysoc);
$manufacturedvalued = $tmparray['pu_ht'] * $object->qty;
}
print '<tr><td>'.$langs->trans("ManufacturingGeneratedValue").'</td><td>'.price($manufacturedvalued).'</td></tr>';
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';

View file

@ -1409,7 +1409,7 @@ class BOM extends CommonObject
*/
public function calculateCosts()
{
global $conf, $hookmanager;
global $hookmanager;
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$this->unit_cost = 0;

View file

@ -112,7 +112,7 @@ if ($nolinesbefore) {
// Service and workstations are active
if ($filtertype == 1 && isModEnabled('workstation')) {
print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
print '<td class="linecolworkstation">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
}
// Cost
print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>';

View file

@ -83,11 +83,11 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><td colspan="3">'.$titlesearch.'</td></tr>';
print '<tr class="oddeven"><td class="nowrap">';
print '<tr class="oddeven nohover"><td class="nowrap">';
print $langs->trans("Ref").':</td><td><input type="text" class="flat inputsearch" name="sref"></td>';
print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr class="oddeven"><td class="nowrap">';
print $langs->trans("Other").':</td><td><input type="text" class="flat inputsearch" name="sall"></td>';
print '<tr class="oddeven nohover"><td class="nowrap">';
print $langs->trans("Other").':</td><td><input type="text" class="flat inputsearch" name="search_all"></td>';
print "</table></div></form><br>\n";
@ -189,7 +189,7 @@ if ($result) {
print ' | '.$langs->trans("Phone");
}
print '</td>';
print '<td class="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("AllEMailings").'</a></td>';
print '<td class="right"><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php" title="'.$langs->trans("AllEMailings").'"><span class="badge marginleftonlyshort">...</span></td>';
print '</tr>';
$num = $db->num_rows($result);

View file

@ -1470,7 +1470,7 @@ class Invoices extends DolibarrApi
* Add payment line to a specific invoice with the remain to pay as amount.
*
* @param int $id Id of invoice
* @param string $datepaye {@from body} Payment date {@type timestamp}
* @param string $datepaye {@from body} Payment date
* @param int $paymentid {@from body} Payment mode Id {@min 1}
* @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no}
* @param int $accountid {@from body} Account Id {@min 1}
@ -1591,7 +1591,7 @@ class Invoices extends DolibarrApi
* Example of value for parameter arrayofamounts: {"1": {"amount": "99.99", "multicurrency_amount": ""}, "2": {"amount": "", "multicurrency_amount": "10"}}
*
* @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice
* @param string $datepaye {@from body} Payment date {@type timestamp}
* @param string $datepaye {@from body} Payment date
* @param int $paymentid {@from body} Payment mode Id {@min 1}
* @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no}
* @param int $accountid {@from body} Account Id {@min 1}

View file

@ -265,7 +265,7 @@ class FormFile
}
if (getDolGlobalString('MAIN_UPLOAD_DOC')) {
if ($perm) {
if ($perm && empty($conf->dol_optimize_smallscreen)) {
$langs->load('other');
$menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security");

View file

@ -71,34 +71,39 @@ print "jQuery(document).ready(function () {\n";
//print " console.log('referrer=".dol_escape_js($_SERVER['HTTP_REFERER'])."');\n";
print ' var nowtime = Date.now();';
print ' var time_auto_update = '.max(1, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_FREQUENCY')).';'."\n"; // Always defined
print ' var time_js_next_test;'."\n";
print ' var dolnotif_nb_test_for_page = 0;'."\n";
print ' var dolnotif_idinterval = null;'."\n";
print 'var nowtime = Date.now();'."\n";
print 'var time_auto_update = '.max(1, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_FREQUENCY')).';'."\n"; // Always defined
print 'var time_js_next_test;'."\n";
print 'var dolnotif_nb_test_for_page = 0;'."\n";
print 'var dolnotif_idinterval = null;'."\n";
?>
/* Check if Notification is supported */
if ("Notification" in window) {
/* Check if permission ok */
if (Notification.permission !== "granted") {
console.log("Ask Notification.permission");
Notification.requestPermission(function(result) {
console.log("result for Notification.requestPermission is "+result);
});
var methodfornotification = '<?php print getDolUserString('AGENDA_NOTIFICATION_METHOD', getDolGlobalString('AGENDA_NOTIFICATION_METHOD', 'jnotify')); ?>';
/* For old method notification system, check if Notification is supported */
if (methodfornotification == "jsnotification") {
if ("Notification" in window) {
/* Check if permission ok */
if (Notification.permission !== "granted") {
console.log("Ask Notification.permission");
Notification.requestPermission(function(result) {
console.log("result for Notification.requestPermission is "+result);
});
}
} else {
console.log("This browser in this context does not support Notification.");
}
}
/* Launch timer */
/* Launch timer for notifications */
if (methodfornotification == "jnotify" || (methodfornotification == "jsnotification" && "Notification" in window)) {
// We set a delay before launching first test so next check will arrive after the time_auto_update compared to previous one.
//var time_first_execution = (time_auto_update + (time_js_next_test - nowtime)) * 1000; //need milliseconds
var time_first_execution = <?php echo max(3, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION', 0)); ?>;
setTimeout(first_execution, time_first_execution * 1000); // Launch a first execution after a time_first_execution delay
setTimeout(first_execution, time_first_execution * 1000); // Launch the function first_execution() after a time_first_execution delay
time_js_next_test = nowtime + time_first_execution;
console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" time_js_next_check = "+time_js_next_test);
} else {
console.log("This browser in this context does not support Notification.");
}
/* The method called after time_first_execution on each page */
@ -111,7 +116,7 @@ function first_execution() {
}
}
/* the method call frequently every time_auto_update */
/* The method call frequently every time_auto_update */
function check_events() {
var result = 0;
dolnotif_nb_test_for_page += 1;

View file

@ -1148,8 +1148,10 @@ function GETPOSTFLOAT($paramname, $rounding = '')
* @param string $hourTime 'getpost' to include hour, minute, second values from the HTTP request,
* or 'XX:YY:ZZ' to set hour, minute, second respectively (for instance '23:59:59')
* or '' means '00:00:00' (default)
* @param string $gm Passed to dol_mktime
* @param int|string $gm Passed to dol_mktime
* @return int|string Date as a timestamp, '' or false if error
*
* @see dol_mktime()
*/
function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
{
@ -3647,7 +3649,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '')
* @param int $month Month (1 to 12)
* @param int $day Day (1 to 31)
* @param int $year Year
* @param mixed $gm True or 1 or 'gmt'=Input information are GMT values
* @param bool|int|string $gm True or 1 or 'gmt'=Input information are GMT values
* False or 0 or 'tzserver' = local to server TZ
* 'auto'
* 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented.
@ -10577,9 +10579,12 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
$scheck = preg_replace('/\s\(/', '__PARENTHESIS__ ', $scheck); // accept parenthesis in '... (' like in 'if ($a == 1)'. Must replace with __PARENTHESIS__ with a space after to allow following substitutions
$scheck = preg_replace('/^!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in 'function(' and '!function('
$scheck = preg_replace('/\s!?[a-zA-Z0-9_]+\(/', '__FUNCTION__', $scheck); // accept parenthesis in '... function(' and '... !function('
$scheck = preg_replace('/^!\(/', '__NOTANDPARENTHESIS__', $scheck); // accept parenthesis in '!('
$scheck = preg_replace('/\s!\(/', '__NOTANDPARENTHESIS__', $scheck); // accept parenthesis in '... !('
$scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)')
}
//print 'scheck='.$scheck." : ".strpos($scheck, '(')."<br>\n";
if (strpos($scheck, '(') !== false) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (mode '.$onlysimplestring.', found call of a function or method without using the direct name of the function): '.$s;

View file

@ -53,7 +53,7 @@ function check_user_password_googleoauth($usertotest, $passwordtotest, $entityto
// We save data of form into a variable
$_SESSION['datafromloginform'] = array(
'entity'=>GETPOSTINT('entity'),
'entity'=>GETPOST('entity', 'int'), // avoid to return 0 if entity var not exists
'backtopage'=>GETPOST('backtopage'),
'tz'=>GETPOST('tz'),
'tz_string'=>GETPOST('tz_string'),

View file

@ -334,7 +334,7 @@ if (!GETPOST('code') && !GETPOST('error')) {
dol_syslog("we received the login/email to log to, it is ".$useremail);
$tmparray = (empty($_SESSION['datafromloginform']) ? array() : $_SESSION['datafromloginform']);
$entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1);
$entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1);
// Delete the old token
$storage->clearToken($genericstring); // Delete the token called ("Generic-".$storage->keyforprovider)

View file

@ -324,7 +324,7 @@ if (!GETPOST('code')) {
dol_syslog("we received the login/email to log to, it is ".$useremail);
$tmparray = (empty($_SESSION['datafromloginform']) ? array() : $_SESSION['datafromloginform']);
$entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1);
$entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1);
// Delete the old token
$storage->clearToken('Google'); // Delete the token called ("Google-".$storage->keyforprovider)

View file

@ -6,7 +6,8 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011-2016 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -25,7 +26,7 @@
/**
* \file htdocs/core/modules/supplier_order/modules_commandefournisseur.php
* \ingroup order fournisseur
* \ingroup supplier order
* \brief File that contains parent class for supplier orders models
* and parent class for supplier orders numbering models
*/

View file

@ -161,7 +161,7 @@ foreach ($object->fields as $key => $val) {
$value = $object->$key;
$rightpart .= '<tr><td';
$rightpart .= ' class="'.(empty($val['tdcss']) ? 'titlefield' : $val['tdcss']).' fieldname_'.$key;
$rightpart .= ' class="'.(empty($val['tdcss']) ? 'titlefieldmiddle' : $val['tdcss']).' fieldname_'.$key;
//if ($val['notnull'] > 0) $rightpart .= ' fieldrequired'; // No fieldrequired in the view output
if ($val['type'] == 'text' || $val['type'] == 'html') {
$rightpart .= ' tdtop';

View file

@ -616,8 +616,6 @@ class ExpenseReport extends CommonObject
*/
public function update($user, $notrigger = 0, $userofexpensereport = null)
{
global $langs;
$error = 0;
$this->db->begin();
@ -644,24 +642,21 @@ class ExpenseReport extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
if (!$error && !$notrigger) {
// Call trigger
$result = $this->call_trigger('EXPENSE_REPORT_MODIFY', $user);
if ($result < 0) {
$error++;
}
// End call triggers
}
if (empty($error)) {
if (!$error) {
$this->db->commit();
return 1;
} else {

View file

@ -32,7 +32,7 @@
/**
* \file htdocs/fourn/commande/card.php
* \ingroup supplier, order
* \ingroup supplier order
* \brief Card supplier order
*/

View file

@ -22,7 +22,7 @@
/**
* \file htdocs/fourn/commande/contact.php
* \ingroup order
* \ingroup supplier order
* \brief Onglet de gestion des contacts de commande
*/

View file

@ -27,7 +27,7 @@
/**
* \file htdocs/fourn/commande/dispatch.php
* \ingroup commande
* \ingroup supplier order
* \brief Page to dispatch receiving
*/

View file

@ -24,7 +24,7 @@
/**
* \file htdocs/fourn/commande/document.php
* \ingroup supplier
* \ingroup supplier order
* \brief Management page of attached documents to a supplier order
*/

View file

@ -22,7 +22,7 @@
/**
* \file htdocs/fourn/commande/index.php
* \ingroup order fournisseur
* \ingroup supplier order
* \brief Home page of supplier's orders area
*/
@ -52,6 +52,7 @@ $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
// Security check
$orderid = GETPOST('orderid');
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
@ -116,7 +117,13 @@ if ($resql) {
$db->free($resql);
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
/**
* @var string $badgeStatus0
* @var string $badgeStatus1
* @var string $badgeStatus4
* @var string $badgeStatus6
* @var string $badgeStatus9
*/
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>';

View file

@ -21,7 +21,7 @@
/**
* \file htdocs/fourn/commande/info.php
* \ingroup order
* \ingroup supplier order
* \brief Info page for Purchase Order / Supplier Order
*/

View file

@ -29,7 +29,7 @@
/**
* \file htdocs/fourn/commande/list.php
* \ingroup fournisseur
* \ingroup supplier order
* \brief List of purchase orders
*/

View file

@ -22,7 +22,7 @@
/**
* \file htdocs/fourn/commande/note.php
* \ingroup order
* \ingroup supplier order
* \brief page for notes on supplier orders
*/

View file

@ -85,11 +85,11 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
$canread = 0;
if (($id > 0) || $ref) {
$object->fetch($id, $ref);
// Check current user can read this leave request
$canread = 0;
if ($user->hasRight('holiday', 'readall')) {
$canread = 1;
}
@ -169,10 +169,10 @@ if (empty($reshook)) {
$db->begin();
$date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
$date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
$date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1);
$date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1);
$date_debut = GETPOSTDATE('date_debut_', '00:00:00');
$date_fin = GETPOSTDATE('date_fin_', '00:00:00');
$date_debut_gmt = GETPOSTDATE('date_debut_', '00:00:00', 1);
$date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1);
$starthalfday = GETPOST('starthalfday');
$endhalfday = GETPOST('endhalfday');
$type = GETPOST('type');
@ -325,10 +325,10 @@ if (empty($reshook)) {
}
if ($action == 'update' && !GETPOSTISSET('savevalidator')) { // Test on permission done later
$date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
$date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
$date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1);
$date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1);
$date_debut = GETPOSTDATE('date_debut_', '00:00:00');
$date_fin = GETPOSTDATE('date_fin_', '00:00:00');
$date_debut_gmt = GETPOSTDATE('date_debut_', '00:00:00', 1);
$date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1);
$starthalfday = GETPOST('starthalfday');
$endhalfday = GETPOST('endhalfday');
$halfday = 0;
@ -542,6 +542,9 @@ if (empty($reshook)) {
} elseif ($object->halfday == 0 || $object->halfday == 2) {
$starthalfdaykey = "Morning";
$endhalfdaykey = "Afternoon";
} else {
$starthalfdaykey = "";
$endhalfdaykey = "";
}
$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
@ -1154,7 +1157,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
if (!GETPOST('date_debut_')) { // If visitor does not come from agenda
print $form->selectDate(-1, 'date_debut_', 0, 0, 0, '', 1, 1);
} else {
$tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month'), GETPOSTINT('date_debut_day'), GETPOSTINT('date_debut_year'));
$tmpdate = GETPOSTDATE('date_debut_', '00:00:00');
print $form->selectDate($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
@ -1171,7 +1174,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
if (!GETPOST('date_fin_')) {
print $form->selectDate(-1, 'date_fin_', 0, 0, 0, '', 1, 1);
} else {
$tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_fin_month'), GETPOSTINT('date_fin_day'), GETPOSTINT('date_fin_year'));
$tmpdate = GETPOSTDATE('date_fin_', '00:00:00');
print $form->selectDate($tmpdate, 'date_fin_', 0, 0, 0, '', 1, 1);
}
print ' &nbsp; &nbsp; ';
@ -1349,7 +1352,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
print '</td>';
print '<td>';
$tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month'), GETPOSTINT('date_debut_day'), GETPOSTINT('date_debut_year'));
$tmpdate = GETPOSTDATE('date_debut_', '00:00:00');
print $form->selectDate($tmpdate ? $tmpdate : $object->date_debut, 'date_debut_');
print ' &nbsp; &nbsp; ';
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ? GETPOST('starthalfday') : $starthalfday));
@ -1650,9 +1653,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
$includedocgeneration = 0;
// Documents
/* $includedocgeneration = 0;
if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref.'/'.$objref.'.pdf';
@ -1661,7 +1663,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$genallowed = ($user->hasRight('holiday', 'read') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'readall'); // If you can read, you can build the PDF to read content
$delallowed = ($user->hasRight('holiday', 'write') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'writeall_advance'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('holiday:Holiday', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
} */
// Show links to link elements
//$tmparray = $form->showLinkToObjectBlock($object, null, array('myobject'), 1);

View file

@ -35,19 +35,20 @@ create table llx_user
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer, -- user who created dataset
fk_user_modif integer, -- user who modified dataset
login varchar(50) NOT NULL,
pass_encoding varchar(24),
pass varchar(128),
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity)
api_key varchar(128), -- key to use REST API by this user
pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity)
api_key varchar(128), -- key to use REST API by this user
gender varchar(10),
civility varchar(6),
lastname varchar(50),
firstname varchar(50),
address varchar(255), -- user personal address
zip varchar(25), -- zipcode
town varchar(50), -- town
address varchar(255), -- user personal address
zip varchar(25), -- zipcode
town varchar(50), -- town
fk_state integer DEFAULT 0,
fk_country integer DEFAULT 0,
birth date, -- birthday
@ -74,6 +75,7 @@ create table llx_user
fk_user_expense_validator integer NULL,
fk_user_holiday_validator integer NULL,
national_registration_number varchar(50),
idpers1 varchar(128),
idpers2 varchar(128),
idpers3 varchar(128),
@ -90,10 +92,11 @@ create table llx_user
flagdelsessionsbefore datetime DEFAULT NULL, -- set this to a date if we need to launch an external process to invalidate all sessions for the same login created before this date
iplastlogin varchar(250),
ippreviouslogin varchar(250),
--egroupware_id integer,
ldap_sid varchar(255) DEFAULT NULL,
openid varchar(255),
statut tinyint DEFAULT 1,
photo varchar(255), -- filename or url of photo
lang varchar(6), -- default language for communication. Note that language selected by user as interface language is savec into llx_user_param.
color varchar(6),
@ -114,8 +117,9 @@ create table llx_user
weeklyhours double(16,8), -- DENORMALIZED FIELD. Value coming from llx_user_employment
import_key varchar(14), -- import key
default_range integer,
default_c_exp_tax_cat integer,
national_registration_number varchar(50),
fk_warehouse integer -- default warehouse of user
)ENGINE=innodb;

View file

@ -568,8 +568,8 @@ Module10Name=Accounting (simplified)
Module10Desc=Simple accounting reports (journals, turnover) based on database content. Does not use any ledger table.
Module20Name=Proposals
Module20Desc=Commercial proposal management
Module22Name=Mass Emailings
Module22Desc=Manage bulk emailing
Module22Name=Mass Emails
Module22Desc=Manage mass/bulk email campaign
Module23Name=Energy
Module23Desc=Monitoring the consumption of energies
Module25Name=Sales Orders
@ -848,10 +848,10 @@ Permission212=Order lines
Permission213=Activate line
Permission214=Setup Telephony
Permission215=Setup providers
Permission221=Read emailings
Permission222=Create/modify emailings (topic, recipients...)
Permission223=Validate emailings (allows sending)
Permission229=Delete emailings
Permission221=Read mass emails
Permission222=Create/modify mass emails (topic, recipients...)
Permission223=Validate mass emails (allows sending)
Permission229=Delete mass emails
Permission237=View recipients and info
Permission238=Manually send mailings
Permission239=Delete mailings after validation or sent
@ -1818,9 +1818,9 @@ FCKeditorForNotePrivate=WYSIWYG creation/modification of the field "private note
FCKeditorForCompany=WYSIWYG creation/modification of the field description of elements (except products/services)
FCKeditorForProductDetails=WYSIWYG creation/modification of products description or lines for objects (lines of proposals, orders, invoices, etc...).
FCKeditorForProductDetails2=Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files.
FCKeditorForMailing= WYSIWYG creation/modification for mass eMailings (Tools->eMailing)
FCKeditorForMailing= WYSIWYG creation/modification for mass eMails (Tools->Mass eMails)
FCKeditorForUserSignature=WYSIWYG creation/modification of user signature
FCKeditorForMail=WYSIWYG creation/modification for all mail (except Tools->eMailing)
FCKeditorForMail=WYSIWYG creation/modification for all mail (except Tools->Mass eMails)
FCKeditorForTicket=WYSIWYG creation/modification for tickets
##### Stock #####
StockSetup=Stock module setup

View file

@ -79,7 +79,7 @@ Chat=Chat
PhonePro=Bus. phone
PhonePerso=Pers. phone
PhoneMobile=Mobile
No_Email=Refuse bulk emailings
No_Email=Refuse mass emails
Fax=Fax
Zip=Zip Code
Town=City

View file

@ -1,9 +1,9 @@
# Dolibarr language file - Source file is en_US - mails
Mailing=EMailing
EMailing=EMailing
EMailings=EMailings
EMailings=Mass EMails
SMSings=SMSings
AllEMailings=All eMailings
AllEMailings=All mass eMails
MailCard=EMailing card
MailRecipients=Recipients
MailRecipient=Recipient
@ -26,19 +26,19 @@ MailFile=Attached files
MailMessage=Email body
SubjectNotIn=Not in Subject
BodyNotIn=Not in Body
ShowEMailing=Show emailing
ListOfEMailings=List of emailings
NewMailing=New emailing
ShowEMailing=Show mass Email
ListOfEMailings=List of mass Email
NewMailing=New mass Email
NewSMSing=New smsing
EditMailing=Edit emailing
ResetMailing=Resend emailing
EditMailing=Edit mass Email
ResetMailing=Resend mass Email
ConfirmResetMailingTargetMassaction=Confirmation of the reset of targets statusin error
ResetMailingTargetMassaction=Reset status in error
DeleteMailing=Delete emailing
PreviewMailing=Preview emailing
CreateMailing=Create emailing
DeleteMailing=Delete mass Email
PreviewMailing=Preview mass Email
CreateMailing=Create mass Email
TestMailing=Test
ValidMailing=Valid emailing
ValidMailing=Valid mass Email
MailingStatusDraft=Draft
MailingStatusValidated=Validated
MailingStatusSent=Sent
@ -108,24 +108,24 @@ EmailCollectorFilterDesc=All filters must match to have an email being collected
LineInFile=Line %s in file
RecipientSelectionModules=Defined requests for recipient's selection
MailSelectedRecipients=Selected recipients
MailingArea=EMailings area
LastMailings=Latest %s emailings
MailingArea=Mass Emails
LastMailings=Latest %s mass emails
TargetsStatistics=Targets statistics
NbOfCompaniesContacts=Unique contacts/addresses
MailNoChangePossible=Recipients for validated emailing can't be changed
SearchAMailing=Search mailing
SendMailing=Send emailing
SearchAMailing=Search a mass Email
SendMailing=Send mass Email
SentBy=Sent by
AdvancedAlternative=Advanced alternative
MailingNeedCommand=Sending an emailing can be performed from command line. Ask your server administrator to launch the following command to send the emailing to all recipients:
MailingNeedCommand2=You can however send them online by adding parameter MAILING_LIMIT_SENDBYWEB with value of max number of emails you want to send by session. For this, go on Home - Setup - Other.
ConfirmSendingEmailing=If you want to send emailing directly from this screen, please confirm you are sure you want to send emailing now from your browser ?
LimitSendingEmailing=Note: Sending of emailings from web interface is done in several times for security and timeout reasons, <b>%s</b> recipients at a time for each sending session.
LimitSendingEmailing=Note: Sending of a mass email from web interface is done in several times for security and timeout reasons, <b>%s</b> recipients at a time for each sending session.
TargetsReset=Clear list
ToClearAllRecipientsClickHere=Click here to clear the recipient list for this emailing
ToAddRecipientsChooseHere=Add recipients by choosing from the lists
NbOfEMailingsReceived=Mass emailings received
NbOfEMailingsSend=Mass emailings sent
NbOfEMailingsReceived=Mass emails received
NbOfEMailingsSend=Mass emails sent
IdRecord=ID record
DeliveryReceipt=Delivery Ack.
YouCanUseCommaSeparatorForSeveralRecipients=You can use the <b>comma</b> separator to specify several recipients.

View file

@ -95,6 +95,9 @@ ProductsToConsume=Products to consume
ProductsToProduce=Products to produce
UnitCost=Unit cost
TotalCost=Total cost
ManufacturingCost=Manufacturing cost
ManufacturingUnitCost=Unit manufacturing cost
ManufacturingGeneratedValue=Manufacturing value generated
BOMTotalCost=The cost to produce this BOM based on cost of each quantity and product to consume (use Cost price if defined, else Average Weighted Price if defined, else the Best purchase price)
BOMTotalCostService=If the "Workstation" module is activated and a workstation is defined by default on the line, then the calculation is "quantity (converted into hours) x workstation ahr", otherwise "quantity x cost price of the service"
GoOnTabProductionToProduceFirst=You must first have started the production to close a Manufacturing Order (See tab '%s'). But you can Cancel it.

View file

@ -12,7 +12,7 @@ WEBSITE_ALIASALTDesc=Use here list of other name/aliases so the page can also be
WEBSITE_CSS_URL=URL of external CSS file
WEBSITE_CSS_INLINE=CSS file content (common to all pages)
WEBSITE_JS_INLINE=JavaScript file content (common to all pages)
WEBSITE_HTML_HEADER=Addition at bottom of HTML Header (common to all pages)
WEBSITE_HTML_HEADER=HTML Header (common to all pages)
WEBSITE_ROBOT=Robot file (robots.txt)
WEBSITE_HTACCESS=Website .htaccess file
WEBSITE_MANIFEST_JSON=Website manifest.json file

View file

@ -12,7 +12,7 @@ WEBSITE_ALIASALTDesc=Utilisez ici la liste des autres noms / alias afin que la p
WEBSITE_CSS_URL=URL du fichier de la feuille de style (CSS) externe
WEBSITE_CSS_INLINE=Contenu du fichier CSS (commun à toute les pages)
WEBSITE_JS_INLINE=Contenu du fichier JavaScript (commun à toutes les pages)
WEBSITE_HTML_HEADER=Ajout en bas de l'en-tête HTML (commun à toutes les pages)
WEBSITE_HTML_HEADER=En-tête HTML (commun à toutes les pages)
WEBSITE_ROBOT=Fichier robot (robots.txt)
WEBSITE_HTACCESS=Fichier .htaccess du site web
WEBSITE_MANIFEST_JSON=Fichier manifest.json de site Web

View file

@ -170,7 +170,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
// phpcs:enable
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
global $user, $langs, $conf, $mysoc, $hookmanager, $nblines;
dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
@ -854,8 +854,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
* Show table for lines
*
* @param TCPDF|TCPDI $pdf Object PDF
* @param int $tab_top Top position of table
* @param int $tab_height Height of table (rectangle)
* @param float $tab_top Top position of table
* @param float $tab_height Height of table (rectangle)
* @param int $nexY Y (not used)
* @param Translate $outputlangs Langs object
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) ---Replace with your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
@ -17,6 +18,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @var CommonObject $object
* @var Translate $langs
* @var User $user
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";

View file

@ -1619,7 +1619,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if ($type == 1) {
print '<tr><td>'.$langs->trans("Duration").'</td><td>';
print img_picto('', 'clock', 'class="pictofixedwidth"');
print '<input name="duration_value" size="4" value="'.GETPOSTINT('duration_value').'">';
print '<input name="duration_value" class="width50" value="'.(GETPOSTISSET('duration_value') ? GETPOSTINT('duration_value') : '').'">';
print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_unit') ? GETPOST('duration_unit', 'alpha') : 'h'), 0, 1);
// Mandatory period
@ -1750,7 +1750,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
$doleditor->Create();
print "</td></tr>";
//}
if (isModEnabled('category')) {
// Categories
@ -1773,6 +1772,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td class="titlefieldcreate">'.$langs->trans("VATRate").'</td><td>';
$defaultva = get_default_tva($mysoc, $mysoc);
print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
print ajax_combobox("tva_tx");
print '</td></tr>';
print '</table>';
@ -1785,6 +1785,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td class="titlefieldcreate">'.$langs->trans("SellingPrice").'</td>';
print '<td><input name="price" class="maxwidth50" value="'.$object->price.'">';
print $form->selectPriceBaseType(getDolGlobalString('PRODUCT_PRICE_BASE_TYPE'), "price_base_type");
print ajax_combobox("select_price_base_type");
print '</td></tr>';
// Min price
@ -1796,6 +1797,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td>'.$langs->trans("VATRate").'</td><td>';
$defaultva = get_default_tva($mysoc, $mysoc);
print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
print ajax_combobox("tva_tx");
print '</td></tr>';
print '</table>';
@ -2244,7 +2246,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if ($object->isService()) {
// Duration
print '<tr><td>'.$langs->trans("Duration").'</td><td>';
print '<input name="duration_value" size="5" value="'.$object->duration_value.'"> ';
print '<input name="duration_value" class="width50" value="'.($object->duration_value ? $object->duration_value : '').'"> ';
print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1);
// Mandatory period

View file

@ -6011,7 +6011,7 @@ span[phptag] {
border: none;
font-weight: normal;
}
.websitebar .button.bordertransp {
.websitebar .button.bordertransp, .websitebar .fa-plus-circle.btnTitle-icon {
color: unset;
text-decoration: unset !important;
margin: 0px 4px 0px 4px !important
@ -7401,9 +7401,11 @@ span#select2-boxbookmark-container {
}
span.select2-dropdown--below {
margin-top: -1px;
min-width: 100px;
}
span.select2-dropdown--above {
margin-bottom: -1px;
min-width: 100px;
}
.parentonrightofpage {

View file

@ -5966,7 +5966,12 @@ span[phptag] {
.websitebar .button.bordertransp {
color: unset;
text-decoration: unset !important;
border: unset !important;
/* margin: 0px 4px 0px 4px !important */
box-shadow: none;
}
.websitebar .fa-plus-circle.btnTitle-icon {
margin: 0px 4px 0px 4px !important;
}
.websitebar {

View file

@ -597,7 +597,11 @@ class User extends CommonObject
if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
$sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
} else {
$sql .= " WHERE u.entity IN (0, ".((int) (($entity != '' && $entity >= 0) ? $entity : $conf->entity)).")"; // search in entity provided in parameter
if ($entity != '' && $entity == 0) { // If $entity = 0
$sql .= " WHERE u.entity = 0";
} else { // if $entity is -1 or > 0
$sql .= " WHERE u.entity IN (0, ".((int) ($entity > 0 ? $entity : $conf->entity)).")";
}
}
}

View file

@ -1772,13 +1772,17 @@ if ($action == 'updatecss' && $usercanedit) {
$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
if (!$errorphpcheck) {
$htaccesscontent = '';
$htaccesscontent .= $dataposted."\n";
if ($dataposted) {
$htaccesscontent = '';
$htaccesscontent .= $dataposted."\n";
$result = dolSaveHtaccessFile($filehtaccess, $htaccesscontent);
if (!$result) {
$error++;
setEventMessages('Failed to write file '.$filehtaccess, null, 'errors');
$result = dolSaveHtaccessFile($filehtaccess, $htaccesscontent);
if (!$result) {
$error++;
setEventMessages('Failed to write file '.$filehtaccess, null, 'errors');
}
} else {
dol_delete_file($filehtaccess, 0, 0);
}
} else {
$error++;
@ -3067,7 +3071,10 @@ if (!GETPOST('hide_websitemenu')) {
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) {
// Edit website properties
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.urlencode($object->ref).'&pageid='.((int) $pageid).'&action=editcss&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditCss")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditCss")).'</span></a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.urlencode($object->ref).'&pageid='.((int) $pageid).'&action=editcss&token='.newToken().'" class="button bordertransp valignmiddle" title="'.dol_escape_htmltag($langs->trans("EditCss")).'"'.$disabled.'>';
print img_picto('', 'setup');
print '<span class="hideonsmartphone paddingleft">'.dol_escape_htmltag($langs->trans("EditCss")).'</span>';
print '</a>';
// Import web site
$importlabel = $langs->trans("ImportSite");
@ -3431,10 +3438,16 @@ if (!GETPOST('hide_websitemenu')) {
print '<span class="websiteselection">';
// Edit web page properties
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editmeta&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</span></a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editmeta&token='.newToken().'" class="button bordertransp valignmiddle" title="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'"'.$disabled.'>';
print img_picto('', 'setup');
print '<span class="hideonsmartphone paddingleft">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</span>';
print '</a>';
// Edit HTML content
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editsource&token='.newToken().'" class="button bordertransp"'.$disabled.'>'.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editsource&token='.newToken().'" class="button bordertransp"'.$disabled.'>';
print img_picto('', 'code');
print '<span class="hideonsmartphone paddingleft">'.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).'</span>';
print '</a>';
// Edit CKEditor
if (getDolGlobalInt('WEBSITE_ALLOW_CKEDITOR')) {
@ -3868,10 +3881,6 @@ if ($action == 'editcss') {
} else {
$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
}
if (!trim($htaccesscontent)) {
$htaccesscontent .= "# Order allow,deny\n";
$htaccesscontent .= "# Deny from all\n";
}
if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) {
$manifestjsoncontent = @file_get_contents($filemanifestjson);
@ -3946,7 +3955,7 @@ if ($action == 'editcss') {
print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2);
print '</td><td>';
print img_picto('', 'language', 'class="picotfixedwidth"');
print '<input type="text" class="flat" value="'.(GETPOSTISSET('WEBSITE_OTHERLANG') ? GETPOST('WEBSITE_OTHERLANG', 'alpha') : $object->otherlang).'" name="WEBSITE_OTHERLANG">';
print '<input type="text" class="flat maxwidth200" value="'.(GETPOSTISSET('WEBSITE_OTHERLANG') ? GETPOST('WEBSITE_OTHERLANG', 'alpha') : $object->otherlang).'" name="WEBSITE_OTHERLANG">';
print '</td>';
print '</tr>';
@ -4034,7 +4043,13 @@ if ($action == 'editcss') {
// .htaccess
print '<tr><td class="tdtop">';
print $langs->trans('WEBSITE_HTACCESS');
$textwithhelp3 = $langs->trans("Example").' :';
$textwithhelp3 .= "<br># Order allow,deny\n";
$textwithhelp3 .= "<br># Deny from all\n";
$textwithhelp3 .= "<br># Require all granted\n";
print $form->textwithpicto($langs->trans('WEBSITE_HTACCESS'), $textwithhelp3, 1, 'help', '', 0, 2, 'htmlheadertooltip3');
print '</td><td>';
$poscursor = array('x' => GETPOST('WEBSITE_HTACCESS_x'), 'y' => GETPOST('WEBSITE_HTACCESS_y'));