@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | |
19 | 19 | api_protect_admin_script(true); |
20 | 20 | |
21 | -$formSent=0; |
|
22 | -$errorMsg=''; |
|
21 | +$formSent = 0; |
|
22 | +$errorMsg = ''; |
|
23 | 23 | //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
24 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
25 | -$interbreadcrumb[] = array('url' => "session_category_list.php","name" => get_lang('ListSessionCategory')); |
|
24 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
25 | +$interbreadcrumb[] = array('url' => "session_category_list.php", "name" => get_lang('ListSessionCategory')); |
|
26 | 26 | |
27 | 27 | // Database Table Definitions |
28 | 28 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | //display the header |
62 | 62 | Display::display_header($tool_name); |
63 | 63 | if (!empty($return)) { |
64 | - Display::display_error_message($return,false); |
|
64 | + Display::display_error_message($return, false); |
|
65 | 65 | } |
66 | 66 | ?> |
67 | 67 | <div class="row"> |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | <div class="form-group"> |
73 | 73 | <label class="col-sm-3 control-label"><?php echo get_lang('SessionCategoryName') ?></label> |
74 | 74 | <div class="col-sm-6"> |
75 | - <input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>"> |
|
75 | + <input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if ($formSent) echo api_htmlentities($name, ENT_QUOTES, $charset); ?>"> |
|
76 | 76 | </div> |
77 | 77 | <div class="col-md-3"></div> |
78 | 78 | </div> |
79 | 79 | <div class="form-group"> |
80 | 80 | <div class="col-sm-offset-3 col-sm-6"> |
81 | - <?php echo get_lang('TheTimeLimitsAreReferential');?> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a> |
|
81 | + <?php echo get_lang('TheTimeLimitsAreReferential'); ?> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a> |
|
82 | 82 | </div> |
83 | 83 | <div class="col-md-3"></div> |
84 | 84 | </div> |
@@ -90,58 +90,58 @@ discard block |
||
90 | 90 | <div class="col-sm-6"> |
91 | 91 | <select name="day_start"> |
92 | 92 | <option value="1">01</option> |
93 | - <option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
94 | - <option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
95 | - <option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
96 | - <option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
97 | - <option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
98 | - <option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
99 | - <option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
100 | - <option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
101 | - <option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
102 | - <option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
103 | - <option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
104 | - <option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option> |
|
105 | - <option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option> |
|
106 | - <option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option> |
|
107 | - <option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option> |
|
108 | - <option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option> |
|
109 | - <option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option> |
|
110 | - <option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option> |
|
111 | - <option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option> |
|
112 | - <option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option> |
|
113 | - <option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option> |
|
114 | - <option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option> |
|
115 | - <option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option> |
|
116 | - <option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option> |
|
117 | - <option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option> |
|
118 | - <option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option> |
|
119 | - <option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option> |
|
120 | - <option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option> |
|
121 | - <option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option> |
|
122 | - <option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option> |
|
93 | + <option value="2" <?php if ((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
94 | + <option value="3" <?php if ((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
95 | + <option value="4" <?php if ((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
96 | + <option value="5" <?php if ((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
97 | + <option value="6" <?php if ((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
98 | + <option value="7" <?php if ((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
99 | + <option value="8" <?php if ((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
100 | + <option value="9" <?php if ((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
101 | + <option value="10" <?php if ((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
102 | + <option value="11" <?php if ((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
103 | + <option value="12" <?php if ((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
104 | + <option value="13" <?php if ((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option> |
|
105 | + <option value="14" <?php if ((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option> |
|
106 | + <option value="15" <?php if ((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option> |
|
107 | + <option value="16" <?php if ((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option> |
|
108 | + <option value="17" <?php if ((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option> |
|
109 | + <option value="18" <?php if ((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option> |
|
110 | + <option value="19" <?php if ((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option> |
|
111 | + <option value="20" <?php if ((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option> |
|
112 | + <option value="21" <?php if ((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option> |
|
113 | + <option value="22" <?php if ((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option> |
|
114 | + <option value="23" <?php if ((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option> |
|
115 | + <option value="24" <?php if ((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option> |
|
116 | + <option value="25" <?php if ((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option> |
|
117 | + <option value="26" <?php if ((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option> |
|
118 | + <option value="27" <?php if ((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option> |
|
119 | + <option value="28" <?php if ((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option> |
|
120 | + <option value="29" <?php if ((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option> |
|
121 | + <option value="30" <?php if ((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option> |
|
122 | + <option value="31" <?php if ((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option> |
|
123 | 123 | </select> |
124 | 124 | / |
125 | 125 | <select name="month_start"> |
126 | 126 | <option value="1">01</option> |
127 | - <option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
128 | - <option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
129 | - <option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
130 | - <option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
131 | - <option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
132 | - <option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
133 | - <option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
134 | - <option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
135 | - <option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
136 | - <option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
137 | - <option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
127 | + <option value="2" <?php if ((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
128 | + <option value="3" <?php if ((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
129 | + <option value="4" <?php if ((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
130 | + <option value="5" <?php if ((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
131 | + <option value="6" <?php if ((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
132 | + <option value="7" <?php if ((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
133 | + <option value="8" <?php if ((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
134 | + <option value="9" <?php if ((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
135 | + <option value="10" <?php if ((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
136 | + <option value="11" <?php if ((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
137 | + <option value="12" <?php if ((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
138 | 138 | </select> |
139 | 139 | / |
140 | 140 | <select name="year_start"> |
141 | 141 | <?php |
142 | - for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
|
142 | + for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++) { |
|
143 | 143 | ?> |
144 | - <option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option> |
|
144 | + <option value="<?php echo $i; ?>" <?php if ((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option> |
|
145 | 145 | <?php |
146 | 146 | } |
147 | 147 | ?> |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | <select name="year_end"> |
207 | 207 | <option value="0">----</option> |
208 | 208 | <?php |
209 | - for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
|
209 | + for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++) { |
|
210 | 210 | ?> |
211 | 211 | <option value="<?php echo $i; ?>"><?php echo $i; ?></option> |
212 | 212 | <?php |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $tool_name = get_lang('EditSession'); |
38 | 38 | |
39 | 39 | //$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
40 | -$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); |
|
41 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview')); |
|
40 | +$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); |
|
41 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview')); |
|
42 | 42 | |
43 | 43 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
44 | 44 | $formSent = 1; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | WHERE status='1'".$order_clause; |
53 | 53 | |
54 | 54 | if (api_is_multiple_url_enabled()) { |
55 | - $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
55 | + $table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
56 | 56 | $access_url_id = api_get_current_access_url_id(); |
57 | 57 | if ($access_url_id != -1) { |
58 | 58 | $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $thisYear = date('Y'); |
69 | 69 | |
70 | 70 | $coachesOption = array( |
71 | - '' => '----- ' . get_lang('None') . ' -----' |
|
71 | + '' => '----- '.get_lang('None').' -----' |
|
72 | 72 | ); |
73 | 73 | |
74 | 74 | foreach ($coaches as $coach) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | -$formAction = api_get_self() . '?'; |
|
91 | +$formAction = api_get_self().'?'; |
|
92 | 92 | $formAction .= http_build_query(array( |
93 | 93 | 'page' => Security::remove_XSS($_GET['page']), |
94 | 94 | 'id' => $id |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $duration = null; |
140 | 140 | } |
141 | 141 | $description = $params['description']; |
142 | - $showDescription = isset($params['show_description']) ? 1: 0; |
|
142 | + $showDescription = isset($params['show_description']) ? 1 : 0; |
|
143 | 143 | $sendSubscriptionNotification = isset($params['send_subscription_notification']); |
144 | 144 | |
145 | 145 | $extraFields = array(); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | ); |
171 | 171 | |
172 | 172 | if ($return == strval(intval($return))) { |
173 | - header('Location: resume_session.php?id_session=' . $return); |
|
173 | + header('Location: resume_session.php?id_session='.$return); |
|
174 | 174 | exit(); |
175 | 175 | } |
176 | 176 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $tool_name = get_lang('ExportSessionListXMLCSV'); |
34 | 34 | |
35 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
35 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
36 | 36 | |
37 | 37 | set_time_limit(0); |
38 | 38 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | ORDER BY id"; |
57 | 57 | |
58 | 58 | if (api_is_multiple_url_enabled()) { |
59 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
59 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
60 | 60 | $access_url_id = api_get_current_access_url_id(); |
61 | - if ($access_url_id != -1){ |
|
61 | + if ($access_url_id != -1) { |
|
62 | 62 | $sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id |
63 | 63 | FROM $tbl_session s |
64 | 64 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type; |
115 | 115 | while (file_exists($archivePath.$archiveFile)) { |
116 | - $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
116 | + $archiveFile = 'export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $cvs = false; |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | |
124 | 124 | |
125 | 125 | while ($row = Database::fetch_array($result)) { |
126 | - $row['name'] = str_replace(';',',',$row['name']); |
|
127 | - $row['username'] = str_replace(';',',',$row['username']); |
|
128 | - $row['access_start_date'] = str_replace(';',',',$row['access_start_date']); |
|
129 | - $row['access_end_date'] = str_replace(';',',',$row['access_end_date']); |
|
130 | - $row['visibility'] = str_replace(';',',',$row['visibility']); |
|
131 | - $row['session_category'] = str_replace(';',',',$row['session_category_id']); |
|
126 | + $row['name'] = str_replace(';', ',', $row['name']); |
|
127 | + $row['username'] = str_replace(';', ',', $row['username']); |
|
128 | + $row['access_start_date'] = str_replace(';', ',', $row['access_start_date']); |
|
129 | + $row['access_end_date'] = str_replace(';', ',', $row['access_end_date']); |
|
130 | + $row['visibility'] = str_replace(';', ',', $row['visibility']); |
|
131 | + $row['session_category'] = str_replace(';', ',', $row['session_category_id']); |
|
132 | 132 | |
133 | 133 | |
134 | 134 | // users |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | |
143 | 143 | $rsUsers = Database::query($sql); |
144 | 144 | $users = ''; |
145 | - while ($rowUsers = Database::fetch_array($rsUsers)){ |
|
146 | - if($cvs){ |
|
147 | - $users .= str_replace(';',',',$rowUsers['username']).'|'; |
|
145 | + while ($rowUsers = Database::fetch_array($rsUsers)) { |
|
146 | + if ($cvs) { |
|
147 | + $users .= str_replace(';', ',', $rowUsers['username']).'|'; |
|
148 | 148 | } else { |
149 | 149 | $users .= "\t\t<User>$rowUsers[username]</User>\n"; |
150 | 150 | } |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | $coachs = implode(",", $coachs); |
185 | 185 | |
186 | 186 | if ($cvs) { |
187 | - $courses .= str_replace(';',',',$rowCourses['code']); |
|
188 | - $courses .= '['.str_replace(';',',',$coachs).']['; |
|
187 | + $courses .= str_replace(';', ',', $rowCourses['code']); |
|
188 | + $courses .= '['.str_replace(';', ',', $coachs).']['; |
|
189 | 189 | } else { |
190 | 190 | $courses .= "\t\t<Course>\n"; |
191 | 191 | $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n"; |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | $rsUsersCourse = Database::query($sql); |
210 | 210 | $userscourse = ''; |
211 | - while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){ |
|
211 | + while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)) { |
|
212 | 212 | if ($cvs) { |
213 | - $userscourse .= str_replace(';',',',$rowUsersCourse['username']).','; |
|
213 | + $userscourse .= str_replace(';', ',', $rowUsersCourse['username']).','; |
|
214 | 214 | } else { |
215 | 215 | $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n"; |
216 | 216 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | if (api_is_multiple_url_enabled()) { |
292 | 292 | $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
293 | 293 | $access_url_id = api_get_current_access_url_id(); |
294 | - if ($access_url_id != -1){ |
|
294 | + if ($access_url_id != -1) { |
|
295 | 295 | $sql = "SELECT s.id, name FROM $tbl_session s |
296 | 296 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
297 | 297 | ON (s.id = session_rel_url.session_id) |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | echo '<div class="actions">'; |
306 | 306 | echo '<a href="../session/session_list.php">'. |
307 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
307 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
308 | 308 | echo '</div>'; |
309 | 309 | |
310 | 310 | if (!empty($errorMsg)) { |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | |
314 | 314 | $form = new FormValidator('session_export', 'post', api_get_self()); |
315 | 315 | $form->addElement('hidden', 'formSent', 1); |
316 | -$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null); |
|
317 | -$form->addElement('radio', 'file_type', '', 'XLS' , 'xls', null); |
|
316 | +$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null); |
|
317 | +$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null); |
|
318 | 318 | $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml')); |
319 | 319 | |
320 | 320 | $options = array(); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $options[$enreg['id']] = $enreg['name']; |
324 | 324 | } |
325 | 325 | |
326 | -$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'), $options); |
|
326 | +$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'), $options); |
|
327 | 327 | $form->addButtonExport(get_lang('ExportSession')); |
328 | 328 | |
329 | 329 | $defaults = array(); |
@@ -4,9 +4,9 @@ |
||
4 | 4 | * @package chamilo.messages |
5 | 5 | */ |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | -if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') { |
|
7 | +if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
8 | 8 | header('Location:inbox.php?f=social'); |
9 | -} elseif ( api_get_setting('allow_message_tool')=='true') { |
|
9 | +} elseif (api_get_setting('allow_message_tool') == 'true') { |
|
10 | 10 | header('Location:inbox.php'); |
11 | 11 | } |
12 | 12 | exit; |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | // get message user id for inbox/outbox |
50 | 50 | $message_uid = ''; |
51 | -$message_type = array('inbox','outbox'); |
|
52 | -if (in_array($_GET['type'],$message_type)) { |
|
51 | +$message_type = array('inbox', 'outbox'); |
|
52 | +if (in_array($_GET['type'], $message_type)) { |
|
53 | 53 | if ($_GET['type'] == 'inbox') { |
54 | 54 | $message_uid = $row_users['user_receiver_id']; |
55 | 55 | } else { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | if (!empty($row_users['group_id'])) { |
65 | 65 | $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
66 | - if (!in_array($current_uid,array_keys($users_group))) { |
|
66 | + if (!in_array($current_uid, array_keys($users_group))) { |
|
67 | 67 | $not_allowed_to_edit = true; |
68 | 68 | } |
69 | 69 | } else { |
@@ -93,6 +93,6 @@ discard block |
||
93 | 93 | if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) { |
94 | 94 | // launch event |
95 | 95 | Event::event_download($file_url); |
96 | - DocumentManager::file_send_for_download($full_file_name,TRUE, $title); |
|
96 | + DocumentManager::file_send_for_download($full_file_name, TRUE, $title); |
|
97 | 97 | } |
98 | 98 | exit; |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | |
11 | 11 | if (isset($_GET['messages_page_nr'])) { |
12 | - if (api_get_setting('allow_social_tool')=='true' && |
|
13 | - api_get_setting('allow_message_tool')=='true' |
|
12 | + if (api_get_setting('allow_social_tool') == 'true' && |
|
13 | + api_get_setting('allow_message_tool') == 'true' |
|
14 | 14 | ) { |
15 | 15 | $social_link = ''; |
16 | - if ($_REQUEST['f']=='social') { |
|
16 | + if ($_REQUEST['f'] == 'social') { |
|
17 | 17 | $social_link = '&f=social'; |
18 | 18 | } |
19 | 19 | header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (api_get_setting('allow_message_tool')!='true'){ |
|
24 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
25 | 25 | api_not_allowed(); |
26 | 26 | } |
27 | 27 | //jquery thickbox already called from main/inc/header.inc.php |
28 | 28 | |
29 | -$htmlHeadXtra[]='<script language="javascript"> |
|
29 | +$htmlHeadXtra[] = '<script language="javascript"> |
|
30 | 30 | function enviar(miforma) { |
31 | 31 | if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'")) |
32 | 32 | miforma.submit(); |
@@ -53,44 +53,44 @@ discard block |
||
53 | 53 | /* |
54 | 54 | MAIN CODE |
55 | 55 | */ |
56 | -if (isset($_GET['f']) && $_GET['f']=='social') { |
|
56 | +if (isset($_GET['f']) && $_GET['f'] == 'social') { |
|
57 | 57 | $this_section = SECTION_SOCIAL; |
58 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
59 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
58 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social')); |
|
59 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox')); |
|
60 | 60 | } else { |
61 | 61 | $this_section = SECTION_MYPROFILE; |
62 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
63 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
62 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile')); |
|
63 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox')); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $actions = ''; |
67 | 67 | if (api_get_setting('extended_profile') == 'true') { |
68 | 68 | if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
69 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
|
69 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
|
70 | 70 | } |
71 | 71 | if (api_get_setting('allow_message_tool') == 'true') { |
72 | 72 | //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>'; |
73 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
74 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
75 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
73 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
74 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
75 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
80 | -$info_delete_outbox =array(); |
|
81 | -$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : ''; |
|
80 | +$info_delete_outbox = array(); |
|
81 | +$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : ''; |
|
82 | 82 | $count_delete_outbox = count($info_delete_outbox) - 1; |
83 | 83 | |
84 | -if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') { |
|
84 | +if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') { |
|
85 | 85 | for ($i = 1; $i <= $count_delete_outbox; $i++) { |
86 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]); |
|
87 | 87 | } |
88 | - $message_box=get_lang('SelectedMessagesDeleted'). |
|
88 | + $message_box = get_lang('SelectedMessagesDeleted'). |
|
89 | 89 | '  |
90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
91 | 91 | get_lang('BackToOutbox'). |
92 | 92 | '</a>'; |
93 | - Display::display_normal_message(api_xml_http_response_encode($message_box),false); |
|
93 | + Display::display_normal_message(api_xml_http_response_encode($message_box), false); |
|
94 | 94 | exit; |
95 | 95 | } |
96 | 96 | |
@@ -111,24 +111,24 @@ discard block |
||
111 | 111 | } |
112 | 112 | //MAIN CONTENT |
113 | 113 | if ($action == 'delete') { |
114 | - $delete_list_id=array(); |
|
114 | + $delete_list_id = array(); |
|
115 | 115 | if (isset($_POST['out'])) { |
116 | - $delete_list_id=$_POST['out']; |
|
116 | + $delete_list_id = $_POST['out']; |
|
117 | 117 | } |
118 | 118 | if (isset($_POST['id'])) { |
119 | - $delete_list_id=$_POST['id']; |
|
119 | + $delete_list_id = $_POST['id']; |
|
120 | 120 | } |
121 | - for ($i=0;$i<count($delete_list_id);$i++) { |
|
121 | + for ($i = 0; $i < count($delete_list_id); $i++) { |
|
122 | 122 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]); |
123 | 123 | } |
124 | - $delete_list_id=array(); |
|
124 | + $delete_list_id = array(); |
|
125 | 125 | $social_right_content .= MessageManager::outbox_display(); |
126 | 126 | |
127 | -} elseif($action =='deleteone') { |
|
128 | - $delete_list_id=array(); |
|
127 | +} elseif ($action == 'deleteone') { |
|
128 | + $delete_list_id = array(); |
|
129 | 129 | $id = Security::remove_XSS($_GET['id']); |
130 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$id); |
|
131 | - $delete_list_id=array(); |
|
130 | + MessageManager::delete_message_by_user_sender(api_get_user_id(), $id); |
|
131 | + $delete_list_id = array(); |
|
132 | 132 | $social_right_content .= MessageManager::outbox_display(); |
133 | 133 | } else { |
134 | 134 | $social_right_content .= MessageManager::outbox_display(); |
@@ -3,25 +3,25 @@ discard block |
||
3 | 3 | /** |
4 | 4 | * @package chamilo.messages |
5 | 5 | */ |
6 | -$cidReset= true; |
|
6 | +$cidReset = true; |
|
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | -if (api_get_setting('allow_message_tool')!='true') { |
|
9 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
10 | 10 | api_not_allowed(); |
11 | 11 | } |
12 | 12 | |
13 | 13 | if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { |
14 | 14 | $this_section = SECTION_SOCIAL; |
15 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
16 | - $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox')); |
|
15 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social')); |
|
16 | + $interbreadcrumb[] = array('url' => 'inbox.php?f=social', 'name' => get_lang('Inbox')); |
|
17 | 17 | } else { |
18 | 18 | $this_section = SECTION_MYPROFILE; |
19 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
19 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile')); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $social_right_content = null; |
23 | 23 | |
24 | -if (isset($_GET['f']) && $_GET['f']=='social') { |
|
24 | +if (isset($_GET['f']) && $_GET['f'] == 'social') { |
|
25 | 25 | $social_parameter = '?f=social'; |
26 | 26 | } else { |
27 | 27 | if (api_get_setting('extended_profile') == 'true') { |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | } |
34 | 34 | if (api_get_setting('allow_message_tool') == 'true') { |
35 | 35 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
36 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
36 | + Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
37 | 37 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
38 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
38 | + Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
39 | 39 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
40 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
40 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
41 | 41 | } |
42 | 42 | $social_right_content .= '</div>'; |
43 | 43 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $show_menu = 'messages_inbox'; |
54 | 54 | } |
55 | 55 | |
56 | -$message = ''; |
|
56 | +$message = ''; |
|
57 | 57 | |
58 | 58 | // LEFT COLUMN |
59 | 59 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -12,19 +12,19 @@ discard block |
||
12 | 12 | * - reply on message (when pressing reply when viewing a message) |
13 | 13 | * - send to specific user (when pressing send message in the who is online list) |
14 | 14 | */ |
15 | -$cidReset = true; |
|
15 | +$cidReset = true; |
|
16 | 16 | require_once '../inc/global.inc.php'; |
17 | 17 | |
18 | 18 | api_block_anonymous_users(); |
19 | 19 | |
20 | -if (api_get_setting('allow_message_tool') !='true') { |
|
20 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
21 | 21 | api_not_allowed(); |
22 | 22 | } |
23 | 23 | |
24 | 24 | $nameTools = api_xml_http_response_encode(get_lang('Messages')); |
25 | 25 | /* Constants and variables */ |
26 | 26 | |
27 | -$htmlHeadXtra[]=' |
|
27 | +$htmlHeadXtra[] = ' |
|
28 | 28 | <script language="javascript"> |
29 | 29 | function validate(form, list) { |
30 | 30 | if(list.selectedIndex<0) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | function show_compose_to_any($user_id) { |
77 | 77 | $online_user_list = MessageManager::get_online_user_list($user_id); |
78 | 78 | $default['user_list'] = 0; |
79 | - $online_user_list=null; |
|
79 | + $online_user_list = null; |
|
80 | 80 | $html = manage_form($default, $online_user_list); |
81 | 81 | return $html; |
82 | 82 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $query = "SELECT user_sender_id FROM $table_message |
88 | 88 | WHERE user_receiver_id=".intval($receiver_id)." AND id='".intval($message_id)."';"; |
89 | 89 | $result = Database::query($query); |
90 | - $row = Database::fetch_array($result,'ASSOC'); |
|
90 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
91 | 91 | if (!isset($row['user_sender_id'])) { |
92 | 92 | $html = get_lang('InvalidMessageId'); |
93 | 93 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | return $html; |
101 | 101 | } |
102 | 102 | |
103 | -function show_compose_to_user ($receiver_id) { |
|
103 | +function show_compose_to_user($receiver_id) { |
|
104 | 104 | $html = get_lang('To').': <strong>'.GetFullUserName($receiver_id).'</strong>'; |
105 | 105 | $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
106 | 106 | $default['users'] = array($receiver_id); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | function manage_form($default, $select_from_user_list = null, $sent_to = null) |
112 | 112 | { |
113 | 113 | $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; |
114 | - $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
|
114 | + $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
|
115 | 115 | $param_f = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null; |
116 | 116 | |
117 | 117 | $form = new FormValidator('compose_message', null, api_get_self().'?f='.$param_f, null, array('enctype'=>'multipart/form-data')); |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | ) |
129 | 129 | ); |
130 | 130 | $form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required'); |
131 | - $form->addElement('html','<div id="id_div_search" style="padding:0px" class="message-select-box" > </div>'); |
|
132 | - $form->addElement('hidden','user_list', 0, array('id'=>'user_list')); |
|
131 | + $form->addElement('html', '<div id="id_div_search" style="padding:0px" class="message-select-box" > </div>'); |
|
132 | + $form->addElement('hidden', 'user_list', 0, array('id'=>'user_list')); |
|
133 | 133 | } else { |
134 | 134 | if (!empty($sent_to)) { |
135 | 135 | $form->addLabel(get_lang('SendMessageTo'), $sent_to); |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | array(), |
144 | 144 | [ |
145 | 145 | 'multiple' => 'multiple', |
146 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'message.ajax.php?a=find_users' |
|
146 | + 'url' => api_get_path(WEB_AJAX_PATH).'message.ajax.php?a=find_users' |
|
147 | 147 | ] |
148 | 148 | ); |
149 | 149 | } else { |
150 | - $form->addElement('hidden','hidden_user',$default['users'][0],array('id'=>'hidden_user')); |
|
150 | + $form->addElement('hidden', 'hidden_user', $default['users'][0], array('id'=>'hidden_user')); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | } else { |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | $group_info = $userGroup->get($group_id); |
156 | 156 | |
157 | 157 | $form->addElement('label', get_lang('ToGroup'), api_xml_http_response_encode($group_info['name'])); |
158 | - $form->addElement('hidden','group_id',$group_id); |
|
159 | - $form->addElement('hidden','parent_id',$message_id); |
|
158 | + $form->addElement('hidden', 'group_id', $group_id); |
|
159 | + $form->addElement('hidden', 'parent_id', $message_id); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | $form->addText('title', get_lang('Subject'), true); |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | if (isset($_GET['re_id'])) { |
172 | 172 | $message_reply_info = MessageManager::get_message_by_id($_GET['re_id']); |
173 | 173 | $default['title'] = get_lang('MailSubjectReplyShort')." ".$message_reply_info['title']; |
174 | - $form->addElement('hidden','re_id', intval($_GET['re_id'])); |
|
175 | - $form->addElement('hidden','save_form','save_form'); |
|
174 | + $form->addElement('hidden', 're_id', intval($_GET['re_id'])); |
|
175 | + $form->addElement('hidden', 'save_form', 'save_form'); |
|
176 | 176 | |
177 | 177 | //adding reply mail |
178 | 178 | $user_reply_info = api_get_user_info($message_reply_info['user_sender_id']); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | </div>' |
196 | 196 | ); |
197 | 197 | |
198 | - $form->addElement('label', '', '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span> ('.sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize'))).')'); |
|
198 | + $form->addElement('label', '', '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span> ('.sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))).')'); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | $form->addButtonSend(get_lang('SendMessage'), 'compose'); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $content = $default['content']; |
217 | 217 | $group_id = isset($default['group_id']) ? $default['group_id'] : null; |
218 | 218 | $parent_id = isset($default['parent_id']) ? $default['parent_id'] : null; |
219 | - if (is_array($user_list) && count($user_list)> 0) { |
|
219 | + if (is_array($user_list) && count($user_list) > 0) { |
|
220 | 220 | //all is well, send the message |
221 | 221 | foreach ($user_list as $user) { |
222 | 222 | $res = MessageManager::send_message( |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | Security::clear_token(); |
240 | 240 | } else { |
241 | 241 | $token = Security::get_token(); |
242 | - $form->addElement('hidden','sec_token'); |
|
242 | + $form->addElement('hidden', 'sec_token'); |
|
243 | 243 | $form->setConstants(array('sec_token' => $token)); |
244 | 244 | $html .= $form->returnForm(); |
245 | 245 | } |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | if ($group_id != 0) { |
270 | 270 | $social_right_content .= '<div class=actions>'; |
271 | 271 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
272 | - Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
272 | + Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
273 | 273 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
274 | - Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
274 | + Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
275 | 275 | $social_right_content .= '</div>'; |
276 | 276 | } else { |
277 | 277 | if ($socialToolIsActive) { |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | } |
284 | 284 | if (api_get_setting('allow_message_tool') == 'true') { |
285 | 285 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
286 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
286 | + Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
287 | 287 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
288 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
288 | + Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
289 | 289 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
290 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
290 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
291 | 291 | } |
292 | 292 | $social_right_content .= '</div>'; |
293 | 293 | } |
@@ -301,21 +301,21 @@ discard block |
||
301 | 301 | $social_right_content .= '<div class="row">'; |
302 | 302 | $social_right_content .= '<div class="col-md-12">'; |
303 | 303 | $social_right_content .= '<div class="actions">'; |
304 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'. |
|
304 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'. |
|
305 | 305 | Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>'; |
306 | - $social_right_content .= '</div>'; |
|
307 | - $social_right_content .= '</div>'; |
|
306 | + $social_right_content .= '</div>'; |
|
307 | + $social_right_content .= '</div>'; |
|
308 | 308 | $social_right_content .= '<div class="col-md-12">'; |
309 | 309 | } |
310 | 310 | |
311 | 311 | // MAIN CONTENT |
312 | 312 | if (!isset($_POST['compose'])) { |
313 | - if(isset($_GET['re_id'])) { |
|
313 | + if (isset($_GET['re_id'])) { |
|
314 | 314 | $social_right_content .= show_compose_reply_to_message( |
315 | 315 | $_GET['re_id'], |
316 | 316 | api_get_user_id() |
317 | 317 | ); |
318 | - } elseif(isset($_GET['send_to_user'])) { |
|
318 | + } elseif (isset($_GET['send_to_user'])) { |
|
319 | 319 | $social_right_content .= show_compose_to_user($_GET['send_to_user']); |
320 | 320 | } else { |
321 | 321 | $social_right_content .= show_compose_to_any(api_get_user_id()); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $restrict = true; |
327 | 327 | } elseif (isset($_POST['group_id'])) { |
328 | 328 | $restrict = true; |
329 | - } elseif(isset($_POST['hidden_user'])) { |
|
329 | + } elseif (isset($_POST['hidden_user'])) { |
|
330 | 330 | $restrict = true; |
331 | 331 | } |
332 | 332 | |
@@ -349,13 +349,13 @@ discard block |
||
349 | 349 | } |
350 | 350 | $social_right_content .= manage_form($default); |
351 | 351 | } else { |
352 | - $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'),'error'); |
|
352 | + $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'), 'error'); |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | } |
356 | 356 | if (api_get_setting('allow_social_tool') == 'true') { |
357 | - $social_right_content .= '</div>'; |
|
358 | - $social_right_content .= '</div>'; |
|
357 | + $social_right_content .= '</div>'; |
|
358 | + $social_right_content .= '</div>'; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | $tpl = new Template(get_lang('ComposeMessage')); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $form = new FormValidator( |
25 | 25 | 'filter', |
26 | 26 | 'post', |
27 | - 'index.php?action=attendance_sheet_list&' . api_get_cidreq().'&attendance_id=' . $attendance_id, |
|
27 | + 'index.php?action=attendance_sheet_list&'.api_get_cidreq().'&attendance_id='.$attendance_id, |
|
28 | 28 | null, |
29 | 29 | array(), |
30 | 30 | 'inline' |
@@ -107,14 +107,14 @@ discard block |
||
107 | 107 | if (!$is_locked_attendance || api_is_platform_admin()) { |
108 | 108 | |
109 | 109 | $actionsLeft = '<a style="float:left;" href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'. |
110 | - Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
110 | + Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
111 | 111 | $actionsLeft .= '<a id="pdf_export" style="float:left;" href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.'&filter='.$default_filter.'&group_id='.$groupId.'">'. |
112 | - Display::return_icon('pdf.png',get_lang('ExportToPDF'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
112 | + Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
113 | 113 | //if (count($users_in_course) > 0) { |
114 | 114 | $actionsRight = $form->returnForm(); |
115 | 115 | //} |
116 | 116 | |
117 | - $toolbar = Display::toolbarAction('toolbar-attendance', array(0 => $actionsLeft, 1 => $actionsRight), 2 , false); |
|
117 | + $toolbar = Display::toolbarAction('toolbar-attendance', array(0 => $actionsLeft, 1 => $actionsRight), 2, false); |
|
118 | 118 | echo $toolbar; |
119 | 119 | } |
120 | 120 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | <th width="100px"><?php echo get_lang('AttendancesFaults')?></th> |
221 | 221 | </tr> |
222 | 222 | <tr class="tableFloatingHeaderOriginal" > |
223 | - <th width="10px"><?php echo '#';?></th> |
|
223 | + <th width="10px"><?php echo '#'; ?></th> |
|
224 | 224 | <th width="10px"><?php echo get_lang('Photo')?></th> |
225 | 225 | <th width="150px"><?php echo get_lang('LastName')?></th> |
226 | 226 | <th width="140px"><?php echo get_lang('FirstName')?></th> |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | foreach ($users_in_course as $data) { |
235 | 235 | $faults = 0; |
236 | 236 | if ($i % 2 == 0) { |
237 | - $class='row_odd'; |
|
237 | + $class = 'row_odd'; |
|
238 | 238 | } else { |
239 | - $class='row_even'; |
|
239 | + $class = 'row_even'; |
|
240 | 240 | } |
241 | 241 | $username = api_htmlentities(sprintf(get_lang('LoginX'), $data['username']), ENT_QUOTES); |
242 | 242 | ?> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | <td><span title="<?php echo $username ?>"><?php echo $data['lastname'] ?></span></td> |
247 | 247 | <td><?php echo $data['firstname'] ?></td> |
248 | 248 | <td> |
249 | - <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar'])?$data['result_color_bar']:'none') ?>"> |
|
249 | + <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar']) ? $data['result_color_bar'] : 'none') ?>"> |
|
250 | 250 | <?php echo $data['attendance_result'] ?> |
251 | 251 | </div> |
252 | 252 | </td> |
@@ -264,30 +264,30 @@ discard block |
||
264 | 264 | echo '<table class="tableWithFloatingHeader data_table" width="100%">'; |
265 | 265 | echo '<thead>'; |
266 | 266 | $result = null; |
267 | - if (count($attendant_calendar) > 0 ) { |
|
267 | + if (count($attendant_calendar) > 0) { |
|
268 | 268 | foreach ($attendant_calendar as $calendar) { |
269 | 269 | $date = $calendar['date']; |
270 | 270 | $time = $calendar['time']; |
271 | - $datetime = '<div class="grey">'. $date . ' - ' . $time . '</div>'; |
|
271 | + $datetime = '<div class="grey">'.$date.' - '.$time.'</div>'; |
|
272 | 272 | |
273 | - $img_lock = Display::return_icon('lock-closed.png',get_lang('DateUnLock'),array('class'=>'img_lock','id'=>'datetime_column_'.$calendar['id'])); |
|
273 | + $img_lock = Display::return_icon('lock-closed.png', get_lang('DateUnLock'), array('class'=>'img_lock', 'id'=>'datetime_column_'.$calendar['id'])); |
|
274 | 274 | |
275 | - if (!empty($calendar['done_attendance'])){ |
|
276 | - $datetime = '<div class="blue">' . $date . ' - ' . $time . '</div>'; |
|
275 | + if (!empty($calendar['done_attendance'])) { |
|
276 | + $datetime = '<div class="blue">'.$date.' - '.$time.'</div>'; |
|
277 | 277 | } |
278 | 278 | $disabled_check = 'disabled = "true"'; |
279 | 279 | $input_hidden = '<input type="hidden" id="hidden_input_'.$calendar['id'].'" name="hidden_input[]" value="" disabled />'; |
280 | 280 | if ($next_attendance_calendar_id == $calendar['id']) { |
281 | 281 | $input_hidden = '<input type="hidden" id="hidden_input_'.$calendar['id'].'" name="hidden_input[]" value="'.$calendar['id'].'" />'; |
282 | 282 | $disabled_check = ''; |
283 | - $img_lock = Display::return_icon('lock-closed.png',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id'])); |
|
283 | + $img_lock = Display::return_icon('lock-closed.png', get_lang('DateLock'), array('class'=>'img_unlock', 'id'=>'datetime_column_'.$calendar['id'])); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | $result .= '<th>'; |
287 | 287 | $result .= '<div class="date-attendance">'.$datetime.' '; |
288 | 288 | |
289 | 289 | if (api_is_allowed_to_edit(null, true)) { |
290 | - $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>'; |
|
290 | + $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin() ? $img_lock : '').'</span>'; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | if ($is_locked_attendance == false) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | } else { |
300 | 300 | $result = '<th width="2000px"><span><a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'; |
301 | - $result .= Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>'; |
|
301 | + $result .= Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>'; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | echo '<tr class="tableFloatingHeader row_odd" style="position: absolute; top: 0px; left: 0px; visibility: hidden; margin:0px;padding:0px">'; |
@@ -312,14 +312,14 @@ discard block |
||
312 | 312 | $i = 0; |
313 | 313 | foreach ($users_in_course as $user) { |
314 | 314 | $class = ''; |
315 | - if ($i%2 == 0) { |
|
315 | + if ($i % 2 == 0) { |
|
316 | 316 | $class = 'row_even'; |
317 | 317 | } else { |
318 | 318 | $class = 'row_odd'; |
319 | 319 | } |
320 | 320 | echo '<tr class="'.$class.'">'; |
321 | 321 | |
322 | - if (count($attendant_calendar) > 0 ) { |
|
322 | + if (count($attendant_calendar) > 0) { |
|
323 | 323 | foreach ($attendant_calendar as $calendar) { |
324 | 324 | $checked = 'checked'; |
325 | 325 | $presence = -1; |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $style_td = ''; |
344 | 344 | |
345 | 345 | if ($next_attendance_calendar_id == $calendar['id']) { |
346 | - if ($i%2==0) |
|
346 | + if ($i % 2 == 0) |
|
347 | 347 | $style_td = 'background-color:#eee;'; |
348 | 348 | else |
349 | 349 | $style_td = 'background-color:#dcdcdc;'; |
@@ -358,15 +358,15 @@ discard block |
||
358 | 358 | echo '<input type="checkbox" name="check_presence['.$calendar['id'].'][]" value="'.$user['user_id'].'" '.$disabled.' '.$checked.' />'; |
359 | 359 | echo '<span class="anchor_'.$calendar['id'].'"></span>'; |
360 | 360 | } else { |
361 | - echo $presence ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence')); |
|
361 | + echo $presence ? Display::return_icon('checkbox_on.gif', get_lang('Presence')) : Display::return_icon('checkbox_off.gif', get_lang('Presence')); |
|
362 | 362 | } |
363 | 363 | } else { |
364 | 364 | switch ($presence) { |
365 | 365 | case 1: |
366 | - echo Display::return_icon('accept.png',get_lang('Attended')); |
|
366 | + echo Display::return_icon('accept.png', get_lang('Attended')); |
|
367 | 367 | break; |
368 | 368 | case 0: |
369 | - echo Display::return_icon('exclamation.png',get_lang('NotAttended')); |
|
369 | + echo Display::return_icon('exclamation.png', get_lang('NotAttended')); |
|
370 | 370 | break; |
371 | 371 | case -1: |
372 | 372 | //echo Display::return_icon('warning.png',get_lang('NotAttended')); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | </td>'; |
390 | 390 | } |
391 | 391 | echo '</tr>'; |
392 | - $i++ ; |
|
392 | + $i++; |
|
393 | 393 | } |
394 | 394 | echo '</tbody></table>'; |
395 | 395 | echo '</div></div>'; |
@@ -414,13 +414,13 @@ discard block |
||
414 | 414 | echo Display::page_header(get_lang('AttendanceSheetReport')); |
415 | 415 | // View for students |
416 | 416 | ?> |
417 | - <?php if(!empty($users_presence)) { ?> |
|
417 | + <?php if (!empty($users_presence)) { ?> |
|
418 | 418 | <div> |
419 | 419 | <table width="250px;"> |
420 | 420 | <tr> |
421 | 421 | <td><?php echo get_lang('ToAttend').': ' ?></td> |
422 | 422 | <td> |
423 | - <center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar'])?$faults['color_bar']:'none') ?>"> |
|
423 | + <center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar']) ? $faults['color_bar'] : 'none') ?>"> |
|
424 | 424 | <?php echo $faults['faults'].'/'.$faults['total'].' ('.$faults['faults_porcent'].'%)' ?></div></center> |
425 | 425 | </td> |
426 | 426 | </tr> |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | $i = 0; |
438 | 438 | foreach ($users_presence[$user_id] as $presence) { |
439 | 439 | $class = ''; |
440 | - if ($i%2==0) { |
|
440 | + if ($i % 2 == 0) { |
|
441 | 441 | $class = 'row_even'; |
442 | 442 | } else { |
443 | 443 | $class = 'row_odd'; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | ?> |
446 | 446 | <tr class="<?php echo $class ?>"> |
447 | 447 | <td> |
448 | - <?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence')) ?> |
|
448 | + <?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif', get_lang('Presence')) : Display::return_icon('checkbox_off.gif', get_lang('Presence')) ?> |
|
449 | 449 | <?php echo " ".$presence['date_time'] ?> |
450 | 450 | </td> |
451 | 451 | </tr> |