Skip to content

Commit

Permalink
Fix for marketplace
Browse files Browse the repository at this point in the history
add index files
  • Loading branch information
tsmr committed Dec 13, 2021
1 parent 2de8dad commit 6b5ab48
Show file tree
Hide file tree
Showing 16 changed files with 195 additions and 400 deletions.
2 changes: 1 addition & 1 deletion addressing.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function nameIsThere(params) {
var typeElm = $('select[name="type"]');
var divNameItemElm = $('div[id="nameItem"]');
$.ajax({
url: root_doc + '/plugins/addressing/front/addressing.php',
url: root_doc + '/front/addressing.php',
type: "GET",
dataType: "json",
data: {
Expand Down
4 changes: 4 additions & 0 deletions addressing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<author>Nelly Mahu-Lasson</author>
</authors>
<versions>
<version>
<num>2.9.1</num>
<compatibility>9.5</compatibility>
</version>
<version>
<num>2.9.0</num>
<compatibility>9.5</compatibility>
Expand Down
28 changes: 28 additions & 0 deletions ajax/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
* @version $Id$
-------------------------------------------------------------------------
addressing plugin for GLPI
Copyright (C) 2009-2016 by the addressing Development Team.
https://github.com/pluginsGLPI/addressing
-------------------------------------------------------------------------
LICENSE
This file is part of addressing.
addressing is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
addressing is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
28 changes: 28 additions & 0 deletions front/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
* @version $Id$
-------------------------------------------------------------------------
addressing plugin for GLPI
Copyright (C) 2009-2016 by the addressing Development Team.
https://github.com/pluginsGLPI/addressing
-------------------------------------------------------------------------
LICENSE
This file is part of addressing.
addressing is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
addressing is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
26 changes: 13 additions & 13 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,68 +30,68 @@
function plugin_addressing_install() {
global $DB;

include_once(GLPI_ROOT . "/plugins/addressing/inc/profile.class.php");
include_once(PLUGIN_ADDRESSING_DIR . "/inc/profile.class.php");

$update = false;
if (!$DB->tableExists("glpi_plugin_addressing_display")
&& !$DB->tableExists("glpi_plugin_addressing")
&& !$DB->tableExists("glpi_plugin_addressing_configs")) {

$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/empty-3.0.0.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/empty-3.0.0.sql");

} else {

if (!$DB->tableExists("glpi_plugin_addressing_profiles")
&& $DB->tableExists("glpi_plugin_addressing_display")
&& !$DB->fieldExists("glpi_plugin_addressing_display", "ipconf1")) {//1.4
$update = true;
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-1.4.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-1.4.sql");
}

if (!$DB->tableExists("glpi_plugin_addressing")
&& $DB->tableExists("glpi_plugin_addressing_display")
&& $DB->fieldExists("glpi_plugin_addressing_display", "ipconf1")) {
$update = true;
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-1.5.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-1.5.sql");

}

if ($DB->tableExists("glpi_plugin_addressing_display")
&& !$DB->fieldExists("glpi_plugin_addressing", "ipdeb")) {
$update = true;
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-1.6.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-1.6.sql");

}

if ($DB->tableExists("glpi_plugin_addressing_profiles")
&& $DB->fieldExists("glpi_plugin_addressing_profiles", "interface")) {
$update = true;
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-1.7.0.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-1.7.0.sql");

}

if (!$DB->tableExists("glpi_plugin_addressing_configs")) {
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-1.8.0.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-1.8.0.sql");
$update = true;
}

if ($DB->tableExists("glpi_plugin_addressing_profiles")
&& !$DB->fieldExists("glpi_plugin_addressing_profiles", "use_ping_in_equipment")) {
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-1.9.0.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-1.9.0.sql");
$update = true;
}
//Version 2.4.0
if (!$DB->tableExists("glpi_plugin_addressing_filters")) {
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-2.4.0.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-2.4.0.sql");
}

//Version 2.5.0
if (!$DB->fieldExists("glpi_plugin_addressing_addressings", "locations_id") && !$DB->fieldExists("glpi_plugin_addressing_addressings", "fqdns_id")) {
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-2.5.0.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-2.5.0.sql");
}
//Version 2.9.1
if (!$DB->tableExists("glpi_plugin_addressing_pinginfos")) {
$DB->runFile(GLPI_ROOT . "/plugins/addressing/sql/update-2.9.1.sql");
$DB->runFile(PLUGIN_ADDRESSING_DIR . "/sql/update-2.9.1.sql");
}

}
Expand Down Expand Up @@ -143,8 +143,8 @@ function plugin_addressing_install() {
function plugin_addressing_uninstall() {
global $DB;

include_once(GLPI_ROOT . "/plugins/addressing/inc/profile.class.php");
include_once(GLPI_ROOT . "/plugins/addressing/inc/menu.class.php");
include_once(PLUGIN_ADDRESSING_DIR . "/inc/profile.class.php");
include_once(PLUGIN_ADDRESSING_DIR . "/inc/menu.class.php");

$migration = new Migration("2.5.0");
$tables = ["glpi_plugin_addressing_addressings",
Expand Down
2 changes: 1 addition & 1 deletion inc/addressing.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ function showReport($params) {
$('#ajax_loader').show();
$.ajax({
url: '" . $CFG_GLPI["root_doc"] . PLUGIN_ADDRESSING_DIR_NOFULL . "/ajax/updatepinginfo.php',
url: '" . PLUGINADDRESSING_WEBDIR . "/ajax/updatepinginfo.php',
type: 'POST',
data: {'addressing_id' : addressing_id},
success: function(response){
Expand Down
4 changes: 2 additions & 2 deletions inc/filter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static function showList($item, $options = []) {
'items_id' => $item_id,
'id' => -1];
Ajax::updateItemJsCode("viewfilter" . $item_id . "$rand",
$CFG_GLPI["root_doc"] . "/plugins/addressing/ajax/addressing.php",
PLUGINADDRESSING_WEBDIR . "/ajax/addressing.php",
$params);
echo "};";
echo "</script>\n";
Expand Down Expand Up @@ -363,7 +363,7 @@ function showMinimalFilterForm($item, $filter, $canedit, $rand) {
'items_id' => $item["id"],
'id' => $filter['id']];
Ajax::updateItemJsCode("viewfilter" . $item["id"] . "$rand",
$CFG_GLPI["root_doc"] . "/plugins/addressing/ajax/addressing.php",
PLUGINADDRESSING_WEBDIR. "/ajax/addressing.php",
$params);
echo "};";
echo "</script>\n";
Expand Down
28 changes: 28 additions & 0 deletions inc/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
* @version $Id$
-------------------------------------------------------------------------
addressing plugin for GLPI
Copyright (C) 2009-2016 by the addressing Development Team.
https://github.com/pluginsGLPI/addressing
-------------------------------------------------------------------------
LICENSE
This file is part of addressing.
addressing is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
addressing is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with addressing. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
4 changes: 1 addition & 3 deletions inc/menu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ static function getMenuContent() {

$menu = [];
$menu['title'] = self::getMenuName();
$menu['page'] = "/plugins/addressing/front/addressing.php";

$menu['title'] = PluginAddressingAddressing::getTypeName(2);
$menu['page'] = PluginAddressingAddressing::getSearchURL(false);
$menu['links']['search'] = PluginAddressingAddressing::getSearchURL(false);
Expand Down Expand Up @@ -71,7 +69,7 @@ static function getMenuContent() {
}

static function getIcon() {
return "fas fa-map-pin";
return "ti ti-map-pin";
}

static function removeRightsFromSession() {
Expand Down
2 changes: 1 addition & 1 deletion inc/ping_equipment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function showPingForm($itemtype, $items_id)
echo "</table>";

echo Html::scriptBlock("$(document).on('click', '#ping_ip', function(event) {
$('#ping_response').load('" . $CFG_GLPI["root_doc"] . "/plugins/addressing/ajax/ping.php', {
$('#ping_response').load('" . PLUGINADDRESSING_WEBDIR . "/ajax/ping.php', {
'ip': $('#ip').val(),
'itemtype': '$itemtype',
'items_id': '$items_id'
Expand Down
Loading

0 comments on commit 6b5ab48

Please sign in to comment.