@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | function renderHtml() |
32 | 32 | { |
33 | 33 | if (in_array($this->query('search'), array('hide', 'view'))) { |
34 | - $this->getKernel()->setting->set('user', 'contact.search', $this->query('search')); |
|
34 | + $this->getKernel()->setting->set('user', 'contact.search', $this->query('search')); |
|
35 | 35 | } |
36 | 36 | /* |
37 | 37 | elseif (!empty($_GET['import'])) { |
@@ -61,30 +61,30 @@ discard block |
||
61 | 61 | function putForm() |
62 | 62 | { |
63 | 63 | if ($this->body('action') == 'delete') { |
64 | - $deleted = array(); |
|
65 | - if (is_array($this->body('selected'))) { |
|
66 | - foreach ($this->body('selected') AS $key=>$id) { |
|
67 | - $contact = $this->getGateway()->findById(intval($id)); |
|
68 | - if ($contact->delete()) { |
|
69 | - $deleted[] = $id; |
|
70 | - } |
|
71 | - } |
|
72 | - } |
|
64 | + $deleted = array(); |
|
65 | + if (is_array($this->body('selected'))) { |
|
66 | + foreach ($this->body('selected') AS $key=>$id) { |
|
67 | + $contact = $this->getGateway()->findById(intval($id)); |
|
68 | + if ($contact->delete()) { |
|
69 | + $deleted[] = $id; |
|
70 | + } |
|
71 | + } |
|
72 | + } |
|
73 | 73 | } elseif ($this->body('undelete')) { |
74 | 74 | |
75 | - if (is_string($this->body('deleted'))) { |
|
76 | - $undelete = unserialize(base64_decode($this->body('deleted'))); |
|
77 | - } else { |
|
78 | - throw new Exception('Could not undelete'); |
|
79 | - } |
|
80 | - if (!empty($undelete) AND is_array($undelete)) { |
|
81 | - foreach ($undelete AS $key=>$id) { |
|
82 | - $contact = $this->getGateway()->findById(intval($id)); |
|
83 | - if (!$contact->undelete()) { |
|
84 | - // void |
|
85 | - } |
|
86 | - } |
|
87 | - } |
|
75 | + if (is_string($this->body('deleted'))) { |
|
76 | + $undelete = unserialize(base64_decode($this->body('deleted'))); |
|
77 | + } else { |
|
78 | + throw new Exception('Could not undelete'); |
|
79 | + } |
|
80 | + if (!empty($undelete) AND is_array($undelete)) { |
|
81 | + foreach ($undelete AS $key=>$id) { |
|
82 | + $contact = $this->getGateway()->findById(intval($id)); |
|
83 | + if (!$contact->undelete()) { |
|
84 | + // void |
|
85 | + } |
|
86 | + } |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return new k_SeeOther($this->url()); |
@@ -340,15 +340,15 @@ discard block |
||
340 | 340 | |
341 | 341 | if (isset($_GET['query']) || isset($_GET['keyword_id'])) { |
342 | 342 | |
343 | - if (isset($_GET['query'])) { |
|
344 | - $this->getContact()->getDBQuery()->setFilter('search', $_GET['query']); |
|
345 | - } |
|
343 | + if (isset($_GET['query'])) { |
|
344 | + $this->getContact()->getDBQuery()->setFilter('search', $_GET['query']); |
|
345 | + } |
|
346 | 346 | |
347 | - if (isset($_GET['keyword_id'])) { |
|
348 | - $this->getContact()->getDBQuery()->setKeyword($_GET['keyword_id']); |
|
349 | - } |
|
347 | + if (isset($_GET['keyword_id'])) { |
|
348 | + $this->getContact()->getDBQuery()->setKeyword($_GET['keyword_id']); |
|
349 | + } |
|
350 | 350 | } else { |
351 | - $this->getContact()->getDBQuery()->useCharacter(); |
|
351 | + $this->getContact()->getDBQuery()->useCharacter(); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | $this->getContact()->getDBQuery()->defineCharacter('character', 'address.name'); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | */ |
56 | 56 | |
57 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
57 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
58 | 58 | return $smarty->render($this, array('contacts' => $this->getContacts())); |
59 | 59 | } |
60 | 60 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $doc = new Intraface_modules_contact_PdfLabel($this->getKernel()->setting->get("user", "label")); |
105 | 105 | $used_keyword = array(); |
106 | 106 | foreach ($contact->getDBQuery()->getKeyword() AS $kid) { |
107 | - foreach ($keywords AS $k){ |
|
107 | + foreach ($keywords AS $k) { |
|
108 | 108 | if ($k['id'] == $kid) { |
109 | 109 | $used_keyword[] = $k['keyword']; |
110 | 110 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if (is_array($keyword_ids) && count($keyword_ids) > 0) { |
134 | 134 | |
135 | 135 | foreach ($keyword_ids AS $kid) { |
136 | - foreach ($keywords AS $k){ |
|
136 | + foreach ($keywords AS $k) { |
|
137 | 137 | if ($k['id'] == $kid) { |
138 | 138 | $used_keyword[] = $k['keyword']; |
139 | 139 | } |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | |
143 | 143 | } |
144 | 144 | |
145 | - $keywords = 'Nøgleord' . implode(' ', $used_keyword); |
|
146 | - $search = 'Søgetekst' . $contact->getDBQuery()->getFilter('search'); |
|
147 | - $count = 'Kontakter i søgning' . count($contacts); |
|
145 | + $keywords = 'Nøgleord'.implode(' ', $used_keyword); |
|
146 | + $search = 'Søgetekst'.$contact->getDBQuery()->getFilter('search'); |
|
147 | + $count = 'Kontakter i søgning'.count($contacts); |
|
148 | 148 | |
149 | 149 | $i = 1; |
150 | 150 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $i = $i + 1; |
178 | 178 | $worksheet->write($i, 0, $count, $format_italic); |
179 | 179 | |
180 | - $i = $i+2; |
|
180 | + $i = $i + 2; |
|
181 | 181 | $worksheet->write($i, 0, 'Navn', $format_bold); |
182 | 182 | $worksheet->write($i, 1, 'Adresse', $format_bold); |
183 | 183 | $worksheet->write($i, 2, 'Postnummer', $format_bold); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | $this->document->addScript('contact/contact_edit.js'); |
214 | 214 | |
215 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/edit'); |
|
215 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/edit'); |
|
216 | 216 | return $smarty->render($this); |
217 | 217 | } |
218 | 218 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | if ($this->body()) { |
278 | 278 | return $value = $_POST; |
279 | 279 | } |
280 | - return array('number' => $this->getContact()->getMaxNumber()+1); |
|
280 | + return array('number' => $this->getContact()->getMaxNumber() + 1); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | function getAddressValues() |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | function postForm() |
35 | 35 | { |
36 | - $validator = new Intraface_Validator($this->getContact()->error); |
|
37 | - $validator->isString($_POST['subject'], 'error in subject'); |
|
38 | - $validator->isString($_POST['text'], 'error in text'); |
|
36 | + $validator = new Intraface_Validator($this->getContact()->error); |
|
37 | + $validator->isString($_POST['subject'], 'error in subject'); |
|
38 | + $validator->isString($_POST['text'], 'error in text'); |
|
39 | 39 | |
40 | - $contact = new Contact($this->getKernel()); |
|
40 | + $contact = new Contact($this->getKernel()); |
|
41 | 41 | $keyword = $contact->getKeywords(); |
42 | 42 | $keywords = $keyword->getAllKeywords(); |
43 | 43 | $contact->getDBQuery()->defineCharacter('character', 'address.name'); |
@@ -45,37 +45,37 @@ discard block |
||
45 | 45 | $contacts = $contact->getList("use_address"); |
46 | 46 | |
47 | 47 | if (!$contact->error->isError()) { |
48 | - // valideret subject og body |
|
49 | - $j = 0; |
|
50 | - |
|
51 | - foreach ($contacts as $contact) { |
|
52 | - if (!$validator->isEmail($contact['email'], "")) { |
|
53 | - continue; |
|
54 | - } |
|
55 | - |
|
56 | - $contact = $this->context->getGateway()->findById($contact['id']); |
|
57 | - |
|
58 | - $email = new Email($this->getKernel()); |
|
59 | - $input = array( |
|
60 | - 'subject' => $_POST['subject'], |
|
61 | - 'body' => $_POST['text'] . "\n\nLogin: " . $contact->get('login_url'), |
|
62 | - 'from_email' => $this->getKernel()->user->get('email'), |
|
63 | - 'from_name' => $this->getKernel()->user->get('name'), |
|
64 | - 'contact_id' => $contact->get('id'), |
|
65 | - 'type_id' => 11, // email til search |
|
66 | - 'belong_to' => 0 // der er ikke nogen specifik id at s�tte |
|
67 | - ); |
|
68 | - |
|
69 | - $email->save($input); |
|
70 | - $email->queue(); |
|
71 | - $j++; |
|
72 | - } |
|
73 | - $this->msg = 'Emailen blev i alt sendt til ' . $j . ' kontakter. <a href="'.$this->url('../').'">Tilbage til kontakter</a>.'; |
|
74 | - } else { |
|
75 | - $value = $_POST; |
|
76 | - } |
|
77 | - |
|
78 | - return $this->render(); |
|
48 | + // valideret subject og body |
|
49 | + $j = 0; |
|
50 | + |
|
51 | + foreach ($contacts as $contact) { |
|
52 | + if (!$validator->isEmail($contact['email'], "")) { |
|
53 | + continue; |
|
54 | + } |
|
55 | + |
|
56 | + $contact = $this->context->getGateway()->findById($contact['id']); |
|
57 | + |
|
58 | + $email = new Email($this->getKernel()); |
|
59 | + $input = array( |
|
60 | + 'subject' => $_POST['subject'], |
|
61 | + 'body' => $_POST['text'] . "\n\nLogin: " . $contact->get('login_url'), |
|
62 | + 'from_email' => $this->getKernel()->user->get('email'), |
|
63 | + 'from_name' => $this->getKernel()->user->get('name'), |
|
64 | + 'contact_id' => $contact->get('id'), |
|
65 | + 'type_id' => 11, // email til search |
|
66 | + 'belong_to' => 0 // der er ikke nogen specifik id at s�tte |
|
67 | + ); |
|
68 | + |
|
69 | + $email->save($input); |
|
70 | + $email->queue(); |
|
71 | + $j++; |
|
72 | + } |
|
73 | + $this->msg = 'Emailen blev i alt sendt til ' . $j . ' kontakter. <a href="'.$this->url('../').'">Tilbage til kontakter</a>.'; |
|
74 | + } else { |
|
75 | + $value = $_POST; |
|
76 | + } |
|
77 | + |
|
78 | + return $this->render(); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | function getContact() |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'contact' => $contact |
28 | 28 | ); |
29 | 29 | |
30 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/sendemail'); |
|
30 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/sendemail'); |
|
31 | 31 | return $smarty->render($this, $data); |
32 | 32 | } |
33 | 33 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $email = new Email($this->getKernel()); |
59 | 59 | $input = array( |
60 | 60 | 'subject' => $_POST['subject'], |
61 | - 'body' => $_POST['text'] . "\n\nLogin: " . $contact->get('login_url'), |
|
61 | + 'body' => $_POST['text']."\n\nLogin: ".$contact->get('login_url'), |
|
62 | 62 | 'from_email' => $this->getKernel()->user->get('email'), |
63 | 63 | 'from_name' => $this->getKernel()->user->get('name'), |
64 | 64 | 'contact_id' => $contact->get('id'), |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $email->queue(); |
71 | 71 | $j++; |
72 | 72 | } |
73 | - $this->msg = 'Emailen blev i alt sendt til ' . $j . ' kontakter. <a href="'.$this->url('../').'">Tilbage til kontakter</a>.'; |
|
73 | + $this->msg = 'Emailen blev i alt sendt til '.$j.' kontakter. <a href="'.$this->url('../').'">Tilbage til kontakter</a>.'; |
|
74 | 74 | } else { |
75 | 75 | $value = $_POST; |
76 | 76 | } |
@@ -23,42 +23,42 @@ |
||
23 | 23 | |
24 | 24 | function postForm() |
25 | 25 | { |
26 | - if ($this->body('mark_as_seen')) { |
|
27 | - $this->getMemo()->setStatus('seen'); |
|
28 | - } elseif ($this->body('cancel')) { |
|
29 | - $this->getMemo()->setStatus('cancelled'); |
|
30 | - } elseif ($this->body('postpone_1_day')) { |
|
31 | - $date = new Date($this->getMemo()->get('reminder_date')); |
|
32 | - $next_day = $date->getNextDay(); |
|
33 | - $this->getMemo()->postponeUntil($next_day->getDate()); |
|
34 | - } elseif ($this->body('postpone_1_week')) { |
|
35 | - $date = new Date($this->getMemo()->get('reminder_date')); |
|
36 | - $date_span = new Date_Span(); |
|
37 | - $date_span->setFromDays(7); |
|
38 | - $date->addSpan($date_span); |
|
39 | - $this->getMemo()->postponeUntil($date->getDate()); |
|
40 | - } elseif ($this->body('postpone_1_month')) { |
|
41 | - $date = new Date($this->getMemo()->get('reminder_date')); |
|
42 | - $date_span = new Date_Span(); |
|
26 | + if ($this->body('mark_as_seen')) { |
|
27 | + $this->getMemo()->setStatus('seen'); |
|
28 | + } elseif ($this->body('cancel')) { |
|
29 | + $this->getMemo()->setStatus('cancelled'); |
|
30 | + } elseif ($this->body('postpone_1_day')) { |
|
31 | + $date = new Date($this->getMemo()->get('reminder_date')); |
|
32 | + $next_day = $date->getNextDay(); |
|
33 | + $this->getMemo()->postponeUntil($next_day->getDate()); |
|
34 | + } elseif ($this->body('postpone_1_week')) { |
|
35 | + $date = new Date($this->getMemo()->get('reminder_date')); |
|
36 | + $date_span = new Date_Span(); |
|
37 | + $date_span->setFromDays(7); |
|
38 | + $date->addSpan($date_span); |
|
39 | + $this->getMemo()->postponeUntil($date->getDate()); |
|
40 | + } elseif ($this->body('postpone_1_month')) { |
|
41 | + $date = new Date($this->getMemo()->get('reminder_date')); |
|
42 | + $date_span = new Date_Span(); |
|
43 | 43 | $date_calc = new Date_Calc(); |
44 | - $date_parts = explode('-', $this->getMemo()->get('reminder_date')); |
|
44 | + $date_parts = explode('-', $this->getMemo()->get('reminder_date')); |
|
45 | 45 | $date_span->setFromDays($date_calc->daysInMonth($date_parts[1], $date_parts[0])); |
46 | - $date->addSpan($date_span); |
|
47 | - $this->getMemo()->postponeUntil($date->getDate()); |
|
48 | - } elseif ($this->body('postpone_1_year')) { |
|
49 | - $date = new Date($this->getMemo()->get('reminder_date')); |
|
50 | - $date_span = new Date_Span(); |
|
51 | - $date_span->setFromDays(365); // does not take account of leap year |
|
52 | - $date->addSpan($date_span); |
|
53 | - $this->getMemo()->postponeUntil($date->getDate()); |
|
54 | - } else { |
|
55 | - if ($id = $this->getMemo()->update($_POST)) { |
|
56 | - return new k_SeeOther($this->url('../')); |
|
57 | - } |
|
58 | - $value = $_POST; |
|
59 | - } |
|
46 | + $date->addSpan($date_span); |
|
47 | + $this->getMemo()->postponeUntil($date->getDate()); |
|
48 | + } elseif ($this->body('postpone_1_year')) { |
|
49 | + $date = new Date($this->getMemo()->get('reminder_date')); |
|
50 | + $date_span = new Date_Span(); |
|
51 | + $date_span->setFromDays(365); // does not take account of leap year |
|
52 | + $date->addSpan($date_span); |
|
53 | + $this->getMemo()->postponeUntil($date->getDate()); |
|
54 | + } else { |
|
55 | + if ($id = $this->getMemo()->update($_POST)) { |
|
56 | + return new k_SeeOther($this->url('../')); |
|
57 | + } |
|
58 | + $value = $_POST; |
|
59 | + } |
|
60 | 60 | |
61 | - return $this->render(); |
|
61 | + return $this->render(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function getMemo() |
@@ -11,13 +11,13 @@ |
||
11 | 11 | |
12 | 12 | function renderHtml() |
13 | 13 | { |
14 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/memo'); |
|
14 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/memo'); |
|
15 | 15 | return $smarty->render($this, array('reminder' => $this->getMemo())); |
16 | 16 | } |
17 | 17 | |
18 | 18 | function renderHtmlEdit() |
19 | 19 | { |
20 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/memo-edit'); |
|
20 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/memo-edit'); |
|
21 | 21 | return $smarty->render($this, array('reminder' => $this->getMemo())); |
22 | 22 | } |
23 | 23 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | $data = array('data' => $this->session()->get('fileimport_data')); |
22 | 22 | |
23 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/import'); |
|
23 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/import'); |
|
24 | 24 | return $smarty->render($this, $data); |
25 | 25 | } |
26 | 26 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $string_appender->addKeywordsByString($_POST['keyword']); |
49 | 49 | $this->success++; |
50 | 50 | } else { |
51 | - $this->errors[$e]['line'] = $line+1; // line starts at 0 |
|
51 | + $this->errors[$e]['line'] = $line + 1; // line starts at 0 |
|
52 | 52 | $this->errors[$e]['name'] = $contact['name']; |
53 | 53 | $this->errors[$e]['email'] = $contact['email']; |
54 | 54 | $this->errors[$e]['error'] = $contact_object->error; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $data = $this->session()->set('fileimport_data', null); |
60 | 60 | |
61 | 61 | if (empty($this->errors)) { |
62 | - return new k_SeeOther($this->url('../', array('flare' => $this->success . ' contacts imported successfully'))); |
|
62 | + return new k_SeeOther($this->url('../', array('flare' => $this->success.' contacts imported successfully'))); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $this->render(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $contact = $this->context->getContact(); |
35 | 35 | $similar_contacts = $contact->getSimilarContacts(); |
36 | 36 | |
37 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/merge'); |
|
37 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/merge'); |
|
38 | 38 | return $smarty->render($this); |
39 | 39 | } |
40 | 40 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | function setNewContactId($old_contact_id, $new_contact_id) |
75 | 75 | { |
76 | - $this->db_sql->query('UPDATE contact_person SET contact_id = ' . $new_contact_id . ' WHERE contact_id = ' . $old_contact_id); |
|
76 | + $this->db_sql->query('UPDATE contact_person SET contact_id = '.$new_contact_id.' WHERE contact_id = '.$old_contact_id); |
|
77 | 77 | return true; |
78 | 78 | } |
79 | 79 |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | |
16 | 16 | function renderHtmlEdit() |
17 | 17 | { |
18 | - $contact = $this->context->context->getContact(); |
|
19 | - $person = $contact->loadContactPerson($this->name()); |
|
18 | + $contact = $this->context->context->getContact(); |
|
19 | + $person = $contact->loadContactPerson($this->name()); |
|
20 | 20 | |
21 | 21 | $smarty = $this->template->create(dirname(__FILE__) . '/templates/contactperson-edit'); |
22 | 22 | return $smarty->render($this, array('contact' => $contact, 'person' => $person)); |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | |
25 | 25 | function postForm() |
26 | 26 | { |
27 | - $contact = $this->context->context->getContact(); |
|
28 | - $person = $contact->loadContactPerson($this->name()); |
|
29 | - if ($id = $person->save($_POST)) { |
|
30 | - return new k_SeeOther($this->url('../')); |
|
31 | - } else { |
|
32 | - $value = $_POST; |
|
33 | - } |
|
34 | - return $this->render(); |
|
27 | + $contact = $this->context->context->getContact(); |
|
28 | + $person = $contact->loadContactPerson($this->name()); |
|
29 | + if ($id = $person->save($_POST)) { |
|
30 | + return new k_SeeOther($this->url('../')); |
|
31 | + } else { |
|
32 | + $value = $_POST; |
|
33 | + } |
|
34 | + return $this->render(); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $contact = $this->context->context->getContact(); |
19 | 19 | $person = $contact->loadContactPerson($this->name()); |
20 | 20 | |
21 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/contactperson-edit'); |
|
21 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/contactperson-edit'); |
|
22 | 22 | return $smarty->render($this, array('contact' => $contact, 'person' => $person)); |
23 | 23 | } |
24 | 24 |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | $this->getKernel()->useModule('newsletter'); |
41 | 41 | |
42 | 42 | $validator = new Intraface_Validator($this->getContact()->error); |
43 | - $validator->isNumeric($_POST['newsletter_id'], 'error in newsletter'); |
|
43 | + $validator->isNumeric($_POST['newsletter_id'], 'error in newsletter'); |
|
44 | 44 | |
45 | - $contact = new Contact($this->getKernel()); |
|
45 | + $contact = new Contact($this->getKernel()); |
|
46 | 46 | $keyword = $contact->getKeywords(); |
47 | 47 | $keywords = $keyword->getAllKeywords(); |
48 | 48 | $contact->getDBQuery()->defineCharacter('character', 'address.name'); |
@@ -50,28 +50,28 @@ discard block |
||
50 | 50 | $contacts = $contact->getList("use_address"); |
51 | 51 | |
52 | 52 | if (!$contact->error->isError()) { |
53 | - // valideret subject og body |
|
54 | - $j = 0; |
|
53 | + // valideret subject og body |
|
54 | + $j = 0; |
|
55 | 55 | |
56 | - foreach ($contacts as $c) { |
|
57 | - $contact = $this->context->getGateway()->findById($c['id']); |
|
56 | + foreach ($contacts as $c) { |
|
57 | + $contact = $this->context->getGateway()->findById($c['id']); |
|
58 | 58 | |
59 | - $newsletter = new NewsletterList($this->getKernel(), $_POST['newsletter_id']); |
|
60 | - if ($newsletter->get('id') == 0) { |
|
61 | - throw new Exception('Invalid newsletter list'); |
|
62 | - } |
|
59 | + $newsletter = new NewsletterList($this->getKernel(), $_POST['newsletter_id']); |
|
60 | + if ($newsletter->get('id') == 0) { |
|
61 | + throw new Exception('Invalid newsletter list'); |
|
62 | + } |
|
63 | 63 | |
64 | - $subscriber = new NewsletterSubscriber($newsletter); |
|
65 | - $subscriber->addContact($contact); |
|
64 | + $subscriber = new NewsletterSubscriber($newsletter); |
|
65 | + $subscriber->addContact($contact); |
|
66 | 66 | |
67 | - $j++; |
|
68 | - } |
|
69 | - $this->msg = 'I alt blev ' . $j . ' kontakter tilmeldt nyhedsbrevet. <a href="'.$this->url('../', array('use_stored' => 'true')).'">Tilbage til kontakter</a>.'; |
|
70 | - } else { |
|
71 | - $value = $_POST; |
|
72 | - } |
|
67 | + $j++; |
|
68 | + } |
|
69 | + $this->msg = 'I alt blev ' . $j . ' kontakter tilmeldt nyhedsbrevet. <a href="'.$this->url('../', array('use_stored' => 'true')).'">Tilbage til kontakter</a>.'; |
|
70 | + } else { |
|
71 | + $value = $_POST; |
|
72 | + } |
|
73 | 73 | |
74 | - return $this->render(); |
|
74 | + return $this->render(); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | function getContact() |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | 'contact' => $contact |
32 | 32 | ); |
33 | 33 | |
34 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/batchnewsletter'); |
|
34 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/batchnewsletter'); |
|
35 | 35 | return $smarty->render($this, $data); |
36 | 36 | } |
37 | 37 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | $j++; |
68 | 68 | } |
69 | - $this->msg = 'I alt blev ' . $j . ' kontakter tilmeldt nyhedsbrevet. <a href="'.$this->url('../', array('use_stored' => 'true')).'">Tilbage til kontakter</a>.'; |
|
69 | + $this->msg = 'I alt blev '.$j.' kontakter tilmeldt nyhedsbrevet. <a href="'.$this->url('../', array('use_stored' => 'true')).'">Tilbage til kontakter</a>.'; |
|
70 | 70 | } else { |
71 | 71 | $value = $_POST; |
72 | 72 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | function renderHtmlCreate() |
22 | 22 | { |
23 | 23 | $contact = $this->context->getContact(); |
24 | - $person = $contact->loadContactPerson(0); |
|
24 | + $person = $contact->loadContactPerson(0); |
|
25 | 25 | |
26 | 26 | $smarty = $this->template->create(dirname(__FILE__) . '/templates/contactperson-edit'); |
27 | 27 | return $smarty->render($this, array('person' => $person, 'contact' => $contact)); |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | function postForm() |
36 | 36 | { |
37 | - $contact = $this->context->getContact(); |
|
38 | - $person = $contact->loadContactPerson(0); |
|
39 | - if ($id = $person->save($_POST)) { |
|
40 | - return new k_SeeOther($this->url('../')); |
|
41 | - } else { |
|
42 | - $value = $_POST; |
|
43 | - } |
|
44 | - return $this->render(); |
|
37 | + $contact = $this->context->getContact(); |
|
38 | + $person = $contact->loadContactPerson(0); |
|
39 | + if ($id = $person->save($_POST)) { |
|
40 | + return new k_SeeOther($this->url('../')); |
|
41 | + } else { |
|
42 | + $value = $_POST; |
|
43 | + } |
|
44 | + return $this->render(); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $contact = $this->context->getContact(); |
24 | 24 | $person = $contact->loadContactPerson(0); |
25 | 25 | |
26 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/contactperson-edit'); |
|
26 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/contactperson-edit'); |
|
27 | 27 | return $smarty->render($this, array('person' => $person, 'contact' => $contact)); |
28 | 28 | } |
29 | 29 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | function renderHtmlCreate() |
33 | 33 | { |
34 | - $reminder = new ContactReminder($this->context->getKernel()); |
|
34 | + $reminder = new ContactReminder($this->context->getKernel()); |
|
35 | 35 | $contact = $reminder->contact; |
36 | 36 | |
37 | 37 | $smarty = $this->template->create(dirname(__FILE__) . '/templates/memo-edit'); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | function postForm() |
42 | 42 | { |
43 | 43 | $contact = $this->context->getContact(); |
44 | - $reminder = new ContactReminder($contact); |
|
44 | + $reminder = new ContactReminder($contact); |
|
45 | 45 | |
46 | - if ($id = $reminder->update($_POST)) { |
|
47 | - return new k_SeeOther($this->url('../')); |
|
48 | - } |
|
46 | + if ($id = $reminder->update($_POST)) { |
|
47 | + return new k_SeeOther($this->url('../')); |
|
48 | + } |
|
49 | 49 | return $this->render(); |
50 | 50 | } |
51 | 51 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $this->document->setTitle('Memos'); |
21 | 21 | |
22 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/memos'); |
|
22 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/memos'); |
|
23 | 23 | |
24 | 24 | if (is_numeric($this->context->name())) { |
25 | 25 | return $tpl->render($this, array('memos' => $gateway->findByContactId($this->context->name()))); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $reminder = new ContactReminder($this->context->getKernel()); |
35 | 35 | $contact = $reminder->contact; |
36 | 36 | |
37 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/memo-edit'); |
|
37 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/memo-edit'); |
|
38 | 38 | return $smarty->render($this, array('reminder' => $reminder, 'contact' => $contact)); |
39 | 39 | } |
40 | 40 |