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

This commit is contained in:
Laurent Destailleur 2021-03-15 11:21:58 +01:00
commit 902c237ed5
34 changed files with 116 additions and 78 deletions

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.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
@ -220,7 +220,7 @@ if ($conf->accounting->enabled) {
/*
* Show boxes
*/
$boxlist .= '<div class="twocolumns">';
$boxlist = '<div class="twocolumns">';
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';

View File

@ -2216,7 +2216,7 @@ class Adherent extends CommonObject
$statusType = 'status1';
$labelStatus = $langs->trans("MemberStatusActive");
$labelStatusShort = $langs->trans("MemberStatusActiveShort");
} elseif ($date_end_subscription < time()) {
} elseif ($date_end_subscription < dol_now()) {
$statusType = 'status3';
$labelStatus = $langs->trans("MemberStatusActiveLate");
$labelStatusShort = $langs->trans("MemberStatusActiveLateShort");

View File

@ -79,10 +79,10 @@ $subscriptionstatic = new Subscription($db);
print load_fiche_titre($langs->trans("MembersArea"), $resultboxes['selectboxlist'], 'members');
$Adherents = array();
$AdherentsAValider = array();
$MemberUpToDate = array();
$AdherentsResilies = array();
$MembersValidated = array();
$MembersToValidate = array();
$MembersUpToDate = array();
$MembersResiliated = array();
$AdherentType = array();
@ -111,7 +111,7 @@ if ($result) {
$AdherentType[$objp->rowid] = $adhtype;
if ($objp->statut == -1) {
$MemberToValidate[$objp->rowid] = $objp->somme;
$MembersToValidate[$objp->rowid] = $objp->somme;
}
if ($objp->statut == 1) {
$MembersValidated[$objp->rowid] = $objp->somme;
@ -144,7 +144,7 @@ if ($result) {
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$MemberUpToDate[$objp->fk_adherent_type] = $objp->somme;
$MembersUpToDate[$objp->fk_adherent_type] = $objp->somme;
$i++;
}
$db->free();
@ -202,13 +202,13 @@ if ($conf->use_javascript_ajax) {
$dataval = array();
$i = 0;
foreach ($AdherentType as $key => $adhtype) {
$dataval['draft'][] = array($i, isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0);
$dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0);
$dataval['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0);
$dataval['draft'][] = array($i, isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0);
$dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0);
$dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0);
$dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0);
$SommeA += isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0;
$SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0;
$SommeC += isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0;
$SommeA += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0;
$SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0;
$SommeC += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0;
$SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0;
$i++;
}
@ -476,9 +476,9 @@ print "</tr>\n";
foreach ($AdherentType as $key => $adhtype) {
print '<tr class="oddeven">';
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
print '<td class="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0 ? $MemberToValidate[$key] : '').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) > 0) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'</td>';
print '<td class="right">'.(isset($MembersToValidate[$key]) && $MembersToValidate[$key] > 0 ? $MembersToValidate[$key] : '').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) > 0) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).'</td>';
print '<td class="right">'.(isset($MembersUpToDate[$key]) && $MembersUpToDate[$key] > 0 ? $MembersUpToDate[$key] : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'</td>';
print '<td class="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key] > 0 ? $MembersResiliated[$key] : '').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'</td>';
print "</tr>\n";
}

View File

