Completed
Pull Request — master (#27)
by Lars
11:31 queued 01:30
created
src/Intraface/modules/newsletter/Newsletter.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     private function load()
78 78
     {
79 79
         $db = new DB_Sql;
80
-         $db->query("SELECT id, list_id, subject, text, deadline, sent_to_receivers, status FROM newsletter_archieve WHERE id = " . $this->id . " AND active = 1 LIMIT 1");
80
+         $db->query("SELECT id, list_id, subject, text, deadline, sent_to_receivers, status FROM newsletter_archieve WHERE id = ".$this->id." AND active = 1 LIMIT 1");
81 81
 
82 82
         $db2 = new DB_Sql;
83 83
         if ($db->nextRecord()) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             return false;
119 119
         }
120 120
         $db = new DB_Sql;
121
-        $db->query("UPDATE newsletter_archieve SET active = 0 WHERE id = " . $this->get("id") . "  AND intranet_id = " . $this->list->getIntranet()->getId() . " AND locked = 0");
121
+        $db->query("UPDATE newsletter_archieve SET active = 0 WHERE id = ".$this->get("id")."  AND intranet_id = ".$this->list->getIntranet()->getId()." AND locked = 0");
122 122
 
123 123
         return true;
124 124
     }
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
             $sql_end  = ', date_created = NOW()';
149 149
         } else {
150 150
             $sql_type = "UPDATE";
151
-            $sql_end  = " WHERE id = " . $this->id;
151
+            $sql_end  = " WHERE id = ".$this->id;
152 152
         }
153 153
         $db  = new DB_Sql;
154
-        $sql = $sql_type . " newsletter_archieve
154
+        $sql = $sql_type." newsletter_archieve
155 155
             SET subject = '".$var['subject']."',
156 156
             text = '".$var['text']."',
157 157
             intranet_id = ".$this->list->getIntranet()->getId().",
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     private function updateSent($receivers)
182 182
     {
183 183
         $db = new DB_Sql;
184
-        $db->query("UPDATE newsletter_archieve SET status = 1, sent_to_receivers = '".(int)$receivers."' WHERE id = " . $this->id . " AND intranet_id = " . $this->list->getIntranet()->getId());
184
+        $db->query("UPDATE newsletter_archieve SET status = 1, sent_to_receivers = '".(int)$receivers."' WHERE id = ".$this->id." AND intranet_id = ".$this->list->getIntranet()->getId());
185 185
         return true;
186 186
     }
187 187
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $db        = MDB2::singleton(DB_DSN);
223 223
 
224 224
         if (PEAR::isError($db)) {
225
-            throw new Exception($result->getMessage() . $result->getUserInfo());
225
+            throw new Exception($result->getMessage().$result->getUserInfo());
226 226
         }
227 227
 
228 228
         $i       = 0;
@@ -259,19 +259,19 @@  discard block
 block discarded – undo
259 259
                 '".$name."',
260 260
                 8,
261 261
                 2,
262
-                ".$this->get('id') . ",
263
-                '".$this->get('deadline'). "',
264
-                " .$this->list->getIntranet()->getId(). " ,
265
-                " .$subscriber['contact_id']. " ,
262
+                ".$this->get('id').",
263
+                '".$this->get('deadline')."',
264
+                " .$this->list->getIntranet()->getId()." ,
265
+                " .$subscriber['contact_id']." ,
266 266
                 " .$this->list->kernel->user->get('id').",
267 267
                 ".$subject.",
268 268
                 ".$body.")";
269 269
 
