Skip to content

Commit

Permalink
Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/fourn/commande/card.php
	htdocs/user/class/user.class.php
  • Loading branch information
eldy committed Apr 24, 2019
2 parents e5c2027 + a15f135 commit 68d438b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/lib/project.lib.php
Expand Up @@ -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>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/card_presend.tpl.php
Expand Up @@ -174,7 +174,7 @@
$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');
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/commande/card.php
Expand Up @@ -2467,16 +2467,16 @@
}

// 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)
{
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)
if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_payment_salary.sql
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_payment_various.sql
Expand Up @@ -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,
Expand Down
32 changes: 27 additions & 5 deletions htdocs/user/class/user.class.php
Expand Up @@ -3130,14 +3130,13 @@ public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)

// 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();

Expand Down Expand Up @@ -3248,15 +3247,38 @@ public function user_get_property($rowid, $mode)
* @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();
Expand Down

0 comments on commit 68d438b

Please sign in to comment.