@@ -91,8 +91,7 @@ public function indexAction(): Response
9191 $ teams_that_solved = array_column ($ teams_that_solved , 'num_correct ' , 'teamid ' );
9292
9393 $ table_fields = [
94- 'teamid ' => ['title ' => 'ID ' , 'sort ' => true , 'default_sort ' => true ],
95- 'externalid ' => ['title ' => 'external ID ' , 'sort ' => true ],
94+ 'externalid ' => ['title ' => 'ID ' , 'sort ' => true , 'default_sort ' => true ],
9695 'label ' => ['title ' => 'label ' , 'sort ' => true ,],
9796 'effective_name ' => ['title ' => 'name ' , 'sort ' => true ,],
9897 'category ' => ['title ' => 'category ' , 'sort ' => true ,],
@@ -120,7 +119,7 @@ public function indexAction(): Response
120119 $ teamdata = [];
121120 $ teamactions = [];
122121
123- $ this ->addEntityCheckbox ($ teamdata , $ t , $ t ->getTeamid (), 'team-checkbox ' , fn (Team $ team ) => !$ team ->isLocked ());
122+ $ this ->addEntityCheckbox ($ teamdata , $ t , $ t ->getExternalid (), 'team-checkbox ' , fn (Team $ team ) => !$ team ->isLocked ());
124123
125124 // Get whatever fields we can from the team object itself.
126125 foreach ($ table_fields as $ k => $ v ) {
@@ -155,14 +154,14 @@ public function indexAction(): Response
155154 'icon ' => 'edit ' ,
156155 'title ' => 'edit this team ' ,
157156 'link ' => $ this ->generateUrl ('jury_team_edit ' , [
158- 'teamId ' => $ t ->getTeamid (),
157+ 'teamId ' => $ t ->getExternalid (),
159158 ]),
160159 ];
161160 $ teamactions [] = [
162161 'icon ' => 'trash-alt ' ,
163162 'title ' => 'delete this team ' ,
164163 'link ' => $ this ->generateUrl ('jury_team_delete ' , [
165- 'teamId ' => $ t ->getTeamId (),
164+ 'teamId ' => $ t ->getExternalid (),
166165 ]),
167166 'ajaxModal ' => true ,
168167 ];
@@ -171,7 +170,7 @@ public function indexAction(): Response
171170 'icon ' => 'envelope ' ,
172171 'title ' => 'send clarification to this team ' ,
173172 'link ' => $ this ->generateUrl ('jury_clarification_new ' , [
174- 'teamto ' => $ t ->getTeamId (),
173+ 'teamto ' => $ t ->getExternalid (),
175174 ])
176175 ];
177176
@@ -218,7 +217,7 @@ public function indexAction(): Response
218217 $ teams_table [] = [
219218 'data ' => $ teamdata ,
220219 'actions ' => $ teamactions ,
221- 'link ' => $ this ->generateUrl ('jury_team ' , ['teamId ' => $ t ->getTeamId ()]),
220+ 'link ' => $ this ->generateUrl ('jury_team ' , ['teamId ' => $ t ->getExternalid ()]),
222221 'cssclass ' => ($ t ->getCategory () ? ("category " . $ t ->getCategory ()->getCategoryId ()) : '' ) .
223222 ($ t ->getEnabled () ? '' : ' disabled ' ),
224223 ];
@@ -325,10 +324,10 @@ public function viewAction(
325324 }
326325
327326 #[IsGranted('ROLE_ADMIN ' )]
328- #[Route(path: '/{teamId<\d+> }/edit ' , name: 'jury_team_edit ' )]
329- public function editAction (Request $ request , int $ teamId ): Response
327+ #[Route(path: '/{teamId}/edit ' , name: 'jury_team_edit ' )]
328+ public function editAction (Request $ request , string $ teamId ): Response
330329 {
331- $ team = $ this ->em ->getRepository (Team::class)->find ($ teamId );
330+ $ team = $ this ->em ->getRepository (Team::class)->findByExternalId ($ teamId );
332331 if (!$ team ) {
333332 throw new NotFoundHttpException (sprintf ('Team with ID %s not found ' , $ teamId ));
334333 }
@@ -341,7 +340,7 @@ public function editAction(Request $request, int $teamId): Response
341340 $ this ->possiblyAddUser ($ team );
342341 $ this ->assetUpdater ->updateAssets ($ team );
343342 $ this ->saveEntity ($ team , $ team ->getTeamid (), false );
344- return $ this ->redirectToRoute ('jury_team ' , ['teamId ' => $ team ->getTeamid ()]);
343+ return $ this ->redirectToRoute ('jury_team ' , ['teamId ' => $ team ->getExternalid ()]);
345344 }
346345
347346 return $ this ->render ('jury/team_edit.html.twig ' , [
@@ -351,10 +350,10 @@ public function editAction(Request $request, int $teamId): Response
351350 }
352351
353352 #[IsGranted('ROLE_ADMIN ' )]
354- #[Route(path: '/{teamId<\d+> }/delete ' , name: 'jury_team_delete ' )]
355- public function deleteAction (Request $ request , int $ teamId ): Response
353+ #[Route(path: '/{teamId}/delete ' , name: 'jury_team_delete ' )]
354+ public function deleteAction (Request $ request , string $ teamId ): Response
356355 {
357- $ team = $ this ->em ->getRepository (Team::class)->find ($ teamId );
356+ $ team = $ this ->em ->getRepository (Team::class)->findByExternalId ($ teamId );
358357 if (!$ team ) {
359358 throw new NotFoundHttpException (sprintf ('Team with ID %s not found ' , $ teamId ));
360359 }
@@ -363,13 +362,13 @@ public function deleteAction(Request $request, int $teamId): Response
363362 }
364363
365364 #[IsGranted('ROLE_ADMIN ' )]
366- #[Route(path: '/delete-multiple ' , name: 'jury_team_delete_multiple ' , methods: ['GET ' , 'POST ' ])]
365+ #[Route(path: '/delete-multiple ' , name: 'jury_team_delete_multiple ' , methods: ['GET ' , 'POST ' ], priority: 1 )]
367366 public function deleteMultipleAction (Request $ request ): Response
368367 {
369368 return $ this ->deleteMultiple (
370369 $ request ,
371370 Team::class,
372- 'teamid ' ,
371+ 'externalid ' ,
373372 'jury_teams ' ,
374373 'No teams could be deleted (they might be in a locked contest). ' ,
375374 fn (Team $ team ) => !$ team ->isLocked ()
@@ -388,7 +387,7 @@ public function addAction(Request $request): Response
388387
389388 if ($ response = $ this ->processAddFormForExternalIdEntity (
390389 $ form , $ team ,
391- fn () => $ this ->generateUrl ('jury_team ' , ['teamId ' => $ team ->getTeamid ()]),
390+ fn () => $ this ->generateUrl ('jury_team ' , ['teamId ' => $ team ->getExternalid ()]),
392391 function () use ($ team ) {
393392 $ this ->possiblyAddUser ($ team );
394393 $ this ->em ->persist ($ team );
0 commit comments