Skip to content

Commit

Permalink
Merge branch '7.0' of [email protected]:Dolibarr/dolibarr.git into 8.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/class/html.formprojet.class.php
  • Loading branch information
eldy committed Nov 5, 2018
2 parents 2900947 + 56a70ab commit 4c591da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions htdocs/core/class/html.formprojet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,25 +306,31 @@ function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $m
* @param string $morecss More css added to the select component
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
* @param string $showproject 'all' = Show project info, ''=Hide project info
* @param User $usertofilter User object to use for filtering
* @return int Nbr of project if OK, <0 if KO
*/
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all')
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null)
{
global $user,$conf,$langs;

require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';

if (is_null($usertofilter))
{
$usertofilter = $user;
}

$out='';

$hideunselectables = false;
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;

if (empty($projectsListId))
{
if (empty($user->rights->projet->all->lire))
if (empty($usertofilter->rights->projet->all->lire))
{
$projectstatic=new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1);
}
}

Expand Down Expand Up @@ -370,7 +376,7 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24,
{
$obj = $this->db->fetch_object($resql);
// If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire))
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire))
{
// Do nothing
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/activity/perday.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">';
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1);
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess);
print '</div>';
print ' ';
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/activity/perweek.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">';
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1);
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess);
print '</div>';
print ' ';
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
Expand Down

0 comments on commit 4c591da

Please sign in to comment.