@@ -139,7 +139,7 @@ |
||
| 139 | 139 | { |
| 140 | 140 | $form = $this->createFormBuilder(array(), array( |
| 141 | 141 | 'method' => 'POST', |
| 142 | - )) |
|
| 142 | + )) |
|
| 143 | 143 | ->add('roles', ChoiceType::class, array( |
| 144 | 144 | 'label' => 'User Role', 'choices' => array('Reporter' => 'Reporter', 'Developer' => 'Developer', 'Master' => 'Master'), 'required' => false, 'placeholder' => 'Please select a role', 'choices_as_values' => true, 'constraints' => array( |
| 145 | 145 | new NotBlank(), |
@@ -122,80 +122,80 @@ |
||
| 122 | 122 | )); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - /** |
|
| 126 | - * Form to choose which brabch and remote a user will pull. |
|
| 127 | - * This is just the form. Also see pullToLocal(). |
|
| 128 | - * |
|
| 129 | - * @Route("/delete/{remote}", name="project_deleteremote") |
|
| 130 | - * @Method("GET") |
|
| 131 | - * @Template() |
|
| 132 | - * @ProjectAccess(grantType="MASTER") |
|
| 133 | - */ |
|
| 134 | - public function deleteAction(Request $request, $id, $remote) |
|
| 135 | - { |
|
| 136 | - try { |
|
| 137 | - $response = $this->gitSyncCommands->deleteRemote($remote); |
|
| 138 | - $this->get('session')->getFlashBag()->add('notice', $response); |
|
| 139 | - } catch (\Exception $e) { |
|
| 140 | - $this->get('session')->getFlashBag()->add('error', $e->getMessage()); |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - return $this->redirect($this->generateUrl('project_listremote', array('id' => $id))); |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - /** |
|
| 147 | - * Create rename remote form. |
|
| 148 | - * |
|
| 149 | - * @Route("/rename/{remote}", name="project_renameremote") |
|
| 150 | - * @Method("GET") |
|
| 151 | - * @Template() |
|
| 152 | - * @ProjectAccess(grantType="MASTER") |
|
| 153 | - */ |
|
| 154 | - public function renameAction(Request $request, $id, $remote) |
|
| 155 | - { |
|
| 156 | - $defaultData = array('remoteName' => $remote); |
|
| 157 | - $renameRemoteForm = $this->createRenameRemoteForm($defaultData); |
|
| 158 | - |
|
| 159 | - return array_merge($this->viewVariables, array( |
|
| 125 | + /** |
|
| 126 | + * Form to choose which brabch and remote a user will pull. |
|
| 127 | + * This is just the form. Also see pullToLocal(). |
|
| 128 | + * |
|
| 129 | + * @Route("/delete/{remote}", name="project_deleteremote") |
|
| 130 | + * @Method("GET") |
|
| 131 | + * @Template() |
|
| 132 | + * @ProjectAccess(grantType="MASTER") |
|
| 133 | + */ |
|
| 134 | + public function deleteAction(Request $request, $id, $remote) |
|
| 135 | + { |
|
| 136 | + try { |
|
| 137 | + $response = $this->gitSyncCommands->deleteRemote($remote); |
|
| 138 | + $this->get('session')->getFlashBag()->add('notice', $response); |
|
| 139 | + } catch (\Exception $e) { |
|
| 140 | + $this->get('session')->getFlashBag()->add('error', $e->getMessage()); |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + return $this->redirect($this->generateUrl('project_listremote', array('id' => $id))); |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + /** |
|
| 147 | + * Create rename remote form. |
|
| 148 | + * |
|
| 149 | + * @Route("/rename/{remote}", name="project_renameremote") |
|
| 150 | + * @Method("GET") |
|
| 151 | + * @Template() |
|
| 152 | + * @ProjectAccess(grantType="MASTER") |
|
| 153 | + */ |
|
| 154 | + public function renameAction(Request $request, $id, $remote) |
|
| 155 | + { |
|
| 156 | + $defaultData = array('remoteName' => $remote); |
|
| 157 | + $renameRemoteForm = $this->createRenameRemoteForm($defaultData); |
|
| 158 | + |
|
| 159 | + return array_merge($this->viewVariables, array( |
|
| 160 | 160 | 'remote_form' => $renameRemoteForm->createView(), |
| 161 | 161 | 'branchName' => $this->branchName, |
| 162 | 162 | )); |
| 163 | - } |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * Changes the name of the remote repositiory in git for the local branch. |
|
| 167 | - * |
|
| 168 | - * @Route("/rename/{remote}", name="project_remoteupdate") |
|
| 169 | - * @Method("POST") |
|
| 170 | - * @Template("VersionControlGitControlBundle:ProjectRemote:rename.html.twig") |
|
| 171 | - * @ProjectAccess(grantType="MASTER") |
|
| 172 | - */ |
|
| 173 | - public function updateAction(Request $request, $id) |
|
| 174 | - { |
|
| 175 | - $renameRemoteForm = $this->createRenameRemoteForm(); |
|
| 176 | - |
|
| 177 | - $renameRemoteForm->handleRequest($request); |
|
| 178 | - |
|
| 179 | - if ($renameRemoteForm->isValid()) { |
|
| 180 | - $data = $renameRemoteForm->getData(); |
|
| 181 | - $remoteName = $data['remoteName']; |
|
| 182 | - $newRemoteName = $data['newRemoteName']; |
|
| 183 | - |
|
| 184 | - try { |
|
| 185 | - $response = $this->gitSyncCommands->renameRemote($remoteName, $newRemoteName); |
|
| 186 | - $this->get('session')->getFlashBag()->add('notice', $response); |
|
| 187 | - } catch (\Exception $e) { |
|
| 188 | - $this->get('session')->getFlashBag()->add('error', $e->getMessage()); |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - return $this->redirect($this->generateUrl('project_listremote', array('id' => $id))); |
|
| 192 | - } |
|
| 193 | - |
|
| 194 | - return array_merge($this->viewVariables, array( |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * Changes the name of the remote repositiory in git for the local branch. |
|
| 167 | + * |
|
| 168 | + * @Route("/rename/{remote}", name="project_remoteupdate") |
|
| 169 | + * @Method("POST") |
|
| 170 | + * @Template("VersionControlGitControlBundle:ProjectRemote:rename.html.twig") |
|
| 171 | + * @ProjectAccess(grantType="MASTER") |
|
| 172 | + */ |
|
| 173 | + public function updateAction(Request $request, $id) |
|
| 174 | + { |
|
| 175 | + $renameRemoteForm = $this->createRenameRemoteForm(); |
|
| 176 | + |
|
| 177 | + $renameRemoteForm->handleRequest($request); |
|
| 178 | + |
|
| 179 | + if ($renameRemoteForm->isValid()) { |
|
| 180 | + $data = $renameRemoteForm->getData(); |
|
| 181 | + $remoteName = $data['remoteName']; |
|
| 182 | + $newRemoteName = $data['newRemoteName']; |
|
| 183 | + |
|
| 184 | + try { |
|
| 185 | + $response = $this->gitSyncCommands->renameRemote($remoteName, $newRemoteName); |
|
| 186 | + $this->get('session')->getFlashBag()->add('notice', $response); |
|
| 187 | + } catch (\Exception $e) { |
|
| 188 | + $this->get('session')->getFlashBag()->add('error', $e->getMessage()); |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + return $this->redirect($this->generateUrl('project_listremote', array('id' => $id))); |
|
| 192 | + } |
|
| 193 | + |
|
| 194 | + return array_merge($this->viewVariables, array( |
|
| 195 | 195 | 'remote_form' => $renameRemoteForm->createView(), |
| 196 | 196 | 'branchName' => $this->branchName, |
| 197 | 197 | )); |
| 198 | - } |
|
| 198 | + } |
|
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | 201 | * @param int $id |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | break; |
| 55 | 55 | }else{ |
| 56 | 56 | //Get last md file |
| 57 | - $readme = $this->gitFilesCommands->readFile($file); |
|
| 57 | + $readme = $this->gitFilesCommands->readFile($file); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -407,8 +407,8 @@ |
||
| 407 | 407 | $this->issueRepository->closeIssue($issueId); |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | - // $em->persist($entity); |
|
| 411 | - // $em->flush(); |
|
| 410 | + // $em->persist($entity); |
|
| 411 | + // $em->flush(); |
|
| 412 | 412 | |
| 413 | 413 | return $this->redirect($this->generateUrl('issue_show', array('id' => $this->project->getId(), 'issueId' => $issueId))); |
| 414 | 414 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->get('session')->getFlashBag()->add('error', $e->getMessage()); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - //return $this->redirect($this->generateUrl('project_push', array('id' => $id))); |
|
| 157 | + //return $this->redirect($this->generateUrl('project_push', array('id' => $id))); |
|
| 158 | 158 | $data = ['redirect' => $this->generateUrl('project_tags', array('id' => $this->project->getId()))]; |
| 159 | 159 | |
| 160 | 160 | return $this->viewHandler($data, 'json', true); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $gitRemoteVersions = $this->gitCommands->command('sync')->getRemoteVersions(); |
| 169 | 169 | |
| 170 | 170 | $content = $this->render('VersionControlGitControlBundle:ProjectTag:pushTag.html.twig', |
| 171 | - array_merge($this->viewVariables, array( |
|
| 171 | + array_merge($this->viewVariables, array( |
|
| 172 | 172 | 'remoteVersions' => $gitRemoteVersions, |
| 173 | 173 | 'push_form' => $form->createView() |
| 174 | 174 | ) |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | $data = $pullForm->getData(); |
| 150 | 150 | $remote = $data['remote']; |
| 151 | 151 | $branch = $data['branch']; |
| 152 | - //die('form valid'); |
|
| 152 | + //die('form valid'); |
|
| 153 | 153 | if ($pullForm->get('viewDiff')->isClicked()) { |
| 154 | 154 | $response = $this->gitSyncCommands->fetch($remote, $branch); |
| 155 | 155 | $this->get('session')->getFlashBag()->add('notice', $response); |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | $url = $this->client->getContainer()->get('router')->generate('issues', array('id' => $project->getId())); |
| 16 | 16 | |
| 17 | 17 | $crawler = $this->client->request('GET', $url, array(), array(), array( |
| 18 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 18 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 19 | 19 | )); |
| 20 | 20 | //$crawler = $this->client->followRedirect(); |
| 21 | 21 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET '.$url); |
| 22 | 22 | |
| 23 | 23 | $newIssueLink = $crawler->filter('.box-tools > form > .pull-right > a')->link(); |
| 24 | 24 | $crawler = $this->client->request($newIssueLink->getMethod(), $newIssueLink->getUri(), array(), array(), array( |
| 25 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 25 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 26 | 26 | )); |
| 27 | 27 | |
| 28 | 28 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET '.$url); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | //Show Issue |
| 46 | 46 | $issueShowLink = $crawler->filter('a:contains("Test")')->link(); |
| 47 | 47 | $crawler = $this->client->request($issueShowLink->getMethod(), $issueShowLink->getUri(), array(), array(), array( |
| 48 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 48 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 49 | 49 | )); |
| 50 | 50 | |
| 51 | 51 | $this->assertGreaterThan(0, $crawler->filter('h1:contains("Test")')->count(), 'Missing element h1:contains("Test") on Issue show page'); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | // Edit the entity |
| 54 | 54 | $issueEditLink = $crawler->filter('a:contains("Edit")')->link(); |
| 55 | 55 | $crawler = $this->client->request($issueEditLink->getMethod(), $issueEditLink->getUri(), array(), array(), array( |
| 56 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 56 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 57 | 57 | )); |
| 58 | 58 | |
| 59 | 59 | $form = $crawler->selectButton('Update')->form(array( |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | //Back to Show Issue |
| 76 | 76 | $crawler = $this->client->request($issueShowLink->getMethod(), $issueShowLink->getUri(), array(), array(), array( |
| 77 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 77 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 78 | 78 | )); |
| 79 | 79 | |
| 80 | 80 | //Close Issue |
| 81 | 81 | $issueCloseLink = $crawler->filter('a:contains("Close")')->link(); |
| 82 | 82 | $crawler = $this->client->request($issueCloseLink->getMethod(), $issueCloseLink->getUri(), array(), array(), array( |
| 83 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 83 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 84 | 84 | )); |
| 85 | 85 | |
| 86 | 86 | $crawler = $this->client->followRedirect(); |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | //Back to Show Issue |
| 90 | 90 | $crawler = $this->client->request($issueShowLink->getMethod(), $issueShowLink->getUri(), array(), array(), array( |
| 91 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 91 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 92 | 92 | )); |
| 93 | 93 | |
| 94 | 94 | //Re-Open Issue |
| 95 | 95 | $issueReOpenLink = $crawler->filter('a:contains("Re-Open")')->link(); |
| 96 | 96 | $crawler = $this->client->request($issueReOpenLink->getMethod(), $issueReOpenLink->getUri(), array(), array(), array( |
| 97 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 97 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 98 | 98 | )); |
| 99 | 99 | |
| 100 | 100 | $crawler = $this->client->followRedirect(); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | // List users for project |
| 15 | 15 | $url = $this->client->getContainer()->get('router')->generate('members_list', array('id' => $project->getId())); |
| 16 | 16 | $crawler = $this->client->request('GET', $url, array(), array(), array( |
| 17 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 17 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 18 | 18 | )); |
| 19 | 19 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET /userprojects/'); |
| 20 | 20 | } |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | // List Issue milestones |
| 15 | 15 | $listMilestoneURL = $this->client->getContainer()->get('router')->generate('issuemilestones', array('id' => $project->getId())); |
| 16 | 16 | $crawler = $this->client->request('GET', $listMilestoneURL, array(), array(), array( |
| 17 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 17 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 18 | 18 | )); |
| 19 | 19 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET '.$listMilestoneURL); |
| 20 | 20 | |
| 21 | 21 | //Click New Issue Milestone Link |
| 22 | 22 | $newIssueMilestoneLink = $crawler->filter('a:contains("New Milestone")')->link(); |
| 23 | 23 | $crawler = $this->client->request($newIssueMilestoneLink->getMethod(), $newIssueMilestoneLink->getUri(), array(), array(), array( |
| 24 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 24 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 25 | 25 | )); |
| 26 | 26 | |
| 27 | 27 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET '.$newIssueMilestoneLink->getUri()); |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $this->assertGreaterThan(0, $crawler->filter('h1:contains("Test Milestone")')->count(), 'Missing element h1:contains("Test Milestone")'); |
| 42 | 42 | $showUrl = $this->client->getRequest()->getUri(); |
| 43 | 43 | |
| 44 | - // Edit the issue milestone |
|
| 44 | + // Edit the issue milestone |
|
| 45 | 45 | $issueMilestoneEditLink = $crawler->filter('a:contains("Edit")')->link(); |
| 46 | 46 | $crawler = $this->client->request($issueMilestoneEditLink->getMethod(), $issueMilestoneEditLink->getUri(), array(), array(), array( |
| 47 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 47 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 48 | 48 | )); |
| 49 | 49 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for edit issue milestone'); |
| 50 | 50 | |
@@ -62,21 +62,21 @@ discard block |
||
| 62 | 62 | //Close Milestone |
| 63 | 63 | $issueMilestoneCloseLink = $crawler->filter('a:contains("Close")')->link(); |
| 64 | 64 | $crawler = $this->client->request($issueMilestoneCloseLink->getMethod(), $issueMilestoneCloseLink->getUri(), array(), array(), array( |
| 65 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 65 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 66 | 66 | )); |
| 67 | 67 | $crawler = $this->client->followRedirect(); |
| 68 | 68 | $this->assertNotRegExp('/Test Milestone Edit/', $this->client->getResponse()->getContent()); |
| 69 | 69 | |
| 70 | 70 | //Open Show Issue milestone again |
| 71 | 71 | $crawler = $this->client->request('GET', $showUrl, array(), array(), array( |
| 72 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 72 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 73 | 73 | )); |
| 74 | 74 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for edit issue milestone'); |
| 75 | 75 | |
| 76 | 76 | //Re-open Milestone |
| 77 | 77 | $issueMilestoneReOpenLink = $crawler->filter('a:contains("Re-open")')->link(); |
| 78 | 78 | $crawler = $this->client->request($issueMilestoneReOpenLink->getMethod(), $issueMilestoneReOpenLink->getUri(), array(), array(), array( |
| 79 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 79 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 80 | 80 | )); |
| 81 | 81 | $crawler = $this->client->followRedirect(); |
| 82 | 82 | $this->assertGreaterThan(0, $crawler->filter('.alert:contains("has been opened")')->count(), 'Missing element .alert:contains("successfully updated")'); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | //Close Milestone Again |
| 85 | 85 | $issueMilestoneCloseLink = $crawler->filter('a:contains("Close")')->link(); |
| 86 | 86 | $crawler = $this->client->request($issueMilestoneCloseLink->getMethod(), $issueMilestoneCloseLink->getUri(), array(), array(), array( |
| 87 | - 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 87 | + 'HTTP_X-Requested-With' => 'XMLHttpRequest', |
|
| 88 | 88 | )); |
| 89 | 89 | $crawler = $this->client->followRedirect(); |
| 90 | 90 | $this->assertNotRegExp('/Test Milestone Edit/', $this->client->getResponse()->getContent()); |