Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ajax/sendMDMCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

$items = [];
foreach ($_POST['items_id'] as $items_id) {
/** @var PluginJamfMobileDevice $item */
$item = new PluginJamfMobileDevice();
$item->getFromDB((int) $items_id);
$items[] = $item;
Expand Down
2 changes: 1 addition & 1 deletion inc/migration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function applyMigrations()
}

// Sort semantically
uksort($versionMap, 'version_compare');
uksort($versionMap, version_compare(...));

// Get last known recorded version. If none exists, assume this is 1.0.0 since versions weren't recorded until 2.0.0.
// Migrations should be replayable so nothing should be lost on multiple runs.
Expand Down
58 changes: 28 additions & 30 deletions inc/ruleimport.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,38 @@ public function maxActionsCount()

public function getCriterias()
{
$criterias = [];
$criterias['name']['field'] = 'name';
$criterias['name']['name'] = _x('field', 'Name', 'jamf');
$criterias['name']['table'] = '';

$criterias['itemtype']['field'] = 'itemtype';
$criterias['itemtype']['name'] = _x('field', 'Item type', 'jamf');
$criterias['itemtype']['table'] = '';
$criterias['itemtype']['allow_condition'] = [Rule::PATTERN_IS, Rule::PATTERN_IS_NOT];

$criterias['last_inventory']['field'] = 'last_inventory';
$criterias['last_inventory']['name'] = _x('field', 'Last inventory', 'jamf');
$criterias['last_inventory']['table'] = '';

$criterias['managed']['field'] = 'managed';
$criterias['managed']['name'] = _x('field', 'Managed', 'jamf');
$criterias['managed']['type'] = 'yesno';
$criterias['managed']['table'] = '';

$criterias['supervised']['field'] = 'supervised';
$criterias['supervised']['name'] = _x('field', 'Supervised', 'jamf');
$criterias['supervised']['type'] = 'yesno';
$criterias['supervised']['table'] = '';

return $criterias;
return ['name' => [
'field' => 'name',
'name' => _x('field', 'Name', 'jamf'),
'table' => '',
], 'itemtype' => [
'field' => 'itemtype',
'name' => _x('field', 'Item type', 'jamf'),
'table' => '',
'allow_condition' => [Rule::PATTERN_IS, Rule::PATTERN_IS_NOT],
], 'last_inventory' => [
'field' => 'last_inventory',
'name' => _x('field', 'Last inventory', 'jamf'),
'table' => '',
], 'managed' => [
'field' => 'managed',
'name' => _x('field', 'Managed', 'jamf'),
'type' => 'yesno',
'table' => '',
], 'supervised' => [
'field' => 'supervised',
'name' => _x('field', 'Supervised', 'jamf'),
'type' => 'yesno',
'table' => '',
]];
}

public function getActions()
{
$actions = [];
$actions['_import']['name'] = _x('action', 'Import', 'jamf');
$actions['_import']['type'] = 'yesno';

return $actions;
return ['_import' => [
'name' => _x('action', 'Import', 'jamf'),
'type' => 'yesno',
]];
}

public function displayAdditionalRuleCondition($condition, $crit, $name, $value, $test = false)
Expand Down
1 change: 0 additions & 1 deletion inc/sync.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ protected function applyDesiredState($itemtype, $match_criteria, $state, $option
throw new Exception('Item type class ' . $itemtype . ' must extend CommonDBTM');
}

/** @var CommonDBTM $item */
$item = new $itemtype();
$item_matches = $item->find($match_criteria);
if (!count($item_matches)) {
Expand Down
2 changes: 1 addition & 1 deletion jamf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>JAMF Plugin for GLPI</name>
<key>jamf</key>
<state>stable</state>
<logo>https://raw.githubusercontent.com/pluginsGLPI/jamf/master/Logo.png</logo>
<logo>https://raw.githubusercontent.com/pluginsGLPI/jamf/main/Logo.png</logo>
<description>
<short>
<en>Sync devices and data from Jamf to GLPI</en>
Expand Down