@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | require_once($beanFiles[$beanList[$key]]); |
47 | 47 | $focus = new $beanList[$key]; |
48 | 48 | $loopControl[$key][$key] = $focus; |
49 | - $prefixes[$key] = strtolower($focus->object_name) . '_'; |
|
50 | - if ($focus->object_name == 'Case') $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_'; |
|
49 | + $prefixes[$key] = strtolower($focus->object_name).'_'; |
|
50 | + if ($focus->object_name == 'Case') $prefixes[$key] = 'a'.strtolower($focus->object_name).'_'; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -125,16 +125,16 @@ discard block |
||
125 | 125 | if (isset($beanList[$key]) && isset($beanFiles[$beanList[$key]]) && !str_begin($key, 'AOW_') && !str_begin($key, 'zr2_')) { |
126 | 126 | |
127 | 127 | if ($key == 'Contacts') { |
128 | - $dropdown .= "<option value='" . $key . "'> |
|
129 | - " . $lblContactAndOthers . " |
|
128 | + $dropdown .= "<option value='".$key."'> |
|
129 | + " . $lblContactAndOthers." |
|
130 | 130 | </option>"; |
131 | 131 | } else if (isset($app_list_strings['moduleListSingular'][$key])) { |
132 | - $dropdown .= "<option value='" . $key . "'> |
|
133 | - " . $app_list_strings['moduleListSingular'][$key] . " |
|
132 | + $dropdown .= "<option value='".$key."'> |
|
133 | + " . $app_list_strings['moduleListSingular'][$key]." |
|
134 | 134 | </option>"; |
135 | 135 | } else { |
136 | - $dropdown .= "<option value='" . $key . "'> |
|
137 | - " . $app_list_strings['moduleList'][$key] . " |
|
136 | + $dropdown .= "<option value='".$key."'> |
|
137 | + " . $app_list_strings['moduleList'][$key]." |
|
138 | 138 | </option>"; |
139 | 139 | } |
140 | 140 | } |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | } |
353 | 353 | if (!empty($tracker_url) && !empty($template_text) && !empty($matches[0][$i][0]) && !empty($tracked_urls[$matches[0][$i][0]])) { |
354 | 354 | $template_text = substr_replace($template_text, $tracker_url, $matches[0][$i][1], strlen($matches[0][$i][0])); |
355 | - $template_text = str_replace($sugar_config['site_url'] . '/' . $sugar_config['site_url'], $sugar_config['site_url'], $template_text); |
|
355 | + $template_text = str_replace($sugar_config['site_url'].'/'.$sugar_config['site_url'], $sugar_config['site_url'], $template_text); |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
@@ -406,10 +406,10 @@ discard block |
||
406 | 406 | if ($beanList[$focus_name] == 'User') { |
407 | 407 | $pattern_prefix = '$contact_user_'; |
408 | 408 | } else { |
409 | - $pattern_prefix = '$' . strtolower($beanList[$focus_name]) . '_'; |
|
409 | + $pattern_prefix = '$'.strtolower($beanList[$focus_name]).'_'; |
|
410 | 410 | } |
411 | 411 | $pattern_prefix_length = strlen($pattern_prefix); |
412 | - $pattern = '/\\' . $pattern_prefix . '[A-Za-z_0-9]*/'; |
|
412 | + $pattern = '/\\'.$pattern_prefix.'[A-Za-z_0-9]*/'; |
|
413 | 413 | |
414 | 414 | foreach ($template_text_array as $key => $template_text) { |
415 | 415 | if (!isset($this->parsed_entities[$key])) { |
@@ -505,16 +505,16 @@ discard block |
||
505 | 505 | $translated = translate($field_def['options'], 'Users', $user->$field_def['name']); |
506 | 506 | |
507 | 507 | if (isset($translated) && !is_array($translated)) { |
508 | - $repl_arr["contact_user_" . $field_def['name']] = $translated; |
|
508 | + $repl_arr["contact_user_".$field_def['name']] = $translated; |
|
509 | 509 | } else { // unset enum field, make sure we have a match string to replace with "" |
510 | - $repl_arr["contact_user_" . $field_def['name']] = ''; |
|
510 | + $repl_arr["contact_user_".$field_def['name']] = ''; |
|
511 | 511 | } |
512 | 512 | } else { |
513 | 513 | if (isset($user->$field_def['name'])) { |
514 | 514 | // bug 47647 - allow for fields to translate before adding to template |
515 | - $repl_arr["contact_user_" . $field_def['name']] = self::_convertToType($field_def['type'], $user->$field_def['name']); |
|
515 | + $repl_arr["contact_user_".$field_def['name']] = self::_convertToType($field_def['type'], $user->$field_def['name']); |
|
516 | 516 | } else { |
517 | - $repl_arr["contact_user_" . $field_def['name']] = ""; |
|
517 | + $repl_arr["contact_user_".$field_def['name']] = ""; |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | } |
@@ -540,8 +540,8 @@ discard block |
||
540 | 540 | continue; |
541 | 541 | } |
542 | 542 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
543 | - 'contact_' . $field_def['name'] => '', |
|
544 | - 'contact_account_' . $field_def['name'] => '', |
|
543 | + 'contact_'.$field_def['name'] => '', |
|
544 | + 'contact_account_'.$field_def['name'] => '', |
|
545 | 545 | )); |
546 | 546 | } |
547 | 547 | foreach ($prospect->field_defs as $field_def) { |
@@ -549,8 +549,8 @@ discard block |
||
549 | 549 | continue; |
550 | 550 | } |
551 | 551 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
552 | - 'contact_' . $field_def['name'] => '', |
|
553 | - 'contact_account_' . $field_def['name'] => '', |
|
552 | + 'contact_'.$field_def['name'] => '', |
|
553 | + 'contact_account_'.$field_def['name'] => '', |
|
554 | 554 | )); |
555 | 555 | } |
556 | 556 | foreach ($contact->field_defs as $field_def) { |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | continue; |
559 | 559 | } |
560 | 560 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
561 | - 'contact_' . $field_def['name'] => '', |
|
562 | - 'contact_account_' . $field_def['name'] => '', |
|
561 | + 'contact_'.$field_def['name'] => '', |
|
562 | + 'contact_account_'.$field_def['name'] => '', |
|
563 | 563 | )); |
564 | 564 | } |
565 | 565 | foreach ($acct->field_defs as $field_def) { |
@@ -567,8 +567,8 @@ discard block |
||
567 | 567 | continue; |
568 | 568 | } |
569 | 569 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
570 | - 'account_' . $field_def['name'] => '', |
|
571 | - 'account_contact_' . $field_def['name'] => '', |
|
570 | + 'account_'.$field_def['name'] => '', |
|
571 | + 'account_contact_'.$field_def['name'] => '', |
|
572 | 572 | )); |
573 | 573 | } |
574 | 574 | // cn: end bug 9277 fix |
@@ -592,21 +592,21 @@ discard block |
||
592 | 592 | |
593 | 593 | if (isset($translated) && !is_array($translated)) { |
594 | 594 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
595 | - 'account_' . $field_def['name'] => $translated, |
|
596 | - 'contact_account_' . $field_def['name'] => $translated, |
|
595 | + 'account_'.$field_def['name'] => $translated, |
|
596 | + 'contact_account_'.$field_def['name'] => $translated, |
|
597 | 597 | )); |
598 | 598 | } else { // unset enum field, make sure we have a match string to replace with "" |
599 | 599 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
600 | - 'account_' . $field_def['name'] => '', |
|
601 | - 'contact_account_' . $field_def['name'] => '', |
|
600 | + 'account_'.$field_def['name'] => '', |
|
601 | + 'contact_account_'.$field_def['name'] => '', |
|
602 | 602 | )); |
603 | 603 | } |
604 | 604 | } else { |
605 | 605 | // bug 47647 - allow for fields to translate before adding to template |
606 | 606 | $translated = self::_convertToType($field_def['type'], $acct->$field_def['name']); |
607 | 607 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
608 | - 'account_' . $field_def['name'] => $translated, |
|
609 | - 'contact_account_' . $field_def['name'] => $translated, |
|
608 | + 'account_'.$field_def['name'] => $translated, |
|
609 | + 'contact_account_'.$field_def['name'] => $translated, |
|
610 | 610 | )); |
611 | 611 | } |
612 | 612 | } |
@@ -636,13 +636,13 @@ discard block |
||
636 | 636 | |
637 | 637 | if (isset($translated) && !is_array($translated)) { |
638 | 638 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
639 | - 'contact_' . $field_def['name'] => $translated, |
|
640 | - 'contact_account_' . $field_def['name'] => $translated, |
|
639 | + 'contact_'.$field_def['name'] => $translated, |
|
640 | + 'contact_account_'.$field_def['name'] => $translated, |
|
641 | 641 | )); |
642 | 642 | } else { // unset enum field, make sure we have a match string to replace with "" |
643 | 643 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
644 | - 'contact_' . $field_def['name'] => '', |
|
645 | - 'contact_account_' . $field_def['name'] => '', |
|
644 | + 'contact_'.$field_def['name'] => '', |
|
645 | + 'contact_account_'.$field_def['name'] => '', |
|
646 | 646 | )); |
647 | 647 | } |
648 | 648 | } else { |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | // bug 47647 - allow for fields to translate before adding to template |
651 | 651 | $translated = self::_convertToType($field_def['type'], $contact->$field_def['name']); |
652 | 652 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
653 | - 'contact_' . $field_def['name'] => $translated, |
|
654 | - 'contact_account_' . $field_def['name'] => $translated, |
|
653 | + 'contact_'.$field_def['name'] => $translated, |
|
654 | + 'contact_account_'.$field_def['name'] => $translated, |
|
655 | 655 | )); |
656 | 656 | } // if |
657 | 657 | } |
@@ -671,27 +671,27 @@ discard block |
||
671 | 671 | |
672 | 672 | if (isset($translated) && !is_array($translated)) { |
673 | 673 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
674 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => $translated, |
|
674 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => $translated, |
|
675 | 675 | )); |
676 | 676 | } else { // unset enum field, make sure we have a match string to replace with "" |
677 | 677 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
678 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => '', |
|
678 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => '', |
|
679 | 679 | )); |
680 | 680 | } |
681 | 681 | } else { |
682 | 682 | // bug 47647 - translate currencies to appropriate values |
683 | 683 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
684 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => self::_convertToType($field_def['type'], $focus->$field_def['name']), |
|
684 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => self::_convertToType($field_def['type'], $focus->$field_def['name']), |
|
685 | 685 | )); |
686 | 686 | } |
687 | 687 | } else { |
688 | 688 | if ($field_def['name'] == 'full_name') { |
689 | 689 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
690 | - strtolower($beanList[$bean_name]) . '_full_name' => $focus->get_summary_text(), |
|
690 | + strtolower($beanList[$bean_name]).'_full_name' => $focus->get_summary_text(), |
|
691 | 691 | )); |
692 | 692 | } else { |
693 | 693 | $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array( |
694 | - strtolower($beanList[$bean_name]) . "_" . $field_def['name'] => '', |
|
694 | + strtolower($beanList[$bean_name])."_".$field_def['name'] => '', |
|
695 | 695 | )); |
696 | 696 | } |
697 | 697 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | |
10 | -if( |
|
10 | +if ( |
|
11 | 11 | (isset($_SESSION['screen_height']) ? $_SESSION['screen_height'] : null) != (isset($_POST['height']) ? $_POST['height'] : null) || |
12 | 12 | (isset($_SESSION['screen_width']) ? $_SESSION['screen_width'] : null) != (isset($_POST['width']) ? $_POST['width'] : null)) { |
13 | 13 | $_SESSION['screen_height'] = $_POST['height']; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | |
4 | 4 | global $db; |
5 | 5 | |
@@ -12,25 +12,25 @@ discard block |
||
12 | 12 | $event = new FP_events(); |
13 | 13 | $event->retrieve($even_id); |
14 | 14 | |
15 | - if($type == 'c'){ |
|
15 | + if ($type == 'c') { |
|
16 | 16 | |
17 | 17 | $event->load_relationship('fp_events_contacts'); // get related contacts |
18 | 18 | |
19 | - if($response == 'accept'){ |
|
19 | + if ($response == 'accept') { |
|
20 | 20 | |
21 | 21 | //check to see if they have already responded to the email |
22 | 22 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
23 | 23 | $check = $db->getOne($check_q); |
24 | 24 | //update contact to accepted |
25 | 25 | $query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
26 | - if($db->query($query) && $check != '1'){ |
|
26 | + if ($db->query($query) && $check != '1') { |
|
27 | 27 | |
28 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
28 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
29 | 29 | |
30 | 30 | $url = $event->accept_redirect; |
31 | - header('Location: ' . $url); |
|
31 | + header('Location: '.$url); |
|
32 | 32 | } |
33 | - else{ |
|
33 | + else { |
|
34 | 34 | echo 'Thank you for accepting'; |
35 | 35 | } |
36 | 36 | } |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
39 | 39 | } |
40 | 40 | } |
41 | - else if($response == 'decline'){ |
|
41 | + else if ($response == 'decline') { |
|
42 | 42 | //check to see if they have already responded to the email |
43 | 43 | $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"'; |
44 | 44 | $check = $db->getOne($check_q); |
45 | 45 | //update contact to accepted |
46 | 46 | $query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"'; |
47 | 47 | |
48 | - if($db->query($query) && $check != '1'){ |
|
48 | + if ($db->query($query) && $check != '1') { |
|
49 | 49 | |
50 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
50 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
51 | 51 | |
52 | 52 | $url = $event->decline_redirect; |
53 | - header('Location: ' . $url); |
|
53 | + header('Location: '.$url); |
|
54 | 54 | |
55 | 55 | } |
56 | - else{ |
|
56 | + else { |
|
57 | 57 | echo 'Thank you for declining'; |
58 | 58 | } |
59 | 59 | } |
@@ -62,25 +62,25 @@ discard block |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
65 | - if($type == 't'){ |
|
65 | + if ($type == 't') { |
|
66 | 66 | |
67 | 67 | $event->load_relationship('fp_events_prospects_1'); //get related targets |
68 | 68 | |
69 | - if($response == 'accept'){ |
|
69 | + if ($response == 'accept') { |
|
70 | 70 | //check to see if they have already responded to the email |
71 | 71 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
72 | 72 | $check = $db->getOne($check_q); |
73 | 73 | |
74 | 74 | //update contact to accepted |
75 | 75 | $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
76 | - if($db->query($query) && $check != '1'){ |
|
76 | + if ($db->query($query) && $check != '1') { |
|
77 | 77 | |
78 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
78 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
79 | 79 | |
80 | 80 | $url = $event->accept_redirect; |
81 | - header('Location: ' . $url); |
|
81 | + header('Location: '.$url); |
|
82 | 82 | } |
83 | - else{ |
|
83 | + else { |
|
84 | 84 | echo 'Thank you for accepting'; |
85 | 85 | } |
86 | 86 | } |
@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.'; |
89 | 89 | } |
90 | 90 | } |
91 | - else if($response == 'decline'){ |
|
91 | + else if ($response == 'decline') { |
|
92 | 92 | //check to see if they have already responded to the email |
93 | 93 | $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"'; |
94 | 94 | $check = $db->getOne($check_q); |
95 | 95 | //update contact to accepted |
96 | 96 | $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"'; |
97 | - if($db->query($query) && $check != '1'){ |
|
97 | + if ($db->query($query) && $check != '1') { |
|
98 | 98 | |
99 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
99 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
100 | 100 | |
101 | 101 | $url = $event->decline_redirect; |
102 | - header('Location: ' . $url); |
|
102 | + header('Location: '.$url); |
|
103 | 103 | |
104 | 104 | } |
105 | - else{ |
|
105 | + else { |
|
106 | 106 | echo 'Thank you for declining'; |
107 | 107 | } |
108 | 108 | } |
@@ -111,24 +111,24 @@ discard block |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
114 | - if($type == 'l'){ |
|
114 | + if ($type == 'l') { |
|
115 | 115 | |
116 | 116 | $event->load_relationship('fp_events_leads_1'); //get related leads |
117 | 117 | |
118 | - if($response == 'accept'){ |
|
118 | + if ($response == 'accept') { |
|
119 | 119 | //check to see if they have already responded to the email |
120 | 120 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE ffp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
121 | 121 | $check = $db->getOne($check_q); |
122 | 122 | //update contact to accepted |
123 | 123 | $query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
124 | - if($db->query($query) && $check != '1'){ |
|
124 | + if ($db->query($query) && $check != '1') { |
|
125 | 125 | |
126 | - if(!IsNullOrEmptyString($event->accept_redirect)){ |
|
126 | + if (!IsNullOrEmptyString($event->accept_redirect)) { |
|
127 | 127 | |
128 | 128 | $url = $event->accept_redirect; |
129 | - header('Location: ' . $url); |
|
129 | + header('Location: '.$url); |
|
130 | 130 | } |
131 | - else{ |
|
131 | + else { |
|
132 | 132 | echo 'Thank you for accepting'; |
133 | 133 | } |
134 | 134 | } |
@@ -136,22 +136,22 @@ discard block |
||
136 | 136 | echo 'There was a problem with the link please contact the sender of the invite'; |
137 | 137 | } |
138 | 138 | } |
139 | - else if($response == 'decline'){ |
|
139 | + else if ($response == 'decline') { |
|
140 | 140 | //check to see if they have already responded to the email |
141 | 141 | $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"'; |
142 | 142 | $check = $db->getOne($check_q); |
143 | 143 | //update contact to accepted |
144 | 144 | $query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"'; |
145 | 145 | |
146 | - if($db->query($query) && $check != '1'){ |
|
146 | + if ($db->query($query) && $check != '1') { |
|
147 | 147 | |
148 | - if(!IsNullOrEmptyString($event->decline_redirect)){ |
|
148 | + if (!IsNullOrEmptyString($event->decline_redirect)) { |
|
149 | 149 | |
150 | 150 | $url = $event->decline_redirect; |
151 | - header('Location: ' . $url); |
|
151 | + header('Location: '.$url); |
|
152 | 152 | |
153 | 153 | } |
154 | - else{ |
|
154 | + else { |
|
155 | 155 | echo 'Thank you for declining'; |
156 | 156 | } |
157 | 157 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | // Function for basic field validation (present and neither empty nor only white space nor just 'http://') |
164 | - function IsNullOrEmptyString($question){ |
|
165 | - return (!isset($question) || trim($question)==='' || $question =='http://'); |
|
164 | + function IsNullOrEmptyString($question) { |
|
165 | + return (!isset($question) || trim($question) === '' || $question == 'http://'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -47,40 +47,40 @@ discard block |
||
47 | 47 | |
48 | 48 | global $db, $current_user, $mod_strings, $app_strings, $app_list_strings; |
49 | 49 | |
50 | -$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0",true); |
|
50 | +$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0", true); |
|
51 | 51 | $row = $db->fetchByAssoc($ret); |
52 | 52 | |
53 | 53 | $meetingBean = loadBean('Meetings'); |
54 | 54 | $meetingBean->retrieve($_REQUEST['meeting_id']); |
55 | 55 | |
56 | -if ( $_REQUEST['host_meeting'] == '1' ) { |
|
57 | - if($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
|
56 | +if ($_REQUEST['host_meeting'] == '1') { |
|
57 | + if ($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) { |
|
58 | 58 | SugarApplication::redirect($meetingBean->host_url); |
59 | - }else{ |
|
59 | + } else { |
|
60 | 60 | //since they are now the owner of the meeting nor an Admin they cannot start the meeting. |
61 | 61 | $tplFile = 'modules/Meetings/tpls/extMeetingNoStart.tpl'; |
62 | - if ( file_exists('custom/'.$tplFile) ) { |
|
62 | + if (file_exists('custom/'.$tplFile)) { |
|
63 | 63 | $tplFile = 'custom/'.$tplFile; |
64 | 64 | } |
65 | 65 | |
66 | 66 | $ss = new Sugar_Smarty(); |
67 | - $ss->assign('current_user',$current_user); |
|
68 | - $ss->assign('bean',$meetingBean->toArray()); |
|
67 | + $ss->assign('current_user', $current_user); |
|
68 | + $ss->assign('bean', $meetingBean->toArray()); |
|
69 | 69 | $ss->display($tplFile); |
70 | 70 | } |
71 | -}else{ |
|
72 | - if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){ |
|
71 | +} else { |
|
72 | + if (isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) { |
|
73 | 73 | SugarApplication::redirect($meetingBean->join_url); |
74 | - }else{ |
|
74 | + } else { |
|
75 | 75 | //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting. |
76 | 76 | $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl'; |
77 | - if ( file_exists('custom/'.$tplFile) ) { |
|
77 | + if (file_exists('custom/'.$tplFile)) { |
|
78 | 78 | $tplFile = 'custom/'.$tplFile; |
79 | 79 | } |
80 | 80 | |
81 | 81 | $ss = new Sugar_Smarty(); |
82 | - $ss->assign('current_user',$current_user); |
|
83 | - $ss->assign('bean',$meetingBean->toArray()); |
|
82 | + $ss->assign('current_user', $current_user); |
|
83 | + $ss->assign('bean', $meetingBean->toArray()); |
|
84 | 84 | $ss->display($tplFile); |
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['meeting_status_dom'], $app_list_strings['meeting_status_default'])); |
57 | 57 | $this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format()); |
58 | - $this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')'); |
|
59 | - $this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')'); |
|
58 | + $this->ss->assign("TIME_FORMAT", '('.$timedate->get_user_time_format().')'); |
|
59 | + $this->ss->assign("USER_DATEFORMAT", '('.$timedate->get_user_date_format().')'); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | - if($this->viaAJAX) { // override for ajax call |
|
64 | + if ($this->viaAJAX) { // override for ajax call |
|
65 | 65 | $this->ss->assign('saveOnclick', "onclick='if(check_form(\"meetingsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"activities\"); else return false;'"); |
66 | 66 | $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_activities\")';"); |
67 | 67 | } |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | $focus->duration_hours = "1"; |
84 | 84 | |
85 | 85 | |
86 | - $date_start_array=explode(" ",trim($focus->date_start)); |
|
87 | - if (count($date_start_array)==2) { |
|
86 | + $date_start_array = explode(" ", trim($focus->date_start)); |
|
87 | + if (count($date_start_array) == 2) { |
|
88 | 88 | $focus->time_start = $timedate->to_db_time($date_start_array[1], false); |
89 | 89 | //$focus->date_start = $date_start_array[0]; |
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->ss->assign("DATE_START", $focus->date_start); |
93 | - $this->ss->assign("TIME_START", substr($focus->time_start,0,5)); |
|
93 | + $this->ss->assign("TIME_START", substr($focus->time_start, 0, 5)); |
|
94 | 94 | $time_start_hour = intval(substr($focus->time_start, 0, 2)); |
95 | 95 | $time_start_minutes = substr($focus->time_start, 3, 5); |
96 | 96 | |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | |
111 | 111 | |
112 | 112 | // We default the to assume that the time preference is set to 11:00 (i.e. without meridiem) |
113 | - $hours_arr = array (); |
|
113 | + $hours_arr = array(); |
|
114 | 114 | $num_of_hours = 24; |
115 | 115 | $start_at = 0; |
116 | 116 | |
117 | 117 | $time_pref = $timedate->get_time_format(); |
118 | - if(strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
118 | + if (strpos($time_pref, 'a') || strpos($time_pref, 'A')) { |
|
119 | 119 | $num_of_hours = 13; |
120 | 120 | $start_at = 1; |
121 | 121 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | */ |
130 | 130 | |
131 | - for ($i = $start_at; $i < $num_of_hours; $i ++) { |
|
131 | + for ($i = $start_at; $i < $num_of_hours; $i++) { |
|
132 | 132 | $i = $i.""; |
133 | 133 | if (strlen($i) == 1) { |
134 | 134 | $i = "0".$i; |
@@ -141,18 +141,18 @@ discard block |
||
141 | 141 | $this->ss->assign("DURATION_HOURS", $focus->duration_hours); |
142 | 142 | $this->ss->assign("DURATION_MINUTES_OPTIONS", get_select_options_with_id($focus->minutes_values, $focus->duration_minutes)); |
143 | 143 | // Test to see if time format is 11:00am; otherwise it's 11:00AM |
144 | - if($num_of_hours == 13) { |
|
144 | + if ($num_of_hours == 13) { |
|
145 | 145 | |
146 | 146 | if (strpos($time_pref, 'a')) { |
147 | 147 | |
148 | - if(!isset($focus->meridiem_am_values)) { |
|
148 | + if (!isset($focus->meridiem_am_values)) { |
|
149 | 149 | $focus->meridiem_am_values = array('am'=>'am', 'pm'=>'pm'); |
150 | 150 | } |
151 | 151 | |
152 | 152 | $this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_am_values, $time_start_hour < 12 ? 'am' : 'pm')); |
153 | 153 | |
154 | 154 | } else { |
155 | - if(!isset($focus->meridiem_AM_values)) { |
|
155 | + if (!isset($focus->meridiem_AM_values)) { |
|
156 | 156 | $focus->meridiem_AM_values = array('AM'=>'AM', 'PM'=>'PM'); |
157 | 157 | } |
158 | 158 |
@@ -16,14 +16,14 @@ |
||
16 | 16 | |
17 | 17 | global $app_strings; |
18 | 18 | |
19 | - $script = "<a href='javascript:void(0)' id='export_listview_top' " . |
|
20 | - "onclick=\"return sListView.send_form(true, '{$_REQUEST['module']}', " . |
|
21 | - "'index.php?entryPoint=export', " . |
|
22 | - "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_EXPORT']}</a>" . |
|
23 | - "</li><li>" . // List item hack |
|
24 | - "<a href='javascript:void(0)' id='map_listview_top' " . |
|
25 | - " onclick=\"return sListView.send_form(true, 'jjwg_Maps', " . |
|
26 | - "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', " . |
|
19 | + $script = "<a href='javascript:void(0)' id='export_listview_top' ". |
|
20 | + "onclick=\"return sListView.send_form(true, '{$_REQUEST['module']}', ". |
|
21 | + "'index.php?entryPoint=export', ". |
|
22 | + "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_EXPORT']}</a>". |
|
23 | + "</li><li>".// List item hack |
|
24 | + "<a href='javascript:void(0)' id='map_listview_top' ". |
|
25 | + " onclick=\"return sListView.send_form(true, 'jjwg_Maps', ". |
|
26 | + "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', ". |
|
27 | 27 | "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_MAP']}</a>"; |
28 | 28 | |
29 | 29 | return $script; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | |
80 | 80 | // Stick the form header out there. |
81 | 81 | echo get_form_header($mod_strings['LBL_INVITEE'], $button, false); |
82 | -$xtpl=new XTemplate ('modules/Meetings/SubPanelViewInvitees.html'); |
|
82 | +$xtpl = new XTemplate('modules/Meetings/SubPanelViewInvitees.html'); |
|
83 | 83 | $xtpl->assign("MOD", $mod_strings); |
84 | 84 | $xtpl->assign("APP", $app_strings); |
85 | 85 | $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id"); |
86 | 86 | $xtpl->assign("MEETING_ID", $focus->id); |
87 | 87 | |
88 | 88 | $oddRow = true; |
89 | -foreach($focus_users_list as $user) |
|
89 | +foreach ($focus_users_list as $user) |
|
90 | 90 | { |
91 | 91 | $user_fields = array( |
92 | 92 | 'USER_NAME' => $user->user_name, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $xtpl->assign("USER", $user_fields); |
100 | 100 | |
101 | - if($oddRow) |
|
101 | + if ($oddRow) |
|
102 | 102 | { |
103 | 103 | //todo move to themes |
104 | 104 | $xtpl->assign("ROW_COLOR", 'oddListRow'); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $xtpl->out("users"); |
119 | 119 | |
120 | 120 | $oddRow = true; |
121 | -foreach($focus_contacts_list as $contact) |
|
121 | +foreach ($focus_contacts_list as $contact) |
|
122 | 122 | { |
123 | 123 | $contact_fields = array( |
124 | 124 | 'FIRST_NAME' => $contact->first_name, |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $xtpl->assign("CONTACT", $contact_fields); |
133 | 133 | |
134 | - if($oddRow) |
|
134 | + if ($oddRow) |
|
135 | 135 | { |
136 | 136 | //todo move to themes |
137 | 137 | $xtpl->assign("ROW_COLOR", 'oddListRow'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | var $meetings_arr; |
94 | 94 | // when assoc w/ a user/contact: |
95 | 95 | var $minutes_value_default = 15; |
96 | - var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45'); |
|
96 | + var $minutes_values = array('0'=>'00', '15'=>'15', '30'=>'30', '45'=>'45'); |
|
97 | 97 | var $table_name = "meetings"; |
98 | 98 | var $rel_users_table = "meetings_users"; |
99 | 99 | var $rel_contacts_table = "meetings_contacts"; |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | var $importable = true; |
105 | 105 | // This is used to retrieve related fields from form posts. |
106 | 106 | var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status'); |
107 | - var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case', |
|
108 | - 'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings'); |
|
107 | + var $relationship_fields = array('account_id'=>'accounts', 'opportunity_id'=>'opportunity', 'case_id'=>'case', |
|
108 | + 'assigned_user_id'=>'users', 'contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings'); |
|
109 | 109 | // so you can run get_users() twice and run query only once |
110 | 110 | var $cached_get_users = null; |
111 | 111 | var $new_schema = true; |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | function Meeting() { |
118 | 118 | parent::SugarBean(); |
119 | 119 | $this->setupCustomFields('Meetings'); |
120 | - foreach($this->field_defs as $field) { |
|
120 | + foreach ($this->field_defs as $field) { |
|
121 | 121 | $this->field_name_map[$field['name']] = $field; |
122 | 122 | } |
123 | 123 | // $this->fill_in_additional_detail_fields(); |
124 | - if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) { |
|
124 | + if (!empty($GLOBALS['app_list_strings']['duration_intervals'])) { |
|
125 | 125 | $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals']; |
126 | 126 | } |
127 | 127 | } |
@@ -131,21 +131,21 @@ discard block |
||
131 | 131 | * @param $view string |
132 | 132 | * @param $is_owner bool |
133 | 133 | */ |
134 | - function ACLAccess($view,$is_owner='not_set',$in_group='not_set'){ |
|
134 | + function ACLAccess($view, $is_owner = 'not_set', $in_group = 'not_set') { |
|
135 | 135 | // don't check if meeting is being synced from Outlook |
136 | - if($this->syncing == false){ |
|
136 | + if ($this->syncing == false) { |
|
137 | 137 | $view = strtolower($view); |
138 | - switch($view){ |
|
138 | + switch ($view) { |
|
139 | 139 | case 'edit': |
140 | 140 | case 'save': |
141 | 141 | case 'editview': |
142 | 142 | case 'delete': |
143 | - if(!empty($this->recurring_source) && $this->recurring_source != "Sugar"){ |
|
143 | + if (!empty($this->recurring_source) && $this->recurring_source != "Sugar") { |
|
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
148 | - return parent::ACLAccess($view,$is_owner,$in_group); |
|
148 | + return parent::ACLAccess($view, $is_owner, $in_group); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | |
165 | 165 | global $disable_date_format; |
166 | 166 | |
167 | - if(isset($this->date_start)) |
|
167 | + if (isset($this->date_start)) |
|
168 | 168 | { |
169 | 169 | $td = $timedate->fromDb($this->date_start); |
170 | - if(!$td){ |
|
170 | + if (!$td) { |
|
171 | 171 | $this->date_start = $timedate->to_db($this->date_start); |
172 | 172 | $td = $timedate->fromDb($this->date_start); |
173 | 173 | } |
174 | - if($td) |
|
174 | + if ($td) |
|
175 | 175 | { |
176 | 176 | if (isset($this->duration_hours) && $this->duration_hours != '') |
177 | 177 | { |
@@ -185,17 +185,17 @@ discard block |
||
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - $check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false; |
|
189 | - if(empty($_REQUEST['send_invites'])) { |
|
190 | - if(!empty($this->id)) { |
|
188 | + $check_notify = (!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false; |
|
189 | + if (empty($_REQUEST['send_invites'])) { |
|
190 | + if (!empty($this->id)) { |
|
191 | 191 | $old_record = new Meeting(); |
192 | 192 | $old_record->retrieve($this->id); |
193 | 193 | $old_assigned_user_id = $old_record->assigned_user_id; |
194 | 194 | } |
195 | - if((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) ){ |
|
195 | + if ((empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id']) || (isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id'])) { |
|
196 | 196 | $this->special_notification = true; |
197 | 197 | $check_notify = true; |
198 | - if(isset($_REQUEST['assigned_user_name'])) { |
|
198 | + if (isset($_REQUEST['assigned_user_name'])) { |
|
199 | 199 | $this->new_assigned_user_name = $_REQUEST['assigned_user_name']; |
200 | 200 | } |
201 | 201 | } |
@@ -207,23 +207,23 @@ discard block |
||
207 | 207 | }*/ |
208 | 208 | |
209 | 209 | // prevent a mass mailing for recurring meetings created in Calendar module |
210 | - if(empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id)) |
|
210 | + if (empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id)) |
|
211 | 211 | $check_notify = false; |
212 | 212 | |
213 | - if (empty($this->status) ) { |
|
213 | + if (empty($this->status)) { |
|
214 | 214 | $this->status = $this->getDefaultStatus(); |
215 | 215 | } |
216 | 216 | |
217 | 217 | // Do any external API saving |
218 | 218 | // Clear out the old external API stuff if we have changed types |
219 | - if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type ) { |
|
219 | + if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type) { |
|
220 | 220 | $this->join_url = ''; |
221 | 221 | $this->host_url = ''; |
222 | 222 | $this->external_id = ''; |
223 | 223 | $this->creator = ''; |
224 | 224 | } |
225 | 225 | |
226 | - if (!empty($this->type) && $this->type != 'Sugar' ) { |
|
226 | + if (!empty($this->type) && $this->type != 'Sugar') { |
|
227 | 227 | require_once('include/externalAPI/ExternalAPIFactory.php'); |
228 | 228 | $api = ExternalAPIFactory::loadAPI($this->type); |
229 | 229 | } |
@@ -232,27 +232,27 @@ discard block |
||
232 | 232 | $this->type = 'Sugar'; |
233 | 233 | } |
234 | 234 | |
235 | - if ( isset($api) && is_a($api,'WebMeeting') && empty($this->in_relationship_update) ) { |
|
235 | + if (isset($api) && is_a($api, 'WebMeeting') && empty($this->in_relationship_update)) { |
|
236 | 236 | // Make sure the API initialized and it supports Web Meetings |
237 | 237 | // Also make suer we have an ID, the external site needs something to reference |
238 | - if ( !isset($this->id) || empty($this->id) ) { |
|
238 | + if (!isset($this->id) || empty($this->id)) { |
|
239 | 239 | $this->id = create_guid(); |
240 | 240 | $this->new_with_id = true; |
241 | 241 | } |
242 | 242 | $response = $api->scheduleMeeting($this); |
243 | - if ( $response['success'] == TRUE ) { |
|
243 | + if ($response['success'] == TRUE) { |
|
244 | 244 | // Need to send out notifications |
245 | - if ( $api->canInvite ) { |
|
245 | + if ($api->canInvite) { |
|
246 | 246 | $notifyList = $this->get_notification_recipients(); |
247 | - foreach($notifyList as $person) { |
|
248 | - $api->inviteAttendee($this,$person,$check_notify); |
|
247 | + foreach ($notifyList as $person) { |
|
248 | + $api->inviteAttendee($this, $person, $check_notify); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | } |
252 | 252 | } else { |
253 | 253 | // Generic Message Provides no value to End User - Log the issue with message detail and continue |
254 | 254 | // SugarApplication::appendErrorMessage($GLOBALS['app_strings']['ERR_EXTERNAL_API_SAVE_FAIL']); |
255 | - $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL' . ": " . $this->type . " - " . $response['errorMessage']); |
|
255 | + $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL'.": ".$this->type." - ".$response['errorMessage']); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | $api->logoff(); |
@@ -260,11 +260,11 @@ discard block |
||
260 | 260 | |
261 | 261 | $return_id = parent::save($check_notify); |
262 | 262 | |
263 | - if($this->update_vcal) { |
|
263 | + if ($this->update_vcal) { |
|
264 | 264 | vCal::cache_sugar_vcal($current_user); |
265 | 265 | } |
266 | 266 | |
267 | - if(isset($_REQUEST['reminders_data'])) { |
|
267 | + if (isset($_REQUEST['reminders_data'])) { |
|
268 | 268 | Reminder::saveRemindersDataJson('Meetings', $return_id, html_entity_decode($_REQUEST['reminders_data'])); |
269 | 269 | } |
270 | 270 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | parent::mark_deleted($id); |
284 | 284 | |
285 | - if($this->update_vcal) { |
|
285 | + if ($this->update_vcal) { |
|
286 | 286 | vCal::cache_sugar_vcal($current_user); |
287 | 287 | } |
288 | 288 | } |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | return "$this->name"; |
292 | 292 | } |
293 | 293 | |
294 | - function create_export_query($order_by, $where, $relate_link_join='') |
|
294 | + function create_export_query($order_by, $where, $relate_link_join = '') |
|
295 | 295 | { |
296 | 296 | $custom_join = $this->getCustomJoin(true, true, $where); |
297 | 297 | $custom_join['join'] .= $relate_link_join; |
298 | 298 | $contact_required = stristr($where, "contacts"); |
299 | 299 | |
300 | - if($contact_required) { |
|
300 | + if ($contact_required) { |
|
301 | 301 | $query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner, users.user_name as assigned_user_name "; |
302 | 302 | $query .= $custom_join['select']; |
303 | 303 | $query .= " FROM contacts, meetings, meetings_contacts "; |
@@ -312,14 +312,14 @@ discard block |
||
312 | 312 | |
313 | 313 | $query .= $custom_join['join']; |
314 | 314 | |
315 | - if($where != "") |
|
315 | + if ($where != "") |
|
316 | 316 | $query .= " where $where AND ".$where_auto; |
317 | 317 | else |
318 | 318 | $query .= " where ".$where_auto; |
319 | 319 | |
320 | 320 | $order_by = $this->process_order_by($order_by); |
321 | 321 | if (!empty($order_by)) { |
322 | - $query .= ' ORDER BY ' . $order_by; |
|
322 | + $query .= ' ORDER BY '.$order_by; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | return $query; |
@@ -335,12 +335,12 @@ discard block |
||
335 | 335 | if (!empty($this->contact_id)) { |
336 | 336 | $query = "SELECT first_name, last_name FROM contacts "; |
337 | 337 | $query .= "WHERE id='$this->contact_id' AND deleted=0"; |
338 | - $result = $this->db->limitQuery($query,0,1,true," Error filling in additional detail fields: "); |
|
338 | + $result = $this->db->limitQuery($query, 0, 1, true, " Error filling in additional detail fields: "); |
|
339 | 339 | |
340 | 340 | // Get the contact name. |
341 | 341 | $row = $this->db->fetchByAssoc($result); |
342 | 342 | $GLOBALS['log']->info("additional call fields $query"); |
343 | - if($row != null) |
|
343 | + if ($row != null) |
|
344 | 344 | { |
345 | 345 | $this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name'], '', ''); |
346 | 346 | $GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name"); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | global $timedate; |
385 | 385 | $this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"'); |
386 | - $hours_arr = array (); |
|
386 | + $hours_arr = array(); |
|
387 | 387 | $num_of_hours = 13; |
388 | 388 | $start_at = 1; |
389 | 389 | |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | $start_at = 0; |
393 | 393 | } //if |
394 | 394 | |
395 | - for ($i = $start_at; $i < $num_of_hours; $i ++) { |
|
395 | + for ($i = $start_at; $i < $num_of_hours; $i++) { |
|
396 | 396 | $i = $i.""; |
397 | 397 | if (strlen($i) == 1) { |
398 | 398 | $i = "0".$i; |
@@ -415,12 +415,12 @@ discard block |
||
415 | 415 | if (is_null($this->duration_minutes)) |
416 | 416 | $this->duration_minutes = "1"; |
417 | 417 | |
418 | - if(empty($this->id) && !empty($_REQUEST['date_start'])){ |
|
418 | + if (empty($this->id) && !empty($_REQUEST['date_start'])) { |
|
419 | 419 | $this->date_start = $_REQUEST['date_start']; |
420 | 420 | } |
421 | - if(!empty($this->date_start)) |
|
421 | + if (!empty($this->date_start)) |
|
422 | 422 | { |
423 | - $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(),$this->date_start); |
|
423 | + $td = SugarDateTime::createFromFormat($GLOBALS['timedate']->get_date_time_format(), $this->date_start); |
|
424 | 424 | if (!empty($td)) |
425 | 425 | { |
426 | 426 | if (!empty($this->duration_hours) && $this->duration_hours != '') |
@@ -441,9 +441,9 @@ discard block |
||
441 | 441 | |
442 | 442 | global $app_list_strings; |
443 | 443 | $parent_types = $app_list_strings['record_type_display']; |
444 | - $disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list'); |
|
445 | - foreach($disabled_parent_types as $disabled_parent_type){ |
|
446 | - if($disabled_parent_type != $this->parent_type){ |
|
444 | + $disabled_parent_types = ACLController::disabledModuleList($parent_types, false, 'list'); |
|
445 | + foreach ($disabled_parent_types as $disabled_parent_type) { |
|
446 | + if ($disabled_parent_type != $this->parent_type) { |
|
447 | 447 | unset($parent_types[$disabled_parent_type]); |
448 | 448 | } |
449 | 449 | } |
@@ -453,9 +453,9 @@ discard block |
||
453 | 453 | $this->reminder_time = -1; |
454 | 454 | } |
455 | 455 | |
456 | - if ( empty($this->id) ) { |
|
456 | + if (empty($this->id)) { |
|
457 | 457 | $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time'); |
458 | - if ( isset($reminder_t) ) |
|
458 | + if (isset($reminder_t)) |
|
459 | 459 | $this->reminder_time = $reminder_t; |
460 | 460 | } |
461 | 461 | $this->reminder_checked = $this->reminder_time == -1 ? false : true; |
@@ -463,9 +463,9 @@ discard block |
||
463 | 463 | if (empty($this->email_reminder_time)) { |
464 | 464 | $this->email_reminder_time = -1; |
465 | 465 | } |
466 | - if(empty($this->id)){ |
|
466 | + if (empty($this->id)) { |
|
467 | 467 | $reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time'); |
468 | - if(isset($reminder_t)) |
|
468 | + if (isset($reminder_t)) |
|
469 | 469 | $this->email_reminder_time = $reminder_t; |
470 | 470 | } |
471 | 471 | $this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true; |
@@ -482,15 +482,15 @@ discard block |
||
482 | 482 | $meeting_fields = $this->get_list_view_array(); |
483 | 483 | |
484 | 484 | global $app_list_strings, $focus, $action, $currentModule; |
485 | - if(isset($this->parent_type)) |
|
485 | + if (isset($this->parent_type)) |
|
486 | 486 | $meeting_fields['PARENT_MODULE'] = $this->parent_type; |
487 | - if($this->status == "Planned") { |
|
487 | + if ($this->status == "Planned") { |
|
488 | 488 | //cn: added this if() to deal with sequential Closes in Meetings. this is a hack to a hack(formbase.php->handleRedirect) |
489 | - if(empty($action)) |
|
489 | + if (empty($action)) |
|
490 | 490 | $action = "index"; |
491 | 491 | $setCompleteUrl = "<a id='{$this->id}' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>"; |
492 | 492 | if ($this->ACLAccess('edit')) { |
493 | - $meeting_fields['SET_COMPLETE'] = $setCompleteUrl . SugarThemeRegistry::current()->getImage("close_inline"," border='0'",null,null,'.gif',translate('LBL_CLOSEINLINE'))."</a>"; |
|
493 | + $meeting_fields['SET_COMPLETE'] = $setCompleteUrl.SugarThemeRegistry::current()->getImage("close_inline", " border='0'", null, null, '.gif', translate('LBL_CLOSEINLINE'))."</a>"; |
|
494 | 494 | } else { |
495 | 495 | $meeting_fields['SET_COMPLETE'] = ''; |
496 | 496 | } |
@@ -500,9 +500,9 @@ discard block |
||
500 | 500 | $nextday = $timedate->asDbDate($timedate->getNow()->get("+1 day")); |
501 | 501 | $mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']); |
502 | 502 | $date_db = $timedate->to_db($mergeTime); |
503 | - if($date_db < $today ) { |
|
504 | - $meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>"; |
|
505 | - }else if($date_db < $nextday) { |
|
503 | + if ($date_db < $today) { |
|
504 | + $meeting_fields['DATE_START'] = "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>"; |
|
505 | + } else if ($date_db < $nextday) { |
|
506 | 506 | $meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>"; |
507 | 507 | } else { |
508 | 508 | $meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>"; |
@@ -524,8 +524,8 @@ discard block |
||
524 | 524 | $meeting_fields['CONTACT_ID'] = $this->contact_id; |
525 | 525 | $meeting_fields['CONTACT_NAME'] = $this->contact_name; |
526 | 526 | $meeting_fields['PARENT_NAME'] = $this->parent_name; |
527 | - $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time==-1 ? false : true; |
|
528 | - $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time==-1 ? false : true; |
|
527 | + $meeting_fields['REMINDER_CHECKED'] = $this->reminder_time == -1 ? false : true; |
|
528 | + $meeting_fields['EMAIL_REMINDER_CHECKED'] = $this->email_reminder_time == -1 ? false : true; |
|
529 | 529 | |
530 | 530 | |
531 | 531 | return $meeting_fields; |
@@ -539,12 +539,12 @@ discard block |
||
539 | 539 | |
540 | 540 | |
541 | 541 | // cn: bug 9494 - passing a contact breaks this call |
542 | - $notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user; |
|
542 | + $notifyUser = ($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user; |
|
543 | 543 | // cn: bug 8078 - fixed call to $timedate |
544 | - if(strtolower(get_class($meeting->current_notify_user)) == 'contact') { |
|
544 | + if (strtolower(get_class($meeting->current_notify_user)) == 'contact') { |
|
545 | 545 | $xtpl->assign("ACCEPT_URL", $sugar_config['site_url']. |
546 | 546 | '/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id); |
547 | - } elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') { |
|
547 | + } elseif (strtolower(get_class($meeting->current_notify_user)) == 'lead') { |
|
548 | 548 | $xtpl->assign("ACCEPT_URL", $sugar_config['site_url']. |
549 | 549 | '/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id); |
550 | 550 | } else { |
@@ -553,16 +553,16 @@ discard block |
||
553 | 553 | } |
554 | 554 | $xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name); |
555 | 555 | $xtpl->assign("MEETING_SUBJECT", trim($meeting->name)); |
556 | - $xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:"")); |
|
556 | + $xtpl->assign("MEETING_STATUS", (isset($meeting->status) ? $app_list_strings['meeting_status_dom'][$meeting->status] : "")); |
|
557 | 557 | $typekey = strtolower($meeting->type); |
558 | - if(isset($meeting->type)) { |
|
559 | - if(!empty($app_list_strings['eapm_list'][$typekey])) { |
|
558 | + if (isset($meeting->type)) { |
|
559 | + if (!empty($app_list_strings['eapm_list'][$typekey])) { |
|
560 | 560 | $typestring = $app_list_strings['eapm_list'][$typekey]; |
561 | 561 | } else { |
562 | 562 | $typestring = $app_list_strings['meeting_type_dom'][$meeting->type]; |
563 | 563 | } |
564 | 564 | } |
565 | - $xtpl->assign("MEETING_TYPE", isset($meeting->type)? $typestring:""); |
|
565 | + $xtpl->assign("MEETING_TYPE", isset($meeting->type) ? $typestring : ""); |
|
566 | 566 | $startdate = $timedate->fromDb($meeting->date_start); |
567 | 567 | $xtpl->assign("MEETING_STARTDATE", $timedate->asUser($startdate, $notifyUser)." ".TimeDate::userTimezoneSuffix($startdate, $notifyUser)); |
568 | 568 | $enddate = $timedate->fromDb($meeting->date_end); |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | $xtpl->assign("MEETING_HOURS", $meeting->duration_hours); |
571 | 571 | $xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes); |
572 | 572 | $xtpl->assign("MEETING_DESCRIPTION", $meeting->description); |
573 | - if ( !empty($meeting->join_url) ) { |
|
573 | + if (!empty($meeting->join_url)) { |
|
574 | 574 | $xtpl->assign('MEETING_URL', $meeting->join_url); |
575 | 575 | $xtpl->parse('Meeting.Meeting_External_API'); |
576 | 576 | } |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | /** |
582 | 582 | * Redefine method to attach ics file to notification email |
583 | 583 | */ |
584 | - public function create_notification_email($notify_user){ |
|
584 | + public function create_notification_email($notify_user) { |
|
585 | 585 | // reset acceptance status for non organizer if date is changed |
586 | 586 | if (($notify_user->id != $GLOBALS['current_user']->id) && $this->date_changed) { |
587 | 587 | $this->set_accept_status($notify_user, 'none'); |
@@ -589,12 +589,12 @@ discard block |
||
589 | 589 | |
590 | 590 | $notify_mail = parent::create_notification_email($notify_user); |
591 | 591 | |
592 | - $path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id; |
|
592 | + $path = SugarConfig::getInstance()->get('upload_dir', 'upload/').$this->id; |
|
593 | 593 | |
594 | 594 | require_once("modules/vCals/vCal.php"); |
595 | 595 | $content = vCal::get_ical_event($this, $GLOBALS['current_user']); |
596 | 596 | |
597 | - if(file_put_contents($path,$content)){ |
|
597 | + if (file_put_contents($path, $content)) { |
|
598 | 598 | $notify_mail->AddAttachment($path, 'meeting.ics', 'base64', 'text/calendar'); |
599 | 599 | } |
600 | 600 | return $notify_mail; |
@@ -603,10 +603,10 @@ discard block |
||
603 | 603 | /** |
604 | 604 | * Redefine method to remove ics after email is sent |
605 | 605 | */ |
606 | - public function send_assignment_notifications($notify_user, $admin){ |
|
606 | + public function send_assignment_notifications($notify_user, $admin) { |
|
607 | 607 | parent::send_assignment_notifications($notify_user, $admin); |
608 | 608 | |
609 | - $path = SugarConfig::getInstance()->get('upload_dir','upload/') . $this->id; |
|
609 | + $path = SugarConfig::getInstance()->get('upload_dir', 'upload/').$this->id; |
|
610 | 610 | unlink($path); |
611 | 611 | } |
612 | 612 | |
@@ -618,13 +618,13 @@ discard block |
||
618 | 618 | $result = $this->db->query($query, true); |
619 | 619 | $list = Array(); |
620 | 620 | |
621 | - while($row = $this->db->fetchByAssoc($result)) { |
|
621 | + while ($row = $this->db->fetchByAssoc($result)) { |
|
622 | 622 | $template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one |
623 | 623 | $record = $template->retrieve($row['user_id']); |
624 | 624 | $template->required = $row['required']; |
625 | 625 | $template->accept_status = $row['accept_status']; |
626 | 626 | |
627 | - if($record != null) { |
|
627 | + if ($record != null) { |
|
628 | 628 | // this copies the object into the array |
629 | 629 | $list[] = $template; |
630 | 630 | } |
@@ -640,13 +640,13 @@ discard block |
||
640 | 640 | $result = $this->db->query($query, true); |
641 | 641 | $list = Array(); |
642 | 642 | |
643 | - while($row = $this->db->fetchByAssoc($result)) { |
|
643 | + while ($row = $this->db->fetchByAssoc($result)) { |
|
644 | 644 | $record = $template->retrieve($row['meeting_id']); |
645 | 645 | $template->required = $row['required']; |
646 | 646 | $template->accept_status = $row['accept_status']; |
647 | 647 | |
648 | 648 | |
649 | - if($record != null) |
|
649 | + if ($record != null) |
|
650 | 650 | { |
651 | 651 | // this copies the object into the array |
652 | 652 | $list[] = $template; |
@@ -656,54 +656,54 @@ discard block |
||
656 | 656 | } |
657 | 657 | |
658 | 658 | |
659 | - function set_accept_status(&$user,$status) |
|
659 | + function set_accept_status(&$user, $status) |
|
660 | 660 | { |
661 | - if($user->object_name == 'User') |
|
661 | + if ($user->object_name == 'User') |
|
662 | 662 | { |
663 | - $relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id); |
|
663 | + $relate_values = array('user_id'=>$user->id, 'meeting_id'=>$this->id); |
|
664 | 664 | $data_values = array('accept_status'=>$status); |
665 | - $this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values); |
|
665 | + $this->set_relationship($this->rel_users_table, $relate_values, true, true, $data_values); |
|
666 | 666 | global $current_user; |
667 | 667 | |
668 | - if($this->update_vcal) |
|
668 | + if ($this->update_vcal) |
|
669 | 669 | { |
670 | 670 | vCal::cache_sugar_vcal($user); |
671 | 671 | } |
672 | 672 | } |
673 | - else if($user->object_name == 'Contact') |
|
673 | + else if ($user->object_name == 'Contact') |
|
674 | 674 | { |
675 | - $relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id); |
|
675 | + $relate_values = array('contact_id'=>$user->id, 'meeting_id'=>$this->id); |
|
676 | 676 | $data_values = array('accept_status'=>$status); |
677 | - $this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values); |
|
677 | + $this->set_relationship($this->rel_contacts_table, $relate_values, true, true, $data_values); |
|
678 | 678 | } |
679 | - else if($user->object_name == 'Lead') |
|
679 | + else if ($user->object_name == 'Lead') |
|
680 | 680 | { |
681 | - $relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id); |
|
681 | + $relate_values = array('lead_id'=>$user->id, 'meeting_id'=>$this->id); |
|
682 | 682 | $data_values = array('accept_status'=>$status); |
683 | - $this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values); |
|
683 | + $this->set_relationship($this->rel_leads_table, $relate_values, true, true, $data_values); |
|
684 | 684 | } |
685 | 685 | } |
686 | 686 | |
687 | 687 | |
688 | 688 | function get_notification_recipients() { |
689 | - if($this->special_notification) { |
|
689 | + if ($this->special_notification) { |
|
690 | 690 | return parent::get_notification_recipients(); |
691 | 691 | } |
692 | 692 | |
693 | 693 | $list = array(); |
694 | - if(!is_array($this->contacts_arr)) { |
|
695 | - $this->contacts_arr = array(); |
|
694 | + if (!is_array($this->contacts_arr)) { |
|
695 | + $this->contacts_arr = array(); |
|
696 | 696 | } |
697 | 697 | |
698 | - if(!is_array($this->users_arr)) { |
|
699 | - $this->users_arr = array(); |
|
698 | + if (!is_array($this->users_arr)) { |
|
699 | + $this->users_arr = array(); |
|
700 | 700 | } |
701 | 701 | |
702 | - if(!is_array($this->leads_arr)) { |
|
703 | - $this->leads_arr = array(); |
|
702 | + if (!is_array($this->leads_arr)) { |
|
703 | + $this->leads_arr = array(); |
|
704 | 704 | } |
705 | 705 | |
706 | - foreach($this->users_arr as $user_id) { |
|
706 | + foreach ($this->users_arr as $user_id) { |
|
707 | 707 | $notify_user = new User(); |
708 | 708 | $notify_user->retrieve($user_id); |
709 | 709 | $notify_user->new_assigned_user_name = $notify_user->full_name; |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | $list[$notify_user->id] = $notify_user; |
712 | 712 | } |
713 | 713 | |
714 | - foreach($this->contacts_arr as $contact_id) { |
|
714 | + foreach ($this->contacts_arr as $contact_id) { |
|
715 | 715 | $notify_user = new Contact(); |
716 | 716 | $notify_user->retrieve($contact_id); |
717 | 717 | $notify_user->new_assigned_user_name = $notify_user->full_name; |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | $list[$notify_user->id] = $notify_user; |
720 | 720 | } |
721 | 721 | |
722 | - foreach($this->leads_arr as $lead_id) { |
|
722 | + foreach ($this->leads_arr as $lead_id) { |
|
723 | 723 | $notify_user = new Lead(); |
724 | 724 | $notify_user->retrieve($lead_id); |
725 | 725 | $notify_user->new_assigned_user_name = $notify_user->full_name; |
@@ -728,9 +728,9 @@ discard block |
||
728 | 728 | } |
729 | 729 | |
730 | 730 | global $sugar_config; |
731 | - if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) { |
|
731 | + if (isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) { |
|
732 | 732 | global $current_user; |
733 | - if(isset($list[$current_user->id])) |
|
733 | + if (isset($list[$current_user->id])) |
|
734 | 734 | unset($list[$current_user->id]); |
735 | 735 | } |
736 | 736 | return $list; |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | |
739 | 739 | |
740 | 740 | function bean_implements($interface) { |
741 | - switch($interface) { |
|
741 | + switch ($interface) { |
|
742 | 742 | case 'ACL':return true; |
743 | 743 | } |
744 | 744 | return false; |
@@ -748,18 +748,18 @@ discard block |
||
748 | 748 | $array_assign = parent::listviewACLHelper(); |
749 | 749 | $is_owner = false; |
750 | 750 | $in_group = false; //SECURITY GROUPS |
751 | - if(!empty($this->parent_name)) { |
|
751 | + if (!empty($this->parent_name)) { |
|
752 | 752 | |
753 | - if(!empty($this->parent_name_owner)) { |
|
753 | + if (!empty($this->parent_name_owner)) { |
|
754 | 754 | global $current_user; |
755 | 755 | $is_owner = $current_user->id == $this->parent_name_owner; |
756 | 756 | } |
757 | 757 | /* BEGIN - SECURITY GROUPS */ |
758 | 758 | //parent_name_owner not being set for whatever reason so we need to figure this out |
759 | - else if(!empty($this->parent_type) && !empty($this->parent_id)) { |
|
759 | + else if (!empty($this->parent_type) && !empty($this->parent_id)) { |
|
760 | 760 | global $current_user; |
761 | - $parent_bean = BeanFactory::getBean($this->parent_type,$this->parent_id); |
|
762 | - if($parent_bean !== false) { |
|
761 | + $parent_bean = BeanFactory::getBean($this->parent_type, $this->parent_id); |
|
762 | + if ($parent_bean !== false) { |
|
763 | 763 | $is_owner = $current_user->id == $parent_bean->assigned_user_id; |
764 | 764 | } |
765 | 765 | } |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | /** |
773 | 773 | if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) { |
774 | 774 | */ |
775 | - if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)){ |
|
775 | + if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)) { |
|
776 | 776 | /* END - SECURITY GROUPS */ |
777 | 777 | $array_assign['PARENT'] = 'a'; |
778 | 778 | } else { |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | $is_owner = false; |
783 | 783 | $in_group = false; //SECURITY GROUPS |
784 | 784 | |
785 | - if(!empty($this->contact_name)) { |
|
786 | - if(!empty($this->contact_name_owner)) { |
|
785 | + if (!empty($this->contact_name)) { |
|
786 | + if (!empty($this->contact_name_owner)) { |
|
787 | 787 | global $current_user; |
788 | 788 | $is_owner = $current_user->id == $this->contact_name_owner; |
789 | 789 | } |
@@ -791,8 +791,8 @@ discard block |
||
791 | 791 | //contact_name_owner not being set for whatever reason so we need to figure this out |
792 | 792 | else { |
793 | 793 | global $current_user; |
794 | - $parent_bean = BeanFactory::getBean('Contacts',$this->contact_id); |
|
795 | - if($parent_bean !== false) { |
|
794 | + $parent_bean = BeanFactory::getBean('Contacts', $this->contact_id); |
|
795 | + if ($parent_bean !== false) { |
|
796 | 796 | $is_owner = $current_user->id == $parent_bean->assigned_user_id; |
797 | 797 | } |
798 | 798 | } |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | /** |
806 | 806 | if(ACLController::checkAccess('Contacts', 'view', $is_owner)) { |
807 | 807 | */ |
808 | - if(ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) { |
|
808 | + if (ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) { |
|
809 | 809 | /* END - SECURITY GROUPS */ |
810 | 810 | $array_assign['CONTACT'] = 'a'; |
811 | 811 | } else { |
@@ -816,17 +816,17 @@ discard block |
||
816 | 816 | |
817 | 817 | |
818 | 818 | function save_relationship_changes($is_update, $exclude = array()) { |
819 | - if(empty($this->in_workflow)) { |
|
820 | - if(empty($this->in_import)){//if a meeting is being imported then contact_id should not be excluded |
|
819 | + if (empty($this->in_workflow)) { |
|
820 | + if (empty($this->in_import)) {//if a meeting is being imported then contact_id should not be excluded |
|
821 | 821 | //if the global soap_server_object variable is not empty (as in from a soap/OPI call), then process the assigned_user_id relationship, otherwise |
822 | 822 | //add assigned_user_id to exclude list and let the logic from MeetingFormBase determine whether assigned user id gets added to the relationship |
823 | - if(!empty($GLOBALS['soap_server_object'])){ |
|
823 | + if (!empty($GLOBALS['soap_server_object'])) { |
|
824 | 824 | $exclude = array('contact_id', 'user_id'); |
825 | - }else{ |
|
826 | - $exclude = array('contact_id', 'user_id','assigned_user_id'); |
|
825 | + } else { |
|
826 | + $exclude = array('contact_id', 'user_id', 'assigned_user_id'); |
|
827 | 827 | } |
828 | 828 | } |
829 | - else{ |
|
829 | + else { |
|
830 | 830 | $exclude = array('user_id'); |
831 | 831 | } |
832 | 832 | } |
@@ -839,14 +839,14 @@ discard block |
||
839 | 839 | */ |
840 | 840 | public function afterImportSave() |
841 | 841 | { |
842 | - if ( $this->parent_type == 'Contacts' ) { |
|
842 | + if ($this->parent_type == 'Contacts') { |
|
843 | 843 | $this->load_relationship('contacts'); |
844 | - if ( !$this->contacts->relationship_exists('contacts',array('id'=>$this->parent_id)) ) |
|
844 | + if (!$this->contacts->relationship_exists('contacts', array('id'=>$this->parent_id))) |
|
845 | 845 | $this->contacts->add($this->parent_id); |
846 | 846 | } |
847 | - elseif ( $this->parent_type == 'Leads' ) { |
|
847 | + elseif ($this->parent_type == 'Leads') { |
|
848 | 848 | $this->load_relationship('leads'); |
849 | - if ( !$this->leads->relationship_exists('leads',array('id'=>$this->parent_id)) ) |
|
849 | + if (!$this->leads->relationship_exists('leads', array('id'=>$this->parent_id))) |
|
850 | 850 | $this->leads->add($this->parent_id); |
851 | 851 | } |
852 | 852 | |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | sugar_cache_put($cacheKeyName, $apiList); |
889 | 889 | } |
890 | 890 | |
891 | - if(!empty($value) && empty($apiList[$value])) |
|
891 | + if (!empty($value) && empty($apiList[$value])) |
|
892 | 892 | { |
893 | 893 | $apiList[$value] = $value; |
894 | 894 | } |