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

Commit 72c5c6c

Browse files
committed
feat(core): marketplace compatibilty
Signed-off-by: Stanislas <[email protected]>
1 parent da34549 commit 72c5c6c

6 files changed

+7
-7
lines changed

inc/menu.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function displayMenu($type = 'dashboard') {
135135
* @return array the menu content
136136
*/
137137
public static function getMenuContent() {
138-
$front_flyvemdm = "/plugins/flyvemdm/front";
138+
$front_flyvemdm = "/".Plugin::getWebDir("flyvemdm", false)."/front";
139139

140140
$menu = [];
141141
$menu['title'] = self::getMenuName();

inc/task.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ static function showForNotifiable(CommonDBTM $item, $withtemplate = '') {
669669
'toupdate' => [
670670
'value_fieldname' => 'value',
671671
'to_update' => 'plugin_flyvemdm_policy_value',
672-
'url' => $CFG_GLPI['root_doc'] . "/plugins/flyvemdm/ajax/policyValue.php",
672+
'url' => $CFG_GLPI['root_doc'] . "/".Plugin::getWebDir("flyvemdm", false)."/ajax/policyValue.php",
673673
],
674674
]);
675675
}

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// Maximum GLPI version, exclusive
4040
define('PLUGIN_FLYVEMDM_GLPI_MAX_VERSION', '9.4');
4141

42-
define('PLUGIN_FLYVEMDM_ROOT', GLPI_ROOT . '/plugins/flyvemdm');
42+
define('PLUGIN_FLYVEMDM_ROOT', GLPI_ROOT . '/'.Plugin::getWebDir("flyvemdm", false));
4343

4444
define('PLUGIN_FLYVEMDM_AGENT_DOWNLOAD_URL', 'https://play.google.com/store/apps/details?id=org.flyve.mdm.agent');
4545

tests/suite-unit/PluginFlyvemdmAgent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testShowForm() {
153153
$instance->showForm($agent->getID());
154154
$result = ob_get_contents();
155155
ob_end_clean();
156-
$formAction = preg_quote("/plugins/flyvemdm/front/agent.form.php", '/');
156+
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/agent.form.php", '/');
157157
$this->string($result)
158158
->matches("#method='post' action='.+?" . $formAction . "'#")
159159
->contains("input type='hidden' name='entities_id' value='0'")
@@ -174,7 +174,7 @@ public function testShowDangerZone() {
174174
$instance->showDangerZone($agent);
175175
$result = ob_get_contents();
176176
ob_end_clean();
177-
$formAction = preg_quote("/plugins/flyvemdm/front/agent.form.php", '/');
177+
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/agent.form.php", '/');
178178
$this->string($result)
179179
->matches("#method='post' action='.+?" . $formAction . "'#")
180180
->contains("input type='hidden' name='entities_id'")

tests/suite-unit/PluginFlyvemdmInvitation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function testShowForm() {
198198
$instance->showForm(0);
199199
$result = ob_get_contents();
200200
ob_end_clean();
201-
$formAction = preg_quote("/plugins/flyvemdm/front/invitation.form.php", '/');
201+
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/invitation.form.php", '/');
202202
$this->string($result)
203203
->matches("#method='post' action='.+?" . $formAction . "'#")
204204
->contains("input type='hidden' name='entities_id' value='0'")

tests/suite-unit/PluginFlyvemdmPolicyBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function testFormGenerator() {
248248
'itemtype_applied' => 'fleet',
249249
'items_id_applied' => $fleetId,
250250
]);
251-
$formAction = preg_quote("/plugins/flyvemdm/front/task.form.php", '/');
251+
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/task.form.php", '/');
252252
$this->string($html)
253253
->matches('#action=".+?' . $formAction . '"#')
254254
->contains('input name="value" value="0"')

0 commit comments

Comments
 (0)