@@ -8,7 +8,7 @@ |
||
8 | 8 | /** |
9 | 9 | * Init |
10 | 10 | */ |
11 | -require_once __DIR__ . '/../config.php'; |
|
11 | +require_once __DIR__.'/../config.php'; |
|
12 | 12 | |
13 | 13 | $plugin = AdvancedSubscriptionPlugin::create(); |
14 | 14 | // Get validation hash |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @package chamilo.plugin.advanced_subscription |
6 | 6 | */ |
7 | 7 | |
8 | -require_once __DIR__ . '/../config.php'; |
|
8 | +require_once __DIR__.'/../config.php'; |
|
9 | 9 | |
10 | 10 | // Protect test |
11 | 11 | api_protect_admin_script(); |
@@ -78,8 +78,7 @@ discard block |
||
78 | 78 | $isWesternNameOrder = api_is_western_name_order(); |
79 | 79 | foreach ($adminsArray as &$admin) { |
80 | 80 | $admin['complete_name'] = $isWesternNameOrder ? |
81 | - $admin['firstname'] . ', ' . $admin['lastname'] : |
|
82 | - $admin['lastname'] . ', ' . $admin['firstname'] |
|
81 | + $admin['firstname'].', '.$admin['lastname'] : $admin['lastname'].', '.$admin['firstname'] |
|
83 | 82 | ; |
84 | 83 | } |
85 | 84 | unset($admin); |
@@ -91,8 +90,8 @@ discard block |
||
91 | 90 | $data['admin'] = current($adminsArray); |
92 | 91 | $data['session'] = $sessionArray; |
93 | 92 | $data['signature'] = api_get_setting('Institution'); |
94 | -$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . |
|
95 | - 'advanced_subscription/src/admin_view.php?s=' . $data['sessionId']; |
|
93 | +$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH). |
|
94 | + 'advanced_subscription/src/admin_view.php?s='.$data['sessionId']; |
|
96 | 95 | $data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED; |
97 | 96 | $data['student']['acceptUrl'] = $plugin->getQueueUrl($data); |
98 | 97 | $data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED; |
@@ -116,21 +115,21 @@ discard block |
||
116 | 115 | $tpl->assign($tplParam, $data[$tplParam]); |
117 | 116 | } |
118 | 117 | |
119 | -$dir = __DIR__ . '/../views/'; |
|
118 | +$dir = __DIR__.'/../views/'; |
|
120 | 119 | $files = scandir($dir); |
121 | 120 | |
122 | -echo '<br>', '<pre>' , print_r($files, 1) , '</pre>'; |
|
121 | +echo '<br>', '<pre>', print_r($files, 1), '</pre>'; |
|
123 | 122 | |
124 | 123 | foreach ($files as $k =>&$file) { |
125 | 124 | if ( |
126 | - is_file($dir . $file) && |
|
125 | + is_file($dir.$file) && |
|
127 | 126 | strpos($file, '.tpl') && |
128 | 127 | $file != 'admin_view.tpl' |
129 | 128 | ) { |
130 | 129 | echo '<pre>', $file, '</pre>'; |
131 | - echo $tpl->fetch('/advanced_subscription/views/' . $file); |
|
130 | + echo $tpl->fetch('/advanced_subscription/views/'.$file); |
|
132 | 131 | } else { |
133 | 132 | unset($files[$k]); |
134 | 133 | } |
135 | 134 | } |
136 | -echo '<br>', '<pre>' , print_r($files, 1) , '</pre>'; |
|
135 | +echo '<br>', '<pre>', print_r($files, 1), '</pre>'; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | /** |
9 | 9 | * Init |
10 | 10 | */ |
11 | -require_once __DIR__ . '/../config.php'; |
|
11 | +require_once __DIR__.'/../config.php'; |
|
12 | 12 | // Protect test |
13 | 13 | api_protect_admin_script(); |
14 | 14 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | // Check if a file that limits access from webservices exists and contains |
44 | 44 | // the restraining check |
45 | -if (is_file(api_get_path(WEB_CODE_PATH) .'webservices/webservice-auth-ip.conf.php')) { |
|
45 | +if (is_file(api_get_path(WEB_CODE_PATH).'webservices/webservice-auth-ip.conf.php')) { |
|
46 | 46 | include api_get_path(WEB_CODE_PATH).'webservices/webservice-auth-ip.conf.php'; |
47 | 47 | if (!empty($ws_auth_ip)) { |
48 | 48 | $check_ip = true; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $params['secret_key'] = sha1($security_key); |
64 | 64 | |
65 | 65 | // Registration soap wsdl |
66 | -$wsUrl = api_get_path(WEB_CODE_PATH) . 'webservices/registration.soap.php?wsdl'; |
|
66 | +$wsUrl = api_get_path(WEB_CODE_PATH).'webservices/registration.soap.php?wsdl'; |
|
67 | 67 | $options = array( |
68 | 68 | 'location' => $wsUrl, |
69 | 69 | 'uri' => $wsUrl, |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | var_dump($result); |
81 | 81 | if (is_object($result) && isset($result->action_url)) { |
82 | 82 | echo '<br />'; |
83 | - echo Display::url("message" . $result->message, $result->action_url); |
|
83 | + echo Display::url("message".$result->message, $result->action_url); |
|
84 | 84 | } |
85 | 85 | } catch (\Exception $e) { |
86 | 86 | var_dump($e); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @package chamilo.plugin.advanced_subscription |
6 | 6 | */ |
7 | 7 | |
8 | -require_once __DIR__ . '/../config.php'; |
|
8 | +require_once __DIR__.'/../config.php'; |
|
9 | 9 | |
10 | 10 | // Protect test |
11 | 11 | api_protect_admin_script(); |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | $tpl->assign('termsContent', $termsAndConditions); |
40 | 40 | $termsAndConditions = $tpl->fetch('/advanced_subscription/views/terms_and_conditions_to_pdf.tpl'); |
41 | 41 | $pdf = new PDF(); |
42 | - $filename = 'terms' . sha1(rand(0,99999)); |
|
42 | + $filename = 'terms'.sha1(rand(0, 99999)); |
|
43 | 43 | $pdf->content_to_pdf($termsAndConditions, null, $filename, null, 'F'); |
44 | - $fileDir = api_get_path(WEB_ARCHIVE_PATH) . $filename . '.pdf'; |
|
44 | + $fileDir = api_get_path(WEB_ARCHIVE_PATH).$filename.'.pdf'; |
|
45 | 45 | echo '<pre>', print_r($fileDir, 1), '</pre>'; |
46 | 46 | } |
47 | 47 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | /** |
9 | 9 | * Init |
10 | 10 | */ |
11 | -require_once __DIR__ . '/../config.php'; |
|
11 | +require_once __DIR__.'/../config.php'; |
|
12 | 12 | |
13 | 13 | $plugin = AdvancedSubscriptionPlugin::create(); |
14 | 14 | // Get validation hash |
@@ -120,8 +120,7 @@ discard block |
||
120 | 120 | $isWesternNameOrder = api_is_western_name_order(); |
121 | 121 | foreach ($adminsArray as &$admin) { |
122 | 122 | $admin['complete_name'] = $isWesternNameOrder ? |
123 | - $admin['firstname'] . ', ' . $admin['lastname'] : |
|
124 | - $admin['lastname'] . ', ' . $admin['firstname'] |
|
123 | + $admin['firstname'].', '.$admin['lastname'] : $admin['lastname'].', '.$admin['firstname'] |
|
125 | 124 | ; |
126 | 125 | } |
127 | 126 | unset($admin); |
@@ -140,8 +139,8 @@ discard block |
||
140 | 139 | $res = $plugin->updateQueueStatus($data, ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED); |
141 | 140 | if (!empty($res)) { |
142 | 141 | // Prepare admin url |
143 | - $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . |
|
144 | - 'advanced_subscription/src/admin_view.php?s=' . $data['sessionId']; |
|
142 | + $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH). |
|
143 | + 'advanced_subscription/src/admin_view.php?s='.$data['sessionId']; |
|
145 | 144 | // Send mails |
146 | 145 | $result['mailIds'] = $plugin->sendMail( |
147 | 146 | $data, |
@@ -276,8 +275,7 @@ discard block |
||
276 | 275 | $isWesternNameOrder = api_is_western_name_order(); |
277 | 276 | foreach ($adminsArray as &$admin) { |
278 | 277 | $admin['complete_name'] = $isWesternNameOrder ? |
279 | - $admin['firstname'] . ', ' . $admin['lastname'] : |
|
280 | - $admin['lastname'] . ', ' . $admin['firstname'] |
|
278 | + $admin['firstname'].', '.$admin['lastname'] : $admin['lastname'].', '.$admin['firstname'] |
|
281 | 279 | ; |
282 | 280 | } |
283 | 281 | unset($admin); |
@@ -288,7 +286,7 @@ discard block |
||
288 | 286 | $data['session'] = $sessionArray; |
289 | 287 | $data['signature'] = api_get_setting('Institution'); |
290 | 288 | $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) |
291 | - . 'advanced_subscription/src/admin_view.php?s=' . $data['sessionId']; |
|
289 | + . 'advanced_subscription/src/admin_view.php?s='.$data['sessionId']; |
|
292 | 290 | // Check if exist and action in data |
293 | 291 | if (empty($data['mailAction'])) { |
294 | 292 | // set action in data by new status |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * Init |
10 | 10 | */ |
11 | 11 | |
12 | -require_once __DIR__ . '/../config.php'; |
|
12 | +require_once __DIR__.'/../config.php'; |
|
13 | 13 | $plugin = AdvancedSubscriptionPlugin::create(); |
14 | 14 | $now = api_get_utc_datetime(); |
15 | 15 | $weekAgo = api_get_utc_datetime('-1 week'); |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Get session list |
20 | 20 | */ |
21 | -$joinTables = Database::get_main_table(TABLE_MAIN_SESSION) . ' s INNER JOIN ' . |
|
22 | - Database::get_main_table(TABLE_MAIN_SESSION_USER) . ' su ON s.id = su.session_id INNER JOIN ' . |
|
23 | - Database::get_main_table(TABLE_MAIN_USER_REL_USER) . ' uu ON su.user_id = uu.user_id INNER JOIN ' . |
|
24 | - Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE) . ' asq ON su.session_id = asq.session_id AND su.user_id = asq.user_id'; |
|
21 | +$joinTables = Database::get_main_table(TABLE_MAIN_SESSION).' s INNER JOIN '. |
|
22 | + Database::get_main_table(TABLE_MAIN_SESSION_USER).' su ON s.id = su.session_id INNER JOIN '. |
|
23 | + Database::get_main_table(TABLE_MAIN_USER_REL_USER).' uu ON su.user_id = uu.user_id INNER JOIN '. |
|
24 | + Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE).' asq ON su.session_id = asq.session_id AND su.user_id = asq.user_id'; |
|
25 | 25 | $columns = 's.id AS session_id, uu.friend_user_id AS superior_id, uu.user_id AS student_id, asq.id AS queue_id, asq.status AS status'; |
26 | 26 | $conditions = array( |
27 | 27 | 'where' => array( |
@@ -133,8 +133,7 @@ discard block |
||
133 | 133 | $isWesternNameOrder = api_is_western_name_order(); |
134 | 134 | foreach ($admins as &$admin) { |
135 | 135 | $admin['complete_name'] = $isWesternNameOrder ? |
136 | - $admin['firstname'] . ', ' . $admin['lastname'] : |
|
137 | - $admin['lastname'] . ', ' . $admin['firstname'] |
|
136 | + $admin['firstname'].', '.$admin['lastname'] : $admin['lastname'].', '.$admin['firstname'] |
|
138 | 137 | ; |
139 | 138 | } |
140 | 139 | unset($admin); |
@@ -149,8 +148,8 @@ discard block |
||
149 | 148 | ); |
150 | 149 | foreach ($queueByAdmin as $sessionId => $studentInfo) { |
151 | 150 | $data['sessionId'] = $sessionId; |
152 | - $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . |
|
153 | - 'advanced_subscription/src/admin_view.php?s=' . $data['sessionId']; |
|
151 | + $data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH). |
|
152 | + 'advanced_subscription/src/admin_view.php?s='.$data['sessionId']; |
|
154 | 153 | $data['session'] = $sessionInfoList[$sessionId]; |
155 | 154 | $data['students'] = $studentInfo['students']; |
156 | 155 | $plugin->sendMail($data, ADVANCED_SUBSCRIPTION_ACTION_REMINDER_ADMIN); |
@@ -101,7 +101,7 @@ |
||
101 | 101 | $resubscriptionDate = gmdate($limitDateFormat, strtotime($endDate." +$resubscriptionOffset")); |
102 | 102 | $icon = Display::return_icon('students.gif', get_lang('Student')); |
103 | 103 | $canResubscribeFrom = sprintf(get_plugin_lang('CanResubscribeFromX', 'resubscription'), $resubscriptionDate); |
104 | - throw new Exception(Display::label($icon . ' ' . $canResubscribeFrom, "info")); |
|
104 | + throw new Exception(Display::label($icon.' '.$canResubscribeFrom, "info")); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
@@ -17,4 +17,4 @@ |
||
17 | 17 | // The plugin author. |
18 | 18 | $plugin_info['author'] = 'Julio Montoya'; |
19 | 19 | // For bigger icons change this value to addthis_32x32_style |
20 | -$plugin_info['icon_class'] = ''; |
|
20 | +$plugin_info['icon_class'] = ''; |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $plugin_info['templates'] = array('template.tpl'); |
24 | 24 | |
25 | 25 | //For bigger icons change this value to addthis_32x32_style |
26 | -$plugin_info['icon_class'] = ''; |
|
26 | +$plugin_info['icon_class'] = ''; |
|
27 | 27 | |
28 | 28 | //To use vertical alignment change this value to |
29 | -$plugin_info['position'] = 'addthis_default_style'; //addthis_vertical_style |
|
29 | +$plugin_info['position'] = 'addthis_default_style'; //addthis_vertical_style |