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

Conflicts:
	htdocs/fourn/commande/card.php
	htdocs/user/class/user.class.php
This commit is contained in:
Laurent Destailleur 2019-04-25 01:50:48 +02:00
commit 68d438b697
6 changed files with 34 additions and 12 deletions

View File

@ -474,7 +474,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
} }
// Ref of task // Ref of task
print '<td>'; print '<td class="nowraponall">';
if ($showlineingray) if ($showlineingray)
{ {
print '<i>'.img_object('', 'projecttask').' '.$lines[$i]->ref.'</i>'; print '<i>'.img_object('', 'projecttask').' '.$lines[$i]->ref.'</i>';

View File

@ -174,7 +174,7 @@ if ($action == 'presend')
$listeuser=array(); $listeuser=array();
$fuserdest = new User($db); $fuserdest = new User($db);
$result= $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\'')); $result= $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\''), 'AND', true);
if ($result>0 && is_array($fuserdest->users) && count($fuserdest->users)>0) { if ($result>0 && is_array($fuserdest->users) && count($fuserdest->users)>0) {
foreach($fuserdest->users as $uuserdest) { foreach($fuserdest->users as $uuserdest) {
$listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id, 'email'); $listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id, 'email');

View File

@ -2467,8 +2467,8 @@ elseif (! empty($object->id))
} }
// Create bill // Create bill
if (! empty($conf->facture->enabled)) //if (! empty($conf->facture->enabled))
{ //{
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled
{ {
if ($user->rights->fournisseur->facture->creer) if ($user->rights->fournisseur->facture->creer)
@ -2476,7 +2476,7 @@ elseif (! empty($object->id))
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
} }
} }
} //}
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved

View File

@ -19,7 +19,7 @@
create table llx_payment_salary create table llx_payment_salary
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- payment reference number ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
tms timestamp, tms timestamp,
datec datetime, -- Create date datec datetime, -- Create date
fk_user integer NOT NULL, fk_user integer NOT NULL,

View File

@ -19,7 +19,7 @@
create table llx_payment_various create table llx_payment_various
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- payment reference number ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
num_payment varchar(50), -- num cheque or other num_payment varchar(50), -- num cheque or other
label varchar(255), label varchar(255),
tms timestamp, tms timestamp,

View File

@ -3130,14 +3130,13 @@ class User extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Charge indicateurs this->nb pour le tableau de bord * Load metrics this->nb for dashboard
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function load_state_board() public function load_state_board()
{ {
// phpcs:enable // phpcs:enable
global $conf;
$this->nb=array(); $this->nb=array();
@ -3248,15 +3247,38 @@ class User extends CommonObject
* @param int $offset page * @param int $offset page
* @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...)
* @param string $filtermode Filter mode (AND or OR) * @param string $filtermode Filter mode (AND or OR)
* @param bool $entityfilter Activate entity filter
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND') public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND', $entityfilter = false)
{ {
global $conf; global $conf, $user;
$sql="SELECT t.rowid"; $sql="SELECT t.rowid";
$sql.= ' FROM '.MAIN_DB_PREFIX .$this->table_element.' as t '; $sql.= ' FROM '.MAIN_DB_PREFIX .$this->table_element.' as t ';
if ($entityfilter)
{
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql.= " WHERE t.entity IS NOT NULL"; // Show all users
} else {
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ((ug.fk_user = t.rowid";
$sql.= " AND ug.entity IN (".getEntity('user')."))";
$sql.= " OR t.entity = 0)"; // Show always superadmin
}
}
else
{
$sql.= " WHERE t.entity IN (".getEntity('user').")";
}
}
else
{
$sql.= " WHERE 1"; $sql.= " WHERE 1";
}
// Manage filter // Manage filter
$sqlwhere = array(); $sqlwhere = array();