diff --git a/src/Controller/IssueController.php b/src/Controller/IssueController.php index d4d0696..ff39ed1 100644 --- a/src/Controller/IssueController.php +++ b/src/Controller/IssueController.php @@ -70,7 +70,7 @@ class IssueController extends AbstractController } #[Route('/user/issue/order/{id}', name: 'app_issue_order', methods: ['POST'])] - public function orderIssue(int $id, Request $request, IssueRepository $issueRepository): JsonResponse + public function orderIssue(int $id, Request $request, IssueRepository $issueRepository, EntityManagerInterface $em): JsonResponse { $data = $request->request; @@ -112,23 +112,13 @@ class IssueController extends AbstractController return new JsonResponse(['message' => $e->getMessage()], 400); } - /* - $payload = - [ - 'id' => $id, - 'issue' => [ - 'status_id' => $targetStatus, - 'fixed_version_id' => $targetVersion, - ], - 'positions' => [], - ]; - - foreach ($targetIssues as $key => $issue) { - $payload['positions'][$issue] = ['position' => $key]; + foreach ($targetIssues as $key => $rissue) { + $issue = $issueRepository->find($rissue); + if ($issue) { + $issue->setRowissue($key); + $em->flush(); + } } - - $this->redmineService->updatePosition($payload, $this->getParameter('redmineApikey')); - */ } return new JsonResponse([ diff --git a/src/Service/RedmineService.php b/src/Service/RedmineService.php index e00eab9..606334b 100644 --- a/src/Service/RedmineService.php +++ b/src/Service/RedmineService.php @@ -182,6 +182,7 @@ class RedmineService if (!$issue) { $issue = new Issue(); $issue->setId($rissue['id']); + $issue->setRowissue(1000000); } $issue->setRedmine($rissue); $issue->setProject($project); @@ -217,12 +218,14 @@ class RedmineService } $issue->setRowsprint($sprintPosition); - // Calcul position issue + // Calcul position issue = plus géré via redmine + /* if (isset($rissue['sprint'])) { $issue->setRowissue($rissue['sprint']['position'] ?? 1000000); } else { $issue->setRowissue(1000000); } + */ $this->em->persist($issue); $project->setUpdateAt(new \DateTime()); diff --git a/templates/base.html.twig b/templates/base.html.twig index e5ba51c..005e7a1 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -72,6 +72,11 @@ {% endif %} + + {% block simplebody %} + {% endblock %} + +
{% if usesidebar is defined and usesidebar %} {% if is_granted('ROLE_ADMIN') %} @@ -91,12 +96,12 @@ {% endif %} - {% endif %} + {% endif %} - - {% block body %} - {% endblock %} - + + {% block body %} + {% endblock %} +
diff --git a/templates/issue/edit.html.twig b/templates/issue/edit.html.twig index cda0557..d94cd24 100644 --- a/templates/issue/edit.html.twig +++ b/templates/issue/edit.html.twig @@ -27,28 +27,11 @@
Information
+
{{ form_row(form.color) }} -
- -
-
-
Permissions
-
-
-
- - {% if mode=="update" %} -
-
Détail Redmine
-
-
-
- {% endif %} -
-
{{ form_end(form) }} diff --git a/templates/issue/view.html.twig b/templates/issue/view.html.twig index e7a48a9..dbbd1cd 100644 --- a/templates/issue/view.html.twig +++ b/templates/issue/view.html.twig @@ -16,15 +16,11 @@ {% endfor %} {% endif %}
- -
Modifier
+
+ Modifier +
-
- {% for child in issue.childs %} - {{ child.id }} - {% endfor %} -
@@ -40,9 +36,9 @@ {% endif %} {% endfor %} {% if sprintName %} - Sprint = {{sprintName}} (Position {{ issue.redmine.sprint.position }})
+ Sprint = {{sprintName}}
{% else %} - Sprint = Aucun (Position {{ issue.redmine.sprint.position }})
+ Sprint = Aucun
{% endif %} Version Cible = {{(issue.redmine.fixed_version is defined?issue.redmine.fixed_version.name:'Aucune')}}
Story Point = {{issue.redmine.sprint.story_points}}
@@ -72,6 +68,26 @@ {% endif %}
+
+ {% if issue.parent %} +
+ Issues Parentes +
+ #{{ issue.parent.id }} = {{ issue.parent.redmine.subject }} +
+ {% endif %} + + {% for child in issue.childs %} + {% if loop.first %} +
+ Issues Liées + {%endif%} +
+ #{{ child.id }} = {{ child.redmine.subject }} +
+ {% endfor %} +
+ {% if issue.redmine.description %}

