Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
This commit is contained in:
commit
334c69841a
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
*
|
||||
* 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
|
||||
@ -98,7 +99,8 @@ class box_project extends ModeleBoxes
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " WHERE p.fk_statut = 1"; // Only open projects
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok
|
||||
$sql.= " AND p.fk_statut = 1"; // Only open projects
|
||||
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
|
||||
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
|
||||
@ -1656,21 +1656,24 @@ class Holiday extends CommonObject
|
||||
{
|
||||
if ($type)
|
||||
{
|
||||
// Si utilisateur de Dolibarr
|
||||
|
||||
$sql = "SELECT u.rowid";
|
||||
// If user of Dolibarr
|
||||
$sql = "SELECT";
|
||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= " DISTINCT";
|
||||
}
|
||||
$sql.= " u.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE (ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity = ".$conf->entity.")";
|
||||
$sql.= " OR u.admin = 1";
|
||||
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE ((ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity IN (".getEntity('usergroup')."))";
|
||||
$sql.= " OR u.entity = 0)"; // Show always superadmin
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
$sql.= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
$sql.= " AND u.statut > 0";
|
||||
if ($filters) $sql.=$filters;
|
||||
@ -1754,18 +1757,25 @@ class Holiday extends CommonObject
|
||||
// List for Dolibarr users
|
||||
if ($type)
|
||||
{
|
||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user";
|
||||
// If user of Dolibarr
|
||||
$sql = "SELECT";
|
||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||
$sql .= " DISTINCT";
|
||||
}
|
||||
$sql = " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE (ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity = ".$conf->entity.")";
|
||||
$sql.= " OR u.admin = 1";
|
||||
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE ((ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity IN (".getEntity('usergroup')."))";
|
||||
$sql.= " OR u.entity = 0)"; // Show always superadmin
|
||||
}
|
||||
else
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
{
|
||||
$sql.= " WHERE u.entity IN (".getEntity('user').")";
|
||||
}
|
||||
|
||||
$sql.= " AND u.statut > 0";
|
||||
if ($filters) $sql.=$filters;
|
||||
|
||||
@ -143,31 +143,31 @@ print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</
|
||||
if (! empty($conf->product->enabled))
|
||||
{
|
||||
$statProducts = '<tr class="oddeven">';
|
||||
$statProducts.= '<td><a href="list.php?type=0&tosell=0&tobuy=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td class="right">'.round($prodser[0][0]).'</td>';
|
||||
$statProducts.= '<td><a href="list.php?type=0&search_tosell=0&search_tobuy=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td class="right">'.round($prodser[0][0]).'</td>';
|
||||
$statProducts.= "</tr>";
|
||||
$statProducts.= '<tr class="oddeven">';
|
||||
$statProducts.= '<td><a href="list.php?type=0">'.$langs->trans("ProductsOnSaleOnly").'</a></td><td class="right">'.round($prodser[0][1]).'</td>';
|
||||
$statProducts.= '<td><a href="list.php?type=0&search_tosell=1&search_tobuy=0">'.$langs->trans("ProductsOnSaleOnly").'</a></td><td class="right">'.round($prodser[0][1]).'</td>';
|
||||
$statProducts.= "</tr>";
|
||||
$statProducts.= '<tr class="oddeven">';
|
||||
$statProducts.= '<td><a href="list.php?type=0">'.$langs->trans("ProductsOnPurchaseOnly").'</a></td><td class="right">'.round($prodser[0][2]).'</td>';
|
||||
$statProducts.= '<td><a href="list.php?type=0&search_tosell=0&search_tobuy=1">'.$langs->trans("ProductsOnPurchaseOnly").'</a></td><td class="right">'.round($prodser[0][2]).'</td>';
|
||||
$statProducts.= "</tr>";
|
||||
$statProducts.= '<tr class="oddeven">';
|
||||
$statProducts.= '<td><a href="list.php?type=0&tosell=1&tobuy=1">'.$langs->trans("ProductsOnSellAndOnBuy").'</a></td><td class="right">'.round($prodser[0][3]).'</td>';
|
||||
$statProducts.= '<td><a href="list.php?type=0&search_tosell=1&search_tobuy=1">'.$langs->trans("ProductsOnSellAndOnBuy").'</a></td><td class="right">'.round($prodser[0][3]).'</td>';
|
||||
$statProducts.= "</tr>";
|
||||
}
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$statServices = '<tr class="oddeven">';
|
||||
$statServices.= '<td><a href="list.php?type=1&tosell=0&tobuy=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td class="right">'.round($prodser[1][0]).'</td>';
|
||||
$statServices.= '<td><a href="list.php?type=1&search_tosell=0&search_tobuy=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td class="right">'.round($prodser[1][0]).'</td>';
|
||||
$statServices.= "</tr>";
|
||||
$statServices.= '<tr class="oddeven">';
|
||||
$statServices.= '<td><a href="list.php?type=1">'.$langs->trans("ServicesOnSaleOnly").'</a></td><td class="right">'.round($prodser[1][1]).'</td>';
|
||||
$statServices.= '<td><a href="list.php?type=1&search_tosell=1&search_tobuy=0">'.$langs->trans("ServicesOnSaleOnly").'</a></td><td class="right">'.round($prodser[1][1]).'</td>';
|
||||
$statServices.= "</tr>";
|
||||
$statServices.= '<tr class="oddeven">';
|
||||
$statServices.= '<td><a href="list.php?type=1">'.$langs->trans("ServicesOnPurchaseOnly").'</a></td><td class="right">'.round($prodser[1][2]).'</td>';
|
||||
$statServices.= '<td><a href="list.php?type=1&search_tosell=0&search_tobuy=1">'.$langs->trans("ServicesOnPurchaseOnly").'</a></td><td class="right">'.round($prodser[1][2]).'</td>';
|
||||
$statServices.= "</tr>";
|
||||
$statServices.= '<tr class="oddeven">';
|
||||
$statServices.= '<td><a href="list.php?type=1&tosell=1&tobuy=1">'.$langs->trans("ServicesOnSellAndOnBuy").'</a></td><td class="right">'.round($prodser[1][3]).'</td>';
|
||||
$statServices.= '<td><a href="list.php?type=1&search_tosell=1&search_tobuy=1">'.$langs->trans("ServicesOnSellAndOnBuy").'</a></td><td class="right">'.round($prodser[1][3]).'</td>';
|
||||
$statServices.= "</tr>";
|
||||
}
|
||||
$total=0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user