270 270
             if ($i == 40) {
271
-                $result = $db->exec($sql . implode($params, ','));
271
+                $result = $db->exec($sql.implode($params, ','));
272 272
 
273 273
                 if (PEAR::isError($result)) {
274
-                    $error[] = $result->getMessage() . $result->getUserInfo();
274
+                    $error[] = $result->getMessage().$result->getUserInfo();
275 275
                     return false;
276 276
                 }
277 277
 
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
 
286 286
         // If the number of contacts can be divided evenly into 40 there will be no more params here.
287 287
         if (count($params) > 0) {
288
-            $result = $db->exec($sql . implode($params, ','));
288
+            $result = $db->exec($sql.implode($params, ','));
289 289
         }
290 290
 
291 291
         if (PEAR::isError($result)) {
292
-            $error[] = $result->getMessage() . $result->getUserInfo();
292
+            $error[] = $result->getMessage().$result->getUserInfo();
293 293
         }
294 294
 
295 295
         if (!empty($error)) {
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     {
322 322
         $list = array();
323 323
         $db   = new DB_Sql;
324
-        $db->query("SELECT * FROM newsletter_archieve WHERE active = 1 AND list_id = " . $this->list->get('id') . " ORDER BY deadline DESC");
324
+        $db->query("SELECT * FROM newsletter_archieve WHERE active = 1 AND list_id = ".$this->list->get('id')." ORDER BY deadline DESC");
325 325
         $i = 0;
326 326
         while ($db->nextRecord()) {
327 327
             $list[$i]['subject'] = $db->f('subject');
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/templates/subscribers.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@
 block discarded – undo
49 49
     <tbody>
50 50
     <?php foreach ($context->getSubscribers() as $s) : ?>
51 51
     <tr>
52
-        <td><a href="<?php e(url('../../../../contact/' . $s['contact_id'])); ?>"><?php e($s['contact_name']); ?></a></td>
52
+        <td><a href="<?php e(url('../../../../contact/'.$s['contact_id'])); ?>"><?php e($s['contact_name']); ?></a></td>
53 53
         <td><?php e($s['contact_email']); ?></td>
54 54
         <td><?php e($s['dk_date_submitted']); ?></td>
55 55
         <td>
56
-            <?php if ($s['optin'] == 0 and $s['date_optin_email_sent'] < date('Y-m-d', time() - 60 * 60 * 24 * 3)) : ?>
56
+            <?php if ($s['optin'] == 0 and $s['date_optin_email_sent'] < date('Y-m-d', time() - 60*60*24*3)) : ?>
57 57
                 <a href="<?php e(url($s['id'], array('remind' => 'true', 'use_stored' => 'true'))); ?>"><?php e(t('Remind')); ?></a>
58 58
             <?php elseif ($s['optin'] == 0) : ?>
59 59
                 <?php e(t('Not opted in')); ?>
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/templates/list-edit.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
 
70 70
     <div style="clear: both;">
71
-        <p><?php e(t('Either you are using this link')); ?> <strong><?php e('http://' . $context->getKernel()->setting->get('intranet', 'contact.login_url') . '/' .$context->getKernel()->intranet->get('identifier') . '/login'); ?></strong> <?php e(t('or you can write your own')); ?>:</p>
71
+        <p><?php e(t('Either you are using this link')); ?> <strong><?php e('http://'.$context->getKernel()->setting->get('intranet', 'contact.login_url').'/'.$context->getKernel()->intranet->get('identifier').'/login'); ?></strong> <?php e(t('or you can write your own')); ?>:</p>
72 72
         <label for="optin_link"><?php e(t('Link for the optin page')); ?></label><br />
73 73
         <input type="text" name="optin_link" value="<?php if (!empty($value['optin_link'])) {
74 74
             e($value['optin_link']);
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/templates/letters.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         </td>
38 38
         <td class="buttons">
39 39
             <?php if ($letter['status'] != 'sent') : ?>
40
-                <a href="<?php e(url($letter['id'] . '/send')); ?>"><?php e(t('Send')); ?></a>
40
+                <a href="<?php e(url($letter['id'].'/send')); ?>"><?php e(t('Send')); ?></a>
41 41
                 <a class="edit" href="<?php e(url($letter['id'], array('edit'))); ?>"><?php e(t('Edit')); ?></a>
42 42
                 <a class="delete" href="<?php e(url($letter['id'], array('delete'))); ?>"><?php e(t('Delete')); ?></a>
43 43
             <?php endif; ?>
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/templates/list.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     </tr>
27 27
     <tr>
28 28
         <th><?php e(t('Email sender name')); ?></th>
29
-        <td><?php e($value['sender_name']); ?> <?php echo htmlspecialchars('<' . $value['reply_email'] . '>'); ?></td>
29
+        <td><?php e($value['sender_name']); ?> <?php echo htmlspecialchars('<'.$value['reply_email'].'>'); ?></td>
30 30
     </tr>
31 31
 <!--
32 32
     <tr>
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/templates/contact-lists.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
     <tbody>
12 12
     <?php foreach ($lists as $list) : ?>
13 13
     <tr>
14
-        <td><a href="<?php e(url('lists/' . $list['list']->get('id'))); ?>"><?php e($list['list']->get('title')); ?></a></td>
14
+        <td><a href="<?php e(url('lists/'.$list['list']->get('id'))); ?>"><?php e($list['list']->get('title')); ?></a></td>
15 15
         <td class="options">
16
-            <a class="delete" href="<?php e(url('lists/' . $list['list']->get('id') . '/subscriber/' . $list['subscriber_id'], array('remove'))); ?>"><?php e(t('Remove')); ?></a>
16
+            <a class="delete" href="<?php e(url('lists/'.$list['list']->get('id').'/subscriber/'.$list['subscriber_id'], array('remove'))); ?>"><?php e(t('Remove')); ?></a>
17 17
         </td>
18 18
 
19 19
     </tr>
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/templates/send.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     <fieldset>
17 17
         <legend><?php e(t('Body text')); ?></legend>
18 18
         <div>
19
-        <pre><?php e(wordwrap($context->getLetter()->get('text') . "\n\n" . $context->getLetter()->list->get('unsubscribe')), 72); ?></pre>
19
+        <pre><?php e(wordwrap($context->getLetter()->get('text')."\n\n".$context->getLetter()->list->get('unsubscribe')), 72); ?></pre>
20 20
     </div>
21 21
     </fieldset>
22 22
   <div>
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/Subscribers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
 
89 89
         }*/
90 90
 
91
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/subscribers');
91
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/subscribers');
92 92
         return $smarty->render($this);
93 93
     }
94 94
 
Please login to merge, or discard this patch.
src/Intraface/modules/newsletter/Controller/Send.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     {
13 13
         $module = $this->getKernel()->module("newsletter");
14 14
 
15
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/send');
15
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/send');
16 16
         return $smarty->render($this);
17 17
     }
18 18
 
Please login to merge, or discard this patch.