mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-23 07:37:26 +01:00
[ReelCalculator] Added permission and added it to tools menu.
This commit is contained in:
@@ -273,15 +273,15 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
|
||||
labels:
|
||||
label: "perm.tools.labels"
|
||||
bit: 2
|
||||
calculator:
|
||||
label: "perm.tools.calculator"
|
||||
bit: 4
|
||||
footprints:
|
||||
label: "perm.tools.footprints"
|
||||
bit: 6
|
||||
ic_logos:
|
||||
label: "perm.tools.ic_logos"
|
||||
bit: 8
|
||||
#calculator:
|
||||
# label: "perm.tools.calculator"
|
||||
# bit: 4
|
||||
#footprints:
|
||||
# label: "perm.tools.footprints"
|
||||
# bit: 6
|
||||
#ic_logos:
|
||||
# label: "perm.tools.ic_logos"
|
||||
# bit: 8
|
||||
statistics:
|
||||
label: "perm.tools.statistics"
|
||||
bit: 10
|
||||
@@ -294,6 +294,9 @@ perms: # Here comes a list with all Permission names (they have a perm_[name] co
|
||||
label_scanner:
|
||||
label: "perm.tools.label_scanner"
|
||||
bit: 16
|
||||
reel_calculator:
|
||||
label: "perm.tools.reel_calculator"
|
||||
bit: 18
|
||||
|
||||
groups:
|
||||
label: "perm.groups"
|
||||
|
||||
@@ -21,6 +21,8 @@ class ToolsController extends AbstractController
|
||||
*/
|
||||
public function reelCalculator() : Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('@tools.reel_calculator');
|
||||
|
||||
return $this->render("Tools/ReelCalculator/main.html.twig");
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class GroupFixtures extends Fixture
|
||||
'suppliers' => 5461,
|
||||
'manufacturers' => 5461,
|
||||
'attachment_types' => 1365,
|
||||
'tools' => 87381,
|
||||
'tools' => 349525,
|
||||
'labels' => 87381,
|
||||
'parts_category' => 5,
|
||||
'parts_minamount' => 5,
|
||||
|
||||
@@ -132,6 +132,13 @@ class ToolsTreeBuilder
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->security->isGranted('@tools.reel_calculator')) {
|
||||
$nodes[] = new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.tools.reel_calculator'),
|
||||
$this->urlGenerator->generate('tools_reel_calculator')
|
||||
);
|
||||
}
|
||||
|
||||
return $nodes;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,5 +126,8 @@ class ApplicationAvailabilityFunctionalTest extends WebTestCase
|
||||
yield ['/label/dialog?target_id=1&target_type=part'];
|
||||
yield ['/label/1/dialog'];
|
||||
yield ['/label/1/dialog?target_id=1&target_type=part&generate=1'];
|
||||
|
||||
//Tools
|
||||
yield ['/tools/reel_calc'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9303,5 +9303,17 @@ Element 3</target>
|
||||
<target>This calculator gives you an estimation, how many parts are remaining on an SMD reel. Measure the noted the dimensions on the reel (or use some of the presets) and click "Update" to get an result.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="E1xAigo" name="perm.tools.reel_calculator">
|
||||
<segment>
|
||||
<source>perm.tools.reel_calculator</source>
|
||||
<target>SMD Reel calculator</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="Q_6JPEr" name="tree.tools.tools.reel_calculator">
|
||||
<segment>
|
||||
<source>tree.tools.tools.reel_calculator</source>
|
||||
<target>SMD Reel calculator</target>
|
||||
</segment>
|
||||
</unit>
|
||||
</file>
|
||||
</xliff>
|
||||
|
||||
Reference in New Issue
Block a user