Completed
Pull Request — master (#21)
by Lars
14:31
created
src/Intraface/Controller/templates/main.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     <![endif]-->
18 18
 
19 19
     <?php foreach ($context->document()->scripts() as $url) : ?>
20
-    <script type="text/javascript" src="<?php e(url('/javascript/' . $url)); ?>"></script>
20
+    <script type="text/javascript" src="<?php e(url('/javascript/'.$url)); ?>"></script>
21 21
     <?php endforeach; ?>
22 22
 
23 23
     <link rel="start" href="<?php e(url('.')); ?>" title="Home" />
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 </head>
30 30
 
31 31
 <body id="intraface-dk"<?php if (!empty($module_name)) {
32
-    echo ' class="' . $module_name . '"';
32
+    echo ' class="'.$module_name.'"';
33 33
 } ?>>
34 34
     <div id="container" class="clearfix">
35 35
 
Please login to merge, or discard this patch.
src/Intraface/Controller/templates/wrapper.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 </head>
28 28
 
29 29
 <body id="onlinefaktura-dk"<?php if (!empty($module_name)) {
30
-    echo ' class="' . $module_name . '"';
30
+    echo ' class="'.$module_name.'"';
31 31
 } ?>>
32 32
 
33 33
     <div id="container" class="clearfix">
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             <span class="location"><?php e($context->getKernel()->intranet->address->get('city')); ?></span>
45 45
             <?php endif; ?>
46 46
             <?php if ($context->getKernel()->intranet->address->get('cvr') != "") : ?>
47
-                &bull; <span>CVR <?php e($context->getKernel()->intranet->address->get('cvr'));    ?> </span>
47
+                &bull; <span>CVR <?php e($context->getKernel()->intranet->address->get('cvr')); ?> </span>
48 48
             <?php endif; ?>
49 49
             </div>
50 50
         </div>
Please login to merge, or discard this patch.
src/Intraface/Controller/templates/switchintranet.tpl.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,8 +14,10 @@
 block discarded – undo
14 14
     <div>
15 15
         <input type="submit" value="<?php e(t('Switch')); ?>" /> <a href="<?php if (isset($_SERVER['HTTP_REFERER'])) :
16 16
             e($_SERVER['HTTP_REFERER']);
17
-else :
17
+else {
18
+    :
18 19
     echo 'index.php';
20
+}
19 21
 endif; ?>"><?php e(t('Cancel')); ?></a>
20 22
     </div>
21 23
 
Please login to merge, or discard this patch.
src/Intraface/Controller/Signup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $this->document->setTitle('Signup');
35 35
 
36
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/signup');
36
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/signup');
37 37
         return $smarty->render($this);
38 38
     }
39 39
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         if (!Validate::email($this->body('email'))) {
43 43
             $this->error[] = 'E-mail ugyldig';
44 44
         }
45
-        if (!Validate::string($this->body('password'), VALIDATE_ALPHA . VALIDATE_NUM)) {
45
+        if (!Validate::string($this->body('password'), VALIDATE_ALPHA.VALIDATE_NUM)) {
46 46
             $this->error[] = 'Password ugyldigt';
47 47
         }
48 48
         if (!empty($error) and count($error) > 0) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                     $db->query("INSERT INTO permission SET intranet_id = ".$db->quote($intranet_id, 'integer').", user_id = ".$db->quote($user_id, 'integer'));
78 78
 
79 79
                     // module access
80
-                    $modules = array('administration', 'modulepackage', 'onlinepayment', 'cms', 'filemanager', 'contact', 'debtor','quotation', 'invoice', 'order','accounting', 'product', 'stock', 'webshop');
80
+                    $modules = array('administration', 'modulepackage', 'onlinepayment', 'cms', 'filemanager', 'contact', 'debtor', 'quotation', 'invoice', 'order', 'accounting', 'product', 'stock', 'webshop');
81 81
 
82 82
                     foreach ($modules as $module) {
83 83
                         $res = $db->query("SELECT id FROM module WHERE name = ".$db->quote($module, 'text')." LIMIT 1");
Please login to merge, or discard this patch.
src/Intraface/Controller/RetrievePassword.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $this->document->setTitle('Retrieve forgotten password');
33 33
 
34
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/retrievepassword');
34
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/retrievepassword');
35 35
         return $smarty->render($this);
36 36
     }
37 37
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
         $new_password = Intraface_User::generateNewPassword($this->body('email'));
41 41
 
42 42
         $body  = "Huha, det var heldigt, at vi stod på spring i kulissen, så vi kan hjælpe dig med at lave en ny adgangskode.\n\n";
43
-        $body .= "Din nye adgangskode er: " . $new_password . "\n\n";
43
+        $body .= "Din nye adgangskode er: ".$new_password."\n\n";
44 44
         $body .= "Du kan logge ind fra:\n\n";
45
-        $body .= "<".PATH_WWW . 'login'.">\n\n";
45
+        $body .= "<".PATH_WWW.'login'.">\n\n";
46 46
         $body .= "Med venlig hilsen\nDin hengivne webserver";
47 47
 
48 48
         $this->email
Please login to merge, or discard this patch.
src/Intraface/Controller/SwitchIntranet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
34 34
             }
