From 442718316db1a6cbb51ccb958bd03d1370c071c6 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 6 Sep 2024 17:56:42 +0200 Subject: [PATCH] note sur les issues et report pv propal --- config/routes.yaml | 365 ++++++++++++------------ docker-compose.yml | 19 +- src/Controller/ReportController.php | 77 +++++ src/Controller/ScrumissueController.php | 20 ++ src/Entity/Scrumissue.php | 17 ++ templates/Report/milestone.html.twig | 23 ++ templates/Scrum/view.html.twig | 89 +++++- 7 files changed, 417 insertions(+), 193 deletions(-) create mode 100644 templates/Report/milestone.html.twig diff --git a/config/routes.yaml b/config/routes.yaml index 68b3f31..649c846 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -1,371 +1,374 @@ #== Home ======================================================================================================== app_home: - path: / - defaults: { _controller: App\Controller\HomeController:home } + path: / + defaults: { _controller: App\Controller\HomeController:home } app_admin: - path: /admin/home - defaults: { _controller: App\Controller\HomeController:admin } + path: /admin/home + defaults: { _controller: App\Controller\HomeController:admin } app_ckeditor_upload: - path: /user/activity/upload - defaults: { _controller: App\Controller\HomeController:upload } + path: /user/activity/upload + defaults: { _controller: App\Controller\HomeController:upload } #== Security ==================================================================================================== app_login: - path: /login - defaults: { _controller: App\Controller\SecurityController:login } + path: /login + defaults: { _controller: App\Controller\SecurityController:login } app_logout: - path: /logout - defaults: { _controller: App\Controller\SecurityController:logout } + path: /logout + defaults: { _controller: App\Controller\SecurityController:logout } app_login_callback: - path: /logincallback - defaults: { _controller: App\Controller\SecurityController:callback } + path: /logincallback + defaults: { _controller: App\Controller\SecurityController:callback } app_casdebug: - path: /user/casdebug - defaults: { _controller: App\Controller\SecurityController:casdebug } + path: /user/casdebug + defaults: { _controller: App\Controller\SecurityController:casdebug } #== Config ============================================================================================================== app_config: - path: /admin/config - defaults: { _controller: App\Controller\ConfigController:list } + path: /admin/config + defaults: { _controller: App\Controller\ConfigController:list } app_config_render: - path: /admin/config/render/{category} - defaults: { _controller: App\Controller\ConfigController:listrender } + path: /admin/config/render/{category} + defaults: { _controller: App\Controller\ConfigController:listrender } app_config_submit: - path: /admin/config/submit - defaults: { _controller: App\Controller\ConfigController:submit } + path: /admin/config/submit + defaults: { _controller: App\Controller\ConfigController:submit } app_config_update: - path: /admin/config/update/{id} - defaults: { _controller: App\Controller\ConfigController:update } + path: /admin/config/update/{id} + defaults: { _controller: App\Controller\ConfigController:update } app_config_delete: - path: /admin/config/delete/{id} - defaults: { _controller: App\Controller\ConfigController:delete } + path: /admin/config/delete/{id} + defaults: { _controller: App\Controller\ConfigController:delete } app_config_logo: - path: /admin/config/logo - defaults: { _controller: App\Controller\ConfigController:logo } - + path: /admin/config/logo + defaults: { _controller: App\Controller\ConfigController:logo } + #== Theme ================================================================================================================ app_theme: - path: /admin/theme - defaults: { _controller: App\Controller\ThemeController:list } + path: /admin/theme + defaults: { _controller: App\Controller\ThemeController:list } app_theme_select: - path: /admin/theme/select/{name} - defaults: { _controller: App\Controller\ThemeController:select, name: "" } + path: /admin/theme/select/{name} + defaults: { _controller: App\Controller\ThemeController:select, name: "" } #== Sonde ================================================================================================================ app_sonde: - path: /sonde - defaults: { _controller: App\Controller\SondeController:sonde } + path: /sonde + defaults: { _controller: App\Controller\SondeController:sonde } #== Wss ================================================================================================================== app_wss_sample: - path: /user/wss/sample - defaults: { _controller: App\Controller\WebsocketController:sample } + path: /user/wss/sample + defaults: { _controller: App\Controller\WebsocketController:sample } #== Crop ================================================================================================================= app_crop01: - path: /user/crop01/{type}/{reportinput} - defaults: { _controller: App\Controller\CropController:crop01 } + path: /user/crop01/{type}/{reportinput} + defaults: { _controller: App\Controller\CropController:crop01 } app_crop02: - path: /user/crop02/{type}/{reportinput} - defaults: { _controller: App\Controller\CropController:crop02 } + path: /user/crop02/{type}/{reportinput} + defaults: { _controller: App\Controller\CropController:crop02 } app_ckupload: - path: /user/ckupload - defaults: { _controller: App\Controller\CropController:ckupload } + path: /user/ckupload + defaults: { _controller: App\Controller\CropController:ckupload } oneup_uploader: - resource: . - type: uploader - + resource: . + type: uploader + #== Cron ================================================================================================================= app_cron: - path: /admin/cron - defaults: { _controller: App\Controller\CronController:list } + path: /admin/cron + defaults: { _controller: App\Controller\CronController:list } app_cron_ajax_list: - path: /admin/cron/ajax/list - defaults: { _controller: App\Controller\CronController:ajaxlist } + path: /admin/cron/ajax/list + defaults: { _controller: App\Controller\CronController:ajaxlist } app_cron_update: - path: /admin/cron/update/{id} - defaults: { _controller: App\Controller\CronController:update } + path: /admin/cron/update/{id} + defaults: { _controller: App\Controller\CronController:update } app_cron_exec: - path: /admin/cron/exec/{id} - defaults: { _controller: App\Controller\CronController:exec } + path: /admin/cron/exec/{id} + defaults: { _controller: App\Controller\CronController:exec } app_cron_log: - path: /admin/cron/log - defaults: { _controller: App\Controller\CronController:log } + path: /admin/cron/log + defaults: { _controller: App\Controller\CronController:log } app_cron_getlog: - path: /admin/cron/getlog/{id} - defaults: { _controller: App\Controller\CronController:getlog } + path: /admin/cron/getlog/{id} + defaults: { _controller: App\Controller\CronController:getlog } #== User ======================================================================================================== app_user: - path: /admin/user - defaults: { _controller: App\Controller\UserController:list } + path: /admin/user + defaults: { _controller: App\Controller\UserController:list } app_user_update: - path: /admin/user/update/{id} - defaults: { _controller: App\Controller\UserController:update } + path: /admin/user/update/{id} + defaults: { _controller: App\Controller\UserController:update } app_user_delete: - path: /admin/user/delete/{id} - defaults: { _controller: App\Controller\UserController:delete } + path: /admin/user/delete/{id} + defaults: { _controller: App\Controller\UserController:delete } app_user_select: - path: /user/user/select - defaults: { _controller: App\Controller\UserController:select } + path: /user/user/select + defaults: { _controller: App\Controller\UserController:select } app_user_info: - path: /user/info - defaults: { _controller: App\Controller\UserController:info } + path: /user/info + defaults: { _controller: App\Controller\UserController:info } app_user_profil: - path: /user/profil - defaults: { _controller: App\Controller\UserController:profil } + path: /user/profil + defaults: { _controller: App\Controller\UserController:profil } app_user_preference: - path: /user/preference - defaults: { _controller: App\Controller\UserController:preference } + path: /user/preference + defaults: { _controller: App\Controller\UserController:preference } #== Group ======================================================================================================== app_group: - path: /admin/group - defaults: { _controller: App\Controller\GroupController:list } + path: /admin/group + defaults: { _controller: App\Controller\GroupController:list } app_group_submit: - path: /admin/group/submit - defaults: { _controller: App\Controller\GroupController:submit } + path: /admin/group/submit + defaults: { _controller: App\Controller\GroupController:submit } app_group_update: - path: /admin/group/update/{id} - defaults: { _controller: App\Controller\GroupController:update } + path: /admin/group/update/{id} + defaults: { _controller: App\Controller\GroupController:update } app_group_delete: - path: /admin/group/delete/{id} - defaults: { _controller: App\Controller\GroupController:delete } + path: /admin/group/delete/{id} + defaults: { _controller: App\Controller\GroupController:delete } app_group_select: - path: /user/group/select - defaults: { _controller: App\Controller\GroupController:select } + path: /user/group/select + defaults: { _controller: App\Controller\GroupController:select } #== Report ======================================================================================================= app_report_list: - path: /user/report/list/{id} - defaults: { _controller: App\Controller\ReportController:list } + path: /user/report/list/{id} + defaults: { _controller: App\Controller\ReportController:list } app_report_csv: - path: /user/report/csv/{id} - defaults: { _controller: App\Controller\ReportController:csv } + path: /user/report/csv/{id} + defaults: { _controller: App\Controller\ReportController:csv } + +app_report_milestone: + path: /user/report/milestone/{idscrum}/{mode}/{month} + defaults: { _controller: App\Controller\ReportController:milestone } app_report_test: - path: /user/report/test/{id} - defaults: { _controller: App\Controller\ReportController:test } + path: /user/report/test/{id} + defaults: { _controller: App\Controller\ReportController:test } #== Scrum ======================================================================================================== app_scrum: - path: /user/scrum - defaults: { _controller: App\Controller\ScrumController:list } + path: /user/scrum + defaults: { _controller: App\Controller\ScrumController:list } app_scrum_submit: - path: /master/scrum/submit - defaults: { _controller: App\Controller\ScrumController:submit } + path: /master/scrum/submit + defaults: { _controller: App\Controller\ScrumController:submit } app_scrum_update: - path: /master/scrum/update/{id} - defaults: { _controller: App\Controller\ScrumController:update } + path: /master/scrum/update/{id} + defaults: { _controller: App\Controller\ScrumController:update } app_scrum_delete: - path: /master/scrum/delete/{id} - defaults: { _controller: App\Controller\ScrumController:delete } + path: /master/scrum/delete/{id} + defaults: { _controller: App\Controller\ScrumController:delete } app_scrum_view: - path: /user/scrum/{id} - defaults: { _controller: App\Controller\ScrumController:view } + path: /user/scrum/{id} + defaults: { _controller: App\Controller\ScrumController:view } app_scrum_table: - path: /user/scrum/table/{id} - defaults: { _controller: App\Controller\ScrumController:table } + path: /user/scrum/table/{id} + defaults: { _controller: App\Controller\ScrumController:table } app_scrum_stat: - path: /user/scrum/stat/{id} - defaults: { _controller: App\Controller\ScrumController:stat } + path: /user/scrum/stat/{id} + defaults: { _controller: App\Controller\ScrumController:stat } app_scrum_link: - path: /user/scrum/link/{id} - defaults: { _controller: App\Controller\ScrumController:link } + path: /user/scrum/link/{id} + defaults: { _controller: App\Controller\ScrumController:link } app_scrum_info: - path: /user/scrum/info/{id} - defaults: { _controller: App\Controller\ScrumController:info } - - + path: /user/scrum/info/{id} + defaults: { _controller: App\Controller\ScrumController:info } #== Scrumcolumn ======================================================================================================== app_scrumcolumn_submit: - path: /master/scrumcolumn/submit/{scrumid} - defaults: { _controller: App\Controller\ScrumcolumnController:submit } + path: /master/scrumcolumn/submit/{scrumid} + defaults: { _controller: App\Controller\ScrumcolumnController:submit } app_scrumcolumn_update: - path: /master/scrumcolumn/update/{id} - defaults: { _controller: App\Controller\ScrumcolumnController:update } + path: /master/scrumcolumn/update/{id} + defaults: { _controller: App\Controller\ScrumcolumnController:update } app_scrumcolumn_delete: - path: /master/scrumcolumn/delete/{id} - defaults: { _controller: App\Controller\ScrumcolumnController:delete } + path: /master/scrumcolumn/delete/{id} + defaults: { _controller: App\Controller\ScrumcolumnController:delete } app_scrumcolumn_select: - path: /master/scrumcolumn/select/{scrumid} - defaults: { _controller: App\Controller\ScrumcolumnController:select } + path: /master/scrumcolumn/select/{scrumid} + defaults: { _controller: App\Controller\ScrumcolumnController:select } app_scrumcolumn_order: - path: /master/scrumcolumn/order/{scrumid} - defaults: { _controller: App\Controller\ScrumcolumnController:order } - + path: /master/scrumcolumn/order/{scrumid} + defaults: { _controller: App\Controller\ScrumcolumnController:order } #== Scrumteam ======================================================================================================== app_scrumteam_submit: - path: /master/scrumteam/submit/{scrumid} - defaults: { _controller: App\Controller\ScrumteamController:submit } + path: /master/scrumteam/submit/{scrumid} + defaults: { _controller: App\Controller\ScrumteamController:submit } app_scrumteam_update: - path: /master/scrumteam/update/{id} - defaults: { _controller: App\Controller\ScrumteamController:update } + path: /master/scrumteam/update/{id} + defaults: { _controller: App\Controller\ScrumteamController:update } app_scrumteam_delete: - path: /master/scrumteam/delete/{id} - defaults: { _controller: App\Controller\ScrumteamController:delete } + path: /master/scrumteam/delete/{id} + defaults: { _controller: App\Controller\ScrumteamController:delete } app_scrumteam_select: - path: /master/scrumteam/select/{scrumid} - defaults: { _controller: App\Controller\ScrumteamController:select } + path: /master/scrumteam/select/{scrumid} + defaults: { _controller: App\Controller\ScrumteamController:select } app_scrumteam_order: - path: /master/scrumteam/order/{scrumid} - defaults: { _controller: App\Controller\ScrumteamController:order } - + path: /master/scrumteam/order/{scrumid} + defaults: { _controller: App\Controller\ScrumteamController:order } #== Scrumpriority ======================================================================================================== app_scrumpriority_submit: - path: /master/scrumpriority/submit/{scrumid} - defaults: { _controller: App\Controller\ScrumpriorityController:submit } + path: /master/scrumpriority/submit/{scrumid} + defaults: { _controller: App\Controller\ScrumpriorityController:submit } app_scrumpriority_update: - path: /master/scrumpriority/update/{id} - defaults: { _controller: App\Controller\ScrumpriorityController:update } + path: /master/scrumpriority/update/{id} + defaults: { _controller: App\Controller\ScrumpriorityController:update } app_scrumpriority_delete: - path: /master/scrumpriority/delete/{id} - defaults: { _controller: App\Controller\ScrumpriorityController:delete } + path: /master/scrumpriority/delete/{id} + defaults: { _controller: App\Controller\ScrumpriorityController:delete } app_scrumpriority_select: - path: /master/scrumpriority/select/{scrumid} - defaults: { _controller: App\Controller\ScrumpriorityController:select } + path: /master/scrumpriority/select/{scrumid} + defaults: { _controller: App\Controller\ScrumpriorityController:select } app_scrumpriority_order: - path: /master/scrumpriority/order/{scrumid} - defaults: { _controller: App\Controller\ScrumpriorityController:order } + path: /master/scrumpriority/order/{scrumid} + defaults: { _controller: App\Controller\ScrumpriorityController:order } #== Scrumsprint ======================================================================================================== app_scrumsprint_submit: - path: /master/scrumsprint/submit/{scrumid} - defaults: { _controller: App\Controller\ScrumsprintController:submit } + path: /master/scrumsprint/submit/{scrumid} + defaults: { _controller: App\Controller\ScrumsprintController:submit } app_scrumsprint_update: - path: /master/scrumsprint/update/{id} - defaults: { _controller: App\Controller\ScrumsprintController:update } + path: /master/scrumsprint/update/{id} + defaults: { _controller: App\Controller\ScrumsprintController:update } app_scrumsprint_delete: - path: /master/scrumsprint/delete/{id} - defaults: { _controller: App\Controller\ScrumsprintController:delete } + path: /master/scrumsprint/delete/{id} + defaults: { _controller: App\Controller\ScrumsprintController:delete } app_scrumsprint_select: - path: /master/scrumsprint/select/{scrumid} - defaults: { _controller: App\Controller\ScrumsprintController:select } + path: /master/scrumsprint/select/{scrumid} + defaults: { _controller: App\Controller\ScrumsprintController:select } app_scrumsprint_order: - path: /master/scrumsprint/order/{scrumid} - defaults: { _controller: App\Controller\ScrumsprintController:order } - + path: /master/scrumsprint/order/{scrumid} + defaults: { _controller: App\Controller\ScrumsprintController:order } #== Scrumtype ======================================================================================================== app_scrumtype_submit: - path: /master/scrumtype/submit/{scrumid} - defaults: { _controller: App\Controller\ScrumtypeController:submit } + path: /master/scrumtype/submit/{scrumid} + defaults: { _controller: App\Controller\ScrumtypeController:submit } app_scrumtype_update: - path: /master/scrumtype/update/{id} - defaults: { _controller: App\Controller\ScrumtypeController:update } + path: /master/scrumtype/update/{id} + defaults: { _controller: App\Controller\ScrumtypeController:update } app_scrumtype_delete: - path: /master/scrumtype/delete/{id} - defaults: { _controller: App\Controller\ScrumtypeController:delete } + path: /master/scrumtype/delete/{id} + defaults: { _controller: App\Controller\ScrumtypeController:delete } app_scrumtype_select: - path: /master/scrumtype/select/{scrumid} - defaults: { _controller: App\Controller\ScrumtypeController:select } + path: /master/scrumtype/select/{scrumid} + defaults: { _controller: App\Controller\ScrumtypeController:select } app_scrumtype_order: - path: /master/scrumtype/order/{scrumid} - defaults: { _controller: App\Controller\ScrumtypeController:order } + path: /master/scrumtype/order/{scrumid} + defaults: { _controller: App\Controller\ScrumtypeController:order } #== Scrumissue ======================================================================================================== app_scrumissue_change: - path: /user/scrumissue/change - defaults: { _controller: App\Controller\ScrumissueController:change } + path: /user/scrumissue/change + defaults: { _controller: App\Controller\ScrumissueController:change } app_scrumissue_order: - path: /user/scrumissue/order - defaults: { _controller: App\Controller\ScrumissueController:order } + path: /user/scrumissue/order + defaults: { _controller: App\Controller\ScrumissueController:order } app_scrumissue_info: - path: /user/scrumissue/info - defaults: { _controller: App\Controller\ScrumissueController:info } + path: /user/scrumissue/info + defaults: { _controller: App\Controller\ScrumissueController:info } app_scrumissue_update: - path: /user/scrumissue/update - defaults: { _controller: App\Controller\ScrumissueController:update } + path: /user/scrumissue/update + defaults: { _controller: App\Controller\ScrumissueController:update } app_scrumissue_block: - path: /user/scrumissue/block - defaults: { _controller: App\Controller\ScrumissueController:block } + path: /user/scrumissue/block + defaults: { _controller: App\Controller\ScrumissueController:block } app_scrumissue_unblock: - path: /user/scrumissue/unblock - defaults: { _controller: App\Controller\ScrumissueController:unblock } + path: /user/scrumissue/unblock + defaults: { _controller: App\Controller\ScrumissueController:unblock } app_scrumissue_color: - path: /user/scrumissue/color - defaults: { _controller: App\Controller\ScrumissueController:color } + path: /user/scrumissue/color + defaults: { _controller: App\Controller\ScrumissueController:color } app_scrumissue_assigne: - path: /user/scrumissue/assigne - defaults: { _controller: App\Controller\ScrumissueController:assigne } + path: /user/scrumissue/assigne + defaults: { _controller: App\Controller\ScrumissueController:assigne } + +app_scrumissue_notes: + path: /user/scrumissue/notes + defaults: { _controller: App\Controller\ScrumissueController:notes } app_scrumissue_ctrlchange: - path: /user/scrumissue/ctrlchange - defaults: { _controller: App\Controller\ScrumissueController:ctrlchange } + path: /user/scrumissue/ctrlchange + defaults: { _controller: App\Controller\ScrumissueController:ctrlchange } app_scrumissue_view: - path: /user/scrumissue/view/{id} - defaults: { _controller: App\Controller\ScrumissueController:view } + path: /user/scrumissue/view/{id} + defaults: { _controller: App\Controller\ScrumissueController:view } #== Poker ============================================================================================================= app_poker_get: - path: /user/poker/{userid}/{issueid} - defaults: { _controller: App\Controller\ScrumissueController:getpoker } + path: /user/poker/{userid}/{issueid} + defaults: { _controller: App\Controller\ScrumissueController:getpoker } diff --git a/docker-compose.yml b/docker-compose.yml index 1807f2a..225866a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,24 +6,24 @@ services: container_name: ninegitea-mariadb restart: always ports: - - "3306:3306" + - "3306:3306" environment: MYSQL_ROOT_PASSWORD: changeme MYSQL_DATABASE: ninegitea MYSQL_USER: user - MYSQL_PASSWORD: changeme + MYSQL_PASSWORD: changeme volumes: - - mariadb-data:/var/lib/mysql + - mariadb-data:/var/lib/mysql ninegitea: build: - context: . - dockerfile: ./misc/docker/Dockerfile + context: . + dockerfile: ./misc/docker/Dockerfile container_name: ninegitea-app image: reg.cadoles.com/envole/ninegitea ports: - - "8005:80" - - "5588:5588" + - "8005:80" + - "5588:5588" volumes: - ./src:/app/src:delegated - ./templates:/app/templates:delegated @@ -37,8 +37,9 @@ services: container_name: ninegitea-adminer restart: always ports: - - 6081:8080 - + - 6081:8080 + volumes: mariadb-data: + diff --git a/src/Controller/ReportController.php b/src/Controller/ReportController.php index 9d748de..16f6641 100755 --- a/src/Controller/ReportController.php +++ b/src/Controller/ReportController.php @@ -13,6 +13,9 @@ use App\Service\giteaService; class ReportController extends AbstractController { + private KernelInterface $appKernel; + private giteaService $giteaservice; + public function __construct(KernelInterface $appKernel, giteaService $giteaservice) { $this->appKernel = $appKernel; $this->giteaservice = $giteaservice; @@ -114,6 +117,80 @@ class ReportController extends AbstractController } + public function milestone($idscrum,$mode,$month,Request $request) { + $em = $this->getDoctrine()->getManager(); + $scrum = $em->getRepository("App:Scrum")->find($idscrum); + $datestart=new \DateTime($month."01"); + $dateend=new \DateTime($month."31"); + + $repoid = $scrum->getGiteaid(); + $repoowner = $scrum->getGiteajson()["owner"]["login"]; + $reponame = $scrum->getGiteajson()["name"]; + + //$scrumissues = $em->getRepository("App:Scrumissue")->findBy(["scrum"=>$scrum,"giteastate"=>"open"],["giteamilestonename"=>"ASC","rowid"=>"DESC"]); + $scrumissues = $em->getRepository("App:Scrumissue")->findBy(["scrum"=>$scrum],["giteamilestonename"=>"ASC","rowid"=>"DESC"]); + + $reportissues=[]; + foreach($scrumissues as $scrumissue) { + $labels=array_column($scrumissue->getGiteajson()["labels"], 'name'); + $update=new \DateTime($scrumissue->getGiteajson()["updated_at"]); + $close=new \DateTime($scrumissue->getGiteajson()["closed_at"]); + //"created_at" => "2024-05-03T15:09:26+02:00" + //"updated_at" => "2024-05-03T16:02:00+02:00" + //"closed_at" => "2024-05-03T16:01:59+02:00" + + //if(in_array("Type/Scénario",$labels)&&in_array("Statut/Backlog",$labels)) { + //if(in_array("Type/Scénario",$labels)) { + + // Dans le cas d'un report Propal on ne prend que les tickets ouvert de type scénario du backlog + $ok=false; + + if($mode=="Propal") { + if(in_array("Type/Scénario",$labels)&&in_array("Statut/Backlog",$labels)&&$scrumissue->getGiteastate()=="open") { + $ok=true; + } + } + + // Dans le cas d'un report PV on prend tout les tickets avec une date de modification ou de cloture dans le mois + if($mode=="PV") { + $isstatut=false; + $isupdate=false; + $isclose=false; + + if(in_array("Statut/Livré PREPROD",$labels) || in_array("Statut/A Livrer PROD",$labels) || in_array("Statut/Livré PROD",$labels)) { + $isstatut=true; + } + + if(!empty($close)&&$close>=$datestart&&$close<=$dateend) $isclose=true; + if($update>=$datestart&&$update<=$dateend) $isupdate=true; + + if($isstatut&&($isclose||$isupdate)) $ok=true; + } + + if(!$ok) continue; + + $tmp= [ + "id" => $scrumissue->getGiteanumber(), + "title" => $scrumissue->getGiteatitle(), + "milestone" => ($scrumissue->getGiteamilestonename()??"Aucun"), + "statutorder" => $scrumissue->getScrumcolumn()->getRowid(), + "statut" => $scrumissue->getScrumcolumn()->getName(), + "issueorder" => $scrumissue->getRowid(), + ]; + array_push($reportissues,$tmp); + } + + $statutsort = array_column($reportissues,"statutorder"); + $issuesort = array_column($reportissues,"statutorder"); + $milestonesort = array_column($reportissues,"milestone"); + array_multisort($statutsort, SORT_ASC, $milestonesort, SORT_ASC, $issuesort, SORT_ASC, $reportissues); + + return $this->render('Report/milestone.html.twig', [ + 'useheader' => true, + 'issues' => $reportissues, + ]); + } + public function test($id,Request $request) { $em = $this->getDoctrine()->getManager(); diff --git a/src/Controller/ScrumissueController.php b/src/Controller/ScrumissueController.php index 64ba28a..cc57295 100755 --- a/src/Controller/ScrumissueController.php +++ b/src/Controller/ScrumissueController.php @@ -140,6 +140,7 @@ class ScrumissueController extends AbstractController $output=[]; $output["weight"]=$scrumissue->getWeight(); $output["giteajson"]=$scrumissue->getGiteajson(); + $output["notes"]=$scrumissue->getNotes(); return new JsonResponse($output); } @@ -297,6 +298,25 @@ class ScrumissueController extends AbstractController } + + public function notes(Request $request) + { + $em = $this->getDoctrine()->getManager(); + + $id=$request->get('id'); + $notes=$request->get('notes'); + + // Rechercher l'issue en cours + $scrumissue=$em->getRepository("App:Scrumissue")->find($id); + if(!$scrumissue) return new JsonResponse(['message' => 'No Issue'], 403); + $scrumissue->setNotes($notes); + $em->flush(); + + return new JsonResponse([]); + + } + + public function color(Request $request) { $em = $this->getDoctrine()->getManager(); diff --git a/src/Entity/Scrumissue.php b/src/Entity/Scrumissue.php index 72c141a..902ba4f 100644 --- a/src/Entity/Scrumissue.php +++ b/src/Entity/Scrumissue.php @@ -38,6 +38,11 @@ class Scrumissue */ private $color; + /** + * @ORM\Column(type="text", nullable=true) + */ + private $notes; + /** * @ORM\Column(type="integer") */ @@ -350,4 +355,16 @@ class Scrumissue return $this; } + + public function getNotes(): ?string + { + return $this->notes; + } + + public function setNotes(?string $notes): self + { + $this->notes = $notes; + + return $this; + } } \ No newline at end of file diff --git a/templates/Report/milestone.html.twig b/templates/Report/milestone.html.twig new file mode 100644 index 0000000..5b8c756 --- /dev/null +++ b/templates/Report/milestone.html.twig @@ -0,0 +1,23 @@ +{% extends "base.html.twig" %} + +{% block body %} +{% set statut="" %} +{% set milestone="" %} +{% for issue in issues %} + {% if statut!=issue.statut %} +

 

