Skip to content

Commit

Permalink
Compatibility with GLPI 9.3
Browse files Browse the repository at this point in the history
Set version to 2.4.0
  • Loading branch information
tomolimo committed Jul 2, 2019
1 parent 7acce5a commit ac18d2d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 61 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ Remove functions for 9.1 compatibility

## 2.3.3
Fixed issue with the \r\n

## 2.4.0
Compatibility with GLPI 9.4
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static function cleanText($parm) {
// cases of the " that are converted into '; instead of " in GLPI 9.2, 9.3 and 9.4
$temp_content = str_replace('\\\';', '\\"', $temp_content);
// backport of addslashes_deep from GLPI 9.4/bugfixes, completes the one from GLPI 9.2
$temp_content = str_replace([''', '''], ["'", "'"], $temp_content);
$temp_content = str_replace(['''], ["'"], $temp_content);
// End of GLPI fixes
////////////////////

Expand Down
136 changes: 78 additions & 58 deletions inc/filter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,70 +31,90 @@ static function getTypeName($nb = 0) {
}

/**
* Summary of getSearchOptions
* Summary of rawSearchOptions
* @return mixed
*/
function getSearchOptions() {
function rawSearchOptions() {
global $LANG;

$tab = [];

$tab['common'] = __('Filter', 'ticketcleaner');

$tab[1]['table'] = $this->getTable();
$tab[1]['field'] = 'name';
$tab[1]['name'] = __('Name');
$tab[1]['datatype'] = 'itemlink';
$tab[1]['searchtype'] = 'contains';
$tab[1]['massiveaction'] = false;
$tab[1]['itemlink_type'] = $this->getType();

$tab[8]['table'] = $this->getTable();
$tab[8]['field'] = 'is_active';
$tab[8]['name'] = __('Active');
$tab[8]['massiveaction'] = true;
$tab[8]['datatype'] = 'bool';

$tab[4]['table'] = $this->getTable();
$tab[4]['field'] = 'comment';
$tab[4]['name'] = __('Comments');
$tab[4]['massiveaction'] = true;
$tab[4]['datatype'] = 'text';

$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;

//$tab[802]['table'] = $this->getTable();
//$tab[802]['field'] = 'css_selector_value';
//$tab[802]['name'] = __('Value CSS selector', 'ticketcleaner');
//$tab[802]['massiveaction'] = false;
//$tab[802]['datatype'] = 'dropdown';

$tab[900]['table'] = $this->getTable();
$tab[900]['field'] = 'type';
$tab[900]['name'] = __('Type', 'ticketcleaner');
$tab[900]['massiveaction'] = false;
$tab[900]['searchtype'] = 'equals';
$tab[900]['datatype'] = 'specific';

$tab[901]['table'] = $this->getTable();
$tab[901]['field'] = 'order';
$tab[901]['name'] = __('Order', 'ticketcleaner');
$tab[901]['massiveaction'] = false;
//$tab[901]['searchtype'] = 'equals';

$tab[902]['table'] = $this->getTable();
$tab[902]['field'] = 'regex';
$tab[902]['name'] = __('RegEx', 'ticketcleaner');
$tab[902]['massiveaction'] = false;

$tab[903]['table'] = $this->getTable();
$tab[903]['field'] = 'replacement';
$tab[903]['name'] = __('Replacement', 'ticketcleaner');
$tab[903]['massiveaction'] = false;
$tab[] = [
'id' => 'common',
'name' =>__('Filter', 'ticketcleaner')
];

$tab[] = [
'id' => '1',
'table' => $this->getTable(),
'field' => 'name',
'name' => __('Name'),
'datatype' => 'itemlink',
'searchtype' => 'contains',
'massiveaction' => false,
'itemlink_type' => 'PluginTicketcleanerFilter'
];

$tab[] = [
'id' => '8',
'table' => $this->getTable(),
'field' => 'is_active',
'name' => __('Active'),
'massiveaction' => true,
'datatype' => 'bool'
];

$tab[] = [
'id' => '4',
'table' => $this->getTable(),
'field' => 'comment',
'name' => __('Comments'),
'massiveaction' => true,
'datatype' => 'text'
];

$tab[] = [
'id' => '19',
'table' => $this->getTable(),
'field' => 'date_mod',
'name' => __('Last update'),
'datatype' => 'datetime',
'massiveaction' => false
];

$tab[] = [
'id' => '900',
'table' => $this->getTable(),
'field' => 'type',
'name' => __('Type', 'ticketcleaner'),
'massiveaction' => false,
'searchtype' => 'equals',
'datatype' => 'specific'
];

$tab[] = [
'id' => '901',
'table' => $this->getTable(),
'field' => 'order',
'name' => __('Order', 'ticketcleaner'),
'massiveaction' => false
];

$tab[] = [
'id' => '902',
'table' => $this->getTable(),
'field' => 'regex',
'name' => __('RegEx', 'ticketcleaner'),
'massiveaction' => false
];

$tab[] = [
'id' => '903',
'table' => $this->getTable(),
'field' => 'replacement',
'name' => __('Replacement', 'ticketcleaner'),
'massiveaction' => false
];

return $tab;
}
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// and it cleans attached pictures to emails
// It has been succesfully tested with plain TEXT and HTML emails
// ----------------------------------------------------------------------
define ("PLUGIN_TICKETCLEANER_VERSION", "2.3.3");
define ("PLUGIN_TICKETCLEANER_VERSION", "2.4.0");

/**
* Summary of plugin_init_ticketcleaner
Expand Down
5 changes: 4 additions & 1 deletion ticketcleaner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ This plugin adds the possibility to translate it 'inline', see wiki.]]></en>
<num>2.3.3</num>
<compatibility>9.2</compatibility>
</version>

<version>
<num>2.4.0</num>
<compatibility>9.3</compatibility>
</version>
</versions>
<langs>
<lang>Any</lang>
Expand Down

0 comments on commit ac18d2d

Please sign in to comment.