Completed
Pull Request — master (#26)
by Lars
10:03
created
src/Intraface/modules/modulepackage/ModulePackage.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @param int id on a ModulePackage
38 38
      *
39 39
      * @return void
40
-      */
40
+     */
41 41
     public function __construct($id = 0)
42 42
     {
43 43
         $this->db = MDB2::singleton(DB_DSN);
@@ -204,18 +204,18 @@  discard block
 block discarded – undo
204 204
         $i = 0;
205 205
         $db = $this->dbquery->getRecordset('module_package.id, module_package_plan.plan, module_package_plan.id AS plan_id, module_package.product_id, module_package_group.group_name, module_package_group.id AS group_id');
206 206
         while ($db->nextRecord()) {
207
-             $list[$i]['id'] = $db->f('id');
208
-             $list[$i]['plan'] = $db->f('plan');
209
-             $list[$i]['plan_id'] = $db->f('plan_id');
210
-             $list[$i]['group'] = $db->f('group_name');
211
-             $list[$i]['group_id'] = $db->f('group_id');
212
-             $list[$i]['product_id'] = $db->f('product_id');
207
+                $list[$i]['id'] = $db->f('id');
208
+                $list[$i]['plan'] = $db->f('plan');
209
+                $list[$i]['plan_id'] = $db->f('plan_id');
210
+                $list[$i]['group'] = $db->f('group_name');
211
+                $list[$i]['group_id'] = $db->f('group_id');
212
+                $list[$i]['product_id'] = $db->f('product_id');
213 213
             if ($db->f('product_id') != 0) {
214 214
                 $product_ids[] = $db->f('product_id');
215 215
             }
216
-             $list[$i]['modules'] = $this->getModules($db->f('id'));
217
-             $list[$i]['product'] = array();
218
-             $i++;
216
+                $list[$i]['modules'] = $this->getModules($db->f('id'));
217
+                $list[$i]['product'] = array();
218
+                $i++;
219 219
         }
220 220
 
221 221
         // get all products in one request and add them to the array
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function load()
58 58
     {
59
-        $result = $this->db->query("SELECT module_package.id, module_package.product_id, module_package_group.group_name AS ".$this->db->quoteIdentifier('group').", module_package_plan.plan, module_package_plan.plan_index, module_package_group.id AS group_id " .
60
-                "FROM module_package " .
61
-                "INNER JOIN module_package_group ON module_package.module_package_group_id = module_package_group.id " .
62
-                "INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id " .
59
+        $result = $this->db->query("SELECT module_package.id, module_package.product_id, module_package_group.group_name AS ".$this->db->quoteIdentifier('group').", module_package_plan.plan, module_package_plan.plan_index, module_package_group.id AS group_id ".
60
+                "FROM module_package ".
61
+                "INNER JOIN module_package_group ON module_package.module_package_group_id = module_package_group.id ".
62
+                "INNER JOIN module_package_plan ON module_package.module_package_plan_id = module_package_plan.id ".
63 63
                 "WHERE module_package.id = ".$this->db->quote($this->id, 'integer'));
64 64
 
65 65
         if (PEAR::isError($result)) {
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
             $id = intval($id);
94 94
         }
95 95
 
96
-        $result = $this->db->query("SELECT id, module, limiter " .
97
-                "FROM module_package_module " .
96
+        $result = $this->db->query("SELECT id, module, limiter ".
97
+                "FROM module_package_module ".
98 98
                 "WHERE module_package_module.module_package_id = ".$this->db->quote($id, 'integer'));
99 99
 
100 100
         if (PEAR::isError($result)) {
Please login to merge, or discard this patch.
src/Intraface/modules/contact/ContactPerson.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function load()
62 62
     {
63 63
         $db = new DB_Sql;
64
-        $db->query("SELECT id, name, email, phone, mobile, contact_id FROM contact_person WHERE id = " . $this->id . " LIMIT 1");
64
+        $db->query("SELECT id, name, email, phone, mobile, contact_id FROM contact_person WHERE id = ".$this->id." LIMIT 1");
65 65
         while ($db->nextRecord()) {
66 66
             $this->value['id'] = $db->f('id');
67 67
             $this->value['name'] = $db->f('name');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         if ($this->id > 0) {
101 101
             $sql_type = "UPDATE ";
102
-            $sql_end = " WHERE id = " . $this->id;
102
+            $sql_end = " WHERE id = ".$this->id;
103 103
         } else {
104 104
             $sql_type = "INSERT INTO ";
105 105
             $sql_end = ", date_created = NOW()";
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
 
109 109
         $db = MDB2::singleton(DB_DSN);
110 110
 
111
-        $result = $db->exec($sql_type . "contact_person " .
112
-                "SET " .
113
-                "intranet_id = ".$db->quote($this->contact->kernel->intranet->get("id"), 'integer').", " .
114
-                "name = ".$db->quote($input['name'], 'text').", " .
115
-                "email = ".$db->quote($input['email'], 'text').", " .
116
-                "phone = ".$db->quote($input['phone'], 'text').", " .
117
-                "mobile = ".$db->quote($input['mobile']).", " .
118
-                "contact_id = " . $db->quote($this->contact->get('id'), 'integer') . ", " .
119
-                "date_changed = NOW() " . $sql_end);
111
+        $result = $db->exec($sql_type."contact_person ".
112
+                "SET ".
113
+                "intranet_id = ".$db->quote($this->contact->kernel->intranet->get("id"), 'integer').", ".
114
+                "name = ".$db->quote($input['name'], 'text').", ".
115
+                "email = ".$db->quote($input['email'], 'text').", ".
116
+                "phone = ".$db->quote($input['phone'], 'text').", ".
117
+                "mobile = ".$db->quote($input['mobile']).", ".
118
+                "contact_id = ".$db->quote($this->contact->get('id'), 'integer').", ".
119
+                "date_changed = NOW() ".$sql_end);
120 120
 
121 121
         if (PEAR::isError($result)) {
122 122
             throw new Exception('Error in query: '.$result->getUserInfo());
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     public function getList()
144 144
     {
145 145
         $db = new DB_Sql;
146
-        $db->query("SELECT * FROM contact_person WHERE contact_id = " . $this->contact->get('id'));
146
+        $db->query("SELECT * FROM contact_person WHERE contact_id = ".$this->contact->get('id'));
147 147
         $persons = array();
148 148
         $i = 0;
149 149
         while ($db->nextRecord()) {
Please login to merge, or discard this patch.
src/Intraface/modules/contact/include_frontpage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * @package Intraface_Contact
4 4
  */
5 5
 
6
-require_once dirname(__FILE__) . '/ContactReminder.php';
6
+require_once dirname(__FILE__).'/ContactReminder.php';
7 7
 $contact_module = $kernel->useModule('contact');
8 8
 
9 9
 $contact = new Contact($kernel);
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     }
26 26
     $_attention_needed[] = array(
27 27
         'module' => $contact_module->getName(),
28
-        'link' => $contact_module->getPath() .$reminder['contact_id'] . '/memo/' . $reminder['id'],
28
+        'link' => $contact_module->getPath().$reminder['contact_id'].'/memo/'.$reminder['id'],
29 29
         'msg' => $text.' ('.$reminder['dk_reminder_date'].'): '.$reminder['contact_name'].':  '.$reminder['subject'].'.',
30 30
         'no_translation' => true
31 31
     );
Please login to merge, or discard this patch.
src/Intraface/modules/contact/MainContact.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $this->addPreloadFile('Contact.php');
22 22
         $this->addPreloadFile('ContactMessage.php'); // kan m�ske slettes
23 23
         $this->addPreloadFile('ContactPerson.php');
24
-         $this->addPreloadFile('ContactReminder.php');
24
+            $this->addPreloadFile('ContactReminder.php');
25 25
 
26 26
         $this->addRequiredShared('email');
27 27
         $this->addRequiredShared('keyword');
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         // settings
42 42
         // paymentconditions in days
43
-         $this->includeSettingFile('settings.php');
43
+            $this->includeSettingFile('settings.php');
44 44
 
45 45
         $this->addSetting('paymentcondition', array(0, 8, 14, 30));
46 46
         $this->addSetting(
@@ -51,29 +51,29 @@  discard block
 block discarded – undo
51 51
             )
52 52
         );
53 53
 
54
-         $this->addSetting('contact_login_url', array(
54
+            $this->addSetting('contact_login_url', array(
55 55
             0 => 'kundelogin.dk',
56 56
             1 => 'medlemslogin.dk'
57
-         ));
57
+            ));
58 58
 
59
-         $this->addSetting(
60
-             'preferred_invoice',
61
-             array(
59
+            $this->addSetting(
60
+                'preferred_invoice',
61
+                array(
62 62
                 1 => 'pdf',
63 63
                 2 => 'email',
64 64
                 3 => 'electronic'
65
-             )
66
-         );
65
+                )
66
+            );
67 67
 
68
-         $this->addSetting(
69
-             'reminder_status',
70
-             array(
68
+            $this->addSetting(
69
+                'reminder_status',
70
+                array(
71 71
                 0 => '_Invalid type_',
72 72
                 1 => 'created',
73 73
                 2 => 'seen',
74 74
                 3 => 'cancelled'
75
-             )
76
-         );
75
+                )
76
+            );
77 77
 
78 78
     }
79 79
 }
Please login to merge, or discard this patch.
src/Intraface/modules/contact/PdfLabel.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,18 +57,18 @@  discard block
 block discarded – undo
57 57
         }
58 58
         
59 59
         if (is_array($keywords) && count($keywords) > 0) {
60
-            $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing') * $line, $this->get('font_size'), "Nøgleord: ".implode(", ", $keywords));
60
+            $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing')*$line, $this->get('font_size'), "Nøgleord: ".implode(", ", $keywords));
61 61
             $line++;
62 62
         }
63 63
         
64
-        $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing') * $line, $this->get('font_size'), "Antal labels i søgning: ".count($contacts));
64
+        $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing')*$line, $this->get('font_size'), "Antal labels i søgning: ".count($contacts));
65 65
         
66 66
         // The contacts on labels
67 67
         
68 68
         for ($i = 0, $max = count($contacts); $i < $max; $i++) {
69 69
             // TODO -- hvorfor bruger vi ikke antallet af labels til at vide, hvorn�r
70 70
             // vi skifter linje? Vi kender faktisk ikke antallet af labels i en r�kke. Det kunne vi selvf�lgelig komme til
71
-            if ($this->get('x') + $this->label_width  > $this->get('right_margin_position')) {
71
+            if ($this->get('x') + $this->label_width > $this->get('right_margin_position')) {
72 72
                 // For enden af linjen, ny linje
73 73
                 $this->setY("-".$this->label_height);
74 74
                 $this->setX(0);
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
             $address_lines = explode("\n", $contacts[$i]['address']['address']);
92 92
             foreach ($address_lines as $l) {
93 93
                 if (trim($l) != "") {
94
-                    $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing') * $line, $this->get('font_size'), $l);
94
+                    $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing')*$line, $this->get('font_size'), $l);
95 95
                     $line++;
96 96
                 }
97 97
             }
98
-            $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing') * $line, $this->get('font_size'), $contacts[$i]['address']['postcode']." ".$contacts[$i]['address']['city']);
98
+            $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing')*$line, $this->get('font_size'), $contacts[$i]['address']['postcode']." ".$contacts[$i]['address']['city']);
99 99
             $line++;
100
-            $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing') * $line, $this->get('font_size'), $contacts[$i]['address']['country']);
100
+            $this->addText($this->get('x') + $this->label_padding_left, $this->get('y') - $this->label_padding_top - $this->get('font_spacing')*$line, $this->get('font_size'), $contacts[$i]['address']['country']);
101 101
         }
102 102
     }
103 103
 }
Please login to merge, or discard this patch.
src/Intraface/modules/contact/Controller/templates/memos.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     <tr>
12 12
         <td><?php e($memo['dk_reminder_date']); ?></td>
13 13
         <td><a href="<?php e(url($memo['id'])); ?>"><?php e($memo['subject']); ?></a></td>
14
-        <td><a href="<?php e(url('../../' . $memo['contact_id'])); ?>"><?php e(t('Contact')); ?> <?php e($memo['contact_id']); ?></a></td>
14
+        <td><a href="<?php e(url('../../'.$memo['contact_id'])); ?>"><?php e(t('Contact')); ?> <?php e($memo['contact_id']); ?></a></td>
15 15
     </tr>
16 16
 <?php endforeach; ?>
17 17
 </table>
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
src/Intraface/modules/contact/Controller/templates/batchnewsletter.tpl.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,12 @@
 block discarded – undo
8 8
 
9 9
 <p><?php echo $context->getMessage(); ?></p>
10 10
 
11
-<?php else : ?>
11
+<?php else {
12
+    : ?>
12 13
 
13
-    <?php echo $contact->error->view(); ?>
14
+    <?php echo $contact->error->view();
15
+}
16
+?>
14 17
 
15 18
 <p class="message">Du er ved at tilmelde <?php e(count($contacts)); ?> kontakter til nyhedsbrevet.</p>
16 19
 
Please login to merge, or discard this patch.
src/Intraface/modules/contact/Controller/templates/show.tpl.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@  discard block
 block discarded – undo
6 6
 <div id="colOne">
7 7
 
8 8
 <div class="box">
9
-    <img style="float: right;" src="<?php e('http://www.gravatar.com/avatar/'.md5($address['email']).'?s=60&d='.NET_SCHEME . NET_HOST . url('/images/icons/gravatar.png')); ?>" height="60" width="60" />
9
+    <img style="float: right;" src="<?php e('http://www.gravatar.com/avatar/'.md5($address['email']).'?s=60&d='.NET_SCHEME.NET_HOST.url('/images/icons/gravatar.png')); ?>" height="60" width="60" />
10 10
 
11 11
     <h1>#<?php e($value['number']); ?> <?php e($address['name']); ?></h1>
12 12
 
13 13
     <ul class="options" style="clear: none;">
14 14
         <li><a href="<?php e(url(null, array('edit'))); ?>"><?php e(t('Edit')); ?></a></li>
15 15
         <li><a href="<?php e(url('../', array('use_stored' => 'true'))); ?>"><?php e(t('Close')); ?></a></li>
16
-        <li><a class="vcard" href="<?php e(url(null . '.vcf')); ?>"><?php e(t('Vcard')); ?></a></li>
16
+        <li><a class="vcard" href="<?php e(url(null.'.vcf')); ?>"><?php e(t('Vcard')); ?></a></li>
17 17
     </ul>
18 18
 
19 19
     <ul class="options" style="clear: none;">
20 20
     <?php foreach ($context->getDependencies() as $key => $dependency) : ?>
21 21
             <?php if ($dependency['gateway']->findCountByContactId($context->getContact()->get("id")) > 0) : ?>
22
-            <li><a href="<?php e($dependency['url']); ?>"><?php e(t(ucfirst($dependency['label'] . 's'))); ?></a></li>
22
+            <li><a href="<?php e($dependency['url']); ?>"><?php e(t(ucfirst($dependency['label'].'s'))); ?></a></li>
23 23
             <?php elseif (!empty($dependency['url_create'])) : ?>
24
-            <li class="inactive"><a href="<?php e($dependency['url_create']); ?>"><?php e(t('Create') . ' ' . t($dependency['label'])); ?></a></li>
24
+            <li class="inactive"><a href="<?php e($dependency['url_create']); ?>"><?php e(t('Create').' '.t($dependency['label'])); ?></a></li>
25 25
             <?php endif; ?>
26 26
     <?php endforeach; ?>
27 27
     </ul>
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     <?php
157 157
     foreach ($persons as $person) { ?>
158 158
         <tr class="vcard">
159
-        <td class="fn"><a href="<?php e(url('contactperson/' . $person['id'], array('edit'))); ?>"><?php e($person['name']); ?></a></td>
159
+        <td class="fn"><a href="<?php e(url('contactperson/'.$person['id'], array('edit'))); ?>"><?php e($person['name']); ?></a></td>
160 160
         <td class="email"><?php e($person['email']); ?></td>
161 161
         <td class="tel"><?php e($person['phone']); ?></td>
162 162
         <td class="tel"><?php e($person['mobile']); ?></td>
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
 }
202 202
                     ?>
203 203
                 </td>
204
-                <td><a href="<?php e(url('memo/' . $reminder_item['id'])); ?>"><?php e($reminder_item['subject']); ?></a></td>
205
-                <td class="buttons"><a href="<?php e(url('memo/' .$reminder_item['id'], array('edit'))); ?>" class="edit"><?php e(t('edit')); ?></a></td>
204
+                <td><a href="<?php e(url('memo/'.$reminder_item['id'])); ?>"><?php e($reminder_item['subject']); ?></a></td>
205
+                <td class="buttons"><a href="<?php e(url('memo/'.$reminder_item['id'], array('edit'))); ?>" class="edit"><?php e(t('edit')); ?></a></td>
206 206
             </tr>
207 207
             <?php
208 208
         }
Please login to merge, or discard this patch.
src/Intraface/modules/contact/Controller/templates/index.tpl.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
     <?php if ($context->getKernel()->getSetting()->get('user', 'contact.search') == 'hide' and count($context->getContacts()) > 0) : ?>
6 6
     <li><a href="<?php e(url(null, array('search' => 'view'))); ?>"><?php e(t('show search')); ?></a></li>
7 7
     <?php endif; ?>
8
-    <li><a class="pdf" href="<?php e(url(null . '.pdf', array('use_stored' => 'true'))); ?>" target="_blank"><?php e(t('Pdf-labels')); ?></a></li>
9
-    <li><a class="excel" href="<?php e(url(null . '.xls', array('use_stored' => 'true'))); ?>"><?php e(t('Excel')); ?></a></li>
8
+    <li><a class="pdf" href="<?php e(url(null.'.pdf', array('use_stored' => 'true'))); ?>" target="_blank"><?php e(t('Pdf-labels')); ?></a></li>
9
+    <li><a class="excel" href="<?php e(url(null.'.xls', array('use_stored' => 'true'))); ?>"><?php e(t('Excel')); ?></a></li>
10 10
     <li><a href="<?php e(url('sendemail', array('use_stored' => true))); ?>"><?php e(t('Email to contacts in search')); ?></a></li>
11 11
     <li><a href="<?php e(url('import/file')); ?>"><?php e(t('Import contacts')); ?></a></li>
12 12
     <li><a href="<?php e(url('../')); ?>"><?php e(t('Close')); ?></a></li>
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     <input type="checkbox" value="<?php e($c['id']); ?>" name="selected[]" />
87 87
                 </td>
88 88
                 <td><?php e($c['number']); ?></td>
89
-                <td><img style="border: none; vertical-align:middle" src="<?php e('http://www.gravatar.com/avatar/'.md5($c['email']).'?s=20&d=&d='.NET_SCHEME . NET_HOST . url('/images/icons/gravatar.png')); ?>" height="20" width="20" /> <a class="fn" href="<?php e(url($c['id'])); ?>"><?php e($c['name']); ?></a></td>
89
+                <td><img style="border: none; vertical-align:middle" src="<?php e('http://www.gravatar.com/avatar/'.md5($c['email']).'?s=20&d=&d='.NET_SCHEME.NET_HOST.url('/images/icons/gravatar.png')); ?>" height="20" width="20" /> <a class="fn" href="<?php e(url($c['id'])); ?>"><?php e($c['name']); ?></a></td>
90 90
                 <td class="tel"><?php e($c['phone']); ?></td>
91 91
                 <td class="email"><?php e($c['email']); ?></td>
92 92
                 <td class="options">
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,12 +21,15 @@
 block discarded – undo
21 21
 
22 22
     <p><?php e(t('No contacts has been created')); ?>. <a href="<?php e(url(null, array('create'))); ?>"><?php e(t('Create contact')); ?></a>.</p>
23 23
 
24
-<?php else : ?>
24
+<?php else {
25
+    : ?>
25 26
 
26 27
 
27 28
 <?php if ($context->getKernel()->getSetting()->get('user', 'contact.search') == 'view') : ?>
28 29
 
29
-<form action="<?php e(url()); ?>" method="get" class="search-filter">
30
+<form action="<?php e(url());
31
+}
32
+?>" method="get" class="search-filter">
30 33
     <fieldset>
31 34
         <legend><?php e(t('search')); ?></legend>
32 35
 
Please login to merge, or discard this patch.