Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 3895bf7

Browse files
committed
Fix showForm() signature
1 parent 1973e0c commit 3895bf7

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

inc/mantis.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtem
6868

6969
if (Session::haveRightsOr('plugin_mantis_use', [READ, UPDATE])) {
7070
$PluginMantisMantis = new self();
71-
$PluginMantisMantis->showForm($item);
71+
$PluginMantisMantis->showFormForItilItem($item);
7272
} else {
7373
echo "<div align='center'><br><br><img src=\"" . $CFG_GLPI["root_doc"] .
7474
"/pics/warning.png\" alt=\"warning\"><br><br>";
@@ -479,7 +479,7 @@ private static function getInfoSolved($list_ticket_mantis) {
479479
*
480480
* @param $item
481481
*/
482-
public function showForm($item) {
482+
public function showFormForItilItem($item) {
483483
global $CFG_GLPI;
484484

485485
$ws = new PluginMantisMantisws();

inc/profile.class.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,35 +101,25 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtem
101101
}
102102

103103

104-
/**
105-
* Show profile form
106-
*
107-
* @param $items_id integer id of the profile
108-
* @param $target value url of target
109-
*
110-
* @return nothing
111-
**/
112-
function showForm($profiles_id = 0, $openform = true, $closeform = true) {
104+
function showForm($ID, array $options = []) {
113105

114106
echo "<div class='firstbloc'>";
115-
if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE]))
116-
&& $openform) {
107+
if ($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE])) {
117108
$profile = new Profile();
118109
echo "<form method='post' action='".$profile->getFormURL()."'>";
119110
}
120111

121112
$profile = new Profile();
122-
$profile->getFromDB($profiles_id);
113+
$profile->getFromDB($ID);
123114

124115
$profile->displayRightsChoiceMatrix($this->getAllRights(),
125116
['canedit' => $canedit,
126117
'default_class' => 'tab_bg_2',
127118
'title' => __('General')]);
128119

129-
if ($canedit
130-
&& $closeform) {
120+
if ($canedit) {
131121
echo "<div class='center'>";
132-
echo Html::hidden('id', ['value' => $profiles_id]);
122+
echo Html::hidden('id', ['value' => $ID]);
133123
echo Html::submit(_sx('button', 'Save'), ['name' => 'update']);
134124
echo "</div>\n";
135125
Html::closeForm();

0 commit comments

Comments
 (0)