Skip to content

Commit

Permalink
Merge pull request #7 from jc0b/dev
Browse files Browse the repository at this point in the history
Fix issue with reporting
  • Loading branch information
jc0b authored Mar 1, 2023
2 parents 52b3d94 + 5392fbb commit 38a4349
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kandji_processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function run($plist)
// Load Kandji helper
require_once($module_dir.'/lib/kandji_helper.php');
$kandji_helper = new munkireport\module\kandji\kandji_helper;
$json = $kandji_helper->pull_kandji_data($model);
$json = $kandji_helper->pull_kandji_data($this->serial_number);

// Transpose Kandji API output into Kandji model
// General section
Expand Down
4 changes: 2 additions & 2 deletions lib/kandji_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Kandji_helper
* @param object Kandji machine instance
* @author jc0b
**/
public function pull_kandji_data(&$Kandji_machine)
public function pull_kandji_data($serial_number)
{
// Error message
$error = '';
Expand All @@ -20,7 +20,7 @@ public function pull_kandji_data(&$Kandji_machine)
$kandji_api_endpoint = rtrim(conf('kandji_api_endpoint'), '/');

// Get computer data from Kandji
$url = "{$kandji_api_endpoint}/api/v1/devices/?serial_number={$Kandji_machine->serial_number}";
$url = "{$kandji_api_endpoint}/api/v1/devices/?serial_number={$serial_number}";
$kandji_computer_result = $this->send_kandji_query($url);

if(! $kandji_computer_result){
Expand Down
2 changes: 1 addition & 1 deletion views/kandji_listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
$('td:eq(0)', nRow).html(link);
// Make serial number in second column link to Kandji
var serial=$('td:eq(1)', nRow).html();
var kandji_id=$('td:eq(6)', nRow).html();
var kandji_id=$('td:eq(7)', nRow).html();
var kandji_tenant_address = "<?php configAppendFile(__DIR__ . '/../config.php'); echo rtrim(conf('kandji_tenant_address'), '/'); ?>"; // Get the Kandji server address
var link = '<a class="btn btn-default btn-xs" href="'+kandji_tenant_address+'/devices/'+kandji_id+'" target="_blank" title="'+i18n.t('kandji.view_in_kandji')+'">'+serial+'</a>';
$('td:eq(1)', nRow).html(link);
Expand Down

0 comments on commit 38a4349

Please sign in to comment.