2
0
forked from Wavyzz/dolibarr

# WARNING: head commit changed in the meantime

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
Laurent Destailleur
2022-03-16 21:31:08 +01:00
13 changed files with 45 additions and 63 deletions

View File

@@ -64,6 +64,10 @@ class AccountancyExport
public static $EXPORT_TYPE_FEC = 1000;
public static $EXPORT_TYPE_FEC2 = 1010;
/**
* @var DoliDB Database handler
*/
public $db;
/**
* @var string[] Error codes (or messages)

View File

@@ -39,6 +39,24 @@
*/
class AccountancyImport
{
/**
* @var DoliDB Database handler
*/
public $db;
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
public function __construct(DoliDB $db)
{
global $conf;
$this->db = $db;
}
/**
* Compute amount
*

View File

@@ -205,7 +205,7 @@ if (!empty($conf->expedition->enabled)) {
$elementList['shipping_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendShipment'));
}
if (!empty($conf->reception->enabled)) {
$elementList['reception_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception'));
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception'));
}
if (!empty($conf->ficheinter->enabled)) {
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));

View File

@@ -1,36 +0,0 @@
CACHE MANIFEST
# version 2013-05-21 13:30:21
# Note: If this file is dynamic, it must return MIME text/cache-manifest
# Note: Order of CACHE, NETWORK and FALLBACK section does not change behaviour
" Note:
# Files listed under CACHE will be ALWAYS cached after they are loaded.
# And they will be always used from Cache after (even after refresh).
CACHE:
theme/dolibarr_logo.svg
support/
support/index.php
support/default.css
support/helpcenter.png
support/internet.png
support/mail.png
support/pagemaster.png
support/redstar.png
support/star.png
support/who.png
# The NETWORK section contains the path to a folder to ensure that requests
# to load resources will use internet.
# CACHE has priority on NETWORK, so usage is useless
NETWORK:
/
# The FALLBACK section contains entries that provide a backup strategy.
# If the browser is unable to retrieve the original content, the fallback resource will be used.
# In the example above, we display a static image in case the dynamic one is unavailable.
FALLBACK:
#/ public/notice.php
#theme/eldy/img/* theme/md/img/*

View File

@@ -162,7 +162,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'</span>',
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-flip-dolly" ></i> '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'</span>',
'asis' => 1
);

View File

@@ -1189,7 +1189,7 @@ $(document).ready(function() {
// Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup
$(document).ready(function() {
if (window.location !== window.parent.location ) {
if (window.location && window.location.pathname.indexOf("externalsite/frametop.php") == -1 && window.location !== window.parent.location ) {
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
// The page is in an iframe
jQuery(".side-nav-vert, .side-nav, .websitebar").hide();

View File

@@ -8344,7 +8344,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
if ($onlysimplestring == '1') {
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
// We must accept: '$conf->barcode->enabled && preg_match(\'/^(AAA|BBB)/\',$leftmenu)'
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/', '/').']/i', $s)) {
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-*>&|=!?():"\',/', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {
@@ -8356,7 +8356,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
}
} elseif ($onlysimplestring == '2') {
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/;[]', '/').']/i', $s)) {
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-*>&|=!?():"\',/;[]', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {

View File

@@ -119,11 +119,9 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
}
// For multicompany
/*
if (!empty($out)) {
$out .= "&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
if (!empty($out) && !empty($conf->multicompany->enabled)) {
$out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
}
*/
return $out;
}

View File

@@ -299,11 +299,11 @@ class pdf_crabe extends ModelePDFFactures
// Definition of $dir and $file
if ($object->specimen) {
$dir = $conf->facture->dir_output;
$dir = empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity];
$file = $dir."/SPECIMEN.pdf";
} else {
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->facture->dir_output."/".$objectref;
$dir = (empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity])."/".$objectref;
$file = $dir."/".$objectref.".pdf";
}
if (!file_exists($dir)) {

View File

@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array("holiday"));
$langs->loadLangs(array('holiday', 'hrm'));
// Security check
$socid = 0;
@@ -112,7 +112,7 @@ if (empty($reshook)) {
$arrayfields = array(
'cp.ref'=>array('label'=>$langs->trans('Ref'), 'checked'=>1),
'cp.fk_user'=>array('label'=>$langs->trans('Employee'), 'checked'=>1),
'ct.label'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
'cp.fk_type'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
'cp.date_debut'=>array('label'=>$langs->trans('DateDebCP'), 'checked'=>1),
'cp.date_fin'=>array('label'=>$langs->trans('DateFinCP'), 'checked'=>1),
'used_days'=>array('label'=>$langs->trans('NbUseDaysCPShort'), 'checked'=>1),
@@ -141,10 +141,9 @@ $search_month = GETPOST("remonth", 'int') ?GETPOST("remonth", 'int') : date("m",
$search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday";
$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
$sql .= " WHERE cp.rowid > 0";
$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
$sql .= " AND (";
@@ -244,7 +243,7 @@ if (!empty($arrayfields['cp.fk_user']['checked'])) {
}
// Filter: Type
if (!empty($arrayfields['ct.label']['checked'])) {
if (!empty($arrayfields['cp.fk_type']['checked'])) {
$typeleaves = $holidaystatic->getTypes(1, -1);
$arraytypeleaves = array();
foreach ($typeleaves as $key => $val) {
@@ -297,6 +296,9 @@ if (!empty($arrayfields['cp.ref']['checked'])) {
if (!empty($arrayfields['cp.fk_user']['checked'])) {
print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder);
}
if (!empty($arrayfields['cp.fk_type']['checked'])) {
print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
}
if (!empty($arrayfields['ct.label']['checked'])) {
print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
}
@@ -382,8 +384,8 @@ if ($num == 0) {
if (!empty($arrayfields['cp.fk_user']['checked'])) {
print '<td>'.$user->getFullName($langs).'</td>';
}
if (!empty($arrayfields['ct.label']['checked'])) {
print '<td>'.$obj->label.'</td>';
if (!empty($arrayfields['cp.fk_type']['checked'])) {
print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
}
if (!empty($arrayfields['cp.date_debut']['checked'])) {

View File

@@ -1432,11 +1432,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print '<!doctype html>'."\n";
if (!empty($conf->global->MAIN_USE_CACHE_MANIFEST)) {
print '<html lang="'.substr($langs->defaultlang, 0, 2).'" manifest="'.DOL_URL_ROOT.'/cache.manifest">'."\n";
} else {
print '<html lang="'.substr($langs->defaultlang, 0, 2).'">'."\n";
}
//print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n";
if (empty($disablehead)) {
if (!is_object($hookmanager)) {

View File

@@ -632,11 +632,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
}
if (count($array) > 0) {
print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('public', $array, GETPOST('public'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
} else {
print '<input type="hidden" name="public" id="public" value="'.(GETPOSTISSET('public') ? GETPOST('public') : $object->public).'">';
print '<input type="hidden" name="public" id="public" value="'.GETPOST('public').'">';
if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) {
if (GETPOST('public') == 0) {
print $langs->trans("PrivateProject");
} else {
print $langs->trans("SharedProject");

View File

@@ -238,7 +238,6 @@ function pHeader($soutitre, $next, $action = 'none')
header("X-Content-Type-Options: nosniff");
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
print '<html manifest="'.DOL_URL_ROOT.'/cache.manifest">'."\n";
print '<head>'."\n";
print '<meta http-equiv="content-type" content="text/html; charset='.$conf->file->character_set_client.'">'."\n";
print '<meta name="robots" content="index,follow">'."\n";