<?php

//Loop through the groupings to find grouping file you want to append to
foreach ($js_groupings as $key => $groupings) {
    foreach ($groupings as $file => $target) {
        //if the target grouping is found
        $targetFilePath = 'include/javascript/sugar_grp7.min.js';
        if ($target == $targetFilePath) {
            $filePaths = array(
                'modules/AnalyticReporting/assets/js/widget/widgetApp.min.js',
                'modules/AnalyticReporting/assets/js/dashboard/dashboardApp.min.js',
            );

            foreach($filePaths as $index => $filePath) {
                // Add charts to Sugar SideCar
                $js_groupings[$key][$filePath] = $targetFilePath;
                $GLOBALS['log']->info("Sapiens.BI::JSGroupings: [{$key}][{$filePath}] = include/javascript/sugar_sidecar.min.js ->" . sugar_is_file($filePath) . " -> " . sugar_is_file($targetFilePath));
            }
        }

        break;
    }
}