@ -60,7 +60,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
*/
llxHeader('', $langs->trans("EventOrganizationSetup"), $help_url);
llxHeader('', $langs->trans("EventOrganizationSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.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
@ -41,17 +41,11 @@ function bomAdminPrepareHead()
$head[$h][2] = 'settings';
$h++;
$head[$h][0] = dol_buildpath("/admin/bom_extrafields.php", 1);
$head[$h][0] = DOL_URL_ROOT."/admin/bom_extrafields.php";
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'bom_extrafields';
$h++;
/*$head[$h][0] = DOL_URL_ROOT."/bom/admin/about.php";
$head[$h][1] = $langs->trans("About");
$head[$h][2] = 'about';
$h++;
*/
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
//$this->tabs = array(

View File

@ -5,6 +5,7 @@
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
@ -151,7 +152,7 @@ $cate_arbo = $categstatic->get_full_arbo($typetext);
$fulltree = $cate_arbo;
// Load possible missing includes
if ($conf->global->CATEGORY_SHOW_COUNTS) {
if (!empty($conf->global->CATEGORY_SHOW_COUNTS)) {
if ($type == Categorie::TYPE_MEMBER) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
}
@ -177,7 +178,7 @@ foreach ($fulltree as $key => $val) {
$desc = dol_htmlcleanlastbr($val['description']);
$counter = '';
if ($conf->global->CATEGORY_SHOW_COUNTS) {
if (!empty($conf->global->CATEGORY_SHOW_COUNTS)) {
// we need only a count of the elements, so it is enough to consume only the id's from the database
$elements = $type == Categorie::TYPE_ACCOUNT
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"

View File

@ -7,7 +7,7 @@
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.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
@ -258,7 +258,13 @@ if (empty($conf->global->AGENDA_DISABLE_EXT)) {
$buggedfile = 'AGENDA_EXT_BUGGEDFILE'.$i;
if (!empty($conf->global->$source) && !empty($conf->global->$name)) {
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
$listofextcals[] = array('src'=>$conf->global->$source, 'name'=>$conf->global->$name, 'offsettz'=>$conf->global->$offsettz, 'color'=>$conf->global->$color, 'buggedfile'=>(isset($conf->global->buggedfile) ? $conf->global->buggedfile : 0));
$listofextcals[] = array(
'src'=>$conf->global->$source,
'name'=>$conf->global->$name,
'offsettz' => (!empty($conf->global->$offsettz) ? $conf->global->$offsettz : 0),
'color'=>$conf->global->$color,
'buggedfile'=>(isset($conf->global->buggedfile) ? $conf->global->buggedfile : 0)
);
}
}
}
@ -275,7 +281,13 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) {
$buggedfile = 'AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i;
if (!empty($user->conf->$source) && !empty($user->conf->$name)) {
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
$listofextcals[] = array('src'=>$user->conf->$source, 'name'=>$user->conf->$name, 'offsettz'=>$user->conf->$offsettz, 'color'=>$user->conf->$color, 'buggedfile'=>(isset($user->conf->buggedfile) ? $user->conf->buggedfile : 0));
$listofextcals[] = array(
'src'=>$user->conf->$source,
'name'=>$user->conf->$name,
'offsettz' => (!empty($user->conf->$offsettz) ? $user->conf->$offsettz : 0),
'color'=>$user->conf->$color,
'buggedfile'=>(isset($user->conf->buggedfile) ? $user->conf->buggedfile : 0)
);
}
}
}

View File

@ -38,6 +38,7 @@ $action = GETPOST('action', 'aZ09');
$month = GETPOST('month', 'int');
$year = GETPOST('year', 'int');
$optioncss = GETPOST('optioncss', 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');

View File

@ -9,6 +9,7 @@
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
@ -997,6 +998,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
$sql .= ", s.nom as name";
$sql .= ", s.rowid as socid, s.email";
$sql .= ", s.code_client, s.code_compta";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur";
$sql .= ", cc.rowid as country_id, cc.code as country_code";
$sql .= ", sum(pf.amount) as am";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays,".MAIN_DB_PREFIX."facture as f";
@ -1019,6 +1021,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
$sql .= " GROUP BY f.rowid, f.ref, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
$sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur";
$sql .= " ORDER BY f.datef ASC, f.ref ASC";
$resql = $db->query($sql);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.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
@ -114,7 +114,7 @@ if (empty($min)) {
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit, 2=option on payments for products
$modetax = $conf->global->TAX_MODE;
$modetax = empty($conf->global->TAX_MODE) ? 0 : $conf->global->TAX_MODE;
if (GETPOSTISSET("modetax")) {
$modetax = GETPOST("modetax", 'int');
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -116,16 +116,16 @@ if (empty($min)) {
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit, 2=option on payments for products
$modetax = $conf->global->TAX_MODE;
$modetax = (empty($conf->global->TAX_MODE) ? 0 : $conf->global->TAX_MODE);
if (GETPOSTISSET("modetax")) {
$modetax = GETPOST("modetax", 'int');
$modetax = GETPOSTINT("modetax");
}
if (empty($modetax)) {
$modetax = 0;
}
// Security check
$socid = GETPOST('socid', 'int');
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
@ -242,7 +242,7 @@ if ($mysoc->tva_assuj) {
$vatsup .= ' ('.$langs->trans("ToGetBack").')';
}
$optioncss = GETPOST('optioncss');
$optioncss = GETPOST('optioncss', 'alpha');
if ($optioncss != "print") {
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
}

View File

@ -102,9 +102,11 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
$date = $this->db->jdate($objp->date_movement);
$journal = $objp->code_journal;
$label = $objp->label_operation;
$amount = $objp->amount;
$amount = $objp->amount;
$bookkeepingstatic->id = $objp->id;
// adding id (rowid) will give two lines (debit and credit)
// so rowid isn't in sql request
// $bookkeepingstatic->id = $objp->id;
$bookkeepingstatic->piece_num = $objp->piece_num;
$this->info_box_contents[$line][] = array(

View File

@ -7,7 +7,7 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.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
@ -966,6 +966,7 @@ class FormFile
// Loop on each file found
$found = 0;
$i = 0;
foreach ($file_list as $file) {
$i++;
if ($filter && !preg_match('/'.$filter.'/i', $file["name"])) {

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
@ -274,8 +275,7 @@ function getDefaultDatesForTransfer()
global $db, $conf;
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
$periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER;
isset($periodbydefaultontransfer) ? $periodbydefaultontransfer : 0;
$periodbydefaultontransfer = (empty($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? 0 : $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER);
if ($periodbydefaultontransfer == 2) {
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";

View File

@ -34,12 +34,12 @@ function cronadmin_prepare_head()
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath('/cron/admin/cron.php', 1);
$head[$h][0] = DOL_URL_ROOT.'/cron/admin/cron.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'setup';
$h++;
$head[$h][0] = dol_buildpath('/cron/list.php?mode=modulesetup', 1);
$head[$h][0] = DOL_URL_ROOT.'/cron/list.php?mode=modulesetup';
$head[$h][1] = $langs->trans("Module2300Name");
$head[$h][2] = 'jobs';
$h++;
@ -64,12 +64,12 @@ function cron_prepare_head(Cronjob $object)
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath('/cron/card.php', 1).'?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/cron/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("CronTask");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = dol_buildpath('/cron/info.php', 1).'?id='.$object->id;
$head[$h][0] = DOL_URL_ROOT.'/cron/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;

View File

@ -14,7 +14,7 @@ if (empty($extrafieldsobjectkey) && is_object($object)) {
// Loop to show all columns of extrafields from $obj, $extrafields and $db
if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']) > 0) {
if (isset($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']) > 0) {
if (empty($extrafieldsobjectprefix)) {
$extrafieldsobjectprefix = 'ef.';
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.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
@ -1183,9 +1183,10 @@ class Holiday extends CommonObject
*
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $notooltip 1=Disable tooltip
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $save_lastsearch_value = -1)
public function getNomUrl($withpicto = 0, $save_lastsearch_value = -1, $notooltip = 0)
{
global $langs;

View File

@ -4,6 +4,7 @@
* Copyright (C) 2012-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
@ -150,6 +151,7 @@ if (!empty($conf->holiday->enabled)) {
print '<td colspan="3">';
$out = '';
$nb_holiday = 0;
$typeleaves = $holiday->getTypes(1, 1);
foreach ($typeleaves as $key => $val) {
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);

View File

@ -464,7 +464,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$globalStatsKey = $groupElement['globalStatsKey'];
$groupElement['globalStats'] = array();
if (is_array($keys) && in_array($globalStatsKey, $keys)) {
if (isset($keys) && is_array($keys) && in_array($globalStatsKey, $keys)) {
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
$keyIndex = array_search($globalStatsKey, $keys);

View File

@ -13,6 +13,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2020 Demarest Maxime <maxime@indelog.fr>
* Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
@ -791,7 +792,7 @@ if (!defined('NOLOGIN')) {
} else {
// We are already into an authenticated session
$login = $_SESSION["dol_login"];
$entity = $_SESSION["dol_entity"];
$entity = isset($_SESSION["dol_entity"]) ? $_SESSION["dol_entity"] : 0;
dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
$resultFetchUser = $user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1));

View File

@ -125,7 +125,13 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel
if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
$prodser = array();
$prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0;
$prodser[0]['sell'] = 0;
$prodser[0]['buy'] = 0;
$prodser[0]['none'] = 0;
$prodser[1][0] = $prodser[1][1] = $prodser[1][2] = $prodser[1][3] = 0;
$prodser[1]['sell'] = 0;
$prodser[1]['buy'] = 0;
$prodser[1]['none'] = 0;
$sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell, p.tobuy";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";

View File

@ -449,7 +449,7 @@ $title = $langs->trans("Project").' - '.$object->ref.($object->thirdparty->name
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
$title = $object->ref.($object->thirdparty->name ? ' - '.$object->thirdparty->name : '').($object->title ? ' - '.$object->title : '');
}
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos";
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos|DE:Modul_Projekte";
llxHeader("", $title, $help_url);

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.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
@ -40,6 +40,7 @@ $resource_id = GETPOST('resource_id', 'int');
$sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'aZ09comma');
$optioncss = GETPOST('optioncss', 'alpha');
// Initialize context for list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'resourcelist';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2014-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -44,7 +44,7 @@ if (!empty($conf->projet->enabled)) {
$langs->load("projects");
}
$id = GETPOST("id", 'int');
$id = GETPOSTINT('id');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0;
@ -60,11 +60,11 @@ $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday",
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int'));
$datesp = dol_mktime(12, 0, 0, GETPOST("datespmonth", 'int'), GETPOST("datespday", 'int'), GETPOST("datespyear", 'int'));
$dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday", 'int'), GETPOST("dateepyear", 'int'));
$label = GETPOST('label');
$fk_user = GETPOST('userid', 'int');
$label = GETPOST('label', 'alphanohtml');
$fk_user = GETPOSTINT('userid');
// Security check
$socid = GETPOST("socid", "int");
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}

View File

@ -97,6 +97,13 @@ class PaymentSalary extends CommonObject
*/
public $fk_user_modif;
/**
* @var array
*/
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
);
/**
* Constructor
*

View File

@ -0,0 +1 @@

View File

@ -79,7 +79,7 @@ $search_zip = trim(GETPOST("search_zip", 'alpha'));
$search_state = trim(GETPOST("search_state", 'alpha'));
$search_region = trim(GETPOST("search_region", 'alpha'));
$search_email = trim(GETPOST('search_email', 'alpha'));
$search_phone = trim(GETPOST('search_phone', 'ahttps://wiki.dolibarr.org/index.php?title=Migrer_mon_Dolibarr_vers_une_offre_Cloudlpha'));
$search_phone = trim(GETPOST('search_phone', 'alpha'));
$search_fax = trim(GETPOST('search_fax', 'alpha'));
$search_url = trim(GETPOST('search_url', 'alpha'));
$search_idprof1 = trim(GETPOST('search_idprof1', 'alpha'));

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.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
@ -51,7 +51,7 @@ if (empty($page) || $page == -1) {
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$optioncss = GETPOST('optioncss', 'alpha');
/*
@ -185,12 +185,10 @@ if (!$rowid) {
//print "<td>".$charge->customer."</td>\n";
// Link
/*print "<td>";
if ($societestatic->id > 0)
{
if ($societestatic->id > 0) {
print $societestatic->getNomUrl(1);
}
if ($memberstatic->id > 0)
{
if ($memberstatic->id > 0) {
print $memberstatic->getNomUrl(1);
}
print "</td>\n";*/

View File

@ -90,6 +90,7 @@ $yearvalid = GETPOST("yearvalid");
$monthvalid = GETPOST("monthvalid");
$dayvalid = GETPOST("dayvalid");
$optioncss = GETPOST('optioncss', 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');

View File

@ -2909,6 +2909,7 @@ class Ticket extends CommonObject
global $conf, $user, $langs;
$now = dol_now();
$delay_warning = 0;
$this->nbtodo = $this->nbtodolate = 0;
$clause = " WHERE";
@ -2951,8 +2952,8 @@ class Ticket extends CommonObject
while ($obj = $this->db->fetch_object($resql)) {
$response->nbtodo++;
if ($mode == 'opened') {
$datelimit = $this->db->jdate($obj->datefin);
if ($datelimit < ($now - $delay_warning)) {
$datelimit = $this->db->jdate($obj->datec) + $delay_warning;
if ($datelimit < $now) {
//$response->nbtodolate++;
}
}

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) - 2013-2016 Jean-François FERRY <hello@librethic.io>
* Copyright (C) - 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.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
@ -127,11 +128,13 @@ print '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
$tick = array(
'unread' => 0,
'read' => 0,
'needmoreinfo' => 0,
'answered' => 0,
'assigned' => 0,
'inprogress' => 0,
'waiting' => 0,
'closed' => 0,
'canceled' => 0,
'deleted' => 0,
);
@ -144,7 +147,7 @@ $sql .= ' WHERE t.entity IN ('.getEntity('ticket').')';
$sql .= dolSqlDateFilter('datec', 0, 0, $endyear);
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
// External users restriction
@ -153,7 +156,7 @@ if ($user->socid > 0) {
} else {
// For internals users,
if (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && !$user->rights->ticket->manage) {
$sql .= " AND t.fk_user_assign = ".$user->id;
$sql .= " AND t.fk_user_assign = ".((int) $user->id);
}
}
$sql .= " GROUP BY t.fk_statut";
@ -322,7 +325,7 @@ if ($user->socid > 0) {
$sql .= " AND t.fk_soc= ".((int) $user->socid);
} else {
// Restricted to assigned user only
if ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && !$user->rights->ticket->manage) {
if (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && !$user->rights->ticket->manage) {
$sql .= " AND t.fk_user_assign=".$user->id;
}
}

View File

@ -13,7 +13,7 @@
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2015-2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 David Beniamine <David.Beniamine@Tetras-Libre.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -1247,9 +1247,10 @@ if ($action == 'create' || $action == 'adduserldap') {
} else {
// View and edit mode
if ($id > 0) {
$object->fetch($id, '', '', 1);
$res = $object->fetch($id, '', '', 1);
if ($res < 0) {
dol_print_error($db, $object->error); exit;
dol_print_error($db, $object->error);
exit;
}
$res = $object->fetch_optionals();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.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
@ -44,6 +44,7 @@ if ($user->socid > 0) {
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_user = GETPOST('search_user', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
// Load mode employee
$mode = GETPOST("mode", 'alpha');

View File

@ -177,8 +177,8 @@ class Workstation extends CommonObject
{
global $conf, $langs;
dol_include_once('/workstation/class/workstationusergroup.class.php');
dol_include_once('/workstation/class/workstationresource.class.php');
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstationusergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstationresource.class.php';
$this->db = $db;