@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Form which allows users to add a department to the analytics graph. |
12 | 12 | */ |
13 | 13 | $state_array = array('Open'); |
14 | -if($vars['state_array']) { |
|
14 | +if ($vars['state_array']) { |
|
15 | 15 | $state_array = $vars['state_array']; |
16 | 16 | } |
17 | 17 | $state_array = implode(',', $state_array); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | <div class="form-group"> |
39 | 39 | <label class="col-sm-3" style="text-align:right;"> |
40 | - <?php echo elgg_echo('missions:add_this_department_to_graph') . ':';?> |
|
40 | + <?php echo elgg_echo('missions:add_this_department_to_graph') . ':'; ?> |
|
41 | 41 | </label> |
42 | 42 | <div class="col-sm-3"> |
43 | 43 | <?php echo $input_department; ?> |
@@ -16,19 +16,19 @@ |
||
16 | 16 | |
17 | 17 | $input_dropdown = elgg_view('input/dropdown', array( |
18 | 18 | 'name' => 'opt_in_option', |
19 | - 'value' => $opt_in_option, |
|
20 | - 'options' => array( |
|
21 | - elgg_echo('gcconnex_profile:opt:micro_mission'), |
|
22 | - elgg_echo('gcconnex_profile:opt:job_swap'), |
|
23 | - elgg_echo('gcconnex_profile:opt:mentored'), |
|
24 | - elgg_echo('gcconnex_profile:opt:mentoring'), |
|
25 | - elgg_echo('gcconnex_profile:opt:shadowed'), |
|
26 | - elgg_echo('gcconnex_profile:opt:shadowing'), |
|
27 | - elgg_echo('gcconnex_profile:opt:peer_coached'), |
|
28 | - elgg_echo('gcconnex_profile:opt:peer_coaching'), |
|
29 | - elgg_echo('gcconnex_profile:opt:skill_sharing'), |
|
30 | - elgg_echo('gcconnex_profile:opt:job_sharing') |
|
31 | - ) |
|
19 | + 'value' => $opt_in_option, |
|
20 | + 'options' => array( |
|
21 | + elgg_echo('gcconnex_profile:opt:micro_mission'), |
|
22 | + elgg_echo('gcconnex_profile:opt:job_swap'), |
|
23 | + elgg_echo('gcconnex_profile:opt:mentored'), |
|
24 | + elgg_echo('gcconnex_profile:opt:mentoring'), |
|
25 | + elgg_echo('gcconnex_profile:opt:shadowed'), |
|
26 | + elgg_echo('gcconnex_profile:opt:shadowing'), |
|
27 | + elgg_echo('gcconnex_profile:opt:peer_coached'), |
|
28 | + elgg_echo('gcconnex_profile:opt:peer_coaching'), |
|
29 | + elgg_echo('gcconnex_profile:opt:skill_sharing'), |
|
30 | + elgg_echo('gcconnex_profile:opt:job_sharing') |
|
31 | + ) |
|
32 | 32 | )); |
33 | 33 | ?> |
34 | 34 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * Form which allows or disallows completed/cancelled missions to be displayed in My Opportunities. |
12 | 12 | */ |
13 | 13 | $check = false; |
14 | -if(elgg_get_logged_in_user_entity()->show_closed_missions) { |
|
14 | +if (elgg_get_logged_in_user_entity()->show_closed_missions) { |
|
15 | 15 | $checked = true; |
16 | 16 | } |
17 | 17 |
@@ -40,15 +40,15 @@ |
||
40 | 40 | )); |
41 | 41 | |
42 | 42 | if (elgg_is_sticky_form('applicationfill')) { |
43 | - extract(elgg_get_sticky_values('feedbackfill')); |
|
44 | - elgg_clear_sticky_form('feedbackfill'); |
|
43 | + extract(elgg_get_sticky_values('feedbackfill')); |
|
44 | + elgg_clear_sticky_form('feedbackfill'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // If a message has been sent then a second message cannot be sent. |
48 | 48 | $feedback_body .= elgg_view('input/plaintext', array( |
49 | - 'name' => 'feedback_body', |
|
50 | - 'value' => $feedback_body, |
|
51 | - 'id' => 'mission-feedback-body-text-input-' . $feedback_target->guid |
|
49 | + 'name' => 'feedback_body', |
|
50 | + 'value' => $feedback_body, |
|
51 | + 'id' => 'mission-feedback-body-text-input-' . $feedback_target->guid |
|
52 | 52 | )); |
53 | 53 | |
54 | 54 | $input_feedback_rating = elgg_view('input/checkbox', array( |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $feedback_body = $feedback->message; |
28 | 28 | $checked = false; |
29 | -if($feedback->endorsement == 'on') { |
|
29 | +if ($feedback->endorsement == 'on') { |
|
30 | 30 | $checked = true; |
31 | 31 | } |
32 | 32 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | // If a message has been sent then a second message cannot be sent. |
48 | -$feedback_body .= elgg_view('input/plaintext', array( |
|
48 | +$feedback_body .= elgg_view('input/plaintext', array( |
|
49 | 49 | 'name' => 'feedback_body', |
50 | 50 | 'value' => $feedback_body, |
51 | 51 | 'id' => 'mission-feedback-body-text-input-' . $feedback_target->guid |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'name' => 'feedback_rating', |
56 | 56 | 'checked' => $checked, |
57 | 57 | 'id' => 'mission-feedback-rating-checkbox-input-' . $feedback_target->guid |
58 | -));; |
|
58 | +)); ; |
|
59 | 59 | |
60 | 60 | echo elgg_view('input/hidden', array( |
61 | 61 | 'name' => 'hidden_target_guid', |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | |
20 | 20 | if (elgg_is_sticky_form('thirdfill')) { |
21 | 21 | $temp_array = elgg_get_sticky_values('thirdfill'); |
22 | - extract($temp_array); |
|
23 | - // elgg_clear_sticky_form('thirdfill'); |
|
22 | + extract($temp_array); |
|
23 | + // elgg_clear_sticky_form('thirdfill'); |
|
24 | 24 | |
25 | - foreach($temp_array as $key => $value) { |
|
26 | - if(!(strpos($key, 'key_skills') === false)) { |
|
27 | - $key_skills .= $value . ', '; |
|
28 | - } |
|
29 | - } |
|
30 | - $key_skills = substr($key_skills, 0, -2); |
|
25 | + foreach($temp_array as $key => $value) { |
|
26 | + if(!(strpos($key, 'key_skills') === false)) { |
|
27 | + $key_skills .= $value . ', '; |
|
28 | + } |
|
29 | + } |
|
30 | + $key_skills = substr($key_skills, 0, -2); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // Determines whether the remote work checkbox is checked or not. |
@@ -59,27 +59,27 @@ discard block |
||
59 | 59 | $skill_set .= elgg_view('missions/add-skill', array('value' => $skill)); |
60 | 60 | } |
61 | 61 | $input_remotely = elgg_view('input/checkbox', array( |
62 | - 'name' => 'remotely', |
|
63 | - 'checked' => $remotely, |
|
64 | - 'id' => 'post-mission-remotely-checkbox-input' |
|
62 | + 'name' => 'remotely', |
|
63 | + 'checked' => $remotely, |
|
64 | + 'id' => 'post-mission-remotely-checkbox-input' |
|
65 | 65 | )); |
66 | 66 | $input_location = elgg_view('input/dropdown', array( |
67 | - 'name' => 'location', |
|
68 | - 'value' => $location, |
|
69 | - 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('province_string', 'missions')), |
|
70 | - 'id' => 'post-mission-location-text-input' |
|
67 | + 'name' => 'location', |
|
68 | + 'value' => $location, |
|
69 | + 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('province_string', 'missions')), |
|
70 | + 'id' => 'post-mission-location-text-input' |
|
71 | 71 | )); |
72 | 72 | $input_security = elgg_view('input/dropdown', array( |
73 | - 'name' => 'security', |
|
74 | - 'value' => $security, |
|
75 | - 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('security_string', 'missions')), |
|
76 | - 'id' => 'post-mission-security-dropdown-input' |
|
73 | + 'name' => 'security', |
|
74 | + 'value' => $security, |
|
75 | + 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('security_string', 'missions')), |
|
76 | + 'id' => 'post-mission-security-dropdown-input' |
|
77 | 77 | )); |
78 | 78 | $input_timezone = elgg_view('input/dropdown', array( |
79 | - 'name' => 'timezone', |
|
80 | - 'value' => $timezone, |
|
81 | - 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('timezone_string', 'missions')), |
|
82 | - 'id' => 'post-mission-timezone-dropdown-input' |
|
79 | + 'name' => 'timezone', |
|
80 | + 'value' => $timezone, |
|
81 | + 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('timezone_string', 'missions')), |
|
82 | + 'id' => 'post-mission-timezone-dropdown-input' |
|
83 | 83 | )); |
84 | 84 | $input_time_commit = elgg_view('input/text', array( |
85 | 85 | 'name' => 'time_commitment', |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | extract($temp_array); |
23 | 23 | // elgg_clear_sticky_form('thirdfill'); |
24 | 24 | |
25 | - foreach($temp_array as $key => $value) { |
|
26 | - if(!(strpos($key, 'key_skills') === false)) { |
|
25 | + foreach ($temp_array as $key => $value) { |
|
26 | + if (!(strpos($key, 'key_skills') === false)) { |
|
27 | 27 | $key_skills .= $value . ', '; |
28 | 28 | } |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | // Determines whether the remote work checkbox is checked or not. |
34 | -if($remotely == 'on') { |
|
34 | +if ($remotely == 'on') { |
|
35 | 35 | $remotely = true; |
36 | 36 | } |
37 | 37 | else { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $duplicating_entity = get_entity($_SESSION['mission_duplication_id']); |
42 | -if(get_subtype_from_id($duplicating_entity->subtype) == 'mission' && !$_SESSION['mission_duplicating_override_third']) { |
|
42 | +if (get_subtype_from_id($duplicating_entity->subtype) == 'mission' && !$_SESSION['mission_duplicating_override_third']) { |
|
43 | 43 | $key_skills = $duplicating_entity->key_skills; |
44 | 44 | $time_commitment = $duplicating_entity->time_commitment; |
45 | 45 | $time_interval = $duplicating_entity->time_interval; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $skill_set = ''; |
57 | 57 | $skill_array = explode(', ', $key_skills); |
58 | -foreach($skill_array as $skill) { |
|
58 | +foreach ($skill_array as $skill) { |
|
59 | 59 | $skill_set .= elgg_view('missions/add-skill', array('value' => $skill)); |
60 | 60 | } |
61 | 61 | $input_remotely = elgg_view('input/checkbox', array( |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | )); |
128 | 128 | |
129 | 129 | $skill_match_override = $_SESSION['mission_skill_match_is_interlude']; |
130 | -if($skill_match_override) { |
|
130 | +if ($skill_match_override) { |
|
131 | 131 | unset($_SESSION['mission_skill_match_is_interlude']); |
132 | 132 | echo elgg_view('page/elements/skill-match-interlude', array('submit_button_id' => 'mission-post-opportunity-third-form-submission-button')); |
133 | 133 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | <h2 class='h4'><?php echo elgg_echo('missions:third_post_form_title'); ?></h2><br> |
142 | 142 | <div class="form-group"> |
143 | 143 | <label class="col-sm-3" style="text-align:right;"> |
144 | - <?php echo elgg_echo('missions:skills') . ':';?> |
|
144 | + <?php echo elgg_echo('missions:skills') . ':'; ?> |
|
145 | 145 | </label> |
146 | 146 | <div class="col-sm-9"> |
147 | 147 | <div id="mission-skill-container" style="display:inline-block;"> |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | </div> |
156 | 156 | <div class="form-group"> |
157 | 157 | <label for='post-mission-time-commitment-text-input' class="col-sm-3 required" style="text-align:right;" aria-required="true"> |
158 | - <?php echo elgg_echo('missions:time_in_hours');?> |
|
158 | + <?php echo elgg_echo('missions:time_in_hours'); ?> |
|
159 | 159 | <strong class="required" aria-required="true"> |
160 | 160 | <?php echo elgg_echo('missions:required'); ?> |
161 | 161 | </strong> |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | </div> |
174 | 174 | <div class="form-group"> |
175 | 175 | <label for='post-mission-remotely-checkbox-input' class="col-sm-3" style="text-align:right;"> |
176 | - <?php echo elgg_echo('missions:work_remotely') . ':';?> |
|
176 | + <?php echo elgg_echo('missions:work_remotely') . ':'; ?> |
|
177 | 177 | </label> |
178 | 178 | <div class="col-sm-3"> |
179 | 179 | <?php echo $input_remotely; ?> |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | </div> |
182 | 182 | <div class="form-group"> |
183 | 183 | <label for='post-mission-location-text-input' class="col-sm-3 required" style="text-align:right;" aria-required="true"> |
184 | - <?php echo elgg_echo('missions:location');?> |
|
184 | + <?php echo elgg_echo('missions:location'); ?> |
|
185 | 185 | <strong class="required" aria-required="true"> |
186 | 186 | <?php echo elgg_echo('missions:required'); ?> |
187 | 187 | </strong> |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | </div> |
194 | 194 | <div class="form-group"> |
195 | 195 | <label for='post-mission-security-dropdown-input' class="col-sm-3" style="text-align:right;"> |
196 | - <?php echo elgg_echo('missions:security_level') . ':';?> |
|
196 | + <?php echo elgg_echo('missions:security_level') . ':'; ?> |
|
197 | 197 | </label> |
198 | 198 | <div class="col-sm-3"> |
199 | 199 | <?php echo $input_security; ?> |
@@ -33,8 +33,7 @@ |
||
33 | 33 | // Determines whether the remote work checkbox is checked or not. |
34 | 34 | if($remotely == 'on') { |
35 | 35 | $remotely = true; |
36 | -} |
|
37 | -else { |
|
36 | +} else { |
|
38 | 37 | $remotely = false; |
39 | 38 | } |
40 | 39 |
@@ -15,40 +15,40 @@ discard block |
||
15 | 15 | $advanced_form = elgg_get_sticky_values('advancedfill'); |
16 | 16 | // The arrays are different depending on whether the user is searching for missions or candidates. |
17 | 17 | if($_SESSION['mission_search_switch'] == 'candidate') { |
18 | - $search_fields = array( |
|
19 | - //'' => 'Choose', |
|
20 | - '', |
|
21 | - elgg_echo('missions:education'), |
|
22 | - elgg_echo('missions:experience'), |
|
23 | - elgg_echo('missions:skill'), |
|
24 | - elgg_echo('missions:portfolio'), |
|
25 | - elgg_echo('missions:user_department'), |
|
26 | - elgg_echo('missions:opt_in') |
|
27 | - ); |
|
18 | + $search_fields = array( |
|
19 | + //'' => 'Choose', |
|
20 | + '', |
|
21 | + elgg_echo('missions:education'), |
|
22 | + elgg_echo('missions:experience'), |
|
23 | + elgg_echo('missions:skill'), |
|
24 | + elgg_echo('missions:portfolio'), |
|
25 | + elgg_echo('missions:user_department'), |
|
26 | + elgg_echo('missions:opt_in') |
|
27 | + ); |
|
28 | 28 | |
29 | - $subtitle = elgg_echo('missions:advanced_find_candidates'); |
|
29 | + $subtitle = elgg_echo('missions:advanced_find_candidates'); |
|
30 | 30 | $limit_options = array(10,25,50,100); |
31 | 31 | $button_text = elgg_echo('missions:find'); |
32 | 32 | } |
33 | 33 | else { |
34 | - $search_fields = array( |
|
35 | - //'' => 'Choose', |
|
36 | - '', |
|
37 | - elgg_echo('missions:title'), |
|
38 | - elgg_echo('missions:department'), |
|
39 | - elgg_echo('missions:key_skills'), |
|
40 | - elgg_echo('missions:security_clearance'), |
|
41 | - elgg_echo('missions:location'), |
|
42 | - elgg_echo('missions:language'), |
|
43 | - elgg_echo('missions:time'), |
|
44 | - elgg_echo('missions:period'), |
|
45 | - elgg_echo('missions:start_time'), |
|
46 | - elgg_echo('missions:duration'), |
|
47 | - elgg_echo('missions:work_remotely'), |
|
48 | - elgg_echo('missions:program_area') |
|
49 | - ); |
|
34 | + $search_fields = array( |
|
35 | + //'' => 'Choose', |
|
36 | + '', |
|
37 | + elgg_echo('missions:title'), |
|
38 | + elgg_echo('missions:department'), |
|
39 | + elgg_echo('missions:key_skills'), |
|
40 | + elgg_echo('missions:security_clearance'), |
|
41 | + elgg_echo('missions:location'), |
|
42 | + elgg_echo('missions:language'), |
|
43 | + elgg_echo('missions:time'), |
|
44 | + elgg_echo('missions:period'), |
|
45 | + elgg_echo('missions:start_time'), |
|
46 | + elgg_echo('missions:duration'), |
|
47 | + elgg_echo('missions:work_remotely'), |
|
48 | + elgg_echo('missions:program_area') |
|
49 | + ); |
|
50 | 50 | |
51 | - $subtitle = elgg_echo('missions:advanced_search_for_opportunities'); |
|
51 | + $subtitle = elgg_echo('missions:advanced_search_for_opportunities'); |
|
52 | 52 | $limit_options = array(9,18,30,60,120); |
53 | 53 | $button_text = elgg_echo('missions:search'); |
54 | 54 | } |
@@ -72,42 +72,42 @@ discard block |
||
72 | 72 | if ($advanced_form['selection_'.$s]){ |
73 | 73 | |
74 | 74 | |
75 | - $content .= '<div class="form-group">'; |
|
76 | - // Dropdown with a name that is numbered according to its row. |
|
77 | - $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
|
78 | - $content .= elgg_view('input/dropdown', array( |
|
79 | - 'name' => 'selection_' . $s, |
|
80 | - 'value' => $advanced_form['selection_'.$s], |
|
81 | - 'options' => $search_fields, |
|
75 | + $content .= '<div class="form-group">'; |
|
76 | + // Dropdown with a name that is numbered according to its row. |
|
77 | + $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
|
78 | + $content .= elgg_view('input/dropdown', array( |
|
79 | + 'name' => 'selection_' . $s, |
|
80 | + 'value' => $advanced_form['selection_'.$s], |
|
81 | + 'options' => $search_fields, |
|
82 | 82 | |
83 | - 'onchange' => 'element_switch(this)', |
|
84 | - 'onload' => 'element_switch(this)', |
|
85 | - 'id' => 'search-mission-advanced-selection-' . $s . '-dropdown-input', |
|
86 | - 'selected' => 'selected' |
|
87 | - )); |
|
83 | + 'onchange' => 'element_switch(this)', |
|
84 | + 'onload' => 'element_switch(this)', |
|
85 | + 'id' => 'search-mission-advanced-selection-' . $s . '-dropdown-input', |
|
86 | + 'selected' => 'selected' |
|
87 | + )); |
|
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | - $content .= '</div>'; |
|
92 | - $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $s . '"></div>'; |
|
93 | - $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $s . '_element"></div>'; |
|
94 | - // Backup dropdown for when Javascript is disabled. |
|
95 | - $content .= '<noscript>'; |
|
96 | - $content .= elgg_view('input/text', array( |
|
97 | - 'name' => 'backup_' . $s, |
|
98 | - 'value' => '', |
|
99 | - 'id' => 'search-mission-advanced-selection-' . $s . '-dropdown-input-backup' |
|
100 | - )); |
|
101 | - $content .= '</noscript></div>'; |
|
91 | + $content .= '</div>'; |
|
92 | + $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $s . '"></div>'; |
|
93 | + $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $s . '_element"></div>'; |
|
94 | + // Backup dropdown for when Javascript is disabled. |
|
95 | + $content .= '<noscript>'; |
|
96 | + $content .= elgg_view('input/text', array( |
|
97 | + 'name' => 'backup_' . $s, |
|
98 | + 'value' => '', |
|
99 | + 'id' => 'search-mission-advanced-selection-' . $s . '-dropdown-input-backup' |
|
100 | + )); |
|
101 | + $content .= '</noscript></div>'; |
|
102 | 102 | |
103 | 103 | |
104 | 104 | $all_values = array( |
105 | - "value_answer" => $advanced_form['selection_'.$s.'_element'], |
|
106 | - "reading" => $advanced_form['selection_'.$s.'_element_lwc'], |
|
107 | - "writing" => $advanced_form['selection_'.$s.'_element_lwe'], |
|
108 | - "oral" => $advanced_form['selection_'.$s.'_element_lop'], |
|
109 | - "operand" => $advanced_form['selection_'.$s.'_operand'], |
|
110 | - "day" => $advanced_form['selection_'.$s.'_element_day'] |
|
105 | + "value_answer" => $advanced_form['selection_'.$s.'_element'], |
|
106 | + "reading" => $advanced_form['selection_'.$s.'_element_lwc'], |
|
107 | + "writing" => $advanced_form['selection_'.$s.'_element_lwe'], |
|
108 | + "oral" => $advanced_form['selection_'.$s.'_element_lop'], |
|
109 | + "operand" => $advanced_form['selection_'.$s.'_operand'], |
|
110 | + "day" => $advanced_form['selection_'.$s.'_element_day'] |
|
111 | 111 | ); |
112 | 112 | |
113 | 113 | |
@@ -153,67 +153,67 @@ discard block |
||
153 | 153 | <?php |
154 | 154 | |
155 | 155 | }else{ |
156 | - $content .= '<div class="form-group">'; |
|
157 | - // Dropdown with a name that is numbered according to its row. |
|
158 | - $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
|
159 | - $content .= elgg_view('input/dropdown', array( |
|
160 | - 'name' => 'selection_' . $i, |
|
161 | - 'value' => '', |
|
162 | - 'options' => $search_fields, |
|
163 | - 'onchange' => 'element_switch(this)', |
|
164 | - 'onload' => 'element_switch(this)', |
|
165 | - 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input' |
|
166 | - )); |
|
156 | + $content .= '<div class="form-group">'; |
|
157 | + // Dropdown with a name that is numbered according to its row. |
|
158 | + $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
|
159 | + $content .= elgg_view('input/dropdown', array( |
|
160 | + 'name' => 'selection_' . $i, |
|
161 | + 'value' => '', |
|
162 | + 'options' => $search_fields, |
|
163 | + 'onchange' => 'element_switch(this)', |
|
164 | + 'onload' => 'element_switch(this)', |
|
165 | + 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input' |
|
166 | + )); |
|
167 | 167 | |
168 | - $content .= '</div>'; |
|
169 | - $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '"></div>'; |
|
170 | - $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '_element"></div>'; |
|
171 | - // Backup dropdown for when Javascript is disabled. |
|
172 | - $content .= '<noscript>'; |
|
173 | - $content .= elgg_view('input/text', array( |
|
174 | - 'name' => 'backup_' . $i, |
|
175 | - 'value' => '', |
|
176 | - 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input-backup' |
|
177 | - )); |
|
178 | - $content .= '</noscript></div>'; |
|
168 | + $content .= '</div>'; |
|
169 | + $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '"></div>'; |
|
170 | + $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '_element"></div>'; |
|
171 | + // Backup dropdown for when Javascript is disabled. |
|
172 | + $content .= '<noscript>'; |
|
173 | + $content .= elgg_view('input/text', array( |
|
174 | + 'name' => 'backup_' . $i, |
|
175 | + 'value' => '', |
|
176 | + 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input-backup' |
|
177 | + )); |
|
178 | + $content .= '</noscript></div>'; |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | }else{ |
182 | 182 | for ($i = 0; $i < $number_of_rows; $i ++) { |
183 | - $content .= '<div class="form-group">'; |
|
184 | - // Dropdown with a name that is numbered according to its row. |
|
185 | - $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
|
186 | - $content .= elgg_view('input/dropdown', array( |
|
187 | - 'name' => 'selection_' . $i, |
|
188 | - 'value' => '', |
|
189 | - 'options' => $search_fields, |
|
190 | - 'onchange' => 'element_switch(this)', |
|
191 | - 'onload' => 'element_switch(this)', |
|
192 | - 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input' |
|
193 | - )); |
|
183 | + $content .= '<div class="form-group">'; |
|
184 | + // Dropdown with a name that is numbered according to its row. |
|
185 | + $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
|
186 | + $content .= elgg_view('input/dropdown', array( |
|
187 | + 'name' => 'selection_' . $i, |
|
188 | + 'value' => '', |
|
189 | + 'options' => $search_fields, |
|
190 | + 'onchange' => 'element_switch(this)', |
|
191 | + 'onload' => 'element_switch(this)', |
|
192 | + 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input' |
|
193 | + )); |
|
194 | 194 | |
195 | - $content .= '</div>'; |
|
196 | - $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '"></div>'; |
|
197 | - $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '_element"></div>'; |
|
198 | - // Backup dropdown for when Javascript is disabled. |
|
199 | - $content .= '<noscript>'; |
|
200 | - $content .= elgg_view('input/text', array( |
|
201 | - 'name' => 'backup_' . $i, |
|
202 | - 'value' => '', |
|
203 | - 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input-backup' |
|
204 | - )); |
|
205 | - $content .= '</noscript></div>'; |
|
195 | + $content .= '</div>'; |
|
196 | + $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '"></div>'; |
|
197 | + $content .= '<div class="mission-emphasis-extra col-sm-6" id="selection_' . $i . '_element"></div>'; |
|
198 | + // Backup dropdown for when Javascript is disabled. |
|
199 | + $content .= '<noscript>'; |
|
200 | + $content .= elgg_view('input/text', array( |
|
201 | + 'name' => 'backup_' . $i, |
|
202 | + 'value' => '', |
|
203 | + 'id' => 'search-mission-advanced-selection-' . $i . '-dropdown-input-backup' |
|
204 | + )); |
|
205 | + $content .= '</noscript></div>'; |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
209 | 209 | $hidden_input = elgg_view('input/hidden', array( |
210 | - 'name' => 'hidden_return', |
|
211 | - 'value' => $vars['return_to_referer'] |
|
210 | + 'name' => 'hidden_return', |
|
211 | + 'value' => $vars['return_to_referer'] |
|
212 | 212 | )); |
213 | 213 | |
214 | 214 | if($advanced_form){ |
215 | 215 | |
216 | - $clear_link = elgg_view('output/url', array( |
|
216 | + $clear_link = elgg_view('output/url', array( |
|
217 | 217 | 'text' => elgg_echo('missions:clear_search'), |
218 | 218 | 'href' => 'missions/main?clear=true&search='.$advanced_form, |
219 | 219 | 'class' => 'mrgn-lft-sm', |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | elgg_load_js('typeahead'); |
15 | 15 | $advanced_form = elgg_get_sticky_values('advancedfill'); |
16 | 16 | // The arrays are different depending on whether the user is searching for missions or candidates. |
17 | -if($_SESSION['mission_search_switch'] == 'candidate') { |
|
17 | +if ($_SESSION['mission_search_switch'] == 'candidate') { |
|
18 | 18 | $search_fields = array( |
19 | 19 | //'' => 'Choose', |
20 | 20 | '', |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | ); |
28 | 28 | |
29 | 29 | $subtitle = elgg_echo('missions:advanced_find_candidates'); |
30 | - $limit_options = array(10,25,50,100); |
|
30 | + $limit_options = array(10, 25, 50, 100); |
|
31 | 31 | $button_text = elgg_echo('missions:find'); |
32 | 32 | } |
33 | 33 | else { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ); |
50 | 50 | |
51 | 51 | $subtitle = elgg_echo('missions:advanced_search_for_opportunities'); |
52 | - $limit_options = array(9,18,30,60,120); |
|
52 | + $limit_options = array(9, 18, 30, 60, 120); |
|
53 | 53 | $button_text = elgg_echo('missions:search'); |
54 | 54 | } |
55 | 55 | |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | $content .= '<div class="mission-emphasis-extra col-sm-4">' . elgg_echo('missions:value') . '</div></div>'; |
67 | 67 | |
68 | 68 | // Generates the rows of the form according to the settings. |
69 | -if ($advanced_form){ |
|
69 | +if ($advanced_form) { |
|
70 | 70 | |
71 | - for ($s = 0; $s < $number_of_rows; $s ++) { |
|
72 | - if ($advanced_form['selection_'.$s]){ |
|
71 | + for ($s = 0; $s < $number_of_rows; $s++) { |
|
72 | + if ($advanced_form['selection_' . $s]) { |
|
73 | 73 | |
74 | 74 | |
75 | 75 | $content .= '<div class="form-group">'; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
78 | 78 | $content .= elgg_view('input/dropdown', array( |
79 | 79 | 'name' => 'selection_' . $s, |
80 | - 'value' => $advanced_form['selection_'.$s], |
|
80 | + 'value' => $advanced_form['selection_' . $s], |
|
81 | 81 | 'options' => $search_fields, |
82 | 82 | |
83 | 83 | 'onchange' => 'element_switch(this)', |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | |
103 | 103 | |
104 | 104 | $all_values = array( |
105 | - "value_answer" => $advanced_form['selection_'.$s.'_element'], |
|
106 | - "reading" => $advanced_form['selection_'.$s.'_element_lwc'], |
|
107 | - "writing" => $advanced_form['selection_'.$s.'_element_lwe'], |
|
108 | - "oral" => $advanced_form['selection_'.$s.'_element_lop'], |
|
109 | - "operand" => $advanced_form['selection_'.$s.'_operand'], |
|
110 | - "day" => $advanced_form['selection_'.$s.'_element_day'] |
|
105 | + "value_answer" => $advanced_form['selection_' . $s . '_element'], |
|
106 | + "reading" => $advanced_form['selection_' . $s . '_element_lwc'], |
|
107 | + "writing" => $advanced_form['selection_' . $s . '_element_lwe'], |
|
108 | + "oral" => $advanced_form['selection_' . $s . '_element_lop'], |
|
109 | + "operand" => $advanced_form['selection_' . $s . '_operand'], |
|
110 | + "day" => $advanced_form['selection_' . $s . '_element_day'] |
|
111 | 111 | ); |
112 | 112 | |
113 | 113 | |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | ?> |
116 | 116 | <script type="text/javascript"> |
117 | 117 | var name = "<?php echo 'selection_' . $s; ?>"; |
118 | -var value = "<?php echo $advanced_form['selection_'.$s]; ?>"; |
|
119 | -var all_values= <?php echo json_encode($all_values ); ?>; |
|
118 | +var value = "<?php echo $advanced_form['selection_' . $s]; ?>"; |
|
119 | +var all_values= <?php echo json_encode($all_values); ?>; |
|
120 | 120 | |
121 | 121 | |
122 | 122 | element_switch2(name, value,all_values); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | </script> |
153 | 153 | <?php |
154 | 154 | |
155 | - }else{ |
|
155 | + } else { |
|
156 | 156 | $content .= '<div class="form-group">'; |
157 | 157 | // Dropdown with a name that is numbered according to its row. |
158 | 158 | $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | $content .= '</noscript></div>'; |
179 | 179 | } |
180 | 180 | } |
181 | -}else{ |
|
182 | - for ($i = 0; $i < $number_of_rows; $i ++) { |
|
181 | +} else { |
|
182 | + for ($i = 0; $i < $number_of_rows; $i++) { |
|
183 | 183 | $content .= '<div class="form-group">'; |
184 | 184 | // Dropdown with a name that is numbered according to its row. |
185 | 185 | $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | 'value' => $vars['return_to_referer'] |
212 | 212 | )); |
213 | 213 | |
214 | -if($advanced_form){ |
|
214 | +if ($advanced_form) { |
|
215 | 215 | |
216 | 216 | $clear_link = elgg_view('output/url', array( |
217 | 217 | 'text' => elgg_echo('missions:clear_search'), |
218 | - 'href' => 'missions/main?clear=true&search='.$advanced_form, |
|
218 | + 'href' => 'missions/main?clear=true&search=' . $advanced_form, |
|
219 | 219 | 'class' => 'mrgn-lft-sm', |
220 | 220 | 'is_action' => true, |
221 | 221 | 'is_trusted' => true, |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | $subtitle = elgg_echo('missions:advanced_find_candidates'); |
30 | 30 | $limit_options = array(10,25,50,100); |
31 | 31 | $button_text = elgg_echo('missions:find'); |
32 | -} |
|
33 | -else { |
|
32 | +} else { |
|
34 | 33 | $search_fields = array( |
35 | 34 | //'' => 'Choose', |
36 | 35 | '', |
@@ -152,7 +151,7 @@ discard block |
||
152 | 151 | </script> |
153 | 152 | <?php |
154 | 153 | |
155 | - }else{ |
|
154 | + } else{ |
|
156 | 155 | $content .= '<div class="form-group">'; |
157 | 156 | // Dropdown with a name that is numbered according to its row. |
158 | 157 | $content .= '<div class="mission-emphasis-extra col-sm-offset-1 col-sm-4">'; |
@@ -178,7 +177,7 @@ discard block |
||
178 | 177 | $content .= '</noscript></div>'; |
179 | 178 | } |
180 | 179 | } |
181 | -}else{ |
|
180 | +} else{ |
|
182 | 181 | for ($i = 0; $i < $number_of_rows; $i ++) { |
183 | 182 | $content .= '<div class="form-group">'; |
184 | 183 | // Dropdown with a name that is numbered according to its row. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $openess = get_input('so'); |
30 | 30 | |
31 | 31 | if (elgg_is_sticky_form('secondfill')) { |
32 | - extract(elgg_get_sticky_values('secondfill')); |
|
32 | + extract(elgg_get_sticky_values('secondfill')); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if($openess == 'on') { |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | $input_title = elgg_view('input/text', array( |
63 | - 'name' => 'job_title', |
|
64 | - 'value' => $job_title, |
|
65 | - 'id' => 'post-mission-title-text-input' |
|
63 | + 'name' => 'job_title', |
|
64 | + 'value' => $job_title, |
|
65 | + 'id' => 'post-mission-title-text-input' |
|
66 | 66 | )); |
67 | 67 | |
68 | 68 | $input_role = elgg_view('input/radio', array( |
@@ -72,15 +72,15 @@ discard block |
||
72 | 72 | 'options' => array( |
73 | 73 | '<span style="font-weight:normal;"> '.elgg_echo('missions:opportunity_role:offering').'</span>' => 'missions:offering', |
74 | 74 | '<span style="font-weight:normal;"> '.elgg_echo('missions:opportunity_role:seeking').'</span>' => 'missions:seeking' |
75 | - ) |
|
75 | + ) |
|
76 | 76 | ) |
77 | 77 | ); |
78 | 78 | |
79 | 79 | $input_type = elgg_view('input/dropdown', array( |
80 | - 'name' => 'job_type', |
|
81 | - 'value' => $job_type, |
|
80 | + 'name' => 'job_type', |
|
81 | + 'value' => $job_type, |
|
82 | 82 | 'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('opportunity_type_string', 'missions')), |
83 | - 'id' => 'post-mission-type-dropdown-input' |
|
83 | + 'id' => 'post-mission-type-dropdown-input' |
|
84 | 84 | )); |
85 | 85 | |
86 | 86 | $sort_areas = mm_echo_explode_setting_string(elgg_get_plugin_setting('program_area_string', 'missions')); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | $other_value = $other_text; |
96 | 96 | } |
97 | 97 | $input_area = elgg_view('input/dropdown', array( |
98 | - 'name' => 'job_area', |
|
99 | - 'value' => $initial_value, |
|
98 | + 'name' => 'job_area', |
|
99 | + 'value' => $initial_value, |
|
100 | 100 | 'options_values' => $sort_areas, |
101 | - 'id' => 'post-mission-area-dropdown-input' |
|
101 | + 'id' => 'post-mission-area-dropdown-input' |
|
102 | 102 | )); |
103 | 103 | $input_other_area = elgg_view('page/elements/other-text-input', array( |
104 | 104 | 'parent_id' => 'post-mission-area-dropdown-input', |
@@ -106,43 +106,43 @@ discard block |
||
106 | 106 | )); |
107 | 107 | |
108 | 108 | $input_number_of = elgg_view('input/dropdown', array( |
109 | - 'name' => 'number', |
|
110 | - 'value' => $number, |
|
111 | - 'options' => $max_array, |
|
112 | - 'id' => 'post-mission-number-dropdown-input' |
|
109 | + 'name' => 'number', |
|
110 | + 'value' => $number, |
|
111 | + 'options' => $max_array, |
|
112 | + 'id' => 'post-mission-number-dropdown-input' |
|
113 | 113 | )); |
114 | 114 | |
115 | 115 | $input_start_date = elgg_view('input/date', array( |
116 | - 'name' => 'start_date', |
|
117 | - 'value' => $start_date, |
|
118 | - 'id' => 'post-mission-start-date-input', |
|
116 | + 'name' => 'start_date', |
|
117 | + 'value' => $start_date, |
|
118 | + 'id' => 'post-mission-start-date-input', |
|
119 | 119 | 'placeholder' => 'yyyy-mm-dd' |
120 | 120 | )); |
121 | 121 | |
122 | 122 | $input_completion_date = elgg_view('input/date', array( |
123 | - 'name' => 'completion_date', |
|
124 | - 'value' => $completion_date, |
|
125 | - 'id' => 'post-mission-completion-date-input', |
|
123 | + 'name' => 'completion_date', |
|
124 | + 'value' => $completion_date, |
|
125 | + 'id' => 'post-mission-completion-date-input', |
|
126 | 126 | 'placeholder' => 'yyyy-mm-dd' |
127 | 127 | )); |
128 | 128 | |
129 | 129 | $input_deadline = elgg_view('input/date', array( |
130 | - 'name' => 'deadline', |
|
131 | - 'value' => $deadline, |
|
132 | - 'id' => 'post-mission-deadline-date-input', |
|
130 | + 'name' => 'deadline', |
|
131 | + 'value' => $deadline, |
|
132 | + 'id' => 'post-mission-deadline-date-input', |
|
133 | 133 | 'placeholder' => 'yyyy-mm-dd' |
134 | 134 | )); |
135 | 135 | |
136 | 136 | $input_description = elgg_view('input/longtext', array( |
137 | - 'name' => 'description', |
|
138 | - 'value' => $description, |
|
139 | - 'id' => 'post-mission-description-plaintext-input' |
|
137 | + 'name' => 'description', |
|
138 | + 'value' => $description, |
|
139 | + 'id' => 'post-mission-description-plaintext-input' |
|
140 | 140 | )); |
141 | 141 | |
142 | 142 | $input_openess = elgg_view('input/checkbox', array( |
143 | - 'name' => 'openess', |
|
144 | - 'checked' => $openess, |
|
145 | - 'id' => 'post-mission-openess-checkbox-input' |
|
143 | + 'name' => 'openess', |
|
144 | + 'checked' => $openess, |
|
145 | + 'id' => 'post-mission-openess-checkbox-input' |
|
146 | 146 | )); |
147 | 147 | |
148 | 148 | if($department_abbr) { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | 'options'=> mm_echo_explode_setting_string(elgg_get_plugin_setting('gl_group_string', 'missions')), |
162 | 162 | 'id'=>'post-mission-gl-group', |
163 | 163 | 'class'=>'', |
164 | - 'disabled'=>true, |
|
164 | + 'disabled'=>true, |
|
165 | 165 | |
166 | 166 | )); |
167 | 167 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $progenitor = get_entity($ancestor_array[0]); |
13 | 13 | |
14 | 14 | $department_abbr = $progenitor->abbr; |
15 | -if(get_current_language() == 'fr') { |
|
15 | +if (get_current_language() == 'fr') { |
|
16 | 16 | $department_abbr = $progenitor->abbr_french; |
17 | 17 | } |
18 | 18 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | extract(elgg_get_sticky_values('secondfill')); |
33 | 33 | } |
34 | 34 | |
35 | -if($openess == 'on') { |
|
35 | +if ($openess == 'on') { |
|
36 | 36 | $openess = true; |
37 | 37 | } |
38 | 38 | else { |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | |
42 | 42 | $max_applicants = elgg_get_plugin_setting('mission_max_applicants', 'missions'); |
43 | 43 | $max_array = array(); |
44 | -for($i=1;$i<=$max_applicants;$i++) { |
|
45 | - $max_array[$i-1] = $i; |
|
44 | +for ($i = 1; $i <= $max_applicants; $i++) { |
|
45 | + $max_array[$i - 1] = $i; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $duplicating_entity = get_entity($_SESSION['mission_duplication_id']); |
49 | -if(get_subtype_from_id($duplicating_entity->subtype) == 'mission' && !$_SESSION['mission_duplicating_override_second']) { |
|
49 | +if (get_subtype_from_id($duplicating_entity->subtype) == 'mission' && !$_SESSION['mission_duplicating_override_second']) { |
|
50 | 50 | $job_title = $duplicating_entity->job_title; |
51 | 51 | $job_type = $duplicating_entity->job_type; |
52 | 52 | $job_area = $duplicating_entity->program_area; |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | 'id' => 'post-mission-role-radio-input', |
71 | 71 | 'value' => $role_type, |
72 | 72 | 'options' => array( |
73 | - '<span style="font-weight:normal;"> '.elgg_echo('missions:opportunity_role:offering').'</span>' => 'missions:offering', |
|
74 | - '<span style="font-weight:normal;"> '.elgg_echo('missions:opportunity_role:seeking').'</span>' => 'missions:seeking' |
|
73 | + '<span style="font-weight:normal;"> ' . elgg_echo('missions:opportunity_role:offering') . '</span>' => 'missions:offering', |
|
74 | + '<span style="font-weight:normal;"> ' . elgg_echo('missions:opportunity_role:seeking') . '</span>' => 'missions:seeking' |
|
75 | 75 | ) |
76 | 76 | ) |
77 | 77 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $sort_areas = mm_echo_explode_setting_string(elgg_get_plugin_setting('program_area_string', 'missions')); |
87 | 87 | asort($sort_areas); |
88 | 88 | $sort_areas['missions:other'] = elgg_echo('missions:other'); |
89 | -if(array_key_exists($job_area, $sort_areas)) { |
|
89 | +if (array_key_exists($job_area, $sort_areas)) { |
|
90 | 90 | $initial_value = $job_area; |
91 | 91 | $other_value = ''; |
92 | 92 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | 'id' => 'post-mission-openess-checkbox-input' |
146 | 146 | )); |
147 | 147 | |
148 | -if($department_abbr) { |
|
148 | +if ($department_abbr) { |
|
149 | 149 | $openess_string = elgg_echo('missions:openess_sentence', array(strtoupper($department_abbr))); |
150 | 150 | } |
151 | 151 | else { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | <h2 class='h4'><?php echo elgg_echo('missions:second_post_form_title'); ?></h2><br> |
171 | 171 | <div class="form-group"> |
172 | 172 | <label for='post-mission-title-text-input' class="col-sm-3 required text-right" aria-required="true"> |
173 | - <?php echo elgg_echo('missions:opportunity_title');?> |
|
173 | + <?php echo elgg_echo('missions:opportunity_title'); ?> |
|
174 | 174 | <strong class="required" aria-required="true"> |
175 | 175 | <?php echo elgg_echo('missions:required'); ?> |
176 | 176 | </strong> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | </div> |
183 | 183 | <div class="form-group"> |
184 | 184 | <label for='post-mission-role-radio-input' class="col-sm-3 required text-right" aria-required="true"> |
185 | - <?php echo elgg_echo('missions:opportunity_role') . ':';?> |
|
185 | + <?php echo elgg_echo('missions:opportunity_role') . ':'; ?> |
|
186 | 186 | <strong class="required" aria-required="true"> |
187 | 187 | <?php echo elgg_echo('missions:required'); ?> |
188 | 188 | </strong> |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | </div> |
194 | 194 | <div class="form-group"> |
195 | 195 | <label for='post-mission-type-dropdown-input' class="col-sm-3 text-right"> |
196 | - <?php echo elgg_echo('missions:opportunity_type') . ':';?> |
|
196 | + <?php echo elgg_echo('missions:opportunity_type') . ':'; ?> |
|
197 | 197 | </label> |
198 | 198 | <div class="col-sm-3"> |
199 | 199 | <?php echo $input_type; ?> |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | </div> |
203 | 203 | <div class="form-group"> |
204 | 204 | <label for='post-mission-area-dropdown-input' class="col-sm-3 text-right"> |
205 | - <?php echo elgg_echo('missions:program_area') . ':';?> |
|
205 | + <?php echo elgg_echo('missions:program_area') . ':'; ?> |
|
206 | 206 | </label> |
207 | 207 | <div class="col-sm-3"> |
208 | 208 | <?php echo $input_area; ?> |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | <div class="form-group"> |
214 | 214 | <label for='post-mission-gl-group' class="col-sm-3 text-right"> |
215 | - <?php echo elgg_echo('missions:groupandlevel') . ':';?> |
|
215 | + <?php echo elgg_echo('missions:groupandlevel') . ':'; ?> |
|
216 | 216 | </label> |
217 | 217 | <div class="col-sm-3"> |
218 | 218 | <div class="col-sm-6"> |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | <div class="form-group"> |
252 | 252 | <label for='post-mission-number-dropdown-input' class="col-sm-3 text-right"> |
253 | - <?php echo elgg_echo('missions:opportunity_number') . ': ';?> |
|
253 | + <?php echo elgg_echo('missions:opportunity_number') . ': '; ?> |
|
254 | 254 | </label> |
255 | 255 | <div class="col-sm-1"> |
256 | 256 | <?php echo $input_number_of; ?> |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | </div> |
259 | 259 | <div class="form-group"> |
260 | 260 | <label for='post-mission-start-date-input' class="col-sm-3 required text-right" aria-required="true"> |
261 | - <?php echo elgg_echo('missions:ideal_start_date');?> |
|
261 | + <?php echo elgg_echo('missions:ideal_start_date'); ?> |
|
262 | 262 | <strong class="required" aria-required="true"> |
263 | 263 | <?php echo elgg_echo('missions:required'); ?> |
264 | 264 | </strong> |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | </div> |
272 | 272 | <div class="form-group"> |
273 | 273 | <label for='post-mission-completion-date-input' class="col-sm-3 text-right"> |
274 | - <?php echo elgg_echo('missions:ideal_completion_date') . ':';?> |
|
274 | + <?php echo elgg_echo('missions:ideal_completion_date') . ':'; ?> |
|
275 | 275 | </label> |
276 | 276 | <div class="col-sm-3"> |
277 | 277 | <?php echo $input_completion_date; ?> |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | </div> |
281 | 281 | <div class="form-group"> |
282 | 282 | <label for='post-mission-deadline-date-input' class="col-sm-3 required text-right" aria-required="true"> |
283 | - <?php echo elgg_echo('missions:deadline');?> |
|
283 | + <?php echo elgg_echo('missions:deadline'); ?> |
|
284 | 284 | <strong class="required" aria-required="true"> |
285 | 285 | <?php echo elgg_echo('missions:required'); ?> |
286 | 286 | </strong> |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | </div> |
294 | 294 | <div class="form-group"> |
295 | 295 | <label for='post-mission-description-plaintext-input' class="col-sm-3 text-right"> |
296 | - <?php echo elgg_echo('missions:opportunity_description') . ':';?> |
|
296 | + <?php echo elgg_echo('missions:opportunity_description') . ':'; ?> |
|
297 | 297 | </label> |
298 | 298 | <div class="col-sm-7"> |
299 | 299 | <?php echo $input_description; ?> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | </div> |
302 | 302 | <div class="form-group"> |
303 | 303 | <label for='post-mission-openess-checkbox-input' class="col-sm-3 text-right"> |
304 | - <?php echo $openess_string;?> |
|
304 | + <?php echo $openess_string; ?> |
|
305 | 305 | </label> |
306 | 306 | <div class="col-sm-7"> |
307 | 307 | <?php echo $input_openess; ?> |
@@ -34,8 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | if($openess == 'on') { |
36 | 36 | $openess = true; |
37 | -} |
|
38 | -else { |
|
37 | +} else { |
|
39 | 38 | $openess = false; |
40 | 39 | } |
41 | 40 | |
@@ -89,8 +88,7 @@ discard block |
||
89 | 88 | if(array_key_exists($job_area, $sort_areas)) { |
90 | 89 | $initial_value = $job_area; |
91 | 90 | $other_value = ''; |
92 | -} |
|
93 | -else { |
|
91 | +} else { |
|
94 | 92 | $initial_value = 'missions:other'; |
95 | 93 | $other_value = $other_text; |
96 | 94 | } |
@@ -147,8 +145,7 @@ discard block |
||
147 | 145 | |
148 | 146 | if($department_abbr) { |
149 | 147 | $openess_string = elgg_echo('missions:openess_sentence', array(strtoupper($department_abbr))); |
150 | -} |
|
151 | -else { |
|
148 | +} else { |
|
152 | 149 | $openess_string = elgg_echo('missions:openess_sentence_generic'); |
153 | 150 | } |
154 | 151 |
@@ -12,30 +12,30 @@ discard block |
||
12 | 12 | */ |
13 | 13 | function mm_pack_language($lwc, $lwe, $lop, $lang) |
14 | 14 | { |
15 | - $returner = ''; |
|
16 | - |
|
17 | - $value = strtolower($lang); |
|
18 | - $returner .= $value; |
|
19 | - |
|
20 | - if (! empty($lwc) || $lwc == '-') { |
|
21 | - $returner .= $lwc; |
|
22 | - } else { |
|
23 | - $returner .= '-'; |
|
24 | - } |
|
25 | - |
|
26 | - if (! empty($lwe) || $lwe == '-') { |
|
27 | - $returner .= $lwe; |
|
28 | - } else { |
|
29 | - $returner .= '-'; |
|
30 | - } |
|
31 | - |
|
32 | - if (! empty($lop) || $lop == '-') { |
|
33 | - $returner .= $lop; |
|
34 | - } else { |
|
35 | - $returner .= '-'; |
|
36 | - } |
|
37 | - |
|
38 | - return $returner; |
|
15 | + $returner = ''; |
|
16 | + |
|
17 | + $value = strtolower($lang); |
|
18 | + $returner .= $value; |
|
19 | + |
|
20 | + if (! empty($lwc) || $lwc == '-') { |
|
21 | + $returner .= $lwc; |
|
22 | + } else { |
|
23 | + $returner .= '-'; |
|
24 | + } |
|
25 | + |
|
26 | + if (! empty($lwe) || $lwe == '-') { |
|
27 | + $returner .= $lwe; |
|
28 | + } else { |
|
29 | + $returner .= '-'; |
|
30 | + } |
|
31 | + |
|
32 | + if (! empty($lop) || $lop == '-') { |
|
33 | + $returner .= $lop; |
|
34 | + } else { |
|
35 | + $returner .= '-'; |
|
36 | + } |
|
37 | + |
|
38 | + return $returner; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /* |
@@ -43,29 +43,29 @@ discard block |
||
43 | 43 | */ |
44 | 44 | function mm_unpack_language($data_string, $lang) |
45 | 45 | { |
46 | - $returner = array(); |
|
46 | + $returner = array(); |
|
47 | 47 | |
48 | - $value = strtolower($lang); |
|
49 | - $index = stripos($data_string, $value) + strlen($value); |
|
48 | + $value = strtolower($lang); |
|
49 | + $index = stripos($data_string, $value) + strlen($value); |
|
50 | 50 | |
51 | - $returner['lwc_' . $value] = substr($data_string, $index, 1); |
|
52 | - if ($returner['lwc_' . $value] == '-') { |
|
53 | - $returner['lwc_' . $value] = ''; |
|
54 | - } |
|
55 | - $index ++; |
|
51 | + $returner['lwc_' . $value] = substr($data_string, $index, 1); |
|
52 | + if ($returner['lwc_' . $value] == '-') { |
|
53 | + $returner['lwc_' . $value] = ''; |
|
54 | + } |
|
55 | + $index ++; |
|
56 | 56 | |
57 | - $returner['lwe_' . $value] = substr($data_string, $index, 1); |
|
58 | - if ($returner['lwe_' . $value] == '-') { |
|
59 | - $returner['lwe_' . $value] = ''; |
|
60 | - } |
|
61 | - $index ++; |
|
57 | + $returner['lwe_' . $value] = substr($data_string, $index, 1); |
|
58 | + if ($returner['lwe_' . $value] == '-') { |
|
59 | + $returner['lwe_' . $value] = ''; |
|
60 | + } |
|
61 | + $index ++; |
|
62 | 62 | |
63 | - $returner['lop_' . $value] = substr($data_string, $index, 1); |
|
64 | - if ($returner['lop_' . $value] == '-') { |
|
65 | - $returner['lop_' . $value] = ''; |
|
66 | - } |
|
63 | + $returner['lop_' . $value] = substr($data_string, $index, 1); |
|
64 | + if ($returner['lop_' . $value] == '-') { |
|
65 | + $returner['lop_' . $value] = ''; |
|
66 | + } |
|
67 | 67 | |
68 | - return $returner; |
|
68 | + return $returner; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /* |
@@ -73,23 +73,23 @@ discard block |
||
73 | 73 | */ |
74 | 74 | function mm_pack_time($hour, $min, $day) |
75 | 75 | { |
76 | - $returner = ''; |
|
76 | + $returner = ''; |
|
77 | 77 | |
78 | - $value = strtolower($day); |
|
79 | - $returner .= $day; |
|
78 | + $value = strtolower($day); |
|
79 | + $returner .= $day; |
|
80 | 80 | |
81 | - if (! empty($hour)) { |
|
82 | - if($min == '') { |
|
83 | - $min = '00'; |
|
84 | - } |
|
85 | - $returner .= $hour . $min; |
|
86 | - } |
|
81 | + if (! empty($hour)) { |
|
82 | + if($min == '') { |
|
83 | + $min = '00'; |
|
84 | + } |
|
85 | + $returner .= $hour . $min; |
|
86 | + } |
|
87 | 87 | |
88 | - if (empty($hour) && (strpos($day, 'duration') !== false)) { |
|
89 | - $returner .= '0' . $min; |
|
90 | - } |
|
88 | + if (empty($hour) && (strpos($day, 'duration') !== false)) { |
|
89 | + $returner .= '0' . $min; |
|
90 | + } |
|
91 | 91 | |
92 | - return $returner; |
|
92 | + return $returner; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /* |
@@ -97,22 +97,22 @@ discard block |
||
97 | 97 | */ |
98 | 98 | function mm_unpack_time($data_string, $day) |
99 | 99 | { |
100 | - $returner = array(); |
|
100 | + $returner = array(); |
|
101 | 101 | |
102 | - $value = strtolower($day); |
|
103 | - $index = stripos($data_string, $value) + strlen($value); |
|
102 | + $value = strtolower($day); |
|
103 | + $index = stripos($data_string, $value) + strlen($value); |
|
104 | 104 | |
105 | - $dividing_time = 2; |
|
106 | - if (strpos($data_string, 'duration') !== false) { |
|
107 | - $dividing_time = 1; |
|
108 | - } |
|
105 | + $dividing_time = 2; |
|
106 | + if (strpos($data_string, 'duration') !== false) { |
|
107 | + $dividing_time = 1; |
|
108 | + } |
|
109 | 109 | |
110 | - if (! empty($data_string)) { |
|
111 | - $returner[$day . '_hour'] = substr($data_string, $index, $dividing_time); |
|
112 | - $returner[$day . '_min'] = substr($data_string, $index + $dividing_time, 2); |
|
113 | - } |
|
110 | + if (! empty($data_string)) { |
|
111 | + $returner[$day . '_hour'] = substr($data_string, $index, $dividing_time); |
|
112 | + $returner[$day . '_min'] = substr($data_string, $index + $dividing_time, 2); |
|
113 | + } |
|
114 | 114 | |
115 | - return $returner; |
|
115 | + return $returner; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /* |
@@ -120,26 +120,26 @@ discard block |
||
120 | 120 | */ |
121 | 121 | function mm_unpack_mission($entity) |
122 | 122 | { |
123 | - $returner = array(); |
|
124 | - |
|
125 | - $returner = array_merge($returner, mm_unpack_language($entity->english, 'english')); |
|
126 | - $returner = array_merge($returner, mm_unpack_language($entity->french, 'french')); |
|
127 | - $returner = array_merge($returner, mm_unpack_time($entity->mon_start, 'mon_start')); |
|
128 | - $returner = array_merge($returner, mm_unpack_time($entity->mon_duration, 'mon_duration')); |
|
129 | - $returner = array_merge($returner, mm_unpack_time($entity->tue_start, 'tue_start')); |
|
130 | - $returner = array_merge($returner, mm_unpack_time($entity->tue_duration, 'tue_duration')); |
|
131 | - $returner = array_merge($returner, mm_unpack_time($entity->wed_start, 'wed_start')); |
|
132 | - $returner = array_merge($returner, mm_unpack_time($entity->wed_duration, 'wed_duration')); |
|
133 | - $returner = array_merge($returner, mm_unpack_time($entity->thu_start, 'thu_start')); |
|
134 | - $returner = array_merge($returner, mm_unpack_time($entity->thu_duration, 'thu_duration')); |
|
135 | - $returner = array_merge($returner, mm_unpack_time($entity->fri_start, 'fri_start')); |
|
136 | - $returner = array_merge($returner, mm_unpack_time($entity->fri_duration, 'fri_duration')); |
|
137 | - $returner = array_merge($returner, mm_unpack_time($entity->sat_start, 'sat_start')); |
|
138 | - $returner = array_merge($returner, mm_unpack_time($entity->sat_duration, 'sat_duration')); |
|
139 | - $returner = array_merge($returner, mm_unpack_time($entity->sun_start, 'sun_start')); |
|
140 | - $returner = array_merge($returner, mm_unpack_time($entity->sun_duration, 'sun_duration')); |
|
141 | - |
|
142 | - return $returner; |
|
123 | + $returner = array(); |
|
124 | + |
|
125 | + $returner = array_merge($returner, mm_unpack_language($entity->english, 'english')); |
|
126 | + $returner = array_merge($returner, mm_unpack_language($entity->french, 'french')); |
|
127 | + $returner = array_merge($returner, mm_unpack_time($entity->mon_start, 'mon_start')); |
|
128 | + $returner = array_merge($returner, mm_unpack_time($entity->mon_duration, 'mon_duration')); |
|
129 | + $returner = array_merge($returner, mm_unpack_time($entity->tue_start, 'tue_start')); |
|
130 | + $returner = array_merge($returner, mm_unpack_time($entity->tue_duration, 'tue_duration')); |
|
131 | + $returner = array_merge($returner, mm_unpack_time($entity->wed_start, 'wed_start')); |
|
132 | + $returner = array_merge($returner, mm_unpack_time($entity->wed_duration, 'wed_duration')); |
|
133 | + $returner = array_merge($returner, mm_unpack_time($entity->thu_start, 'thu_start')); |
|
134 | + $returner = array_merge($returner, mm_unpack_time($entity->thu_duration, 'thu_duration')); |
|
135 | + $returner = array_merge($returner, mm_unpack_time($entity->fri_start, 'fri_start')); |
|
136 | + $returner = array_merge($returner, mm_unpack_time($entity->fri_duration, 'fri_duration')); |
|
137 | + $returner = array_merge($returner, mm_unpack_time($entity->sat_start, 'sat_start')); |
|
138 | + $returner = array_merge($returner, mm_unpack_time($entity->sat_duration, 'sat_duration')); |
|
139 | + $returner = array_merge($returner, mm_unpack_time($entity->sun_start, 'sun_start')); |
|
140 | + $returner = array_merge($returner, mm_unpack_time($entity->sun_duration, 'sun_duration')); |
|
141 | + |
|
142 | + return $returner; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /* |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // Handles the case where an edit button is needed. |
165 | 165 | // This overwrites the read more button. |
166 | - //Nick - letting site admins have access to edit/ deactivate missions |
|
166 | + //Nick - letting site admins have access to edit/ deactivate missions |
|
167 | 167 | if(($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in()) |
168 | 168 | && $mission->state != 'completed' && $mission->state != 'cancelled') { |
169 | 169 | $button_one = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $button_three = '<div id="complete-button-mission-' . $mission->guid . '" name="complete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
206 | 206 | 'href' => elgg_get_site_url() . 'action/missions/complete-mission?mission_guid=' . $mission->guid, |
207 | 207 | 'text' => elgg_echo('missions:complete').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
208 | - 'is_action' => true, |
|
208 | + 'is_action' => true, |
|
209 | 209 | 'class' => 'elgg-button btn btn-success', |
210 | 210 | 'confirm' => elgg_echo('missions:confirm:complete_mission'), |
211 | 211 | 'style' => 'margin:2px;' |
@@ -281,23 +281,23 @@ discard block |
||
281 | 281 | )) . '</div>'; |
282 | 282 | } |
283 | 283 | |
284 | - //Nick - Adding the option for admins to delete and edit archived missions |
|
285 | - if(elgg_is_admin_logged_in()){ |
|
286 | - $returner['edit_button'] = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
284 | + //Nick - Adding the option for admins to delete and edit archived missions |
|
285 | + if(elgg_is_admin_logged_in()){ |
|
286 | + $returner['edit_button'] = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
287 | 287 | 'href' => elgg_get_site_url() . 'missions/mission-edit/' . $mission->guid, |
288 | 288 | 'text' => elgg_echo('missions:edit').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
289 | 289 | 'class' => 'elgg-button btn btn-primary', |
290 | 290 | 'style' => 'margin:2px;' |
291 | 291 | )) . '</div>'; |
292 | 292 | |
293 | - $button_four = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
294 | - 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
|
295 | - 'text' => elgg_echo('missions:delete').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
296 | - 'is_action' => true, |
|
297 | - 'class' => 'elgg-button btn btn-danger', |
|
298 | - 'style' => 'margin:2px;' |
|
299 | - )) . '</div>'; |
|
300 | - } |
|
293 | + $button_four = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
294 | + 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
|
295 | + 'text' => elgg_echo('missions:delete').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
296 | + 'is_action' => true, |
|
297 | + 'class' => 'elgg-button btn btn-danger', |
|
298 | + 'style' => 'margin:2px;' |
|
299 | + )) . '</div>'; |
|
300 | + } |
|
301 | 301 | |
302 | 302 | } |
303 | 303 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $returner['complete_button'] = '<div id="complete-button-mission-' . $mission->guid . '" name="complete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
345 | 345 | 'href' => elgg_get_site_url() . 'action/missions/complete-mission?mission_guid=' . $mission->guid, |
346 | 346 | 'text' => elgg_echo('missions:complete'), |
347 | - 'is_action' => true, |
|
347 | + 'is_action' => true, |
|
348 | 348 | 'class' => 'elgg-button btn btn-success', |
349 | 349 | 'disabled' => $disabled, |
350 | 350 | 'confirm' => elgg_echo('missions:confirm:complete_mission'), |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | )) . '</div>'; |
362 | 362 | |
363 | 363 | |
364 | - $returner['edit_button'] = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
364 | + $returner['edit_button'] = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
365 | 365 | 'href' => elgg_get_site_url() . 'missions/mission-edit/' . $mission->guid, |
366 | 366 | 'text' => elgg_echo('missions:edit'), |
367 | 367 | 'class' => 'elgg-button btn btn-primary', |
@@ -379,18 +379,18 @@ discard block |
||
379 | 379 | 'style' => 'margin:2px;' |
380 | 380 | )) . '</div>'; |
381 | 381 | } |
382 | - //Nick - adding the ability for site admins to delete missions from the edit page |
|
383 | - //They don't want deleting to be an option for users for the sake of analytics |
|
384 | - //Only admins can delete missions if need be (ex inapropriate content) |
|
385 | - if(elgg_is_admin_logged_in()){ |
|
386 | - $returner['delete_button'] = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
387 | - 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
|
388 | - 'text' => elgg_echo('missions:delete'), |
|
389 | - 'is_action' => true, |
|
390 | - 'class' => 'elgg-button btn btn-danger', |
|
391 | - 'style' => 'margin:2px;' |
|
392 | - )) . '</div>'; |
|
393 | - } |
|
382 | + //Nick - adding the ability for site admins to delete missions from the edit page |
|
383 | + //They don't want deleting to be an option for users for the sake of analytics |
|
384 | + //Only admins can delete missions if need be (ex inapropriate content) |
|
385 | + if(elgg_is_admin_logged_in()){ |
|
386 | + $returner['delete_button'] = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
387 | + 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
|
388 | + 'text' => elgg_echo('missions:delete'), |
|
389 | + 'is_action' => true, |
|
390 | + 'class' => 'elgg-button btn btn-danger', |
|
391 | + 'style' => 'margin:2px;' |
|
392 | + )) . '</div>'; |
|
393 | + } |
|
394 | 394 | |
395 | 395 | return $returner; |
396 | 396 | } |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | else { |
448 | 448 | $recipient_set = get_user_by_email($recipient_entity->email); |
449 | 449 | foreach($recipient_set as $recipient_temp) { |
450 | - messages_send($subject, $body, $recipient_temp->guid, $sender, 0, false); |
|
450 | + messages_send($subject, $body, $recipient_temp->guid, $sender, 0, false); |
|
451 | 451 | } |
452 | 452 | } |
453 | 453 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | else { |
459 | 459 | $sender_set = get_user_by_email($sender_entity->email); |
460 | 460 | $sender_latest = array_pop($sender_set)->guid; |
461 | - messages_send($subject, $body, $recipient, $sender_latest, 0, false); |
|
461 | + messages_send($subject, $body, $recipient, $sender_latest, 0, false); |
|
462 | 462 | } |
463 | 463 | } |
464 | 464 | else { |
@@ -632,23 +632,23 @@ discard block |
||
632 | 632 | } |
633 | 633 | |
634 | 634 | if ($role_type != '') { // apply filtering if some types are passed for filtering |
635 | - $entity_set1 = array(); |
|
636 | - foreach ($entity_set as $type) { |
|
637 | - if (in_array($type->role_type, $role_type)) { |
|
638 | - $entity_set1[] = $type; |
|
639 | - } |
|
640 | - } |
|
641 | - } else { // if nothing is selected for filtering, do not filter |
|
642 | - $entity_set1 = $entity_set; |
|
643 | - } |
|
635 | + $entity_set1 = array(); |
|
636 | + foreach ($entity_set as $type) { |
|
637 | + if (in_array($type->role_type, $role_type)) { |
|
638 | + $entity_set1[] = $type; |
|
639 | + } |
|
640 | + } |
|
641 | + } else { // if nothing is selected for filtering, do not filter |
|
642 | + $entity_set1 = $entity_set; |
|
643 | + } |
|
644 | 644 | |
645 | 645 | if ($opp_type != '') { // apply filtering if some types are passed for filtering |
646 | - $entity_set2 = array(); |
|
647 | - foreach ($entity_set1 as $type) { |
|
648 | - if (in_array($type->job_type, $opp_type)) { |
|
649 | - $entity_set2[] = $type; |
|
650 | - } |
|
651 | - } |
|
646 | + $entity_set2 = array(); |
|
647 | + foreach ($entity_set1 as $type) { |
|
648 | + if (in_array($type->job_type, $opp_type)) { |
|
649 | + $entity_set2[] = $type; |
|
650 | + } |
|
651 | + } |
|
652 | 652 | } else { // if nothing is selected for filtering, do not filter |
653 | 653 | $entity_set2 = $entity_set1; |
654 | 654 | } |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | * Check if the user is opted in to any of the opt-in options. |
725 | 725 | */ |
726 | 726 | function check_if_opted_in($current_user) { |
727 | - //Nick - adding additional checks for other opportunity types |
|
727 | + //Nick - adding additional checks for other opportunity types |
|
728 | 728 | if($current_user->opt_in_missions == 'gcconnex_profile:opt:yes') { |
729 | 729 | return true; |
730 | 730 | } |
@@ -743,35 +743,35 @@ discard block |
||
743 | 743 | if($current_user->opt_in_shadowing == 'gcconnex_profile:opt:yes') { |
744 | 744 | return true; |
745 | 745 | } |
746 | - if($current_user->opt_in_jobshare == 'gcconnex_profile:opt:yes') { |
|
746 | + if($current_user->opt_in_jobshare == 'gcconnex_profile:opt:yes') { |
|
747 | 747 | return true; |
748 | 748 | } |
749 | - if($current_user->opt_in_pcSeek == 'gcconnex_profile:opt:yes') { |
|
749 | + if($current_user->opt_in_pcSeek == 'gcconnex_profile:opt:yes') { |
|
750 | 750 | return true; |
751 | 751 | } |
752 | - if($current_user->opt_in_pcCreate == 'gcconnex_profile:opt:yes') { |
|
752 | + if($current_user->opt_in_pcCreate == 'gcconnex_profile:opt:yes') { |
|
753 | 753 | return true; |
754 | 754 | } |
755 | - if($current_user->opt_in_rotation== 'gcconnex_profile:opt:yes') { |
|
755 | + if($current_user->opt_in_rotation== 'gcconnex_profile:opt:yes') { |
|
756 | 756 | return true; |
757 | 757 | } |
758 | 758 | |
759 | - if($current_user->opt_in_ssSeek == 'gcconnex_profile:opt:yes') { |
|
759 | + if($current_user->opt_in_ssSeek == 'gcconnex_profile:opt:yes') { |
|
760 | 760 | return true; |
761 | 761 | } |
762 | - if($current_user->opt_in_ssCreate == 'gcconnex_profile:opt:yes') { |
|
762 | + if($current_user->opt_in_ssCreate == 'gcconnex_profile:opt:yes') { |
|
763 | 763 | return true; |
764 | 764 | } |
765 | - if($current_user->opt_in_assignSeek == 'gcconnex_profile:opt:yes') { |
|
765 | + if($current_user->opt_in_assignSeek == 'gcconnex_profile:opt:yes') { |
|
766 | 766 | return true; |
767 | 767 | } |
768 | - if($current_user->opt_in_assignCreate == 'gcconnex_profile:opt:yes') { |
|
768 | + if($current_user->opt_in_assignCreate == 'gcconnex_profile:opt:yes') { |
|
769 | 769 | return true; |
770 | 770 | } |
771 | - if($current_user->opt_in_deploySeek == 'gcconnex_profile:opt:yes') { |
|
771 | + if($current_user->opt_in_deploySeek == 'gcconnex_profile:opt:yes') { |
|
772 | 772 | return true; |
773 | 773 | } |
774 | - if($current_user->opt_in_deployCreate == 'gcconnex_profile:opt:yes') { |
|
774 | + if($current_user->opt_in_deployCreate == 'gcconnex_profile:opt:yes') { |
|
775 | 775 | return true; |
776 | 776 | } |
777 | 777 |
@@ -17,19 +17,19 @@ discard block |
||
17 | 17 | $value = strtolower($lang); |
18 | 18 | $returner .= $value; |
19 | 19 | |
20 | - if (! empty($lwc) || $lwc == '-') { |
|
20 | + if (!empty($lwc) || $lwc == '-') { |
|
21 | 21 | $returner .= $lwc; |
22 | 22 | } else { |
23 | 23 | $returner .= '-'; |
24 | 24 | } |
25 | 25 | |
26 | - if (! empty($lwe) || $lwe == '-') { |
|
26 | + if (!empty($lwe) || $lwe == '-') { |
|
27 | 27 | $returner .= $lwe; |
28 | 28 | } else { |
29 | 29 | $returner .= '-'; |
30 | 30 | } |
31 | 31 | |
32 | - if (! empty($lop) || $lop == '-') { |
|
32 | + if (!empty($lop) || $lop == '-') { |
|
33 | 33 | $returner .= $lop; |
34 | 34 | } else { |
35 | 35 | $returner .= '-'; |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | if ($returner['lwc_' . $value] == '-') { |
53 | 53 | $returner['lwc_' . $value] = ''; |
54 | 54 | } |
55 | - $index ++; |
|
55 | + $index++; |
|
56 | 56 | |
57 | 57 | $returner['lwe_' . $value] = substr($data_string, $index, 1); |
58 | 58 | if ($returner['lwe_' . $value] == '-') { |
59 | 59 | $returner['lwe_' . $value] = ''; |
60 | 60 | } |
61 | - $index ++; |
|
61 | + $index++; |
|
62 | 62 | |
63 | 63 | $returner['lop_' . $value] = substr($data_string, $index, 1); |
64 | 64 | if ($returner['lop_' . $value] == '-') { |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $value = strtolower($day); |
79 | 79 | $returner .= $day; |
80 | 80 | |
81 | - if (! empty($hour)) { |
|
82 | - if($min == '') { |
|
81 | + if (!empty($hour)) { |
|
82 | + if ($min == '') { |
|
83 | 83 | $min = '00'; |
84 | 84 | } |
85 | 85 | $returner .= $hour . $min; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $dividing_time = 1; |
108 | 108 | } |
109 | 109 | |
110 | - if (! empty($data_string)) { |
|
110 | + if (!empty($data_string)) { |
|
111 | 111 | $returner[$day . '_hour'] = substr($data_string, $index, $dividing_time); |
112 | 112 | $returner[$day . '_min'] = substr($data_string, $index + $dividing_time, 2); |
113 | 113 | } |
@@ -145,18 +145,18 @@ discard block |
||
145 | 145 | /* |
146 | 146 | * Creates the base button set found in both greater and lesser views of the mission. |
147 | 147 | */ |
148 | -function mm_create_button_set_base($mission, $full_view=false) { |
|
148 | +function mm_create_button_set_base($mission, $full_view = false) { |
|
149 | 149 | $returner = array(); |
150 | 150 | $button_one = null; |
151 | 151 | $button_two = null; |
152 | 152 | $button_three = null; |
153 | 153 | $button_four = null; |
154 | 154 | |
155 | - if(!$full_view) { |
|
155 | + if (!$full_view) { |
|
156 | 156 | // Handles the case where a read more button is needed. |
157 | 157 | $button_zero = '<div id="read-more-button-mission-' . $mission->guid . '" name="read-more-button" style="display:inline-block;">' . elgg_view('output/url', array( |
158 | 158 | 'href' => $mission->getURL(), |
159 | - 'text' => elgg_echo('missions:view').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
159 | + 'text' => elgg_echo('missions:view') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
160 | 160 | 'class' => 'elgg-button btn btn-default', |
161 | 161 | 'style' => 'margin:2px;' |
162 | 162 | )) . '</div>'; |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | // Handles the case where an edit button is needed. |
165 | 165 | // This overwrites the read more button. |
166 | 166 | //Nick - letting site admins have access to edit/ deactivate missions |
167 | - if(($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in()) |
|
167 | + if (($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in()) |
|
168 | 168 | && $mission->state != 'completed' && $mission->state != 'cancelled') { |
169 | 169 | $button_one = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
170 | 170 | 'href' => elgg_get_site_url() . 'missions/mission-edit/' . $mission->guid, |
171 | - 'text' => elgg_echo('missions:edit').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
171 | + 'text' => elgg_echo('missions:edit') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
172 | 172 | 'class' => 'elgg-button btn btn-primary', |
173 | 173 | 'style' => 'margin:2px;' |
174 | 174 | )) . '</div>'; |
@@ -179,32 +179,32 @@ discard block |
||
179 | 179 | // Creates the share button which is always present. |
180 | 180 | $button_two = '<div id="share-button-mission-' . $mission->guid . '" name="share-button" style="display:inline-block;">' . elgg_view('output/url', array( |
181 | 181 | 'href' => elgg_get_site_url() . 'missions/message-share/' . $mission->guid, |
182 | - 'text' => elgg_echo('missions:share').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
182 | + 'text' => elgg_echo('missions:share') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
183 | 183 | 'class' => 'elgg-button btn btn-default', |
184 | 184 | 'style' => 'margin:2px;' |
185 | 185 | )) . '</div>'; |
186 | 186 | //} |
187 | 187 | |
188 | 188 | // Logic to handle the third button. |
189 | - if($mission->state != 'completed' && $mission->state != 'cancelled') { |
|
189 | + if ($mission->state != 'completed' && $mission->state != 'cancelled') { |
|
190 | 190 | if ($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid()) { |
191 | 191 | $candidate_total = count(elgg_get_entities_from_relationship(array( |
192 | 192 | 'relationship' => 'mission_accepted', |
193 | 193 | 'relationship_guid' => $mission->guid |
194 | 194 | ))); |
195 | 195 | |
196 | - $button_three ='<div id="invite-button-mission-' . $mission->guid . '" name="invite-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
196 | + $button_three = '<div id="invite-button-mission-' . $mission->guid . '" name="invite-button" style="display:inline-block;">' . elgg_view('output/url', array( |
|
197 | 197 | 'href' => elgg_get_site_url() . 'missions/mission-candidate-search/' . $mission->guid, |
198 | - 'text' => elgg_echo('missions:find').elgg_echo("mission:button:find", array($mission->title)), |
|
198 | + 'text' => elgg_echo('missions:find') . elgg_echo("mission:button:find", array($mission->title)), |
|
199 | 199 | 'class' => 'elgg-button btn btn-success', |
200 | 200 | 'style' => 'margin:2px;' |
201 | 201 | )) . '</div>'; |
202 | 202 | |
203 | 203 | // Handles the case where a complete button is needed. |
204 | - if(!$full_view && $candidate_total == $mission->number) { |
|
204 | + if (!$full_view && $candidate_total == $mission->number) { |
|
205 | 205 | $button_three = '<div id="complete-button-mission-' . $mission->guid . '" name="complete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
206 | 206 | 'href' => elgg_get_site_url() . 'action/missions/complete-mission?mission_guid=' . $mission->guid, |
207 | - 'text' => elgg_echo('missions:complete').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
207 | + 'text' => elgg_echo('missions:complete') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
208 | 208 | 'is_action' => true, |
209 | 209 | 'class' => 'elgg-button btn btn-success', |
210 | 210 | 'confirm' => elgg_echo('missions:confirm:complete_mission'), |
@@ -219,51 +219,51 @@ discard block |
||
219 | 219 | 'count' => true |
220 | 220 | )); |
221 | 221 | |
222 | - if($relationship_count < $mission->number) { |
|
222 | + if ($relationship_count < $mission->number) { |
|
223 | 223 | $user = elgg_get_logged_in_user_entity(); |
224 | - $mmdep = trim( explode('/', $mission->department_path_english)[0] ); |
|
225 | - if ( !$mission->openess || stripos( $user->department, $mmdep ) !== false ) |
|
224 | + $mmdep = trim(explode('/', $mission->department_path_english)[0]); |
|
225 | + if (!$mission->openess || stripos($user->department, $mmdep) !== false) |
|
226 | 226 | $button_three = '<div id="apply-button-mission-' . $mission->guid . '" name="apply-button" style="display:inline-block;">' . $apply_button = elgg_view('output/url', array( |
227 | 227 | 'href' => elgg_get_site_url() . 'missions/mission-application/' . $mission->guid, |
228 | - 'text' => elgg_echo('missions:apply').elgg_echo("mission:button:apply", array($mission->title)), |
|
228 | + 'text' => elgg_echo('missions:apply') . elgg_echo("mission:button:apply", array($mission->title)), |
|
229 | 229 | 'class' => 'elgg-button btn btn-primary', |
230 | 230 | 'style' => 'margin:2px;' |
231 | 231 | )) . '</div>'; |
232 | 232 | } |
233 | 233 | |
234 | - if(check_entity_relationship($mission->guid, 'mission_tentative', elgg_get_logged_in_user_guid())) { |
|
234 | + if (check_entity_relationship($mission->guid, 'mission_tentative', elgg_get_logged_in_user_guid())) { |
|
235 | 235 | $button_three = '<div id="accept-button-mission-' . $mission->guid . '" name="accept-button" style="display:inline-block;">' . elgg_view('output/url', array( |
236 | 236 | 'href' => elgg_get_site_url() . 'action/missions/accept-invite?applicant=' . elgg_get_logged_in_user_guid() . '&mission=' . $mission->guid, |
237 | - 'text' => elgg_echo('missions:accept').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
237 | + 'text' => elgg_echo('missions:accept') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
238 | 238 | 'is_action' => true, |
239 | 239 | 'class' => 'elgg-button btn btn-success', |
240 | 240 | 'style' => 'margin:2px;' |
241 | 241 | )) . '</div>'; |
242 | 242 | $button_four = '<div id="decline-button-mission-' . $mission->guid . '" name="decline-button" style="display:inline-block;">' . elgg_view('output/url', array( |
243 | 243 | 'href' => elgg_get_site_url() . 'missions/reason-to-decline/' . $mission->guid, |
244 | - 'text' => elgg_echo('missions:decline').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
244 | + 'text' => elgg_echo('missions:decline') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
245 | 245 | 'class' => 'elgg-button btn btn-danger', |
246 | 246 | 'style' => 'margin:2px;' |
247 | 247 | )) . '</div>'; |
248 | 248 | $button_two = null; |
249 | 249 | } |
250 | 250 | |
251 | - if(check_entity_relationship($mission->guid, 'mission_offered', elgg_get_logged_in_user_guid())) { |
|
251 | + if (check_entity_relationship($mission->guid, 'mission_offered', elgg_get_logged_in_user_guid())) { |
|
252 | 252 | $button_three = '<div id="final-accept-button-mission-' . $mission->guid . '" name="final-accept-button" style="display:inline-block;">' . mm_finalize_button($mission, elgg_get_logged_in_user_entity()) . '</div>'; |
253 | 253 | $button_four = '<div id="decline-button-mission-' . $mission->guid . '" name="decline-button" style="display:inline-block;">' . elgg_view('output/url', array( |
254 | 254 | 'href' => elgg_get_site_url() . 'missions/reason-to-decline/' . $mission->guid, |
255 | - 'text' => elgg_echo('missions:decline').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
255 | + 'text' => elgg_echo('missions:decline') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
256 | 256 | 'class' => 'elgg-button btn btn-danger', |
257 | 257 | 'style' => 'margin:2px;' |
258 | 258 | )) . '</div>'; |
259 | 259 | $button_two = null; |
260 | 260 | } |
261 | 261 | |
262 | - if(check_entity_relationship($mission->guid, 'mission_accepted', elgg_get_logged_in_user_guid()) || |
|
262 | + if (check_entity_relationship($mission->guid, 'mission_accepted', elgg_get_logged_in_user_guid()) || |
|
263 | 263 | check_entity_relationship($mission->guid, 'mission_applied', elgg_get_logged_in_user_guid())) { |
264 | 264 | $button_three = '<div id="withdraw-button-mission-' . $mission->guid . '" name="withdraw-button" style="display:inline-block;">' . elgg_view('output/url', array( |
265 | 265 | 'href' => elgg_get_site_url() . 'missions/reason-to-decline/' . $mission->guid, |
266 | - 'text' => elgg_echo('missions:withdraw').elgg_echo("mission:button:withdraw", array($mission->title)), |
|
266 | + 'text' => elgg_echo('missions:withdraw') . elgg_echo("mission:button:withdraw", array($mission->title)), |
|
267 | 267 | 'class' => 'elgg-button btn btn-danger', |
268 | 268 | 'style' => 'margin:2px;' |
269 | 269 | )) . '</div>'; |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | } |
272 | 272 | } |
273 | 273 | else { |
274 | - if(check_if_opted_in(elgg_get_logged_in_user_entity())) { |
|
274 | + if (check_if_opted_in(elgg_get_logged_in_user_entity())) { |
|
275 | 275 | $button_three = '<div id="duplicate-button-mission-' . $mission->guid . '" name="duplicate-button" style="display:inline-block;">' . elgg_view('output/url', array( |
276 | 276 | 'href' => elgg_get_site_url() . 'action/missions/duplicate-mission?mid=' . $mission->guid, |
277 | - 'text' => elgg_echo('missions:duplicate').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
277 | + 'text' => elgg_echo('missions:duplicate') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
278 | 278 | 'is_action' => true, |
279 | 279 | 'class' => 'elgg-button btn btn-success', |
280 | 280 | 'style' => 'margin:2px;' |
@@ -282,17 +282,17 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | //Nick - Adding the option for admins to delete and edit archived missions |
285 | - if(elgg_is_admin_logged_in()){ |
|
285 | + if (elgg_is_admin_logged_in()) { |
|
286 | 286 | $returner['edit_button'] = '<div id="edit-button-mission-' . $mission->guid . '" name="edit-button" style="display:inline-block;">' . elgg_view('output/url', array( |
287 | 287 | 'href' => elgg_get_site_url() . 'missions/mission-edit/' . $mission->guid, |
288 | - 'text' => elgg_echo('missions:edit').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
288 | + 'text' => elgg_echo('missions:edit') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
289 | 289 | 'class' => 'elgg-button btn btn-primary', |
290 | 290 | 'style' => 'margin:2px;' |
291 | 291 | )) . '</div>'; |
292 | 292 | |
293 | 293 | $button_four = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
294 | 294 | 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
295 | - 'text' => elgg_echo('missions:delete').elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
295 | + 'text' => elgg_echo('missions:delete') . elgg_echo("mission:button:oppurtunity", array($mission->title)), |
|
296 | 296 | 'is_action' => true, |
297 | 297 | 'class' => 'elgg-button btn btn-danger', |
298 | 298 | 'style' => 'margin:2px;' |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | } |
330 | 330 | |
331 | 331 | // Button to advance the mission state to cancelled from posted. |
332 | - if (($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid() ||elgg_is_admin_logged_in()) |
|
332 | + if (($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in()) |
|
333 | 333 | && $mission->state != 'cancelled' && $mission->state != 'completed') { |
334 | 334 | $candidate_total = count(elgg_get_entities_from_relationship(array( |
335 | 335 | 'relationship' => 'mission_accepted', |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | ))); |
338 | 338 | |
339 | 339 | $disabled = true; |
340 | - if($candidate_total > 0) { |
|
340 | + if ($candidate_total > 0) { |
|
341 | 341 | $disabled = false; |
342 | 342 | } |
343 | 343 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | )) . '</div>'; |
370 | 370 | } |
371 | 371 | |
372 | - if(($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid()) |
|
372 | + if (($mission->owner_guid == elgg_get_logged_in_user_guid() || $mission->account == elgg_get_logged_in_user_guid()) |
|
373 | 373 | && elgg_get_plugin_setting('mission_developer_tools_on', 'missions') == 'YES') { |
374 | 374 | $returner['delete_button'] = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
375 | 375 | 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | //Nick - adding the ability for site admins to delete missions from the edit page |
383 | 383 | //They don't want deleting to be an option for users for the sake of analytics |
384 | 384 | //Only admins can delete missions if need be (ex inapropriate content) |
385 | - if(elgg_is_admin_logged_in()){ |
|
385 | + if (elgg_is_admin_logged_in()) { |
|
386 | 386 | $returner['delete_button'] = '<div id="delete-button-mission-' . $mission->guid . '" name="delete-button" style="display:inline-block;">' . elgg_view('output/url', array( |
387 | 387 | 'href' => elgg_get_site_url() . 'action/missions/delete-mission?mission_guid=' . $mission->guid, |
388 | 388 | 'text' => elgg_echo('missions:delete'), |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | */ |
401 | 401 | function mm_clean_url_segment($segment) { |
402 | 402 | $clean_segment = $segment; |
403 | - if(strpos($segment, '?') === false) { |
|
403 | + if (strpos($segment, '?') === false) { |
|
404 | 404 | |
405 | 405 | } |
406 | 406 | else { |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | $raw_array = explode(',', $string); |
419 | 419 | |
420 | 420 | $echoed_array = array(); |
421 | - for($i=0;$i<count($raw_array);$i++) { |
|
421 | + for ($i = 0; $i < count($raw_array); $i++) { |
|
422 | 422 | $echoed_array[$raw_array[$i]] = elgg_echo($raw_array[$i], array(), $language_override); |
423 | 423 | } |
424 | 424 | |
@@ -440,19 +440,19 @@ discard block |
||
440 | 440 | $headers .= 'From: ' . $sender_entity->email . "\r\n"; |
441 | 441 | mail($recipient_entity->email, $subject, $body, $headers); |
442 | 442 | |
443 | - if(get_subtype_from_id($recipient_entity->subtype) == 'mission') { |
|
444 | - if($recipient_entity->account) { |
|
443 | + if (get_subtype_from_id($recipient_entity->subtype) == 'mission') { |
|
444 | + if ($recipient_entity->account) { |
|
445 | 445 | messages_send($subject, $body, $recipient_entity->account, $sender, 0, false); |
446 | 446 | } |
447 | 447 | else { |
448 | 448 | $recipient_set = get_user_by_email($recipient_entity->email); |
449 | - foreach($recipient_set as $recipient_temp) { |
|
449 | + foreach ($recipient_set as $recipient_temp) { |
|
450 | 450 | messages_send($subject, $body, $recipient_temp->guid, $sender, 0, false); |
451 | 451 | } |
452 | 452 | } |
453 | 453 | } |
454 | - else if(get_subtype_from_id($sender_entity->subtype) == 'mission') { |
|
455 | - if($sender_entity->account) { |
|
454 | + else if (get_subtype_from_id($sender_entity->subtype) == 'mission') { |
|
455 | + if ($sender_entity->account) { |
|
456 | 456 | messages_send($subject, $body, $recipient, $sender_entity->account, 0, false); |
457 | 457 | } |
458 | 458 | else { |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | /* |
470 | 470 | * Compare two entities by their time_updated values. |
471 | 471 | */ |
472 | -function mm_cmp_by_updated($a, $b) { |
|
473 | - if($a->time_updated == $b->time_updated) { |
|
472 | +function mm_cmp_by_updated($a, $b) { |
|
473 | + if ($a->time_updated == $b->time_updated) { |
|
474 | 474 | return 0; |
475 | 475 | } |
476 | 476 | return ($a->time_updated > $b->time_updated) ? -1 : 1; |
@@ -488,9 +488,9 @@ discard block |
||
488 | 488 | )); |
489 | 489 | |
490 | 490 | $count = 0; |
491 | - foreach($entity_list as $entity) { |
|
491 | + foreach ($entity_list as $entity) { |
|
492 | 492 | $invited_already = false; |
493 | - if(check_entity_relationship($entity->guid, 'mission_accepted', $user_guid) || |
|
493 | + if (check_entity_relationship($entity->guid, 'mission_accepted', $user_guid) || |
|
494 | 494 | check_entity_relationship($entity->guid, 'mission_applied', $user_guid) || |
495 | 495 | check_entity_relationship($entity->guid, 'mission_tentative', $user_guid) || |
496 | 496 | check_entity_relationship($entity->guid, 'mission_offered', $user_guid)) { |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | } |
499 | 499 | |
500 | 500 | // Does not display missions which have filled all the available spots. |
501 | - if($number_of_candidates < $entity->number && !$invited_already) { |
|
501 | + if ($number_of_candidates < $entity->number && !$invited_already) { |
|
502 | 502 | $returner[$entity->guid] = elgg_get_excerpt($entity->job_title, 30); |
503 | 503 | $count++; |
504 | 504 | } |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | 'count' => true |
523 | 523 | )); |
524 | 524 | |
525 | - if(check_entity_relationship($mission->guid, 'mission_offered', $applicant->guid)) { |
|
525 | + if (check_entity_relationship($mission->guid, 'mission_offered', $applicant->guid)) { |
|
526 | 526 | return elgg_view('output/url', array( |
527 | 527 | 'href' => '', |
528 | 528 | 'text' => elgg_echo('missions:offered'), |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | )); |
533 | 533 | } |
534 | 534 | else { |
535 | - if($relationship_count >= $mission->number) { |
|
535 | + if ($relationship_count >= $mission->number) { |
|
536 | 536 | // Disabled button for when the mission is full. |
537 | 537 | return elgg_view('output/url', array( |
538 | 538 | 'href' => '', |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | 'count' => true |
566 | 566 | )); |
567 | 567 | |
568 | - if($relationship_count >= $mission->number) { |
|
568 | + if ($relationship_count >= $mission->number) { |
|
569 | 569 | // Disabled button for when the mission is full. |
570 | 570 | return elgg_view('output/url', array( |
571 | 571 | 'href' => '', |
@@ -592,19 +592,19 @@ discard block |
||
592 | 592 | */ |
593 | 593 | function mm_get_translation_key_from_setting_string($input, $setting_string) { |
594 | 594 | $english_array = mm_echo_explode_setting_string($setting_string, 'en'); |
595 | - foreach($english_array as $key => $value) { |
|
595 | + foreach ($english_array as $key => $value) { |
|
596 | 596 | $english_array[$key] = strtolower($value); |
597 | 597 | } |
598 | 598 | $english_key = array_search(strtolower($input), $english_array); |
599 | 599 | |
600 | 600 | $french_array = mm_echo_explode_setting_string($setting_string, 'fr'); |
601 | - foreach($french_array as $key => $value) { |
|
601 | + foreach ($french_array as $key => $value) { |
|
602 | 602 | $french_array[$key] = strtolower($value); |
603 | 603 | } |
604 | 604 | $french_key = array_search(strtolower($input), $french_array); |
605 | 605 | |
606 | - if(strcmp($french_key, $english_key) === 0) { |
|
607 | - if($english_key == '') { |
|
606 | + if (strcmp($french_key, $english_key) === 0) { |
|
607 | + if ($english_key == '') { |
|
608 | 608 | return false; |
609 | 609 | } |
610 | 610 | else { |
@@ -612,11 +612,11 @@ discard block |
||
612 | 612 | } |
613 | 613 | } |
614 | 614 | |
615 | - if($english_key) { |
|
615 | + if ($english_key) { |
|
616 | 616 | return $english_key; |
617 | 617 | } |
618 | 618 | |
619 | - if($french_key) { |
|
619 | + if ($french_key) { |
|
620 | 620 | return $french_key; |
621 | 621 | } |
622 | 622 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | } |
655 | 655 | |
656 | 656 | $comparison = ''; |
657 | - switch($sort) { |
|
657 | + switch ($sort) { |
|
658 | 658 | case 'missions:date_posted': |
659 | 659 | $comparison = 'mm_cmp_mission_by_posted_date'; |
660 | 660 | break; |
@@ -670,11 +670,11 @@ discard block |
||
670 | 670 | } |
671 | 671 | |
672 | 672 | $result = usort($entity_set2, $comparison); |
673 | - if(!$result) { |
|
673 | + if (!$result) { |
|
674 | 674 | return $backup_array; |
675 | 675 | } |
676 | 676 | else { |
677 | - if($order == 'missions:ascending') { |
|
677 | + if ($order == 'missions:ascending') { |
|
678 | 678 | return array_reverse($entity_set2); |
679 | 679 | } |
680 | 680 | return $entity_set2; |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | * Compares missions by job type. |
686 | 686 | */ |
687 | 687 | function mm_cmp_mission_by_type($a, $b) { |
688 | - if(elgg_echo($a->job_type) == elgg_echo($b->job_type)) { |
|
688 | + if (elgg_echo($a->job_type) == elgg_echo($b->job_type)) { |
|
689 | 689 | return 0; |
690 | 690 | } |
691 | 691 | return (elgg_echo($a->job_type) < elgg_echo($b->job_type)) ? 1 : -1; |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | * Compares missions by their creation timestamp. |
696 | 696 | */ |
697 | 697 | function mm_cmp_mission_by_posted_date($a, $b) { |
698 | - if($a->time_created == $b->time_created) { |
|
698 | + if ($a->time_created == $b->time_created) { |
|
699 | 699 | return 0; |
700 | 700 | } |
701 | 701 | return ($a->time_created < $b->time_created) ? 1 : -1; |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | * Compares missions by the closing timestamp. |
705 | 705 | */ |
706 | 706 | function mm_cmp_mission_by_closed_date($a, $b) { |
707 | - if($a->time_closed == $b->time_closed) { |
|
707 | + if ($a->time_closed == $b->time_closed) { |
|
708 | 708 | return 0; |
709 | 709 | } |
710 | 710 | return ($a->time_closed < $b->time_closed) ? 1 : -1; |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | * Compares missions by their deadline date. |
715 | 715 | */ |
716 | 716 | function mm_cmp_mission_by_deadline($a, $b) { |
717 | - if($a->deadline == $b->deadline) { |
|
717 | + if ($a->deadline == $b->deadline) { |
|
718 | 718 | return 0; |
719 | 719 | } |
720 | 720 | return ($a->deadline < $b->deadline) ? 1 : -1; |
@@ -725,53 +725,53 @@ discard block |
||
725 | 725 | */ |
726 | 726 | function check_if_opted_in($current_user) { |
727 | 727 | //Nick - adding additional checks for other opportunity types |
728 | - if($current_user->opt_in_missions == 'gcconnex_profile:opt:yes') { |
|
728 | + if ($current_user->opt_in_missions == 'gcconnex_profile:opt:yes') { |
|
729 | 729 | return true; |
730 | 730 | } |
731 | - if($current_user->opt_in_swap == 'gcconnex_profile:opt:yes') { |
|
731 | + if ($current_user->opt_in_swap == 'gcconnex_profile:opt:yes') { |
|
732 | 732 | return true; |
733 | 733 | } |
734 | - if($current_user->opt_in_mentored == 'gcconnex_profile:opt:yes') { |
|
734 | + if ($current_user->opt_in_mentored == 'gcconnex_profile:opt:yes') { |
|
735 | 735 | return true; |
736 | 736 | } |
737 | - if($current_user->opt_in_mentoring == 'gcconnex_profile:opt:yes') { |
|
737 | + if ($current_user->opt_in_mentoring == 'gcconnex_profile:opt:yes') { |
|
738 | 738 | return true; |
739 | 739 | } |
740 | - if($current_user->opt_in_shadowed == 'gcconnex_profile:opt:yes') { |
|
740 | + if ($current_user->opt_in_shadowed == 'gcconnex_profile:opt:yes') { |
|
741 | 741 | return true; |
742 | 742 | } |
743 | - if($current_user->opt_in_shadowing == 'gcconnex_profile:opt:yes') { |
|
743 | + if ($current_user->opt_in_shadowing == 'gcconnex_profile:opt:yes') { |
|
744 | 744 | return true; |
745 | 745 | } |
746 | - if($current_user->opt_in_jobshare == 'gcconnex_profile:opt:yes') { |
|
746 | + if ($current_user->opt_in_jobshare == 'gcconnex_profile:opt:yes') { |
|
747 | 747 | return true; |
748 | 748 | } |
749 | - if($current_user->opt_in_pcSeek == 'gcconnex_profile:opt:yes') { |
|
749 | + if ($current_user->opt_in_pcSeek == 'gcconnex_profile:opt:yes') { |
|
750 | 750 | return true; |
751 | 751 | } |
752 | - if($current_user->opt_in_pcCreate == 'gcconnex_profile:opt:yes') { |
|
752 | + if ($current_user->opt_in_pcCreate == 'gcconnex_profile:opt:yes') { |
|
753 | 753 | return true; |
754 | 754 | } |
755 | - if($current_user->opt_in_rotation== 'gcconnex_profile:opt:yes') { |
|
755 | + if ($current_user->opt_in_rotation == 'gcconnex_profile:opt:yes') { |
|
756 | 756 | return true; |
757 | 757 | } |
758 | 758 | |
759 | - if($current_user->opt_in_ssSeek == 'gcconnex_profile:opt:yes') { |
|
759 | + if ($current_user->opt_in_ssSeek == 'gcconnex_profile:opt:yes') { |
|
760 | 760 | return true; |
761 | 761 | } |
762 | - if($current_user->opt_in_ssCreate == 'gcconnex_profile:opt:yes') { |
|
762 | + if ($current_user->opt_in_ssCreate == 'gcconnex_profile:opt:yes') { |
|
763 | 763 | return true; |
764 | 764 | } |
765 | - if($current_user->opt_in_assignSeek == 'gcconnex_profile:opt:yes') { |
|
765 | + if ($current_user->opt_in_assignSeek == 'gcconnex_profile:opt:yes') { |
|
766 | 766 | return true; |
767 | 767 | } |
768 | - if($current_user->opt_in_assignCreate == 'gcconnex_profile:opt:yes') { |
|
768 | + if ($current_user->opt_in_assignCreate == 'gcconnex_profile:opt:yes') { |
|
769 | 769 | return true; |
770 | 770 | } |
771 | - if($current_user->opt_in_deploySeek == 'gcconnex_profile:opt:yes') { |
|
771 | + if ($current_user->opt_in_deploySeek == 'gcconnex_profile:opt:yes') { |
|
772 | 772 | return true; |
773 | 773 | } |
774 | - if($current_user->opt_in_deployCreate == 'gcconnex_profile:opt:yes') { |
|
774 | + if ($current_user->opt_in_deployCreate == 'gcconnex_profile:opt:yes') { |
|
775 | 775 | return true; |
776 | 776 | } |
777 | 777 |
@@ -211,8 +211,7 @@ discard block |
||
211 | 211 | 'style' => 'margin:2px;' |
212 | 212 | )) . '</div>'; |
213 | 213 | } |
214 | - } |
|
215 | - else { |
|
214 | + } else { |
|
216 | 215 | $relationship_count = elgg_get_entities_from_relationship(array( |
217 | 216 | 'relationship' => 'mission_accepted', |
218 | 217 | 'relationship_guid' => $mission->guid, |
@@ -222,13 +221,14 @@ discard block |
||
222 | 221 | if($relationship_count < $mission->number) { |
223 | 222 | $user = elgg_get_logged_in_user_entity(); |
224 | 223 | $mmdep = trim( explode('/', $mission->department_path_english)[0] ); |
225 | - if ( !$mission->openess || stripos( $user->department, $mmdep ) !== false ) |
|
226 | - $button_three = '<div id="apply-button-mission-' . $mission->guid . '" name="apply-button" style="display:inline-block;">' . $apply_button = elgg_view('output/url', array( |
|
224 | + if ( !$mission->openess || stripos( $user->department, $mmdep ) !== false ) { |
|
225 | + $button_three = '<div id="apply-button-mission-' . $mission->guid . '" name="apply-button" style="display:inline-block;">' . $apply_button = elgg_view('output/url', array( |
|
227 | 226 | 'href' => elgg_get_site_url() . 'missions/mission-application/' . $mission->guid, |
228 | 227 | 'text' => elgg_echo('missions:apply').elgg_echo("mission:button:apply", array($mission->title)), |
229 | 228 | 'class' => 'elgg-button btn btn-primary', |
230 | 229 | 'style' => 'margin:2px;' |
231 | 230 | )) . '</div>'; |
231 | + } |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | if(check_entity_relationship($mission->guid, 'mission_tentative', elgg_get_logged_in_user_guid())) { |
@@ -269,8 +269,7 @@ discard block |
||
269 | 269 | )) . '</div>'; |
270 | 270 | } |
271 | 271 | } |
272 | - } |
|
273 | - else { |
|
272 | + } else { |
|
274 | 273 | if(check_if_opted_in(elgg_get_logged_in_user_entity())) { |
275 | 274 | $button_three = '<div id="duplicate-button-mission-' . $mission->guid . '" name="duplicate-button" style="display:inline-block;">' . elgg_view('output/url', array( |
276 | 275 | 'href' => elgg_get_site_url() . 'action/missions/duplicate-mission?mid=' . $mission->guid, |
@@ -402,8 +401,7 @@ discard block |
||
402 | 401 | $clean_segment = $segment; |
403 | 402 | if(strpos($segment, '?') === false) { |
404 | 403 | |
405 | - } |
|
406 | - else { |
|
404 | + } else { |
|
407 | 405 | $cutoff = strpos($segment, '?'); |
408 | 406 | $clean_segment = substr($segment, 0, $cutoff); |
409 | 407 | } |
@@ -443,25 +441,21 @@ discard block |
||
443 | 441 | if(get_subtype_from_id($recipient_entity->subtype) == 'mission') { |
444 | 442 | if($recipient_entity->account) { |
445 | 443 | messages_send($subject, $body, $recipient_entity->account, $sender, 0, false); |
446 | - } |
|
447 | - else { |
|
444 | + } else { |
|
448 | 445 | $recipient_set = get_user_by_email($recipient_entity->email); |
449 | 446 | foreach($recipient_set as $recipient_temp) { |
450 | 447 | messages_send($subject, $body, $recipient_temp->guid, $sender, 0, false); |
451 | 448 | } |
452 | 449 | } |
453 | - } |
|
454 | - else if(get_subtype_from_id($sender_entity->subtype) == 'mission') { |
|
450 | + } else if(get_subtype_from_id($sender_entity->subtype) == 'mission') { |
|
455 | 451 | if($sender_entity->account) { |
456 | 452 | messages_send($subject, $body, $recipient, $sender_entity->account, 0, false); |
457 | - } |
|
458 | - else { |
|
453 | + } else { |
|
459 | 454 | $sender_set = get_user_by_email($sender_entity->email); |
460 | 455 | $sender_latest = array_pop($sender_set)->guid; |
461 | 456 | messages_send($subject, $body, $recipient, $sender_latest, 0, false); |
462 | 457 | } |
463 | - } |
|
464 | - else { |
|
458 | + } else { |
|
465 | 459 | messages_send($subject, $body, $recipient, $sender, 0, false); |
466 | 460 | } |
467 | 461 | } |
@@ -530,8 +524,7 @@ discard block |
||
530 | 524 | 'style' => 'margin:2px;width:120px;', |
531 | 525 | 'disabled' => true |
532 | 526 | )); |
533 | - } |
|
534 | - else { |
|
527 | + } else { |
|
535 | 528 | if($relationship_count >= $mission->number) { |
536 | 529 | // Disabled button for when the mission is full. |
537 | 530 | return elgg_view('output/url', array( |
@@ -541,8 +534,7 @@ discard block |
||
541 | 534 | 'style' => 'margin:2px;width:120px;', |
542 | 535 | 'disabled' => true |
543 | 536 | )); |
544 | - } |
|
545 | - else { |
|
537 | + } else { |
|
546 | 538 | // Button which turns the applicant into a participant. |
547 | 539 | return elgg_view('output/url', array( |
548 | 540 | 'href' => elgg_get_site_url() . 'action/missions/mission-offer?aid=' . $applicant->guid . '&mid=' . $mission->guid, |
@@ -574,8 +566,7 @@ discard block |
||
574 | 566 | 'style' => 'margin:2px;', |
575 | 567 | 'disabled' => true |
576 | 568 | )); |
577 | - } |
|
578 | - else { |
|
569 | + } else { |
|
579 | 570 | // Button which turns the applicant into a participant. |
580 | 571 | return elgg_view('output/url', array( |
581 | 572 | 'href' => elgg_get_site_url() . 'action/missions/finalize-offer?aid=' . $applicant->guid . '&mid=' . $mission->guid, |
@@ -606,8 +597,7 @@ discard block |
||
606 | 597 | if(strcmp($french_key, $english_key) === 0) { |
607 | 598 | if($english_key == '') { |
608 | 599 | return false; |
609 | - } |
|
610 | - else { |
|
600 | + } else { |
|
611 | 601 | return $english_key; |
612 | 602 | } |
613 | 603 | } |
@@ -672,8 +662,7 @@ discard block |
||
672 | 662 | $result = usort($entity_set2, $comparison); |
673 | 663 | if(!$result) { |
674 | 664 | return $backup_array; |
675 | - } |
|
676 | - else { |
|
665 | + } else { |
|
677 | 666 | if($order == 'missions:ascending') { |
678 | 667 | return array_reverse($entity_set2); |
679 | 668 | } |
@@ -284,12 +284,12 @@ discard block |
||
284 | 284 | * Add the appropriate reports to the supplied mission_set |
285 | 285 | */ |
286 | 286 | function mm_analytics_add_reports_by_dates($start_date, $end_date, $separator, &$mission_set) { |
287 | - //array('posted', 'cancelled', 'completed', 'offered', 'declined', 'inprogress'); |
|
287 | + //array('posted', 'cancelled', 'completed', 'offered', 'declined', 'inprogress'); |
|
288 | 288 | if ($separator == 'missions:state') { |
289 | 289 | $subtypes = array( |
290 | - 'mission-posted', |
|
291 | - 'mission-cancelled', |
|
292 | - 'mission-completed', |
|
290 | + 'mission-posted', |
|
291 | + 'mission-cancelled', |
|
292 | + 'mission-completed', |
|
293 | 293 | 'mission-wasoffered', |
294 | 294 | 'mission-declination' |
295 | 295 | ); |
@@ -298,17 +298,17 @@ discard block |
||
298 | 298 | $subtypes_ids[] = get_subtype_id('object', $st); |
299 | 299 | }; |
300 | 300 | |
301 | - // In order to have somewhat useful results prior to this merge, we |
|
302 | - // keep the old single instance tracking, but make sure to not |
|
303 | - // duplicate results with the new report style tracking. |
|
304 | - $originals = array(); |
|
305 | - foreach ($mission_set as $set) { |
|
306 | - $guids = array(); |
|
307 | - foreach ($set as $object) { |
|
308 | - $guids[] = $object->guid; |
|
309 | - } |
|
310 | - $originals[] = $guids; |
|
311 | - } |
|
301 | + // In order to have somewhat useful results prior to this merge, we |
|
302 | + // keep the old single instance tracking, but make sure to not |
|
303 | + // duplicate results with the new report style tracking. |
|
304 | + $originals = array(); |
|
305 | + foreach ($mission_set as $set) { |
|
306 | + $guids = array(); |
|
307 | + foreach ($set as $object) { |
|
308 | + $guids[] = $object->guid; |
|
309 | + } |
|
310 | + $originals[] = $guids; |
|
311 | + } |
|
312 | 312 | |
313 | 313 | $q_options = array(); |
314 | 314 | $q_options['type'] = 'object'; |
@@ -317,10 +317,10 @@ discard block |
||
317 | 317 | $q_options['type_subtype_pairs'] = array('object' => $subtypes); |
318 | 318 | $reports = elgg_get_entities($q_options); |
319 | 319 | foreach ($reports as $report) { |
320 | - if (!in_array($report->mission_guid, $originals[array_search($report->subtype, $subtypes_ids)])) { |
|
321 | - $mission_set[array_search($report->subtype, $subtypes_ids)][] = |
|
322 | - $report; |
|
323 | - } |
|
320 | + if (!in_array($report->mission_guid, $originals[array_search($report->subtype, $subtypes_ids)])) { |
|
321 | + $mission_set[array_search($report->subtype, $subtypes_ids)][] = |
|
322 | + $report; |
|
323 | + } |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | // 'mission-acceptance' (Requires different query, to find missions "in progress". |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | function mm_analytics_generate_time_scale_timestamps($beginning_date, $end_date, $interval) { |
29 | 29 | // Validates the dates using the regex found in mm_analytics_validate_date_for_time_scale. |
30 | - if(!mm_analytics_validate_date_for_time_scale($beginning_date) || !mm_analytics_validate_date_for_time_scale($end_date)) { |
|
30 | + if (!mm_analytics_validate_date_for_time_scale($beginning_date) || !mm_analytics_validate_date_for_time_scale($end_date)) { |
|
31 | 31 | return false; |
32 | 32 | } |
33 | 33 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | }*/ |
58 | 58 | |
59 | 59 | // Decides on the beginning date for the time range . |
60 | - switch($interval) { |
|
60 | + switch ($interval) { |
|
61 | 61 | // Years always start on 01-01. |
62 | 62 | case 'missions:year': |
63 | 63 | $step = '+1 year'; |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | case 'missions:fiscal_year': |
68 | 68 | $step = '+1 year'; |
69 | 69 | $beginning = strtotime($beginning_array[0] . '-04-01'); |
70 | - if($beginning_array[1] != '') { |
|
71 | - if(intval($beginning_array[1]) < 4) { |
|
70 | + if ($beginning_array[1] != '') { |
|
71 | + if (intval($beginning_array[1]) < 4) { |
|
72 | 72 | $beginning = strtotime('-1 year', $beginning); |
73 | 73 | } |
74 | 74 | } |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | case 'missions:quarter': |
78 | 78 | $step = '+3 months'; |
79 | 79 | $beginning = strtotime($beginning_array[0] . '-04-01'); |
80 | - if($beginning_array[1] != '') { |
|
80 | + if ($beginning_array[1] != '') { |
|
81 | 81 | $month_int = intval($beginning_array[1]); |
82 | - if($month_int >= 1 && $month_int <= 3) { |
|
82 | + if ($month_int >= 1 && $month_int <= 3) { |
|
83 | 83 | $beginning = strtotime($beginning_array[0] . '-01-01'); |
84 | 84 | } |
85 | - else if($month_int >= 4 && $month_int <= 6) { |
|
85 | + else if ($month_int >= 4 && $month_int <= 6) { |
|
86 | 86 | $beginning = strtotime($beginning_array[0] . '-04-01'); |
87 | 87 | } |
88 | - else if($month_int >= 7 && $month_int <= 9) { |
|
88 | + else if ($month_int >= 7 && $month_int <= 9) { |
|
89 | 89 | $beginning = strtotime($beginning_array[0] . '-07-01'); |
90 | 90 | } |
91 | - else if($month_int >= 10 && $month_int <= 12) { |
|
91 | + else if ($month_int >= 10 && $month_int <= 12) { |
|
92 | 92 | $beginning = strtotime($beginning_array[0] . '-10-01'); |
93 | 93 | } |
94 | 94 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | case 'missions:month': |
98 | 98 | $step = '+1 month'; |
99 | 99 | $beginning = strtotime($beginning_array[0] . '-01-01'); |
100 | - if($beginning_array[1] != '') { |
|
100 | + if ($beginning_array[1] != '') { |
|
101 | 101 | $beginning = strtotime($beginning_array[0] . '-' . $beginning_array[1] . '-01'); |
102 | 102 | } |
103 | 103 | break; |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | case 'missions:week': |
106 | 106 | $step = '+1 week'; |
107 | 107 | $beginning = strtotime('this week', strtotime($beginning_array[0] . '-01-01')); |
108 | - if($beginning_array[1] != '') { |
|
109 | - $beginning = strtotime('this week', strtotime($beginning_array[0] . '-' . $beginning_array[1] . '-01')); |
|
110 | - if($beginning_array[2] != '') { |
|
108 | + if ($beginning_array[1] != '') { |
|
109 | + $beginning = strtotime('this week', strtotime($beginning_array[0] . '-' . $beginning_array[1] . '-01')); |
|
110 | + if ($beginning_array[2] != '') { |
|
111 | 111 | $beginning = strtotime('this week', strtotime(implode('-', $beginning_array))); |
112 | 112 | } |
113 | 113 | } |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | case 'missions:day': |
117 | 117 | $step = '+1 day'; |
118 | 118 | $beginning = strtotime($beginning_array[0] . '-01-01'); |
119 | - if($beginning_array[1] != '') { |
|
119 | + if ($beginning_array[1] != '') { |
|
120 | 120 | $beginning = strtotime($beginning_array[0] . '-' . $beginning_array[1] . '-01'); |
121 | - if($beginning_array[2] != '') { |
|
121 | + if ($beginning_array[2] != '') { |
|
122 | 122 | $beginning = strtotime(implode('-', $beginning_array)); |
123 | 123 | } |
124 | 124 | } |
@@ -130,24 +130,24 @@ discard block |
||
130 | 130 | // Sets the end date to end of year. |
131 | 131 | $end = strtotime($end_array[0] . '-12-31'); |
132 | 132 | // If the end date has a month set then the end date is set to the end of that month. |
133 | - if($end_array[1] != '') { |
|
133 | + if ($end_array[1] != '') { |
|
134 | 134 | $end = strtotime(date('Y-m-t', strtotime($end_array[0] . '-' . $end_array[1]))); |
135 | 135 | // If the end date has a day set then the end date is set to that day. |
136 | - if($end_array[2] != '') { |
|
136 | + if ($end_array[2] != '') { |
|
137 | 137 | $end = strtotime(implode('-', $end_array)); |
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | 141 | // Creates steps in the interval until a step exceeds the end date and the end date replaces that last step. |
142 | 142 | $returner_array = array($beginning); |
143 | - while(true) { |
|
143 | + while (true) { |
|
144 | 144 | $new_index = count($returner_array); |
145 | 145 | $latest_time = strtotime($step, $returner_array[$new_index - 1]); |
146 | 146 | $returner_array[$new_index] = $latest_time; |
147 | - if($latest_time > $end) { |
|
147 | + if ($latest_time > $end) { |
|
148 | 148 | $end_array = explode('-', date('m-d-Y', $end)); |
149 | 149 | // Sets the end date to the end of that day. |
150 | - $returner_array[$new_index] = mktime(23,59,59,$end_array[0],$end_array[1],$end_array[2]); |
|
150 | + $returner_array[$new_index] = mktime(23, 59, 59, $end_array[0], $end_array[1], $end_array[2]); |
|
151 | 151 | break; |
152 | 152 | } |
153 | 153 | } |
@@ -163,30 +163,30 @@ discard block |
||
163 | 163 | */ |
164 | 164 | function mm_analytics_string_together_time_segments($days, $hours, $minutes, $seconds) { |
165 | 165 | $returner = ''; |
166 | - if($days != 0) { |
|
166 | + if ($days != 0) { |
|
167 | 167 | $plural = 's'; |
168 | - if($days == 1) { |
|
168 | + if ($days == 1) { |
|
169 | 169 | $plural = ''; |
170 | 170 | } |
171 | 171 | $returner .= elgg_echo('missions:day(s)', array($days, $plural)) . ' '; |
172 | 172 | } |
173 | - if($hours != 0) { |
|
173 | + if ($hours != 0) { |
|
174 | 174 | $plural = 's'; |
175 | - if($hours == 1) { |
|
175 | + if ($hours == 1) { |
|
176 | 176 | $plural = ''; |
177 | 177 | } |
178 | 178 | $returner .= elgg_echo('missions:hour(s)', array($hours, $plural)) . ' '; |
179 | 179 | } |
180 | - if($minutes != 0) { |
|
180 | + if ($minutes != 0) { |
|
181 | 181 | $plural = 's'; |
182 | - if($minutes == 1) { |
|
182 | + if ($minutes == 1) { |
|
183 | 183 | $plural = ''; |
184 | 184 | } |
185 | 185 | $returner .= elgg_echo('missions:minute(s)', array($minutes, $plural)) . ' '; |
186 | 186 | } |
187 | - if($seconds != 0) { |
|
187 | + if ($seconds != 0) { |
|
188 | 188 | $plural = 's'; |
189 | - if($seconds == 1) { |
|
189 | + if ($seconds == 1) { |
|
190 | 190 | $plural = ''; |
191 | 191 | } |
192 | 192 | $returner .= elgg_echo('missions:second(s)', array($seconds, $plural)) . ' '; |
@@ -200,12 +200,12 @@ discard block |
||
200 | 200 | function mm_analytics_generate_bin_labels($timescale_array, $case_value, $graph_type) { |
201 | 201 | $timescale_labels = $timescale_array; |
202 | 202 | |
203 | - if($graph_type == 'missions:stacked_graph') { |
|
203 | + if ($graph_type == 'missions:stacked_graph') { |
|
204 | 204 | array_pop($timescale_labels); |
205 | 205 | } |
206 | 206 | |
207 | - foreach($timescale_labels as $key => $time) { |
|
208 | - switch($case_value) { |
|
207 | + foreach ($timescale_labels as $key => $time) { |
|
208 | + switch ($case_value) { |
|
209 | 209 | case 'missions:year': |
210 | 210 | $timescale_labels[$key] = [date('Y', $time), $time * 1000]; |
211 | 211 | break; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $use_time = strtotime('-3 months', $time); |
217 | 217 | $q_num = ceil(intval(date('m', $time)) / 3) - 1; |
218 | 218 | $year = date('Y', $time); |
219 | - if($q_num == 0) { |
|
219 | + if ($q_num == 0) { |
|
220 | 220 | $q_num = 4; |
221 | 221 | $year = date('Y', strtotime('-1 year', $time)); |
222 | 222 | } |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | case 'missions:time_to_complete_mission': |
243 | 243 | case 'missions:time_to_cancel_mission': |
244 | 244 | $plural = 's'; |
245 | - if($time == 1) { |
|
245 | + if ($time == 1) { |
|
246 | 246 | $plural = ''; |
247 | 247 | } |
248 | 248 | |
249 | - switch($_SESSION['missions_analytics_histogram_time_unit_for_axis']) { |
|
249 | + switch ($_SESSION['missions_analytics_histogram_time_unit_for_axis']) { |
|
250 | 250 | case 'DAY': |
251 | 251 | $timescale_labels[$key] = elgg_echo('missions:day(s)', array(($time / 86400), $plural)); |
252 | 252 | break; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | */ |
274 | 274 | function mm_analytics_transform_to_date_format($start, $end, $type) { |
275 | 275 | $returner = array($start, $end); |
276 | - if($type == 'missions:start_date') { |
|
276 | + if ($type == 'missions:start_date') { |
|
277 | 277 | $returner[0] = date('Y-m-d', $start); |
278 | 278 | $returner[1] = date('Y-m-d', $end); |
279 | 279 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $end = $modified_input[1]; |
366 | 366 | $metadata = mm_analytics_get_metadata_name_from_target_value($date_type); |
367 | 367 | |
368 | - if($metadata == '') { |
|
368 | + if ($metadata == '') { |
|
369 | 369 | return false; |
370 | 370 | } |
371 | 371 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $options['limit'] = 0; |
375 | 375 | |
376 | 376 | // Time created is an attribute of the entity table in the database and not metadata. |
377 | - if($metadata == 'time_created') { |
|
377 | + if ($metadata == 'time_created') { |
|
378 | 378 | $options['created_time_lower'] = $start; |
379 | 379 | $options['created_time_upper'] = $end; |
380 | 380 | |
@@ -423,8 +423,8 @@ discard block |
||
423 | 423 | function mm_analytics_cull_missions_by_department($mission_set, $department) { |
424 | 424 | $department_and_children = mo_array_node_and_all_children($department); |
425 | 425 | $mission_set_copy = $mission_set; |
426 | - foreach($mission_set_copy as $key => $mission) { |
|
427 | - if(!in_array($mission->department, $department_and_children)) { |
|
426 | + foreach ($mission_set_copy as $key => $mission) { |
|
427 | + if (!in_array($mission->department, $department_and_children)) { |
|
428 | 428 | unset($mission_set_copy[$key]); |
429 | 429 | } |
430 | 430 | } |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | */ |
438 | 438 | function mm_analytics_cull_missions_by_role_type($mission_set, $role_type) { |
439 | 439 | $mission_set_copy = $mission_set; |
440 | - foreach($mission_set_copy as $key => $mission) { |
|
441 | - if($mission->role_type != $role_type) { |
|
440 | + foreach ($mission_set_copy as $key => $mission) { |
|
441 | + if ($mission->role_type != $role_type) { |
|
442 | 442 | unset($mission_set_copy[$key]); |
443 | 443 | } |
444 | 444 | } |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | */ |
452 | 452 | function mm_analytics_cull_missions_by_job_type($mission_set, $job_type) { |
453 | 453 | $mission_set_copy = $mission_set; |
454 | - foreach($mission_set_copy as $key => $mission) { |
|
455 | - if($mission->job_type != $job_type) { |
|
454 | + foreach ($mission_set_copy as $key => $mission) { |
|
455 | + if ($mission->job_type != $job_type) { |
|
456 | 456 | unset($mission_set_copy[$key]); |
457 | 457 | } |
458 | 458 | } |
@@ -466,8 +466,8 @@ discard block |
||
466 | 466 | function mm_analytics_cull_missions_by_status($mission_set, $status) { |
467 | 467 | |
468 | 468 | $mission_set_copy = $mission_set; |
469 | - foreach($mission_set_copy as $key => $mission) { |
|
470 | - if($mission->state != strtolower(elgg_echo($status, [], 'en'))) { |
|
469 | + foreach ($mission_set_copy as $key => $mission) { |
|
470 | + if ($mission->state != strtolower(elgg_echo($status, [], 'en'))) { |
|
471 | 471 | unset($mission_set_copy[$key]); |
472 | 472 | } |
473 | 473 | } |
@@ -480,12 +480,12 @@ discard block |
||
480 | 480 | */ |
481 | 481 | function mm_analytics_separate_missions_by_values($mission_set, $separator) { |
482 | 482 | $returner_array = array(); |
483 | - if($separator == '' || $separator == 'missions:average_number_of_applicants') { |
|
483 | + if ($separator == '' || $separator == 'missions:average_number_of_applicants') { |
|
484 | 484 | $returner_array[0] = $mission_set; |
485 | 485 | } |
486 | 486 | else { |
487 | 487 | // Creates the array of values which determine which bin a mission will occupy and the metadata where these values are stored.. |
488 | - switch($separator) { |
|
488 | + switch ($separator) { |
|
489 | 489 | case 'missions:state': |
490 | 490 | $meta_tag = 'state'; |
491 | 491 | $comparison_array = array('posted', 'cancelled', 'completed', 'offered', 'declined', 'inprogress'); |
@@ -522,16 +522,16 @@ discard block |
||
522 | 522 | |
523 | 523 | // Creates the bins which the missions will be divided into. |
524 | 524 | $count = 0; |
525 | - foreach($comparison_array as $comparator) { |
|
525 | + foreach ($comparison_array as $comparator) { |
|
526 | 526 | $returner_array[$count] = array(); |
527 | 527 | $count++; |
528 | 528 | } |
529 | 529 | |
530 | 530 | // Divides the missions into the bins according to what value their metadata matches. |
531 | - foreach($mission_set as $mission) { |
|
531 | + foreach ($mission_set as $mission) { |
|
532 | 532 | $count = 0; |
533 | - foreach($comparison_array as $comparator) { |
|
534 | - if($mission->$meta_tag == $comparison_array[$count]) { |
|
533 | + foreach ($comparison_array as $comparator) { |
|
534 | + if ($mission->$meta_tag == $comparison_array[$count]) { |
|
535 | 535 | $returner_array[$count][] = $mission; |
536 | 536 | } |
537 | 537 | $count++; |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | */ |
548 | 548 | function mm_analytics_generate_separation_labels($separator) { |
549 | 549 | $returner = array(); |
550 | - switch($separator) { |
|
550 | + switch ($separator) { |
|
551 | 551 | case 'missions:state': |
552 | 552 | $returner = array('missions:posted', 'missions:cancelled', 'missions:completed', 'missions:offered', 'missions:declined', 'missions:inprogress'); |
553 | 553 | break; |
@@ -593,28 +593,28 @@ discard block |
||
593 | 593 | // Creates a set of bins corresponding to the intervals. |
594 | 594 | $returner = array(); |
595 | 595 | $temp_x_array = array(); |
596 | - for($i=0;$i<(count($timescale_array)-1);$i++) { |
|
596 | + for ($i = 0; $i < (count($timescale_array) - 1); $i++) { |
|
597 | 597 | $temp_x_array[] = array(); |
598 | 598 | } |
599 | 599 | |
600 | 600 | // Adds an interval bin to each of the series bins. |
601 | - foreach($mission_set as $value) { |
|
601 | + foreach ($mission_set as $value) { |
|
602 | 602 | $returner[] = $temp_x_array; |
603 | 603 | } |
604 | 604 | |
605 | - foreach($mission_set as $y => $set) { |
|
606 | - foreach($set as $mission) { |
|
607 | - for($i=0;$i<(count($timescale_array)-1);$i++) { |
|
605 | + foreach ($mission_set as $y => $set) { |
|
606 | + foreach ($set as $mission) { |
|
607 | + for ($i = 0; $i < (count($timescale_array) - 1); $i++) { |
|
608 | 608 | $lower_bound = $timescale_array[$i]; |
609 | - $upper_bound = $timescale_array[$i+1]; |
|
609 | + $upper_bound = $timescale_array[$i + 1]; |
|
610 | 610 | |
611 | - if($graph_type == 'missions:stacked_graph') { |
|
612 | - $modified_data_by_type = mm_analytics_transform_to_date_format($timescale_array[$i], $timescale_array[$i+1], $target); |
|
611 | + if ($graph_type == 'missions:stacked_graph') { |
|
612 | + $modified_data_by_type = mm_analytics_transform_to_date_format($timescale_array[$i], $timescale_array[$i + 1], $target); |
|
613 | 613 | $lower_bound = $modified_data_by_type[0]; |
614 | 614 | $upper_bound = $modified_data_by_type[1]; |
615 | 615 | } |
616 | 616 | |
617 | - if(($mission->$metadata_lower >= $lower_bound || $mission->$metadata_lower == null) && $mission->$metadata_upper < $upper_bound) { |
|
617 | + if (($mission->$metadata_lower >= $lower_bound || $mission->$metadata_lower == null) && $mission->$metadata_upper < $upper_bound) { |
|
618 | 618 | $returner[$y][$i][] = $mission; |
619 | 619 | } |
620 | 620 | } |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $options['limit'] = 0; |
636 | 636 | $options['metadata_name_value_pairs_operator'] = 'AND'; |
637 | 637 | |
638 | - switch($target_value) { |
|
638 | + switch ($target_value) { |
|
639 | 639 | // The first four cases deal with timestamps describing an elapsed period of time. |
640 | 640 | case 'missions:time_to_post_mission': |
641 | 641 | $options['metadata_name_value_pairs'] = array(array('name' => 'time_to_post', 'value' => 0, 'operand' => '>')); |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | $options['metadata_name_value_pairs'] = 'INVALID_TARGET'; |
681 | 681 | } |
682 | 682 | |
683 | - if($options['metadata_name_value_pairs'] != 'INVALID_TARGET') { |
|
683 | + if ($options['metadata_name_value_pairs'] != 'INVALID_TARGET') { |
|
684 | 684 | $mission_set = elgg_get_entities_from_metadata($options); |
685 | 685 | } |
686 | 686 | return $mission_set; |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | function mm_analytics_get_metadata_name_from_target_value($target_value) { |
693 | 693 | $metadata = ''; |
694 | 694 | |
695 | - switch($target_value) { |
|
695 | + switch ($target_value) { |
|
696 | 696 | case 'missions:date_posted': |
697 | 697 | $metadata = 'time_created'; |
698 | 698 | break; |
@@ -738,35 +738,35 @@ discard block |
||
738 | 738 | $max_value = -1; |
739 | 739 | $min_value = -1; |
740 | 740 | // Find the maximum and minimum values of the mission set metadata which define the range. |
741 | - foreach($mission_set as $mission) { |
|
742 | - if($max_value == -1 || $mission->$metadata > $max_value) { |
|
741 | + foreach ($mission_set as $mission) { |
|
742 | + if ($max_value == -1 || $mission->$metadata > $max_value) { |
|
743 | 743 | $max_value = $mission->$metadata; |
744 | 744 | } |
745 | - if($min_value == -1 || $mission->$metadata < $min_value) { |
|
745 | + if ($min_value == -1 || $mission->$metadata < $min_value) { |
|
746 | 746 | $min_value = $mission->$metadata; |
747 | 747 | } |
748 | 748 | } |
749 | - if($max_value == $min_value) { |
|
749 | + if ($max_value == $min_value) { |
|
750 | 750 | $min_value = 0; |
751 | 751 | } |
752 | 752 | $max_value = $max_value + 1; |
753 | 753 | |
754 | - if($max_value > 0 && $min_value >= 0) { |
|
754 | + if ($max_value > 0 && $min_value >= 0) { |
|
755 | 755 | $max_time = ceil($max_value / 86400); |
756 | 756 | $min_time = floor($min_value / 86400); |
757 | 757 | $return_to_timestamp = 86400; |
758 | 758 | $_SESSION['missions_analytics_histogram_time_unit_for_axis'] = 'DAY'; |
759 | - if(($max_time - $min_time) < $number_of_bins) { |
|
759 | + if (($max_time - $min_time) < $number_of_bins) { |
|
760 | 760 | $max_time = ceil($max_value / 3600); |
761 | 761 | $min_time = floor($min_value / 3600); |
762 | 762 | $return_to_timestamp = 3600; |
763 | 763 | $_SESSION['missions_analytics_histogram_time_unit_for_axis'] = 'HOUR'; |
764 | - if(($max_time - $min_time) < $number_of_bins) { |
|
764 | + if (($max_time - $min_time) < $number_of_bins) { |
|
765 | 765 | $max_time = ceil($max_value / 60); |
766 | 766 | $min_time = floor($min_value / 60); |
767 | 767 | $return_to_timestamp = 60; |
768 | 768 | $_SESSION['missions_analytics_histogram_time_unit_for_axis'] = 'MINUTE'; |
769 | - if(($max_time - $min_time) < $number_of_bins) { |
|
769 | + if (($max_time - $min_time) < $number_of_bins) { |
|
770 | 770 | $max_time = ceil($max_value); |
771 | 771 | $min_time = floor($min_value); |
772 | 772 | $return_to_timestamp = 1; |
@@ -779,12 +779,12 @@ discard block |
||
779 | 779 | $bin_step = ceil(($max_time - $min_time) / $number_of_bins); |
780 | 780 | $i = 0; |
781 | 781 | $timescale_bins[$i] = $min_time; |
782 | - while($timescale_bins[$i] < $max_time) { |
|
782 | + while ($timescale_bins[$i] < $max_time) { |
|
783 | 783 | $i++; |
784 | 784 | $timescale_bins[$i] = (($i * $bin_step) + $min_time); |
785 | 785 | } |
786 | 786 | |
787 | - foreach($timescale_bins as $index => $time) { |
|
787 | + foreach ($timescale_bins as $index => $time) { |
|
788 | 788 | $timescale_bins[$index] = $time * $return_to_timestamp; |
789 | 789 | } |
790 | 790 | } |
@@ -800,10 +800,10 @@ discard block |
||
800 | 800 | * @param int $n the number of skills to return, default: top 10 skills |
801 | 801 | * @return array the top $n most requested skills |
802 | 802 | */ |
803 | -function getTopSkills( $n = 10 ){ |
|
803 | +function getTopSkills($n = 10) { |
|
804 | 804 | |
805 | - $top_skills = array(); // the array which will be will be returned |
|
806 | - $all_skills = array(); // will contain all skills as keys with the ammount of time they occur as the value |
|
805 | + $top_skills = array(); // the array which will be will be returned |
|
806 | + $all_skills = array(); // will contain all skills as keys with the ammount of time they occur as the value |
|
807 | 807 | $dbprefix = elgg_get_config('dbprefix'); |
808 | 808 | |
809 | 809 | // Prepare query - we're looking for all skills from currently posted micromissions for now. |
@@ -828,23 +828,23 @@ discard block |
||
828 | 828 | $result = get_data($query_string); |
829 | 829 | |
830 | 830 | // Get an array of distinct skills with along with their occurance frequency |
831 | - foreach ( $result as $row ) { |
|
831 | + foreach ($result as $row) { |
|
832 | 832 | // allows handling of the cases where there are multiple skills |
833 | - $skill_array = explode( ',', $row->skill ); |
|
834 | - foreach ( $skill_array as $skill ) { |
|
833 | + $skill_array = explode(',', $row->skill); |
|
834 | + foreach ($skill_array as $skill) { |
|
835 | 835 | // clean up the string |
836 | 836 | $skill_string = trim($skill); |
837 | - $all_skills[$skill_string] = $all_skills[$skill_string] + $row->num; // add to occurance of this skill the number of opportunities that had this set of skills |
|
837 | + $all_skills[$skill_string] = $all_skills[$skill_string] + $row->num; // add to occurance of this skill the number of opportunities that had this set of skills |
|
838 | 838 | } |
839 | 839 | } |
840 | 840 | |
841 | - arsort($all_skills); // sort by occurance frequency (stored in the array values) |
|
841 | + arsort($all_skills); // sort by occurance frequency (stored in the array values) |
|
842 | 842 | |
843 | 843 | // Get top $n skills |
844 | 844 | $i = 0; |
845 | 845 | foreach ($all_skills as $key => $value) { |
846 | 846 | $top_skills[$key] = $value; |
847 | - $i+=1; |
|
847 | + $i += 1; |
|
848 | 848 | if ($i >= $n) |
849 | 849 | break; |
850 | 850 | } |
@@ -81,14 +81,11 @@ discard block |
||
81 | 81 | $month_int = intval($beginning_array[1]); |
82 | 82 | if($month_int >= 1 && $month_int <= 3) { |
83 | 83 | $beginning = strtotime($beginning_array[0] . '-01-01'); |
84 | - } |
|
85 | - else if($month_int >= 4 && $month_int <= 6) { |
|
84 | + } else if($month_int >= 4 && $month_int <= 6) { |
|
86 | 85 | $beginning = strtotime($beginning_array[0] . '-04-01'); |
87 | - } |
|
88 | - else if($month_int >= 7 && $month_int <= 9) { |
|
86 | + } else if($month_int >= 7 && $month_int <= 9) { |
|
89 | 87 | $beginning = strtotime($beginning_array[0] . '-07-01'); |
90 | - } |
|
91 | - else if($month_int >= 10 && $month_int <= 12) { |
|
88 | + } else if($month_int >= 10 && $month_int <= 12) { |
|
92 | 89 | $beginning = strtotime($beginning_array[0] . '-10-01'); |
93 | 90 | } |
94 | 91 | } |
@@ -379,8 +376,7 @@ discard block |
||
379 | 376 | $options['created_time_upper'] = $end; |
380 | 377 | |
381 | 378 | $missions = elgg_get_entities($options); |
382 | - } |
|
383 | - else { |
|
379 | + } else { |
|
384 | 380 | $options['metadata_name_value_pairs'] = array( |
385 | 381 | array('name' => $metadata, 'value' => $start, 'operand' => '>='), |
386 | 382 | array('name' => $metadata, 'value' => $end, 'operand' => '<=') |
@@ -482,8 +478,7 @@ discard block |
||
482 | 478 | $returner_array = array(); |
483 | 479 | if($separator == '' || $separator == 'missions:average_number_of_applicants') { |
484 | 480 | $returner_array[0] = $mission_set; |
485 | - } |
|
486 | - else { |
|
481 | + } else { |
|
487 | 482 | // Creates the array of values which determine which bin a mission will occupy and the metadata where these values are stored.. |
488 | 483 | switch($separator) { |
489 | 484 | case 'missions:state': |
@@ -845,8 +840,9 @@ discard block |
||
845 | 840 | foreach ($all_skills as $key => $value) { |
846 | 841 | $top_skills[$key] = $value; |
847 | 842 | $i+=1; |
848 | - if ($i >= $n) |
|
849 | - break; |
|
843 | + if ($i >= $n) { |
|
844 | + break; |
|
845 | + } |
|
850 | 846 | } |
851 | 847 | |
852 | 848 | return $top_skills; |