@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $form->add('remotename', HiddenType::class, array( |
| 133 | 133 | 'label' => 'Remote Branch Name', 'required' => true, 'constraints' => array( |
| 134 | 134 | new NotBlank(), |
| 135 | - ), ) |
|
| 135 | + ),) |
|
| 136 | 136 | ); |
| 137 | 137 | |
| 138 | 138 | return array_merge($this->viewVariables, array( |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $form->add('remotename', HiddenType::class, array( |
| 160 | 160 | 'label' => 'Remote Branch Name', 'required' => true, 'constraints' => array( |
| 161 | 161 | new NotBlank(), |
| 162 | - ), ) |
|
| 162 | + ),) |
|
| 163 | 163 | ); |
| 164 | 164 | |
| 165 | 165 | $form->handleRequest($request); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | ->add('name', TextType::class, array( |
| 247 | 247 | 'label' => 'Branch Name', 'required' => true, 'constraints' => array( |
| 248 | 248 | new NotBlank(), |
| 249 | - ), ) |
|
| 249 | + ),) |
|
| 250 | 250 | ) |
| 251 | 251 | ->add('switch', CheckboxType::class, array( |
| 252 | 252 | 'label' => 'Switch to branch on creation', 'required' => false, |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | ->add('branch', ChoiceType::class, array( |
| 311 | 311 | 'choices' => $branches, 'label' => 'Branch Name', 'required' => true, 'choices_as_values' => true, 'constraints' => array( |
| 312 | 312 | new NotBlank(), |
| 313 | - ), ) |
|
| 313 | + ),) |
|
| 314 | 314 | ) |
| 315 | 315 | ->getForm(); |
| 316 | 316 | |
@@ -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 | ) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $tags = $this->gitCommands->command('tag')->getTags(); |
| 46 | 46 | |
| 47 | - $defaultData =array(); |
|
| 47 | + $defaultData = array(); |
|
| 48 | 48 | $form = $this->createNewTagForm($this->project, $defaultData); |
| 49 | 49 | |
| 50 | 50 | return array_merge($this->viewVariables, array( |
@@ -108,12 +108,12 @@ discard block |
||
| 108 | 108 | ->add('name', TextType::class, array( |
| 109 | 109 | 'label' => 'Tag Name', 'required' => true, 'constraints' => array( |
| 110 | 110 | new NotBlank(), |
| 111 | - ), ) |
|
| 111 | + ),) |
|
| 112 | 112 | ) |
| 113 | 113 | ->add('message', TextType::class, array( |
| 114 | 114 | 'label' => 'Tag Message', 'required' => true, 'constraints' => array( |
| 115 | 115 | new NotBlank(), |
| 116 | - ), ) |
|
| 116 | + ),) |
|
| 117 | 117 | ) |
| 118 | 118 | ->add('commit', HiddenType::class) |
| 119 | 119 | ->getForm(); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function pushTagAction(Request $request, $tag, $responseType) |
| 136 | 136 | { |
| 137 | 137 | $success = true; |
| 138 | - $form = $this->createPushTagForm($this->project,$tag); |
|
| 138 | + $form = $this->createPushTagForm($this->project, $tag); |
|
| 139 | 139 | $form->add('push', SubmitType::class, array('label' => 'Push')); |
| 140 | 140 | |
| 141 | 141 | $form->handleRequest($request); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | ->add('remote', ChoiceType::class, array( |
| 205 | 205 | 'label' => 'Remote Server', 'choices' => $remoteChoices, 'data' => $firstOrigin, 'required' => false, 'choices_as_values' => true, 'constraints' => array( |
| 206 | 206 | new NotBlank(), |
| 207 | - ), ) |
|
| 207 | + ),) |
|
| 208 | 208 | ) |
| 209 | 209 | ->add('tag', HiddenType::class) |
| 210 | 210 | ->getForm(); |
@@ -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 |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | ->add('remoteName', TextType::class, array( |
| 221 | 221 | 'label' => 'Remote Name', 'required' => false, 'constraints' => array( |
| 222 | 222 | new NotBlank(), |
| 223 | - ), ) |
|
| 223 | + ),) |
|
| 224 | 224 | ) |
| 225 | 225 | ->add('remoteUrl', TextType::class, array( |
| 226 | 226 | 'label' => 'Remote Url', 'required' => false, 'constraints' => array( |
| 227 | 227 | new NotBlank(), |
| 228 | - ), ) |
|
| 228 | + ),) |
|
| 229 | 229 | )->add('submit', SubmitType::class, array('label' => 'Add')) |
| 230 | 230 | |
| 231 | 231 | ->getForm(); |
@@ -242,12 +242,12 @@ discard block |
||
| 242 | 242 | ->add('remoteName', HiddenType::class, array( |
| 243 | 243 | 'constraints' => array( |
| 244 | 244 | new NotBlank(), |
| 245 | - ), ) |
|
| 245 | + ),) |
|
| 246 | 246 | ) |
| 247 | 247 | ->add('newRemoteName', TextType::class, array( |
| 248 | 248 | 'label' => 'New Remote Name', 'required' => false, 'constraints' => array( |
| 249 | 249 | new NotBlank(), |
| 250 | - ), ) |
|
| 250 | + ),) |
|
| 251 | 251 | )->add('submit', SubmitType::class, array('label' => 'Rename')) |
| 252 | 252 | |
| 253 | 253 | ->getForm(); |
@@ -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); |
@@ -219,12 +219,12 @@ |
||
| 219 | 219 | ->add('remote', ChoiceType::class, array( |
| 220 | 220 | 'label' => 'Remote Server', 'choices' => $remoteChoices, 'data' => $firstOrigin, 'required' => false, 'choices_as_values' => true, 'constraints' => array( |
| 221 | 221 | new NotBlank(), |
| 222 | - ), ) |
|
| 222 | + ),) |
|
| 223 | 223 | ) |
| 224 | 224 | ->add('branch', ChoiceType::class, array( |
| 225 | 225 | 'label' => 'Branch', 'choices' => $branchChoices, 'preferred_choices' => array($currentBranch), 'data' => trim($currentBranch), 'required' => false, 'choices_as_values' => true, 'constraints' => array( |
| 226 | 226 | new NotBlank(), |
| 227 | - ), ) |
|
| 227 | + ),) |
|
| 228 | 228 | ) |
| 229 | 229 | ->getForm(); |
| 230 | 230 | |
@@ -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 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | $firstPage = ''; |
| 110 | 110 | if ($this->currentPage > ($this->midRange + 1)) { // if number of pages between "currentPage" and "firstPage" exceeds $midRange with 1... |
| 111 | - $firstPage .= '<li><a href="'.$this->generateUrl(1).'" class="first">First Page</a></li>'; // ...show "first page"-link |
|
| 111 | + $firstPage .= '<li><a href="'.$this->generateUrl(1).'" class="first">First Page</a></li>'; // ...show "first page"-link |
|
| 112 | 112 | if ($this->currentPage > ($this->midRange + 2)) { // if number of pages between $currentPage and "first page" exceeds $midRange with more than 1 |
| 113 | 113 | //$firstPage .= '…'; // add "..." between "1st page"-link and first page in $range |
| 114 | 114 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (($this->currentPage < ($this->numPages - $this->midRange) - 1)) { // if number of pages between $currentPage and "last page" exceeds $range with more than two |
| 124 | 124 | //$lastPage .= '…'; // add "..." between "last page"-link and last page in $range |
| 125 | 125 | } |
| 126 | - $lastPage .= '<li><a href="'.$this->generateUrl($this->numPages).'" class="last">'.$this->numPages.'</a></li>'; // show "last page"-link |
|
| 126 | + $lastPage .= '<li><a href="'.$this->generateUrl($this->numPages).'" class="last">'.$this->numPages.'</a></li>'; // show "last page"-link |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $lastPage; |
@@ -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 | } |