35 35
         }
36 36
 
37
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/switchintranet');
37
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/switchintranet');
38 38
         return $smarty->render($this);
39 39
     }
40 40
 
41 41
     function getIntranets()
42 42
     {
43
-        $this->db->query("SELECT DISTINCT(intranet.id), name FROM intranet INNER JOIN permission ON permission.intranet_id = intranet.id WHERE permission.user_id = " . $this->getKernel()->user->getId() . " ORDER BY name");
43
+        $this->db->query("SELECT DISTINCT(intranet.id), name FROM intranet INNER JOIN permission ON permission.intranet_id = intranet.id WHERE permission.user_id = ".$this->getKernel()->user->getId()." ORDER BY name");
44 44
         $accessible_intranets = array();
45 45
         while ($this->db->nextRecord()) {
46 46
             $accessible_intranets[$this->db->f('id')] = $this->db->f('name');
Please login to merge, or discard this patch.
src/Intraface/Controller/Restricted.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -246,6 +246,6 @@
 block discarded – undo
246 246
 
247 247
     function getFontSize()
248 248
     {
249
-         return $this->getKernel()->setting->get('user', 'ptextsize');
249
+            return $this->getKernel()->setting->get('user', 'ptextsize');
250 250
     }
251 251
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             }
74 74
 
75 75
             foreach ($frontpage_files as $file) {
76
-                $file = PATH_INCLUDE_MODULE . $module->getName() . '/' .$file;
76
+                $file = PATH_INCLUDE_MODULE.$module->getName().'/'.$file;
77 77
                 if (file_exists($file)) {
78 78
                     include($file);
79 79
                 }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             '_advice' => $_advice
96 96
         );
97 97
 
98
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/restricted');
98
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/restricted');
99 99
         return $smarty->render($this, $data);
100 100
     }
101 101
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $this->document->setTitle('Intraface.dk');
106 106
         }
107 107
 
108
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/main');
108
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/main');
109 109
         $content = $tpl->render($this, array('content' => $content));
110 110
         return new k_HttpResponse(200, $content);
111 111
     }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         while ($this->db->nextRecord()) {
183 183
             if ($this->getKernel()->user->hasModuleAccess($this->db->f('name'))) {
184 184
                 $this->menu[$i]['name'] = $this->t($this->db->f('name'));
185
-                $this->menu[$i]['url'] = $this->url('/restricted/module/' . $this->db->f("name"));
185
+                $this->menu[$i]['url'] = $this->url('/restricted/module/'.$this->db->f("name"));
186 186
                 $i++;
187 187
             }
188 188
         }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
                     if ($access) {
225 225
                         $this->submenu[$j]['name'] = $this->t($all_submenu[$i]['label']);
226
-                        $this->submenu[$j]['url'] = $this->primary_module->getPath(). $all_submenu[$i]['url'];
226
+                        $this->submenu[$j]['url'] = $this->primary_module->getPath().$all_submenu[$i]['url'];
227 227
                         $j++;
228 228
                     }
229 229
                 }
Please login to merge, or discard this patch.
src/Intraface/Controller/Login.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     function renderHtml()
32 32
     {
33 33
         $this->document->setTitle('Login');
34
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/login');
34
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/login');
35 35
         return $smarty->render($this);
36 36
     }
37 37
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -54,6 +54,10 @@
 block discarded – undo
54 54
         return $this->render();
55 55
     }
56 56
 
57
+    /**
58
+     * @param string $username
59
+     * @param string $password
60
+     */
57 61
     protected function selectUser($username, $password)
58 62
     {
59 63
         $adapter = new Intraface_Auth_User($this->mdb2, $this->session()->sessionId(), $username, $password);
Please login to merge, or discard this patch.
src/Intraface/Doctrine/ErrorRender.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,9 +25,8 @@
 block discarded – undo
25 25
             foreach ($errorstack['errorstack'] as $field_name => $error_codes) {
26 26
                 $display .= '<li>';
27 27
                 $display .= $this->translate('There was an error in', 'common').' ';
28
-                $display .= ( isset($errorstack['field_alias'][$field_name]) ?
29
-                            $errorstack['field_alias'][$field_name] :
30
-                            $field_name);
28
+                $display .= (isset($errorstack['field_alias'][$field_name]) ?
29
+                            $errorstack['field_alias'][$field_name] : $field_name);
31 30
 
32 31
                 foreach ($error_codes as $error_code) {
33 32
                     $description = $this->getErrorDescription($error_code);
Please login to merge, or discard this patch.