Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ChangeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function getTypeName($nb = 0)
/**
* Populate the planning with planned ticket tasks
*
* @param $options array of possible options:
* @param array $options array of possible options:
* - who ID of the user (0 = undefined)
* - whogroup ID of the group of users (0 = undefined)
* - begin Date
Expand Down Expand Up @@ -76,7 +76,7 @@ public static function displayPlanningItem(array $val, $who, $type = "", $comple
/**
* Populate the planning with not planned ticket tasks
*
* @param $options array of possible options:
* @param array $options array of possible options:
* - who ID of the user (0 = undefined)
* - whogroup ID of the group of users (0 = undefined)
* - begin Date
Expand Down
6 changes: 4 additions & 2 deletions src/Change_Problem.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $
* Show tickets for a problem
*
* @param Problem $problem
* @return void
**/
public static function showForProblem(Problem $problem)
{
global $DB;

$ID = $problem->getField('id');
if (!$problem->can($ID, READ)) {
return false;
return;
}

$canedit = $problem->canEdit($ID);
Expand Down Expand Up @@ -194,14 +195,15 @@ public static function showForProblem(Problem $problem)
* Show problems for a change
*
* @param Change $change object
* @return void
**/
public static function showForChange(Change $change)
{
global $DB;

$ID = $change->getField('id');
if (!$change->can($ID, READ)) {
return false;
return;
}

$canedit = $change->canEdit($ID);
Expand Down
6 changes: 4 additions & 2 deletions src/Change_Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,15 @@ public static function processMassiveActionsForOneItemtype(
* Show tickets for a change
*
* @param Change $change
* @return void
**/
public static function showForChange(Change $change)
{
global $DB;

$ID = $change->getField('id');
if (!$change->can($ID, READ)) {
return false;
return;
}

$canedit = $change->canEdit($ID);
Expand Down Expand Up @@ -307,14 +308,15 @@ public static function showForChange(Change $change)
* Show changes for a ticket
*
* @param Ticket $ticket object
* @return void
**/
public static function showForTicket(Ticket $ticket)
{
global $DB;

$ID = $ticket->getField('id');
if (!$ticket->can($ID, READ)) {
return false;
return;
}

$canedit = $ticket->canEdit($ID);
Expand Down
1 change: 1 addition & 0 deletions src/CommonITILRecurrent.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*/
abstract class CommonITILRecurrent extends CommonDropdown
{
/** @use Clonable<static> */
use Clonable;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ProblemTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getTypeName($nb = 0)
/**
* Populate the planning with planned problem tasks
*
* @param $options array of possible options:
* @param array $options array of possible options:
* - who ID of the user (0 = undefined)
* - whogroup ID of the group of users (0 = undefined)
* - begin Date
Expand Down Expand Up @@ -75,7 +75,7 @@ public static function displayPlanningItem(array $val, $who, $type = "", $comple
/**
* Populate the planning with not planned problem tasks
*
* @param $options array of possible options:
* @param array $options array of possible options:
* - who ID of the user (0 = undefined)
* - whogroup ID of the group of users (0 = undefined)
* - begin Date
Expand Down
6 changes: 4 additions & 2 deletions src/Problem_Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,14 @@ public static function processMassiveActionsForOneItemtype(
* Show tickets for a problem
*
* @param Problem $problem
* @return void
**/
public static function showForProblem(Problem $problem)
{
$ID = $problem->getField('id');

if (!static::canView() || !$problem->can($ID, READ)) {
return false;
return;
}

$canedit = $problem->canEdit($ID);
Expand Down Expand Up @@ -266,14 +267,15 @@ public static function showForProblem(Problem $problem)
* Show problems for a ticket
*
* @param Ticket $ticket object
* @return void
**/
public static function showForTicket(Ticket $ticket)
{

$ID = $ticket->getField('id');

if (!static::canView() || !$ticket->can($ID, READ)) {
return false;
return;
}

$canedit = $ticket->can($ID, UPDATE);
Expand Down
4 changes: 2 additions & 2 deletions src/TicketTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getTypeName($nb = 0)
/**
* Populate the planning with planned ticket tasks
*
* @param $options array of possible options:
* @param array $options array of possible options:
* - who ID of the user (0 = undefined)
* - whogroup ID of the group of users (0 = undefined)
* - begin Date
Expand All @@ -60,7 +60,7 @@ public static function populatePlanning($options = []): array
/**
* Populate the planning with planned ticket tasks
*
* @param $options array of possible options:
* @param array $options array of possible options:
* - who ID of the user (0 = undefined)
* - whogroup ID of the group of users (0 = undefined)
* - begin Date
Expand Down
Loading