12 use Symfony\Component\HttpFoundation\Request;
13 use Symfony\Component\HttpFoundation\Response;
14 use Symfony\Component\HttpFoundation\JsonResponse;
19 const NAME =
"ajax_reuse_report";
24 private $reuseReportProcessor;
26 function __construct()
28 parent::__construct(self::NAME,
32 $this->uploadDao = $this->
getObject(
'dao.upload');
33 $this->reuseReportProcessor = $this->
getObject(
'businessrules.reusereportprocessor');
41 public function handle(Request $request)
43 $upload = intval($request->get(
"upload"));
45 if (!$this->uploadDao->isAccessible($upload, $groupId)) {
46 throw new \Exception(
"Permission Denied");
48 $vars = $this->reuseReportProcessor->getReuseSummary($upload);
49 return new JsonResponse([
52 "title" => _(
"Edited Results"),
53 "value" => $vars[
'clearedLicense']
56 "title" => _(
"Decleared licenses"),
57 "value" => $vars[
'declearedLicense']
60 "title" => _(
"Used licenses"),
61 "value" => $vars[
'usedLicense']
64 "title" => _(
"Unused licenses"),
65 "value" => $vars[
'unusedLicense']
68 "title" => _(
"Missing licenses"),
69 "value" => $vars[
'missingLicense']
76 register_plugin(
new AjaxReuseReport());
Contains the constants and helpers for authentication of user.
static getGroupId()
Get the current user's group id.