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:
commit
68d438b697
@ -474,7 +474,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
|
||||
// Ref of task
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
if ($showlineingray)
|
||||
{
|
||||
print '<i>'.img_object('', 'projecttask').' '.$lines[$i]->ref.'</i>';
|
||||
|
||||
@ -174,7 +174,7 @@ if ($action == 'presend')
|
||||
$listeuser=array();
|
||||
$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) {
|
||||
foreach($fuserdest->users as $uuserdest) {
|
||||
$listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id, 'email');
|
||||
|
||||
@ -2467,8 +2467,8 @@ elseif (! empty($object->id))
|
||||
}
|
||||
|
||||
// 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 ($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&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// 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
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
create table llx_payment_salary
|
||||
(
|
||||
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,
|
||||
datec datetime, -- Create date
|
||||
fk_user integer NOT NULL,
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
create table llx_payment_various
|
||||
(
|
||||
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
|
||||
label varchar(255),
|
||||
tms timestamp,
|
||||
|
||||
@ -3130,14 +3130,13 @@ class User extends CommonObject
|
||||
|
||||
// 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
|
||||
*/
|
||||
public function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
|
||||
@ -3248,15 +3247,38 @@ class User extends CommonObject
|
||||
* @param int $offset page
|
||||
* @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...)
|
||||
* @param string $filtermode Filter mode (AND or OR)
|
||||
* @param bool $entityfilter Activate entity filter
|
||||
* @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.= ' FROM '.MAIN_DB_PREFIX .$this->table_element.' as t ';
|
||||
$sql.= " WHERE 1";
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user