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

Commit

Permalink
feat(core): marketplace compatibilty
Browse files Browse the repository at this point in the history
Signed-off-by: Stanislas <[email protected]>
  • Loading branch information
stonebuzz committed Sep 25, 2020
1 parent da34549 commit 72c5c6c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion inc/menu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function displayMenu($type = 'dashboard') {
* @return array the menu content
*/
public static function getMenuContent() {
$front_flyvemdm = "/plugins/flyvemdm/front";
$front_flyvemdm = "/".Plugin::getWebDir("flyvemdm", false)."/front";

$menu = [];
$menu['title'] = self::getMenuName();
Expand Down
2 changes: 1 addition & 1 deletion inc/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ static function showForNotifiable(CommonDBTM $item, $withtemplate = '') {
'toupdate' => [
'value_fieldname' => 'value',
'to_update' => 'plugin_flyvemdm_policy_value',
'url' => $CFG_GLPI['root_doc'] . "/plugins/flyvemdm/ajax/policyValue.php",
'url' => $CFG_GLPI['root_doc'] . "/".Plugin::getWebDir("flyvemdm", false)."/ajax/policyValue.php",
],
]);
}
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Maximum GLPI version, exclusive
define('PLUGIN_FLYVEMDM_GLPI_MAX_VERSION', '9.4');

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

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

Expand Down
4 changes: 2 additions & 2 deletions tests/suite-unit/PluginFlyvemdmAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testShowForm() {
$instance->showForm($agent->getID());
$result = ob_get_contents();
ob_end_clean();
$formAction = preg_quote("/plugins/flyvemdm/front/agent.form.php", '/');
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/agent.form.php", '/');
$this->string($result)
->matches("#method='post' action='.+?" . $formAction . "'#")
->contains("input type='hidden' name='entities_id' value='0'")
Expand All @@ -174,7 +174,7 @@ public function testShowDangerZone() {
$instance->showDangerZone($agent);
$result = ob_get_contents();
ob_end_clean();
$formAction = preg_quote("/plugins/flyvemdm/front/agent.form.php", '/');
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/agent.form.php", '/');
$this->string($result)
->matches("#method='post' action='.+?" . $formAction . "'#")
->contains("input type='hidden' name='entities_id'")
Expand Down
2 changes: 1 addition & 1 deletion tests/suite-unit/PluginFlyvemdmInvitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function testShowForm() {
$instance->showForm(0);
$result = ob_get_contents();
ob_end_clean();
$formAction = preg_quote("/plugins/flyvemdm/front/invitation.form.php", '/');
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/invitation.form.php", '/');
$this->string($result)
->matches("#method='post' action='.+?" . $formAction . "'#")
->contains("input type='hidden' name='entities_id' value='0'")
Expand Down
2 changes: 1 addition & 1 deletion tests/suite-unit/PluginFlyvemdmPolicyBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function testFormGenerator() {
'itemtype_applied' => 'fleet',
'items_id_applied' => $fleetId,
]);
$formAction = preg_quote("/plugins/flyvemdm/front/task.form.php", '/');
$formAction = preg_quote("/".Plugin::getWebDir("flyvemdm", false)."/front/task.form.php", '/');
$this->string($html)
->matches('#action=".+?' . $formAction . '"#')
->contains('input name="value" value="0"')
Expand Down

0 comments on commit 72c5c6c

Please sign in to comment.