@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $qb = org_openpsa_directmarketing_campaign_messagereceipt_dba::new_query_builder(); |
89 | 89 | $qb->add_constraint('token', '=', $token); |
90 | 90 | $qb->add_constraint('orgOpenpsaObtype', '=', $type); |
91 | - $ret = $qb->execute(); |
|
91 | + $ret = $qb->execute(); |
|
92 | 92 | debug_print_r("_qb_token_receipts({$token}) returned", $ret); |
93 | 93 | if (empty($ret)) |
94 | 94 | { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | $this->_request_data['token'] = $args[0]; |
184 | 184 | |
185 | - if ( count($args) == 2 |
|
185 | + if (count($args) == 2 |
|
186 | 186 | && !empty($args[1])) |
187 | 187 | { |
188 | 188 | //Due to the way browsers handle the URLs this form only works for root pages |
@@ -187,12 +187,10 @@ |
||
187 | 187 | { |
188 | 188 | //Due to the way browsers handle the URLs this form only works for root pages |
189 | 189 | $this->_request_data['target'] = $args[1]; |
190 | - } |
|
191 | - else if (!empty($_GET['link'])) |
|
190 | + } else if (!empty($_GET['link'])) |
|
192 | 191 | { |
193 | 192 | $this->_request_data['target'] = $_GET['link']; |
194 | - } |
|
195 | - else |
|
193 | + } else |
|
196 | 194 | { |
197 | 195 | throw new midcom_error('Target not present in address or GET, or is empty'); |
198 | 196 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * Looks up an message to display. |
44 | 44 | */ |
45 | - public function _handler_view ($handler_id, array $args, array &$data) |
|
45 | + public function _handler_view($handler_id, array $args, array &$data) |
|
46 | 46 | { |
47 | 47 | midcom::get()->auth->require_valid_user(); |
48 | 48 | $this->_message = new org_openpsa_directmarketing_campaign_message_dba($args[0]); |
@@ -71,8 +71,7 @@ discard block |
||
71 | 71 | $buttons = array(); |
72 | 72 | if ($this->_message->can_do('midgard:update')) |
73 | 73 | { |
74 | - $buttons[] = $workflow->get_button("message/edit/{$this->_message->guid}/", array |
|
75 | - ( |
|
74 | + $buttons[] = $workflow->get_button("message/edit/{$this->_message->guid}/", array( |
|
76 | 75 | MIDCOM_TOOLBAR_ACCESSKEY => 'e', |
77 | 76 | )); |
78 | 77 | } |
@@ -83,8 +82,7 @@ discard block |
||
83 | 82 | } |
84 | 83 | if ($this->_message->can_do('midgard:update')) |
85 | 84 | { |
86 | - $buttons[] = $workflow->get_button("message/copy/{$this->_message->guid}/", array |
|
87 | - ( |
|
85 | + $buttons[] = $workflow->get_button("message/copy/{$this->_message->guid}/", array( |
|
88 | 86 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('copy message'), |
89 | 87 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/editcopy.png', |
90 | 88 | )); |
@@ -95,16 +93,14 @@ discard block |
||
95 | 93 | { |
96 | 94 | $preview_url .= midcom::get()->auth->user->guid . '/'; |
97 | 95 | } |
98 | - $buttons[] = array |
|
99 | - ( |
|
96 | + $buttons[] = array( |
|
100 | 97 | MIDCOM_TOOLBAR_URL => $preview_url, |
101 | 98 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('preview message'), |
102 | 99 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/view.png', |
103 | 100 | MIDCOM_TOOLBAR_ACCESSKEY => 'p', |
104 | 101 | MIDCOM_TOOLBAR_OPTIONS => array('target' => '_BLANK'), |
105 | 102 | ); |
106 | - $buttons[] = array |
|
107 | - ( |
|
103 | + $buttons[] = array( |
|
108 | 104 | MIDCOM_TOOLBAR_URL => "message/report/{$this->_message->guid}/", |
109 | 105 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("message report"), |
110 | 106 | MIDCOM_TOOLBAR_ACCESSKEY => 'r', |
@@ -112,8 +108,7 @@ discard block |
||
112 | 108 | ); |
113 | 109 | |
114 | 110 | $this->_campaign->get_testers(); |
115 | - $buttons[] = array |
|
116 | - ( |
|
111 | + $buttons[] = array( |
|
117 | 112 | MIDCOM_TOOLBAR_URL => "message/send_test/{$this->_message->guid}/", |
118 | 113 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("send message to testers"), |
119 | 114 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_mail-send.png', |
@@ -126,14 +121,12 @@ discard block |
||
126 | 121 | $keys = $mc->list_keys(); |
127 | 122 | |
128 | 123 | // Show the message send if there are recipients |
129 | - $buttons[] = array |
|
130 | - ( |
|
124 | + $buttons[] = array( |
|
131 | 125 | MIDCOM_TOOLBAR_URL => "message/send/{$this->_message->guid}/", |
132 | 126 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("send message to whole campaign"), |
133 | 127 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_mail-send.png', |
134 | 128 | MIDCOM_TOOLBAR_ENABLED => (count($keys) > 0 && $this->_message->can_do('midgard:update')), |
135 | - MIDCOM_TOOLBAR_OPTIONS => array |
|
136 | - ( |
|
129 | + MIDCOM_TOOLBAR_OPTIONS => array( |
|
137 | 130 | 'onclick' => "return confirm('" . $this->_l10n->get('are you sure you wish to send this to the whole campaign') . "')", |
138 | 131 | ) |
139 | 132 | ); |
@@ -143,7 +136,7 @@ discard block |
||
143 | 136 | /** |
144 | 137 | * Shows the loaded message. |
145 | 138 | */ |
146 | - public function _show_view ($handler_id, array &$data) |
|
139 | + public function _show_view($handler_id, array &$data) |
|
147 | 140 | { |
148 | 141 | $data['view_message'] = $this->_datamanager->get_content_html(); |
149 | 142 | midcom_show_style('show-message'); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | throw new midcom_error('"content" not defined in schema'); |
81 | 81 | } |
82 | 82 | //Substyle handling |
83 | - if ( !empty($data['message_array']['substyle']) |
|
83 | + if (!empty($data['message_array']['substyle']) |
|
84 | 84 | && !preg_match('/^builtin:/', $data['message_array']['substyle'])) |
85 | 85 | { |
86 | 86 | debug_add("Appending substyle {$data['message_array']['substyle']}"); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | private function _real_show_compose($handler_id, array &$data) |
127 | 127 | { |
128 | 128 | $prefix = ''; |
129 | - if ( !empty($data['message_array']['substyle']) |
|
129 | + if (!empty($data['message_array']['substyle']) |
|
130 | 130 | && preg_match('/^builtin:(.*)/', $data['message_array']['substyle'], $matches_style)) |
131 | 131 | { |
132 | 132 | $prefix = $matches_style[1] . '-'; |
@@ -246,8 +246,7 @@ |
||
246 | 246 | { |
247 | 247 | $result = array(); |
248 | 248 | $size = 0; |
249 | - } |
|
250 | - else |
|
249 | + } else |
|
251 | 250 | { |
252 | 251 | $result = array_slice($result, $this->_offset); |
253 | 252 | $size = $size - $this->_offset; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Looks up an message to display. |
29 | 29 | */ |
30 | - public function _handler_list ($handler_id, array $args, array &$data) |
|
30 | + public function _handler_list($handler_id, array $args, array &$data) |
|
31 | 31 | { |
32 | 32 | midcom::get()->auth->require_valid_user(); |
33 | 33 | $this->_campaign = $this->_master->load_campaign($args[1]); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Shows the loaded message. |
41 | 41 | */ |
42 | - public function _show_list ($handler_id, array &$data) |
|
42 | + public function _show_list($handler_id, array &$data) |
|
43 | 43 | { |
44 | 44 | $qb = new org_openpsa_qbpager('org_openpsa_directmarketing_campaign_message_dba', 'campaign_messages'); |
45 | 45 | $qb->results_per_page = 10; |
@@ -122,14 +122,13 @@ |
||
122 | 122 | private function _get_sender(array &$data) |
123 | 123 | { |
124 | 124 | $data['message_array'] = $this->_datamanager->get_content_raw(); |
125 | - $data['message_array']['dm_types'] =& $this->_datamanager->types; |
|
125 | + $data['message_array']['dm_types'] = & $this->_datamanager->types; |
|
126 | 126 | if (!array_key_exists('content', $data['message_array'])) |
127 | 127 | { |
128 | 128 | throw new midcom_error('"content" not defined in schema'); |
129 | 129 | } |
130 | 130 | |
131 | - $settings = array |
|
132 | - ( |
|
131 | + $settings = array( |
|
133 | 132 | 'mail_send_backend' => 'mail_send_backend', |
134 | 133 | 'bouncer_address' => 'bounce_detector_address', |
135 | 134 | 'linkdetector_address' => 'link_detector_address', |
@@ -81,8 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | throw new midcom_error(midcom_connection::get_error_string()); |
83 | 83 | } |
84 | - } |
|
85 | - else |
|
84 | + } else |
|
86 | 85 | { |
87 | 86 | $nodes = $object_qb->execute(); |
88 | 87 | $node = $nodes[0]; |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | private function _analyze_message_report(array $data) |
45 | 45 | { |
46 | - $this->_request_data['report'] = array |
|
47 | - ( |
|
46 | + $this->_request_data['report'] = array( |
|
48 | 47 | 'campaign_data' => array(), |
49 | 48 | 'receipt_data' => array() |
50 | 49 | ); |
@@ -52,7 +51,7 @@ discard block |
||
52 | 51 | $qb_receipts->add_constraint('message', '=', $this->_message->id); |
53 | 52 | $qb_receipts->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT); |
54 | 53 | $receipts = $qb_receipts->execute_unchecked(); |
55 | - $receipt_data =& $this->_request_data['report']['receipt_data']; |
|
54 | + $receipt_data = & $this->_request_data['report']['receipt_data']; |
|
56 | 55 | $receipt_data['first_send'] = time(); |
57 | 56 | $receipt_data['last_send'] = 0; |
58 | 57 | $receipt_data['sent'] = count($receipts); |
@@ -90,7 +89,7 @@ discard block |
||
90 | 89 | |
91 | 90 | private function _get_campaign_data($first_send) |
92 | 91 | { |
93 | - $campaign_data =& $this->_request_data['report']['campaign_data']; |
|
92 | + $campaign_data = & $this->_request_data['report']['campaign_data']; |
|
94 | 93 | $qb_unsub = org_openpsa_directmarketing_campaign_member_dba::new_query_builder(); |
95 | 94 | $qb_unsub->add_constraint('campaign', '=', $this->_message->campaign); |
96 | 95 | $qb_unsub->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED); |
@@ -98,8 +97,8 @@ discard block |
||
98 | 97 | $campaign_data['next_message'] = false; |
99 | 98 | // Find "next message" and if present use its sendStarted as constraint for this query |
100 | 99 | $qb_messages = org_openpsa_directmarketing_campaign_message_dba::new_query_builder(); |
101 | - $qb_messages->add_constraint('campaign', '=', $this->_message->campaign); |
|
102 | - $qb_messages->add_constraint('id', '<>', $this->_message->id); |
|
100 | + $qb_messages->add_constraint('campaign', '=', $this->_message->campaign); |
|
101 | + $qb_messages->add_constraint('id', '<>', $this->_message->id); |
|
103 | 102 | $qb_messages->add_constraint('sendStarted', '>', $first_send); |
104 | 103 | $qb_messages->add_order('sendStarted', 'DESC'); |
105 | 104 | $qb_messages->set_limit(1); |
@@ -115,7 +114,7 @@ discard block |
||
115 | 114 | private function _get_link_data($segmentation_param) |
116 | 115 | { |
117 | 116 | $this->_request_data['report']['link_data'] = array(); |
118 | - $link_data =& $this->_request_data['report']['link_data']; |
|
117 | + $link_data = & $this->_request_data['report']['link_data']; |
|
119 | 118 | |
120 | 119 | $link_data['counts'] = array(); |
121 | 120 | $link_data['percentages'] = array('of_links' => array(), 'of_recipients' => array()); |
@@ -142,7 +141,7 @@ discard block |
||
142 | 141 | { |
143 | 142 | $segment = ''; |
144 | 143 | $segment_notfound = false; |
145 | - if ( $segmentation_param |
|
144 | + if ($segmentation_param |
|
146 | 145 | && !empty($link->person)) |
147 | 146 | { |
148 | 147 | try |
@@ -150,7 +149,7 @@ discard block |
||
150 | 149 | $person = org_openpsa_contacts_person_dba::get_cached($link->person); |
151 | 150 | $segment = $person->get_parameter('org.openpsa.directmarketing.segments', $segmentation_param); |
152 | 151 | } |
153 | - catch (midcom_error $e){} |
|
152 | + catch (midcom_error $e) {} |
|
154 | 153 | if (empty($segment)) |
155 | 154 | { |
156 | 155 | $segment = $this->_l10n->get('no segment'); |
@@ -160,7 +159,7 @@ discard block |
||
160 | 159 | { |
161 | 160 | $link_data['segments'][$segment] = $segment_prototype; |
162 | 161 | } |
163 | - $segment_data =& $link_data['segments'][$segment]; |
|
162 | + $segment_data = & $link_data['segments'][$segment]; |
|
164 | 163 | } |
165 | 164 | else |
166 | 165 | { |
@@ -182,27 +181,22 @@ discard block |
||
182 | 181 | |
183 | 182 | if (!$segment_notfound) |
184 | 183 | { |
185 | - $segmentrule = array |
|
186 | - ( |
|
184 | + $segmentrule = array( |
|
187 | 185 | 'comment' => $this->_l10n->get('segment limits'), |
188 | 186 | 'type' => 'AND', |
189 | 187 | 'class' => 'org_openpsa_contacts_person_dba', |
190 | - 'rules' => array |
|
191 | - ( |
|
192 | - array |
|
193 | - ( |
|
188 | + 'rules' => array( |
|
189 | + array( |
|
194 | 190 | 'property' => 'parameter.domain', |
195 | 191 | 'match' => '=', |
196 | 192 | 'value' => 'org.openpsa.directmarketing.segments', |
197 | 193 | ), |
198 | - array |
|
199 | - ( |
|
194 | + array( |
|
200 | 195 | 'property' => 'parameter.name', |
201 | 196 | 'match' => '=', |
202 | 197 | 'value' => $segmentation_param, |
203 | 198 | ), |
204 | - array |
|
205 | - ( |
|
199 | + array( |
|
206 | 200 | 'property' => 'parameter.value', |
207 | 201 | 'match' => '=', |
208 | 202 | 'value' => $segment, |
@@ -233,28 +227,22 @@ discard block |
||
233 | 227 | |
234 | 228 | private function _generate_link_rules(org_openpsa_directmarketing_link_log_dba $link) |
235 | 229 | { |
236 | - return array |
|
237 | - ( |
|
230 | + return array( |
|
238 | 231 | 'comment' => sprintf($this->_l10n->get('all persons who have clicked on link "%s" in message #%d and have not unsubscribed from campaign #%d'), $link->target, $link->message, $this->_message->campaign), |
239 | 232 | 'type' => 'AND', |
240 | - 'classes' => array |
|
241 | - ( |
|
242 | - array |
|
243 | - ( |
|
233 | + 'classes' => array( |
|
234 | + array( |
|
244 | 235 | 'comment' => $this->_l10n->get('link and message limits'), |
245 | 236 | 'type' => 'AND', |
246 | 237 | 'class' => 'org_openpsa_directmarketing_link_log_dba', |
247 | - 'rules' => array |
|
248 | - ( |
|
249 | - array |
|
250 | - ( |
|
238 | + 'rules' => array( |
|
239 | + array( |
|
251 | 240 | 'property' => 'target', |
252 | 241 | 'match' => '=', |
253 | 242 | 'value' => $link->target, |
254 | 243 | ), |
255 | 244 | // PONDER: do we want to limit to this message only ?? |
256 | - array |
|
257 | - ( |
|
245 | + array( |
|
258 | 246 | 'property' => 'message', |
259 | 247 | 'match' => '=', |
260 | 248 | 'value' => $link->message, |
@@ -262,21 +250,17 @@ discard block |
||
262 | 250 | ), |
263 | 251 | ), |
264 | 252 | // Add rule that prevents unsubscribed persons from ending up to the smart-campaign ?? |
265 | - array |
|
266 | - ( |
|
253 | + array( |
|
267 | 254 | 'comment' => $this->_l10n->get('not-unsubscribed -limits'), |
268 | 255 | 'type' => 'AND', |
269 | 256 | 'class' => 'org_openpsa_directmarketing_campaign_member_dba', |
270 | - 'rules' => array |
|
271 | - ( |
|
272 | - array |
|
273 | - ( |
|
257 | + 'rules' => array( |
|
258 | + array( |
|
274 | 259 | 'property' => 'orgOpenpsaObtype', |
275 | 260 | 'match' => '<>', |
276 | 261 | 'value' => org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED, |
277 | 262 | ), |
278 | - array |
|
279 | - ( |
|
263 | + array( |
|
280 | 264 | 'property' => 'campaign', |
281 | 265 | 'match' => '=', |
282 | 266 | 'value' => $this->_message->campaign, |
@@ -292,15 +276,15 @@ discard block |
||
292 | 276 | $this->_initialize_field($array['percentages']['of_links'], $link); |
293 | 277 | $this->_initialize_field($array['percentages']['of_recipients'], $link); |
294 | 278 | |
295 | - $link_data =& $this->_request_data['report']['link_data']; |
|
296 | - $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total']/$link_data['total'])*100; |
|
297 | - $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/$link_data['total'])*100; |
|
279 | + $link_data = & $this->_request_data['report']['link_data']; |
|
280 | + $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total'] / $link_data['total']) * 100; |
|
281 | + $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / $link_data['total']) * 100; |
|
298 | 282 | |
299 | - $receipt_data =& $this->_request_data['report']['receipt_data']; |
|
300 | - $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target])-1)/($receipt_data['sent']-$receipt_data['bounced']))*100; |
|
301 | - $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/($receipt_data['sent']-$receipt_data['bounced']))*100; |
|
283 | + $receipt_data = & $this->_request_data['report']['receipt_data']; |
|
284 | + $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target]) - 1) / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100; |
|
285 | + $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100; |
|
302 | 286 | |
303 | - if ( !isset($array['percentages']['of_recipients']['total']) |
|
287 | + if (!isset($array['percentages']['of_recipients']['total']) |
|
304 | 288 | || $array['percentages']['of_recipients'][$link->target]['total'] > $array['percentages']['of_recipients']['total']) |
305 | 289 | { |
306 | 290 | $array['percentages']['of_recipients']['total'] = $array['percentages']['of_recipients'][$link->target]['total']; |
@@ -371,7 +355,7 @@ discard block |
||
371 | 355 | $this->_campaign = $this->_master->load_campaign($this->_message->campaign); |
372 | 356 | $data['campaign'] = $this->_campaign; |
373 | 357 | |
374 | - if ( isset($_POST['oo_dirmar_userule']) |
|
358 | + if (isset($_POST['oo_dirmar_userule']) |
|
375 | 359 | && !empty($_POST['oo_dirmar_rule_' . $_POST['oo_dirmar_userule']])) |
376 | 360 | { |
377 | 361 | return $this->_create_campaign_from_link($_POST['oo_dirmar_userule']); |
@@ -385,19 +369,16 @@ discard block |
||
385 | 369 | $preview_url = "message/compose/{$this->_message->guid}/"; |
386 | 370 | if (!empty(midcom::get()->auth->user->guid)) |
387 | 371 | { |
388 | - $preview_url .= midcom::get()->auth->user->guid .'/'; |
|
372 | + $preview_url .= midcom::get()->auth->user->guid . '/'; |
|
389 | 373 | } |
390 | 374 | |
391 | - $buttons = array |
|
392 | - ( |
|
393 | - array |
|
394 | - ( |
|
375 | + $buttons = array( |
|
376 | + array( |
|
395 | 377 | MIDCOM_TOOLBAR_URL => "message/{$this->_message->guid}/", |
396 | 378 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get("back"), |
397 | 379 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png', |
398 | 380 | ), |
399 | - array |
|
400 | - ( |
|
381 | + array( |
|
401 | 382 | MIDCOM_TOOLBAR_URL => $preview_url, |
402 | 383 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('preview message'), |
403 | 384 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/view.png', |
@@ -149,8 +149,7 @@ discard block |
||
149 | 149 | { |
150 | 150 | $person = org_openpsa_contacts_person_dba::get_cached($link->person); |
151 | 151 | $segment = $person->get_parameter('org.openpsa.directmarketing.segments', $segmentation_param); |
152 | - } |
|
153 | - catch (midcom_error $e){} |
|
152 | + } catch (midcom_error $e){} |
|
154 | 153 | if (empty($segment)) |
155 | 154 | { |
156 | 155 | $segment = $this->_l10n->get('no segment'); |
@@ -161,8 +160,7 @@ discard block |
||
161 | 160 | $link_data['segments'][$segment] = $segment_prototype; |
162 | 161 | } |
163 | 162 | $segment_data =& $link_data['segments'][$segment]; |
164 | - } |
|
165 | - else |
|
163 | + } else |
|
166 | 164 | { |
167 | 165 | $segment_data = $segment_prototype; |
168 | 166 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * DM2 creation callback, binds to the current content topic. |
58 | 58 | */ |
59 | - public function & dm2_create_callback (&$controller) |
|
59 | + public function & dm2_create_callback(&$controller) |
|
60 | 60 | { |
61 | 61 | $this->_message = new org_openpsa_directmarketing_campaign_message_dba(); |
62 | 62 | // duh ? (copy-paste artefact ??) |
@@ -88,8 +88,7 @@ discard block |
||
88 | 88 | $data['controller'] = $this->get_controller('create'); |
89 | 89 | midcom::get()->head->set_pagetitle(sprintf($this->_l10n_midcom->get('create %s'), $this->_l10n->get($this->_schemadb[$this->_schema]->description))); |
90 | 90 | |
91 | - $workflow = $this->get_workflow('datamanager2', array |
|
92 | - ( |
|
91 | + $workflow = $this->get_workflow('datamanager2', array( |
|
93 | 92 | 'controller' => $data['controller'], |
94 | 93 | 'save_callback' => array($this, 'save_callback') |
95 | 94 | )); |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | { |
52 | 52 | $this->_load_schemadb(); |
53 | 53 | $this->_controller = midcom_helper_datamanager2_controller::create('simple'); |
54 | - $this->_controller->schemadb =& $this->_schemadb; |
|
54 | + $this->_controller->schemadb = & $this->_schemadb; |
|
55 | 55 | $this->_controller->set_storage($this->_message); |
56 | - if (! $this->_controller->initialize()) |
|
56 | + if (!$this->_controller->initialize()) |
|
57 | 57 | { |
58 | 58 | throw new midcom_error("Failed to initialize a DM2 controller instance for message {$this->_message->id}."); |
59 | 59 | } |
@@ -90,8 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $message = new org_openpsa_directmarketing_campaign_message_dba($args[0]); |
92 | 92 | $campaign = new org_openpsa_directmarketing_campaign_dba($message->campaign); |
93 | - $workflow = $this->get_workflow('delete', array |
|
94 | - ( |
|
93 | + $workflow = $this->get_workflow('delete', array( |
|
95 | 94 | 'object' => $message, |
96 | 95 | 'success_url' => "campaign/{$campaign->guid}/" |
97 | 96 | )); |
@@ -114,13 +113,12 @@ discard block |
||
114 | 113 | |
115 | 114 | $this->_schemadb = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_message_copy')); |
116 | 115 | $this->_controller = midcom_helper_datamanager2_controller::create('nullstorage'); |
117 | - $this->_controller->schemadb =& $this->_schemadb; |
|
116 | + $this->_controller->schemadb = & $this->_schemadb; |
|
118 | 117 | $this->_controller->initialize(); |
119 | 118 | |
120 | 119 | midcom::get()->head->set_pagetitle($this->_l10n->get('copy message')); |
121 | 120 | |
122 | - $workflow = $this->get_workflow('datamanager2', array |
|
123 | - ( |
|
121 | + $workflow = $this->get_workflow('datamanager2', array( |
|
124 | 122 | 'controller' => $this->_controller, |
125 | 123 | 'save_callback' => array($this, 'copy_callback') |
126 | 124 | )); |
@@ -142,8 +140,7 @@ discard block |
||
142 | 140 | $new_object = $copy->copy_object($original, $campaign, array('sendStarted' => 0, 'sendCompleted' => 0)); |
143 | 141 | |
144 | 142 | // Store for later use |
145 | - $copy_data[] = array |
|
146 | - ( |
|
143 | + $copy_data[] = array( |
|
147 | 144 | 'message' => $new_object, |
148 | 145 | 'campaign' => $campaign |
149 | 146 | ); |
@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | $siteconfig = org_openpsa_core_siteconfig::get_instance(); |
61 | 61 | $url = $siteconfig->get_node_full_url('org.openpsa.contacts') . 'person/'; |
62 | 62 | |
63 | - $row = array |
|
64 | - ( |
|
63 | + $row = array( |
|
65 | 64 | 'id' => $person->id, |
66 | 65 | 'index_firstname' => $person->firstname, |
67 | 66 | 'firstname' => '<a target="_blank" href="' . $url . $person->guid . '/">' . $person->firstname . '</a>', |
@@ -95,7 +94,7 @@ discard block |
||
95 | 94 | /** |
96 | 95 | * Looks up an campaign to display. |
97 | 96 | */ |
98 | - public function _handler_view ($handler_id, array $args, array &$data) |
|
97 | + public function _handler_view($handler_id, array $args, array &$data) |
|
99 | 98 | { |
100 | 99 | $this->_campaign = $this->_master->load_campaign($args[0]); |
101 | 100 | |
@@ -123,8 +122,7 @@ discard block |
||
123 | 122 | $buttons = array(); |
124 | 123 | if ($this->_campaign->can_do('midgard:update')) |
125 | 124 | { |
126 | - $buttons[] = $workflow->get_button("campaign/edit/{$this->_campaign->guid}/", array |
|
127 | - ( |
|
125 | + $buttons[] = $workflow->get_button("campaign/edit/{$this->_campaign->guid}/", array( |
|
128 | 126 | MIDCOM_TOOLBAR_ACCESSKEY => 'e', |
129 | 127 | )); |
130 | 128 | } |
@@ -138,8 +136,7 @@ discard block |
||
138 | 136 | if ($this->_campaign->orgOpenpsaObtype == org_openpsa_directmarketing_campaign_dba::TYPE_SMART) |
139 | 137 | { |
140 | 138 | //Edit query parameters button in case 1) not in edit mode 2) is smart campaign 3) can edit |
141 | - $buttons[] = array |
|
142 | - ( |
|
139 | + $buttons[] = array( |
|
143 | 140 | MIDCOM_TOOLBAR_URL => "campaign/edit_query/{$this->_campaign->guid}/", |
144 | 141 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('edit rules'), |
145 | 142 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/repair.png', |
@@ -149,16 +146,14 @@ discard block |
||
149 | 146 | else |
150 | 147 | { |
151 | 148 | // Import button if we have permissions to create users |
152 | - $buttons[] = array |
|
153 | - ( |
|
149 | + $buttons[] = array( |
|
154 | 150 | MIDCOM_TOOLBAR_URL => "campaign/import/{$this->_campaign->guid}/", |
155 | 151 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('import subscribers'), |
156 | 152 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people.png', |
157 | 153 | MIDCOM_TOOLBAR_ENABLED => midcom::get()->auth->can_user_do('midgard:create', null, 'org_openpsa_contacts_person_dba'), |
158 | 154 | ); |
159 | 155 | } |
160 | - $buttons[] = array |
|
161 | - ( |
|
156 | + $buttons[] = array( |
|
162 | 157 | MIDCOM_TOOLBAR_URL => "campaign/export/csv/{$this->_campaign->guid}/", |
163 | 158 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('export as csv'), |
164 | 159 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_data-edit-table.png', |
@@ -169,8 +164,7 @@ discard block |
||
169 | 164 | $schemadb_message = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_message')); |
170 | 165 | foreach ($schemadb_message as $name => $schema) |
171 | 166 | { |
172 | - $buttons[] = $workflow->get_button("message/create/{$this->_campaign->guid}/{$name}/", array |
|
173 | - ( |
|
167 | + $buttons[] = $workflow->get_button("message/create/{$this->_campaign->guid}/{$name}/", array( |
|
174 | 168 | MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('new %s'), $this->_l10n->get($schema->description)), |
175 | 169 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/' . org_openpsa_directmarketing_viewer::get_messagetype_icon($schema->customdata['org_openpsa_directmarketing_messagetype']), |
176 | 170 | )); |
@@ -182,7 +176,7 @@ discard block |
||
182 | 176 | /** |
183 | 177 | * Shows the loaded campaign. |
184 | 178 | */ |
185 | - public function _show_view ($handler_id, array &$data) |
|
179 | + public function _show_view($handler_id, array &$data) |
|
186 | 180 | { |
187 | 181 | $data['view_campaign'] = $this->_datamanager->get_content_html(); |
188 | 182 | midcom_show_style('show-campaign'); |
@@ -81,8 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | throw new midcom_error(midcom_connection::get_error_string()); |
83 | 83 | } |
84 | - } |
|
85 | - else |
|
84 | + } else |
|
86 | 85 | { |
87 | 86 | $nodes = $object_qb->execute(); |
88 | 87 | $node = $nodes[0]; |