@@ -5,24 +5,24 @@ |
||
5 | 5 | protected $title; |
6 | 6 | protected $controller; |
7 | 7 | |
8 | - public function initialize(){ |
|
8 | + public function initialize() { |
|
9 | 9 | $this->model = "Acl"; |
10 | 10 | $this->title = "Acl"; |
11 | - $this->controller= "Acl"; |
|
11 | + $this->controller = "Acl"; |
|
12 | 12 | } |
13 | 13 | |
14 | - public function frmAction(){ |
|
14 | + public function frmAction() { |
|
15 | 15 | $typesUser = TypeUser::find(); |
16 | 16 | $operations = Operation::find(); |
17 | 17 | $ressources = Ressource::find(); |
18 | 18 | |
19 | - $this->view->setVar("operations",$operations); |
|
20 | - $this->view->setVar("ressources",$ressources); |
|
21 | - $this->view->setVar("typesUser",$typesUser); |
|
19 | + $this->view->setVar("operations", $operations); |
|
20 | + $this->view->setVar("ressources", $ressources); |
|
21 | + $this->view->setVar("typesUser", $typesUser); |
|
22 | 22 | |
23 | 23 | } |
24 | 24 | |
25 | - public function updateAction(){ |
|
25 | + public function updateAction() { |
|
26 | 26 | parent::updateAction(); |
27 | 27 | $this->response->redirect("$this->controller/index"); |
28 | 28 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $buttonFrm->onClick($dialog->jsShow()); |
33 | 33 | |
34 | 34 | $this->jquery->compile($this->view); |
35 | - }else { |
|
35 | + } else { |
|
36 | 36 | $this->view->pick("main/error"); |
37 | 37 | } |
38 | 38 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | )); |
48 | 48 | $idproj = $projet->getId(); |
49 | 49 | $this->response->redirect("Projets/read/$idproj"); |
50 | - }else { |
|
50 | + } else { |
|
51 | 51 | $this->view->pick("main/error"); |
52 | 52 | } |
53 | 53 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | //Compilation de Jquery dans la vue |
110 | 110 | $this->jquery->compile($this->view); |
111 | - }else { |
|
111 | + } else { |
|
112 | 112 | $this->view->pick("main/error"); |
113 | 113 | } |
114 | 114 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $buttonFrm->onClick($dialog->jsShow()); |
33 | 33 | |
34 | 34 | $this->jquery->compile($this->view); |
35 | - }else { |
|
35 | + } else { |
|
36 | 36 | $this->view->pick("main/error"); |
37 | 37 | } |
38 | 38 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | )); |
48 | 48 | $idproj = $projet->getId(); |
49 | 49 | $this->response->redirect("Projets/read/$idproj"); |
50 | - }else { |
|
50 | + } else { |
|
51 | 51 | $this->view->pick("main/error"); |
52 | 52 | } |
53 | 53 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | //Compilation de Jquery dans la vue |
110 | 110 | $this->jquery->compile($this->view); |
111 | - }else { |
|
111 | + } else { |
|
112 | 112 | $this->view->pick("main/error"); |
113 | 113 | } |
114 | 114 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if ($id != 1) { |
142 | 142 | $client .= ','; |
143 | 143 | } |
144 | - $client .= '{value: ' . $c->getId() . ', text:"' . $c->getIdentite() . '"}'; |
|
144 | + $client .= '{value: '.$c->getId().', text:"'.$c->getIdentite().'"}'; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | $client .= ']'; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if ($id != 1) { |
209 | 209 | $dev .= ','; |
210 | 210 | } |
211 | - $dev .= '{value: ' . $c->getId() . ', text:"' . $c->getIdentite() . '"}'; |
|
211 | + $dev .= '{value: '.$c->getId().', text:"'.$c->getIdentite().'"}'; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | $dev .= ']'; |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $contributor = array_unique($contributor, SORT_REGULAR); |
244 | 244 | |
245 | 245 | $this->view->setVar("contributors", $contributor); |
246 | - $this->view->setVar("usecases", $usecases);; |
|
246 | + $this->view->setVar("usecases", $usecases); ; |
|
247 | 247 | |
248 | 248 | } |
249 | 249 |
@@ -22,34 +22,34 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | public function signInAction() { |
25 | - $bootstrap = $this->jquery->bootstrap(); |
|
25 | + $bootstrap = $this->jquery->bootstrap(); |
|
26 | 26 | |
27 | - if(!empty($_POST['identite']) && !empty($_POST['password'])) { |
|
27 | + if(!empty($_POST['identite']) && !empty($_POST['password'])) { |
|
28 | 28 | |
29 | - $userPseudo = User::findFirst("identite = '".$_POST['identite']."'"); |
|
29 | + $userPseudo = User::findFirst("identite = '".$_POST['identite']."'"); |
|
30 | 30 | |
31 | - $userMail = User::findFirst("mail = '".$_POST['identite']."'"); |
|
31 | + $userMail = User::findFirst("mail = '".$_POST['identite']."'"); |
|
32 | 32 | |
33 | - if($userPseudo != NULL && password_verify($_POST['password'], $userPseudo->getPassword())) { |
|
34 | - $this->session->set("user", $userPseudo); |
|
35 | - $this->response->redirect("Index/index"); |
|
36 | - $this->loadAclAction($userPseudo->getIdTypeUser()); |
|
37 | - } else if($userMail != NULL && password_verify($_POST['password'], $userMail->getPassword())) { |
|
38 | - $this->session->set("user", $userMail); |
|
39 | - $this->response->redirect("Index/index"); |
|
40 | - $this->loadAclAction($userMail->getIdTypeUser()); |
|
41 | - } else { |
|
42 | - echo $bootstrap->htmlAlert("alert1","L'identifiant ou le mot de passe est incorrecte."); |
|
43 | - } |
|
44 | - } |
|
33 | + if($userPseudo != NULL && password_verify($_POST['password'], $userPseudo->getPassword())) { |
|
34 | + $this->session->set("user", $userPseudo); |
|
35 | + $this->response->redirect("Index/index"); |
|
36 | + $this->loadAclAction($userPseudo->getIdTypeUser()); |
|
37 | + } else if($userMail != NULL && password_verify($_POST['password'], $userMail->getPassword())) { |
|
38 | + $this->session->set("user", $userMail); |
|
39 | + $this->response->redirect("Index/index"); |
|
40 | + $this->loadAclAction($userMail->getIdTypeUser()); |
|
41 | + } else { |
|
42 | + echo $bootstrap->htmlAlert("alert1","L'identifiant ou le mot de passe est incorrecte."); |
|
43 | + } |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | |
47 | - public function rulesAction() { |
|
48 | - $accordion=$this->jquery->bootstrap()->htmlAccordion("accordion1"); |
|
49 | - $accordion->addPanel("Panel 1","Contenu du panel 1"); |
|
50 | - $accordion->addPanel("Panel 2","Contenu du panel 2"); |
|
51 | - echo $accordion; |
|
52 | - } |
|
47 | + public function rulesAction() { |
|
48 | + $accordion=$this->jquery->bootstrap()->htmlAccordion("accordion1"); |
|
49 | + $accordion->addPanel("Panel 1","Contenu du panel 1"); |
|
50 | + $accordion->addPanel("Panel 2","Contenu du panel 2"); |
|
51 | + echo $accordion; |
|
52 | + } |
|
53 | 53 | |
54 | 54 | |
55 | 55 |
@@ -24,30 +24,30 @@ discard block |
||
24 | 24 | public function signInAction() { |
25 | 25 | $bootstrap = $this->jquery->bootstrap(); |
26 | 26 | |
27 | - if(!empty($_POST['identite']) && !empty($_POST['password'])) { |
|
27 | + if (!empty($_POST['identite']) && !empty($_POST['password'])) { |
|
28 | 28 | |
29 | 29 | $userPseudo = User::findFirst("identite = '".$_POST['identite']."'"); |
30 | 30 | |
31 | 31 | $userMail = User::findFirst("mail = '".$_POST['identite']."'"); |
32 | 32 | |
33 | - if($userPseudo != NULL && password_verify($_POST['password'], $userPseudo->getPassword())) { |
|
33 | + if ($userPseudo != NULL && password_verify($_POST['password'], $userPseudo->getPassword())) { |
|
34 | 34 | $this->session->set("user", $userPseudo); |
35 | 35 | $this->response->redirect("Index/index"); |
36 | 36 | $this->loadAclAction($userPseudo->getIdTypeUser()); |
37 | - } else if($userMail != NULL && password_verify($_POST['password'], $userMail->getPassword())) { |
|
37 | + } else if ($userMail != NULL && password_verify($_POST['password'], $userMail->getPassword())) { |
|
38 | 38 | $this->session->set("user", $userMail); |
39 | 39 | $this->response->redirect("Index/index"); |
40 | 40 | $this->loadAclAction($userMail->getIdTypeUser()); |
41 | 41 | } else { |
42 | - echo $bootstrap->htmlAlert("alert1","L'identifiant ou le mot de passe est incorrecte."); |
|
42 | + echo $bootstrap->htmlAlert("alert1", "L'identifiant ou le mot de passe est incorrecte."); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | 47 | public function rulesAction() { |
48 | - $accordion=$this->jquery->bootstrap()->htmlAccordion("accordion1"); |
|
49 | - $accordion->addPanel("Panel 1","Contenu du panel 1"); |
|
50 | - $accordion->addPanel("Panel 2","Contenu du panel 2"); |
|
48 | + $accordion = $this->jquery->bootstrap()->htmlAccordion("accordion1"); |
|
49 | + $accordion->addPanel("Panel 1", "Contenu du panel 1"); |
|
50 | + $accordion->addPanel("Panel 2", "Contenu du panel 2"); |
|
51 | 51 | echo $accordion; |
52 | 52 | } |
53 | 53 | |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->jquery->compile($this->view); |
76 | 76 | |
77 | - }else { |
|
77 | + } else { |
|
78 | 78 | $this->view->pick("main/error"); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - public function passwordAction(){ |
|
82 | + public function passwordAction() { |
|
83 | 83 | $password = password_hash("password", PASSWORD_DEFAULT); |
84 | 84 | echo $password; |
85 | 85 | } |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | if ($this->verifyAccessAction($this->controller, "write")) { |
90 | 90 | $typeUser = TypeUser::find(); |
91 | 91 | $this->view->setVar("typeUser", $typeUser); |
92 | - }else { |
|
92 | + } else { |
|
93 | 93 | $this->view->pick("main/error"); |
94 | 94 | } |
95 | 95 | |
96 | 96 | } |
97 | 97 | |
98 | - public function updateAction(){ |
|
98 | + public function updateAction() { |
|
99 | 99 | if ($this->verifyAccessAction($this->controller, "write")) { |
100 | 100 | if ($this->request->isPost()) { |
101 | 101 | $user = new User(); |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | $user->setPassword(password_hash($this->request->getPost("password", "string"), PASSWORD_DEFAULT)); |
104 | 104 | try { |
105 | 105 | $user->save(); |
106 | - echo "Instance de " . $this->model . " ajoutée"; |
|
106 | + echo "Instance de ".$this->model." ajoutée"; |
|
107 | 107 | } catch (\Exception $e) { |
108 | - echo "Impossible d'ajouter l'instance de " . $this->model, "danger : $e"; |
|
108 | + echo "Impossible d'ajouter l'instance de ".$this->model, "danger : $e"; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->jquery->compile($this->view); |
76 | 76 | |
77 | - }else { |
|
77 | + } else { |
|
78 | 78 | $this->view->pick("main/error"); |
79 | 79 | } |
80 | 80 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if ($this->verifyAccessAction($this->controller, "write")) { |
90 | 90 | $typeUser = TypeUser::find(); |
91 | 91 | $this->view->setVar("typeUser", $typeUser); |
92 | - }else { |
|
92 | + } else { |
|
93 | 93 | $this->view->pick("main/error"); |
94 | 94 | } |
95 | 95 |
@@ -14,17 +14,17 @@ |
||
14 | 14 | $this->controller = "Usecases"; |
15 | 15 | } |
16 | 16 | |
17 | - public function updateAction($id=null){ |
|
17 | + public function updateAction($id = null) { |
|
18 | 18 | parent::updateAction(); |
19 | 19 | $this->response->redirect("Projets/read/$id/2"); |
20 | 20 | } |
21 | 21 | |
22 | - public function deleteAction($id = null){ |
|
22 | + public function deleteAction($id = null) { |
|
23 | 23 | $object = Usecase::findFirst("id = $id"); |
24 | 24 | $codeUseCase = $object->getCode(); |
25 | 25 | $taches = Tache::find("codeUseCase = '$codeUseCase'"); |
26 | 26 | //Deletion des taches liés avant deletion de la UseCase |
27 | - foreach($taches as $t){ |
|
27 | + foreach ($taches as $t) { |
|
28 | 28 | $t->delete(); |
29 | 29 | } |
30 | 30 | $object->delete(); |
@@ -9,12 +9,12 @@ |
||
9 | 9 | 'dbname' => 'increase', |
10 | 10 | ), |
11 | 11 | 'application' => array( |
12 | - 'controllersDir' => __DIR__ . '/../../app/controllers/', |
|
13 | - 'modelsDir' => __DIR__ . '/../../app/models/', |
|
14 | - 'viewsDir' => __DIR__ . '/../../app/views/', |
|
15 | - 'pluginsDir' => __DIR__ . '/../../app/plugins/', |
|
16 | - 'libraryDir' => __DIR__ . '/../../app/library/', |
|
17 | - 'cacheDir' => __DIR__ . '/../../app/cache/', |
|
12 | + 'controllersDir' => __DIR__.'/../../app/controllers/', |
|
13 | + 'modelsDir' => __DIR__.'/../../app/models/', |
|
14 | + 'viewsDir' => __DIR__.'/../../app/views/', |
|
15 | + 'pluginsDir' => __DIR__.'/../../app/plugins/', |
|
16 | + 'libraryDir' => __DIR__.'/../../app/library/', |
|
17 | + 'cacheDir' => __DIR__.'/../../app/cache/', |
|
18 | 18 | 'baseUri' => '/increase/', |
19 | 19 | ) |
20 | 20 | )); |
@@ -6,8 +6,8 @@ |
||
6 | 6 | * We're a registering a set of directories taken from the configuration file |
7 | 7 | */ |
8 | 8 | $loader->registerNamespaces(array( |
9 | - 'Ajax' => __DIR__ . '/../../vendor/jcheron/phalcon-jquery/Ajax/', |
|
10 | - 'Library' => __DIR__ . '/../library/' |
|
9 | + 'Ajax' => __DIR__.'/../../vendor/jcheron/phalcon-jquery/Ajax/', |
|
10 | + 'Library' => __DIR__.'/../library/' |
|
11 | 11 | )); |
12 | 12 | $loader->registerDirs( |
13 | 13 |
@@ -190,6 +190,6 @@ |
||
190 | 190 | |
191 | 191 | public function toString() |
192 | 192 | { |
193 | - return $this->libelle . " (" . $this->avancement . ")"; |
|
193 | + return $this->libelle." (".$this->avancement.")"; |
|
194 | 194 | } |
195 | 195 | } |
@@ -241,6 +241,6 @@ |
||
241 | 241 | |
242 | 242 | public function toString() |
243 | 243 | { |
244 | - return $this->nom . " (" . $this->avancement . ")"; |
|
244 | + return $this->nom." (".$this->avancement.")"; |
|
245 | 245 | } |
246 | 246 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | //Return a string containing the principal content of the model |
257 | 257 | public function getPrincipal() |
258 | 258 | { |
259 | - return "Client : " . $this->client->toString() . " <br/> Desciption : " . $this->description; |
|
259 | + return "Client : ".$this->client->toString()." <br/> Desciption : ".$this->description; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | $img = $this->getImage(); |
302 | 302 | $type = getImageSize($img); // [] if you don't have exif you could use getImageSize() |
303 | 303 | $allowedTypes = array( |
304 | - 1, // [] gif |
|
305 | - 2, // [] jpg |
|
306 | - 3, // [] png |
|
304 | + 1, // [] gif |
|
305 | + 2, // [] jpg |
|
306 | + 3, // [] png |
|
307 | 307 | 6 // [] bmp |
308 | 308 | ); |
309 | 309 | if (!in_array($type, $allowedTypes)) { |