+

{{issue.statut}}

+ {% set statut=issue.statut %} + {% set milestone="" %} + {% endif %} + + {% if milestone!=issue.milestone %} +

 

+

{{issue.milestone}}

+ {% set milestone=issue.milestone %} + {% endif %} + +
  • {{issue.id}} = {{ issue.title }}
  • +{% endfor %} + +{% endblock %} \ No newline at end of file diff --git a/templates/Scrum/view.html.twig b/templates/Scrum/view.html.twig index d952173..1d239dd 100644 --- a/templates/Scrum/view.html.twig +++ b/templates/Scrum/view.html.twig @@ -35,6 +35,11 @@ margin-right:5px; } + .tooltip-inner { + text-align: left !important; /* Aligne le texte à gauche */ + white-space: pre-line; /* Conserve les retours à la ligne */ + } + .assignee { width:30px; margin: 5px 5px 0px 0px; @@ -57,7 +62,6 @@ {% set start = microtime(true) %}
    -
    @@ -163,7 +167,7 @@ {% for column in tbissues %}
    -

    {{ column.nmcol }}

    +

    {{ column.nmcol }}

    {% for jalon in column.jalons %} {% for sprint in jalon.sprints %} @@ -199,6 +203,7 @@ {% set datatypes="" %} {% set dataprioritys="datapriority"~giteaprioritys|last %} {% set issuprioritycolor=prioritycolor %} + {% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns and label.id in giteateams %} {% set datateams=datateams~"datateam"~label.id~" " %} @@ -228,7 +233,9 @@ {% set backcolor="background-color:"~issue.scrumissueblock.color~";" %} {% endif %} -
    + {% set notes=(not issue.notes is empty?issue.notes|striptags|replace({'\n': '
    ', '\r': '
    '})|raw:"") %} + +
    + + {% set end = microtime(true) %} {% set duration = end - start %}

    render time: {{ duration }} seconds

    @@ -515,6 +552,14 @@ } $(document).ready(function() { + $(".issue").tooltip({ + content: function() { + return $(this).data('tooltip'); // Utilise le contenu de l'attribut data-tooltip + }, + items: '[data-tooltip]', // Spécifie les éléments qui déclenchent le tooltip + html: true // Autorise le HTML dans le tooltip (si nécessaire pour certains tooltips personnalisés) + }); + // Apply Filter function showhide() { // Vue condensée @@ -830,6 +875,44 @@ }); }); + $(document).on('click','.notesissu',function(){ + $(".modal-title").html("#"+$(this).data("giteaid")+" - "+$(this).data("giteatitle")); + $("#modal-issueid").val($(this).data("issue")); + + + $.ajax({ + method: "POST", + url: "{{path("app_scrumissue_info")}}", + data: { + id:$("#modal-issueid").val(), + }, + success: function(data) { + $('#modal-notes').val(data.notes); + + $("#mymodalnotes").modal('show'); + $(".submenu").hide(); + $("#modal-notes").focus(); + }, + }); + }); + + $("#issu_notes").click(function(){ + $.ajax({ + method: "POST", + url: "{{path("app_scrumissue_notes")}}", + data: { + id:$("#modal-issueid").val(), + notes: $("#modal-notes").val(), + }, + success: function(data) { + location.reload(); + }, + error: function (request, status, error) { + alert("pb sur enregistrement du ticket"); + } + }); + }); + // Filter Milestones function filtermilestones() { $.ajax({