PHRAS-3823 : add permalink in report GUI (#4291)

This commit is contained in:
Aina Sitraka
2023-04-06 15:10:00 +03:00
committed by GitHub
parent 2e8a9dcec2
commit bbd6a240e5
21 changed files with 122 additions and 53 deletions

View File

@@ -10,6 +10,7 @@
namespace Alchemy\Phrasea\Controller\Report;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Media\Subdef\Subdef;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
@@ -48,6 +49,7 @@ class RootController extends Controller
}
$granted = [];
$availableSubdefName = [];
$acl = $this->getAclForUser();
foreach ($acl->get_granted_base([\ACL::CANREPORT]) as $collection) {
@@ -73,6 +75,17 @@ class RootController extends Controller
'base_id' => $collection->get_base_id(),
'name' => $collection->get_name(),
];
if (!isset($availableSubdefName[$sbas_id])) {
foreach ($collection->get_databox()->get_subdef_structure() as $subdefGroup) {
/** @var \databox_subdef $subdef */
foreach ($subdefGroup as $subdef) {
$availableSubdefName[$sbas_id][] = $subdef->get_name();
}
}
$availableSubdefName[$sbas_id] = array_unique($availableSubdefName[$sbas_id]);
}
}
$conf = $this->getConf();
@@ -81,6 +94,7 @@ class RootController extends Controller
'ajax_dash' => true,
'dashboard' => null,
'granted_bases' => $granted,
'availableSubdefName' => $availableSubdefName,
'home_title' => $conf->get(['registry', 'general', 'title']),
'module' => 'report',
'module_name' => 'Report',