Skip to content

Commit

Permalink
fix(form): repair massive acions
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 18, 2017
1 parent 02c2877 commit 7221644
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function getSearchOptionsNew() {
'searchtype' => [
'0' => 'equals'
],
'massiveaction' => false
'massiveaction' => true
];

$tab[] = [
Expand Down Expand Up @@ -207,29 +207,30 @@ public static function getSpecificValueToSelect($field, $name='', $values='', ar

switch ($field) {
case 'is_active' :
return Dropdown::showFromArray('criteria[0][value]', [
return Dropdown::showFromArray($name, [
'0' => __('Inactive'),
'1' => __('Active'),
], [
'value' => $values[$field],
'display_emptychoice' => true,
'display_emptychoice' => false,
'display' => false
]);
break;

case 'access_rights' :
return Dropdown::showFromArray('criteria[0][value]', [
Dropdown::EMPTY_VALUE => '--- ' . __('All langages', 'formcreator') . ' ---',
return Dropdown::showFromArray($name, [
self::ACCESS_PUBLIC => __('Public access', 'formcreator'),
self::ACCESS_PRIVATE => __('Private access', 'formcreator'),
self::ACCESS_RESTRICTED => __('Restricted access', 'formcreator'),
], [
'value' => $values[$field],
'display_emptychoice' => true,
'display_emptychoice' => false,
'display' => false
]);
break;

case 'language' :
return Dropdown::showLanguages('criteria[0][value]', [
return Dropdown::showLanguages($name, [
'value' => $values[$field],
'display_emptychoice' => true,
'emptylabel' => '--- ' . __('All langages', 'formcreator') . ' ---',
Expand Down Expand Up @@ -269,20 +270,24 @@ public static function getSpecificValueToDisplay($field, $values, array $options
}
return $output;
break;

case 'access_rights':
switch ($values[$field]) {
case self::ACCESS_PUBLIC :
return __('Public access', 'formcreator');
break;

case self::ACCESS_PRIVATE :
return __('Private access', 'formcreator');
break;

case self::ACCESS_RESTRICTED :
return __('Restricted access', 'formcreator');
break;
}
return '';
break;

case 'language' :
if (empty($values[$field])) {
return __('All langages', 'formcreator');
Expand Down
2 changes: 1 addition & 1 deletion js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
?>

var modalWindow;
var rootDoc = "<?php echo $CFG_GLPI['root_doc']; ?>";
var rootDoc = CFG_GLPI['root_doc'];
var currentCategory = "0";
var sortByName = false;
var tiles = [];
Expand Down

0 comments on commit 7221644

Please sign in to comment.