diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 0d0d013a69f..3c30200c130 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -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) diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index ea88534b6ed..8ca60e37796 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -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 * diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index dcf7fe18d6f..cb3b16fcc0e 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -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')); diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest deleted file mode 100644 index 5e514a32a47..00000000000 --- a/htdocs/cache.manifest +++ /dev/null @@ -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/* diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 9a40c3f9aec..403c6c9fc6d 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -162,7 +162,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => $delayIcon.' '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'', + 'text' => $delayIcon.' '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'', 'asis' => 1 ); diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 17f09e1acb4..5d47fa5f605 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -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(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 68e83d607ea..dd834a5fc2e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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 { diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 1d529be6327..c57807800d7 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -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; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 63a68f7b802..68b48af57ea 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -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)) { diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 48889ab6a37..e76d316bf6c 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -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 ''.$user->getFullName($langs).''; } - if (!empty($arrayfields['ct.label']['checked'])) { - print ''.$obj->label.''; + if (!empty($arrayfields['cp.fk_type']['checked'])) { + print ''.$arraytypeleaves[$obj->fk_type].''; } if (!empty($arrayfields['cp.date_debut']['checked'])) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 55aa799ed90..a8e99f05856 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1432,11 +1432,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; - if (!empty($conf->global->MAIN_USE_CACHE_MANIFEST)) { - print ''."\n"; - } else { - print ''."\n"; - } + print ''."\n"; + //print ''."\n"; if (empty($disablehead)) { if (!is_object($hookmanager)) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6f587a67a7f..433a933c75b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -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 ''; + print ''; - if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) { + if (GETPOST('public') == 0) { print $langs->trans("PrivateProject"); } else { print $langs->trans("SharedProject"); diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 2836650fe71..d5c92cade7b 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -238,7 +238,6 @@ function pHeader($soutitre, $next, $action = 'none') header("X-Content-Type-Options: nosniff"); print ''."\n"; - print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n";