This repository has been archived by the owner on Aug 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add missing features in regular GLPI UI
- Loading branch information
Showing
14 changed files
with
452 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/* | ||
LICENSE | ||
Copyright (C) 2016 Teclib' | ||
Copyright (C) 2010-2016 by the FusionInventory Development Team. | ||
This file is part of Flyve MDM Plugin for GLPI. | ||
Flyve MDM Plugin for GLPi is a subproject of Flyve MDM. Flyve MDM is a mobile | ||
device management software. | ||
Flyve MDM Plugin for GLPI is free software: you can redistribute it and/or | ||
modify it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Flyve MDM Plugin for GLPI 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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with Flyve MDM Plugin for GLPI. If not, see http://www.gnu.org/licenses/. | ||
------------------------------------------------------------------------------ | ||
@author Thierry Bugier Pineau | ||
@copyright Copyright (c) 2016 Flyve MDM plugin team | ||
@license AGPLv3+ http://www.gnu.org/licenses/agpl.txt | ||
@link https://github.com/flyve-mdm/flyve-mdm-glpi | ||
@link http://www.glpi-project.org/ | ||
------------------------------------------------------------------------------ | ||
*/ | ||
|
||
include ('../../../inc/includes.php'); | ||
$plugin = new Plugin(); | ||
if (!$plugin->isActivated('flyvemdm')) { | ||
Html::displayNotFoundError(); | ||
} | ||
|
||
Session::checkRight("flyvemdm:flyvemdm", PluginFlyvemdmProfile::RIGHT_FLYVEMDM_USE); | ||
|
||
// a computer ID is mandatory | ||
if (!isset($_REQUEST['computers_id'])) { | ||
die(); | ||
} | ||
$computerId = intval($_REQUEST['computers_id']); | ||
|
||
if (!isset($_REQUEST['beginDate']) || empty(trim($_REQUEST['beginDate']))) { | ||
$beginDate = '0000-00-00 00:00:00'; | ||
} else { | ||
$beginDate = new DateTime($_REQUEST['beginDate']); | ||
$beginDate = $beginDate->format('Y-m-d H:i:s'); | ||
} | ||
|
||
if (!isset($_REQUEST['endDate']) || empty(trim($_REQUEST['endDate']))) { | ||
$endDate = date('Y-m-d H:i:s'); | ||
} else { | ||
$endDate = new DateTime($_REQUEST['endDate']); | ||
$endDate = $endDate->format('Y-m-d H:i:s'); | ||
} | ||
|
||
$geolocation = new PluginFlyvemdmGeolocation(); | ||
if ($beginDate == '0000-00-00 00:00:00') { | ||
$rows = $geolocation->find("`computers_id`='$computerId' AND `date` < '$endDate'", '`date`', '100'); | ||
} else { | ||
$rows = $geolocation->find("`computers_id`='$computerId' AND `date` BETWEEN '$beginDate' AND '$endDate'", '`date`'); | ||
} | ||
|
||
$markers = []; | ||
foreach ($rows as $row) { | ||
$markers[] = [ | ||
'date' => $row['date'], | ||
'latitude' => $row['latitude'], | ||
'longitude' => $row['longitude'], | ||
]; | ||
} | ||
echo json_encode($markers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.