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

Commit

Permalink
fix(*): code style, drop compatibility with PHP 5.5 and official GLPI…
Browse files Browse the repository at this point in the history
… 9.1.x

cannot longer test against PHP 5.5 due to dependency problems with composer; project depends on features in GLPI 9.2 only, support on GLPI 9.1.x backports excluding official 9.1.x version; update locales
  • Loading branch information
btry committed Mar 3, 2017
1 parent b80942f commit 9c7c826
Show file tree
Hide file tree
Showing 30 changed files with 3,163 additions and 1,348 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- '5.5'
- '5.6'
- '7.0'

Expand All @@ -10,7 +9,6 @@ env:
- FUSION_SOURCE="https://github.com/fusioninventory/fusioninventory-for-glpi -b glpi9.1+1.1"
matrix:
- GLPI_SOURCE="https://github.com/flyve-mdm/glpi -b 9.1.2-backport"
- GLPI_SOURCE="https://github.com/glpi-project/glpi -b 9.1/bugfixes"
- GLPI_SOURCE="https://github.com/glpi-project/glpi -b master"

before_script:
Expand All @@ -29,7 +27,7 @@ script:
- cd plugins/flyvemdm
- php -S localhost:8088 -t ../.. ../../tests/router.php &>/dev/null &
- vendor/bin/phpunit --verbose
- vendor/bin/phpcs -p --standard=vendor/glpi-project/coding-standard/GlpiStandard/ *.php install/ inc/ front/ ajax/ tests/
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then vendor/bin/phpcs -p --standard=vendor/glpi-project/coding-standard/GlpiStandard/ *.php install/ inc/ front/ ajax/ tests/; fi

notifications:
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
2 changes: 1 addition & 1 deletion ajax/getGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion ajax/policyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"licence": "AGPLv3+",
"keywords": ["glpi", "flyve", "mdm"],
"require": {
"php": ">= 5.6.0",
"ext-gd": "*",
"ext-zip": "*",
"ext-openssl": "*",
Expand All @@ -20,7 +21,8 @@
"glpi-project/coding-standard": "^0.5.0",
"phpunit/phpunit": "^4.8 || ^5.7",
"flyve-mdm/test": "dev-master",
"consolidation/robo": "dev-master"
"consolidation/robo": "dev-master",
"glpi-project/tools": "^0.1.2"
},
"repositories": [
{
Expand Down
144 changes: 142 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front/agent.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/config.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/file.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/fleet.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}
Session::checkRight("flyvemdm:flyvemdm", PluginFlyvemdmProfile::RIGHT_FLYVEMDM_USE);
Expand Down
4 changes: 1 addition & 3 deletions front/fleet_policy.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}
Session::checkRight("flyvemdm:flyvemdm", PluginFlyvemdmProfile::RIGHT_FLYVEMDM_USE);
Expand All @@ -51,7 +51,5 @@
$_POST = $fleet_policy->preprocessInput($_POST);
$fleet_policy->add($_POST);
Html::back();
} else if (isset($_POST['delete_items'])) {

}
Html::back();
2 changes: 1 addition & 1 deletion front/invitation.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/invitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ("../../../inc/includes.php");
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion front/package.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

include ('../../../inc/includes.php');
$plugin = new Plugin();
if(!$plugin->isActivated('flyvemdm')) {
if (!$plugin->isActivated('flyvemdm')) {
Html::displayNotFoundError();
}

Expand Down
2 changes: 1 addition & 1 deletion inc/agent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
return self::createTabEntry(self::getTypeName(1), $nb);
}
break;
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion inc/fleet_policy.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ static function showForFleet(CommonDBTM $item, $withtemplate='') {

// add needed data for display
$factory = new PluginFlyvemdmPolicyFactory();
foreach($appliedPolicies as $id => &$appliedPolicy) {
foreach ($appliedPolicies as $id => &$appliedPolicy) {
$appliedPolicy['checkbox'] = Html::getMassiveActionCheckBox(__CLASS__, $id);
$appliedPolicy['policyName'] = $policies[$appliedPolicy['plugin_flyvemdm_policies_id']]['name'];
$policyItem = $factory->createFromDBByID($appliedPolicy['plugin_flyvemdm_policies_id']);
Expand Down
8 changes: 4 additions & 4 deletions inc/graph.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ public function showDevicesPerOSVersion() {
while ($row = $DB->fetch_assoc($result)) {
$osNames[$row['operatingsystem']] = $row['operatingsystem'];
$versionNames[$row['version']] = $row['version'];
$labels[] = $row['operatingsystem'] /*. ' ' . $row['version']*/;
$labels[] = $row['operatingsystem']; /*. ' ' . $row['version']*/
$versionPerOS[$row['version']][$row['operatingsystem']] = $row['cpt'];
}
foreach($osNames as $osName) {
foreach($versionNames as $versionName) {
foreach ($osNames as $osName) {
foreach ($versionNames as $versionName) {
if (!isset($versionPerOS[$versionName][$osName])) {
$versionPerOS[$versionName][$osName] = '0';
}
}
}
ksort($versionPerOS);
$series = [];
foreach($versionPerOS as $osName => $serie) {
foreach ($versionPerOS as $osName => $serie) {
ksort($serie);
$series[] = [
'name' => $osName,
Expand Down
1 change: 0 additions & 1 deletion inc/invitation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ public function showForm($ID, $options = array()) {
$this->initForm($ID, $options);
$this->showFormHeader();


}

protected function showMassiveActionInviteUser() {
Expand Down
Loading

0 comments on commit 9c7c826

Please sign in to comment.