@@ -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 | ) |
@@ -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 |
@@ -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); |
@@ -135,12 +135,12 @@ |
||
135 | 135 | $listPages = ''; |
136 | 136 | for ($i = ($this->currentPage - $this->midRange); $i < (($this->currentPage + $this->midRange) + 1); ++$i) { |
137 | 137 | if (($i > 0) && ($i <= $this->numPages)) { // if page number are within page range |
138 | - if ($i == $this->currentPage) { |
|
139 | - $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
140 | - } // if we're on current page |
|
141 | - else { |
|
142 | - $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
143 | - } // if not current page |
|
138 | + if ($i == $this->currentPage) { |
|
139 | + $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
140 | + } // if we're on current page |
|
141 | + else { |
|
142 | + $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
143 | + } // if not current page |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 |
@@ -42,8 +42,8 @@ |
||
42 | 42 | try { |
43 | 43 | if ($this->sftpProcess->fileExists($gitPath.'/.git') === false) { |
44 | 44 | $this->context->buildViolation($constraint->message) |
45 | - ->atPath('path') |
|
46 | - ->addViolation(); |
|
45 | + ->atPath('path') |
|
46 | + ->addViolation(); |
|
47 | 47 | } |
48 | 48 | } catch (SshLoginException $sshLoginException) { |
49 | 49 | $this->context->buildViolation($sshLoginException->getMessage()) |
@@ -38,7 +38,7 @@ |
||
38 | 38 | public function configureOptions(OptionsResolver $resolver) |
39 | 39 | { |
40 | 40 | $resolver->setDefaults(array( |
41 | - //'data_class' => 'Lre\MetadataBundle\Entity\Curriculum\ResourceCurriculum', |
|
41 | + //'data_class' => 'Lre\MetadataBundle\Entity\Curriculum\ResourceCurriculum', |
|
42 | 42 | //'data_class' => NULL, |
43 | 43 | //'cascade_validation' => true, |
44 | 44 | )); |
@@ -46,8 +46,8 @@ |
||
46 | 46 | return null; |
47 | 47 | } |
48 | 48 | $entity = $this->objectManager |
49 | - ->getRepository($this->class) |
|
50 | - ->find($id); |
|
49 | + ->getRepository($this->class) |
|
50 | + ->find($id); |
|
51 | 51 | if (null === $entity) { |
52 | 52 | throw new TransformationFailedException(); |
53 | 53 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | 'property' => 'title', // Assuming that the entity has a "name" property |
38 | 38 | 'class' => 'VersionControl\GitControlBundle\Entity\IssueMilestone', |
39 | 39 | )) |
40 | - ->add('issueLabel', EntityType::class, array( |
|
40 | + ->add('issueLabel', EntityType::class, array( |
|
41 | 41 | 'multiple' => true, // Multiple selection allowed |
42 | 42 | 'expanded' => true, // Render as checkboxes |
43 | 43 | 'property' => 'title', // Assuming that the entity has a "name" property |