Skip to content

Commit 1c8f38f

Browse files
committed
fix(form_answer): fix search option
fix #602
1 parent 54c2a2e commit 1c8f38f

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

inc/form_answer.class.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,10 @@ public function getSearchOptionsNew() {
109109

110110
$tab[] = [
111111
'id' => '1',
112-
'table' => $this::getTable(),
113-
'field' => 'status',
114-
'name' => __('Status'),
115-
'searchtype' => [
116-
'0' => 'equals',
117-
'1' => 'notequals'
118-
],
119-
'datatype' => 'specific',
112+
'table' => $this->getTable(),
113+
'field' => 'name',
114+
'name' => __('Name'),
115+
'datatype' => 'itemlink',
120116
'massiveaction' => false
121117
];
122118

@@ -179,6 +175,19 @@ public function getSearchOptionsNew() {
179175
'linkfield' => 'groups_id_validator',
180176
];
181177

178+
$tab[] = [
179+
'id' => '8',
180+
'table' => $this::getTable(),
181+
'field' => 'status',
182+
'name' => __('Status'),
183+
'searchtype' => [
184+
'0' => 'equals',
185+
'1' => 'notequals'
186+
],
187+
'datatype' => 'specific',
188+
'massiveaction' => false
189+
];
190+
182191
if ($display_for_form) {
183192
$optindex = self::SOPTION_ANSWER;
184193
$question = new PluginFormcreatorQuestion;

install/update_dev.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
function plugin_formcreator_update_dev(Migration $migration) {
3+
global $DB;
4+
5+
// Change id of search option for status of form_answer
6+
$table = 'glpi_displaypreferences';
7+
$query = "UPDATE `$table` SET `num`='8' WHERE `itemtype`='PluginFormcreatorForm_Answer' AND `num`='1'";
8+
$DB->query($query);
9+
}

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
global $CFG_GLPI;
33
// Version of the plugin
4-
define('PLUGIN_FORMCREATOR_VERSION', '2.6.1');
4+
define('PLUGIN_FORMCREATOR_VERSION', '2.6.2-dev');
55
// Schema version of this version
66
define('PLUGIN_FORMCREATOR_SCHEMA_VERSION', '2.6');
77

0 commit comments

Comments
 (0)