Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 6 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 @@ -188,20 +189,22 @@ public static function showForProblem(Problem $problem)
'container' => 'mass' . static::class . $rand,
],
]);

}

/**
* 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 Expand Up @@ -279,5 +282,6 @@ public static function showForChange(Change $change)
'container' => 'mass' . static::class . $rand,
],
]);

}
}
2 changes: 2 additions & 0 deletions src/Change_Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public static function processMassiveActionsForOneItemtype(
* Show tickets for a change
*
* @param Change $change
* @return void|false
**/
public static function showForChange(Change $change)
{
Expand Down Expand Up @@ -307,6 +308,7 @@ public static function showForChange(Change $change)
* Show changes for a ticket
*
* @param Ticket $ticket object
* @return void|false
**/
public static function showForTicket(Ticket $ticket)
{
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
8 changes: 6 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 @@ -260,20 +261,22 @@ public static function showForProblem(Problem $problem)
'extraparams' => ['problems_id' => $problem->getID()],
],
]);

}

/**
* 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 Expand Up @@ -331,6 +334,7 @@ public static function showForTicket(Ticket $ticket)
'container' => 'mass' . static::class . $rand,
],
]);

}

/**
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