diff --git a/templates/project/view.html.twig b/templates/project/view.html.twig index 2417406..cee1248 100644 --- a/templates/project/view.html.twig +++ b/templates/project/view.html.twig @@ -17,7 +17,7 @@ } - main { + simplemain { padding-top:80px; } @@ -122,7 +122,10 @@ .issueParent{ font-size:12px; line-height:12px; - color:var(--bs-green); + border-bottom: 1px solid; + padding-bottom:5px; + margin-bottom:5px; + font-style:italic; } .issueBody { @@ -187,7 +190,7 @@ {% endblock %} -{% block body %} +{% block simplebody %}
@@ -257,63 +260,61 @@
-
- {% for status in project.redmine.issue_statuses %} - {% if status.id not in project.hiddenstatuses %} -
-

{{ status.name }}

+ {% for status in project.redmine.issue_statuses %} + {% if status.id not in project.hiddenstatuses %} +
+

{{ status.name }}

- {% for sprint in project.redmine.sprints|reverse %} - {% if sprint.id not in project.hiddensprints %} -
-
-
Sprint = {{ sprint.name }}
- {% if sprint.story_points[status.id] is defined %} -
{{ sprint.story_points[status.id] }}
- {% endif %} -
+ {% for sprint in project.redmine.sprints|reverse %} + {% if sprint.id not in project.hiddensprints %} +
+
+
Sprint = {{ sprint.name }}
+ {% if sprint.story_points[status.id] is defined %} +
{{ sprint.story_points[status.id] }}
+ {% endif %} +
- {% for version in project.redmine.versions|reverse %} - {% if version.id not in project.hiddenversions %} -
-
Version = {{ version.name }}
-
-
- {% endif %} - {% endfor %} - -
-
Version = Aucune
-
-
+ {% for version in project.redmine.versions|reverse %} + {% if version.id not in project.hiddenversions %} +
+
Version = {{ version.name }}
+
+
+ {% endif %} + {% endfor %} + +
+
Version = Aucune
+
+
+
+ {% endif %} + {% endfor %} + +
+
+ Sprint Aucun +
+ + {% for version in project.redmine.versions|reverse %} + {% if version.id not in project.hiddenversions %} +
+
Version = {{ version.name }}
+
{% endif %} {% endfor %} - -
-
- Sprint Aucun -
- - {% for version in project.redmine.versions|reverse %} - {% if version.id not in project.hiddenversions %} -
-
Version = {{ version.name }}
-
-
- {% endif %} - {% endfor %} - -
-
Version = Aucune
-
-
+ +
+
Version = Aucune
+
-
- {% endif %} - {% endfor %} -
+ +
+ {% endif %} + {% endfor %} {% for issue in project.issues %}
@@ -664,17 +665,16 @@ placeholder: 'issue-placeholder', forcePlaceholderSize: true, + scroll: true, // 👈 Active le scroll auto + scrollSensitivity: 50, // 👈 distance (px) à partir du bord pour déclencher le scroll + scrollSpeed: 100, // 👈 vitesse de défilement + start: function (event, ui) { $sourceContainer = ui.item.parent(); $movedItem = ui.item; originalIndex = ui.item.index(); - enableAutoScroll($(window)); // ou remplace par ton conteneur scrollable }, - stop: function () { - disableAutoScroll(); - }, - update: function (event, ui) { console.log("UPDATE"); if (!event.originalEvent) return; @@ -732,40 +732,5 @@ }); } }); - - let autoScrollInterval = null; - - function enableAutoScroll($container) { - $(document).on('mousemove.autoScroll', function (e) { - const scrollMargin = 50; // px depuis le bord de la fenêtre - const scrollSpeed = 20; // px à chaque tick - - const mouseY = e.clientY; - const windowHeight = window.innerHeight; - - // Scroll vers le haut - if (mouseY < scrollMargin) { - clearInterval(autoScrollInterval); - autoScrollInterval = setInterval(() => { - $container.scrollTop($container.scrollTop() - scrollSpeed); - }, 50); - } - // Scroll vers le bas - else if (mouseY > windowHeight - scrollMargin) { - clearInterval(autoScrollInterval); - autoScrollInterval = setInterval(() => { - $container.scrollTop($container.scrollTop() + scrollSpeed); - }, 50); - } else { - clearInterval(autoScrollInterval); - } - }); - } - - function disableAutoScroll() { - $(document).off('mousemove.autoScroll'); - clearInterval(autoScrollInterval); - } - {% endblock %} \ No newline at end of file