Skip to content

Commit ea27c47

Browse files
authored
Fix(build): clean front files (#1019)
1 parent f39b40e commit ea27c47

6 files changed

Lines changed: 6 additions & 131 deletions

File tree

front/commondropdown.form.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

front/commondropdown.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

templates/container.class.tpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use Glpi\DBAL\QueryParam;
4+
35
class %%CLASSNAME%% extends PluginFieldsAbstractContainerInstance
46
{
57
static $rightname = '%%ITEMTYPE_RIGHT%%';
@@ -51,7 +53,7 @@ class %%CLASSNAME%% extends PluginFieldsAbstractContainerInstance
5153
* This block ensures that the 'entities_id' field is created and populated if it
5254
* associated item type requires entity assignment
5355
*/
54-
if (getItemForItemtype('%%ITEMTYPE%%')->isEntityAssign() && !$DB->fieldExists($table, 'entities_id')) {
56+
if (getItemForItemtype(%%ITEMTYPE%%::class)->isEntityAssign() && !$DB->fieldExists($table, 'entities_id')) {
5557
$migration->addField($table, 'entities_id', 'fkey', ['after' => 'plugin_fields_containers_id']);
5658
$migration->addKey($table, 'entities_id');
5759
$migration->executeMigration();
@@ -107,7 +109,7 @@ class %%CLASSNAME%% extends PluginFieldsAbstractContainerInstance
107109
* associated item type requires recursive assignment
108110
*/
109111
if (
110-
getItemForItemtype('%%ITEMTYPE%%')->maybeRecursive()
112+
getItemForItemtype(%%ITEMTYPE%%::class)->maybeRecursive()
111113
&& !$DB->fieldExists($table, 'is_recursive')
112114
&& $DB->fieldExists($table, 'entities_id')) {
113115
$migration->addField($table, 'is_recursive', 'bool', ['after' => 'entities_id']);

templates/dropdown.class.tpl

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ class %%CLASSNAME%% extends CommonTreeDropdown {
5959
* @param $full path or relative one (true by default)
6060
**/
6161
static function getTabsURL($full=true) {
62-
$url = Toolbox::getItemTypeTabsURL('PluginFieldsCommonDropdown', $full);
63-
$plug = isPluginItemType(get_called_class());
64-
$url .= '?ddtype=' . strtolower($plug['class']);
62+
$url = Toolbox::getItemTypeTabsURL(get_called_class(), $full);
6563
return $url;
6664
}
6765

@@ -71,45 +69,7 @@ class %%CLASSNAME%% extends CommonTreeDropdown {
7169
* @param $full path or relative one (true by default)
7270
**/
7371
static function getSearchURL($full=true) {
74-
$url = Toolbox::getItemTypeSearchURL('PluginFieldsCommonDropdown', $full);
75-
$plug = isPluginItemType(get_called_class());
76-
$url .= '?ddtype=' . strtolower($plug['class']);
72+
$url = Toolbox::getItemTypeSearchURL(get_called_class(), $full);
7773
return $url;
7874
}
79-
80-
/**
81-
* Get the form page URL for the current class
82-
*
83-
* @param $full path or relative one (true by default)
84-
**/
85-
static function getFormURL($full=true) {
86-
$url = Toolbox::getItemTypeFormURL('PluginFieldsCommonDropdown', $full);
87-
$plug = isPluginItemType(get_called_class());
88-
$url .= '?ddtype=' . strtolower($plug['class']);
89-
return $url;
90-
}
91-
92-
/**
93-
* Get the form page URL for the current class and point to a specific ID
94-
*
95-
* @param $id (default 0)
96-
* @param $full path or relative one (true by default)
97-
*
98-
* @since version 0.90
99-
**/
100-
static function getFormURLWithID($id=0, $full=true) {
101-
102-
$link = self::getFormURL($full);
103-
$link .= '&id=' . $id;
104-
return $link;
105-
}
106-
107-
/**
108-
* Get default values to search engine to override
109-
**/
110-
static function getDefaultSearchRequest() {
111-
$plug = isPluginItemType(get_called_class());
112-
$search = ['addhidden' => ['ddtype' => strtolower($plug['class'])]];
113-
return $search;
114-
}
11575
}

templates/dropdown.form.tpl

Lines changed: 0 additions & 7 deletions
This file was deleted.

templates/dropdown.tpl

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)