@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | 3 | * Validates imported data. |
4 | + * @param Ddeboer\DataImport\Reader\CsvReader $users |
|
4 | 5 | */ |
5 | 6 | function validate_data($users) |
6 | 7 | { |
@@ -85,6 +86,7 @@ discard block |
||
85 | 86 | |
86 | 87 | /** |
87 | 88 | * Save the imported data |
89 | + * @param Ddeboer\DataImport\Reader\CsvReader $users |
|
88 | 90 | */ |
89 | 91 | function save_data($users) |
90 | 92 | { |
@@ -143,7 +145,7 @@ discard block |
||
143 | 145 | /** |
144 | 146 | * Reads the CSV-file. |
145 | 147 | * @param string $file Path to the CSV-file |
146 | - * @return array All user information read from the file |
|
148 | + * @return Ddeboer\DataImport\Reader\CsvReader All user information read from the file |
|
147 | 149 | */ |
148 | 150 | function parse_csv_data($file) |
149 | 151 | { |
@@ -39,6 +39,9 @@ |
||
39 | 39 | return $this->activateByRoute($request->get('_route'), $rootItems); |
40 | 40 | } |
41 | 41 | |
42 | + /** |
|
43 | + * @param MenuItemModel[] $items |
|
44 | + */ |
|
42 | 45 | protected function activateByRoute($route, $items) |
43 | 46 | { |
44 | 47 | foreach ($items as $item) { /** @var $item MenuItemModel */ |
@@ -38,17 +38,17 @@ |
||
38 | 38 | $needle = Database::escape_string($needle); |
39 | 39 | // search courses where username or firstname or lastname begins likes $needle |
40 | 40 | $sql = 'SELECT code, title FROM '.$tbl_course.' u '. |
41 | - ' WHERE (title LIKE "'.$needle.'%" '. |
|
42 | - ' OR code LIKE "'.$needle.'%" '. |
|
43 | - ' ) '. |
|
44 | - ' ORDER BY title, code '. |
|
45 | - ' LIMIT 11'; |
|
41 | + ' WHERE (title LIKE "'.$needle.'%" '. |
|
42 | + ' OR code LIKE "'.$needle.'%" '. |
|
43 | + ' ) '. |
|
44 | + ' ORDER BY title, code '. |
|
45 | + ' LIMIT 11'; |
|
46 | 46 | $rs = Database::query($sql); |
47 | 47 | $i = 0; |
48 | 48 | while ($course = Database::fetch_array($rs)) { |
49 | 49 | $i++; |
50 | 50 | if ($i <= 10) { |
51 | - $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($course['code']).'\',\''.addslashes($course['title']).' ('.addslashes($course['code']).')'.'\')">'.$course['title'].' ('.$course['code'].')</a><br />'; |
|
51 | + $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($course['code']).'\',\''.addslashes($course['title']).' ('.addslashes($course['code']).')'.'\')">'.$course['title'].' ('.$course['code'].')</a><br />'; |
|
52 | 52 | } else { |
53 | 53 | $return .= '...<br />'; |
54 | 54 | } |
@@ -1756,7 +1756,7 @@ discard block |
||
1756 | 1756 | $html .= '<label class="checkbox-inline"> |
1757 | 1757 | <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ').' /> '.get_lang('No').' |
1758 | 1758 | </label>'; |
1759 | - $html .= '<label class="checkbox-inline"> |
|
1759 | + $html .= '<label class="checkbox-inline"> |
|
1760 | 1760 | <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ').' /> '.get_lang('AfterApproval').' |
1761 | 1761 | </label>'; |
1762 | 1762 | $html .= '</div>'; |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | </div>'; |
1791 | 1791 | |
1792 | 1792 | echo panel($html, get_lang('Platform'), 'platform'); |
1793 | - ?> |
|
1793 | + ?> |
|
1794 | 1794 | <div class='form-group'> |
1795 | 1795 | <div class="col-sm-6"> |
1796 | 1796 | <button type="submit" class="btn btn-default pull-right" name="step3" value="< <?php echo get_lang('Previous'); ?>" ><em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?></button> |
@@ -1880,7 +1880,7 @@ discard block |
||
1880 | 1880 | $access_url_locked_settings = api_get_locked_settings(); |
1881 | 1881 | $table = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
1882 | 1882 | foreach ($access_url_locked_settings as $setting) { |
1883 | - $sql = "UPDATE $table SET access_url_locked = 1 WHERE variable = '$setting'"; |
|
1883 | + $sql = "update $table SET access_url_locked = 1 WHERE variable = '$setting'"; |
|
1884 | 1884 | Database::query($sql); |
1885 | 1885 | } |
1886 | 1886 | } |
@@ -1894,11 +1894,11 @@ discard block |
||
1894 | 1894 | $permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770; |
1895 | 1895 | $permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660; |
1896 | 1896 | // use decoct() to store as string |
1897 | - $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_directories)."' |
|
1897 | + $sql = "update $table SET selected_value = '0".decoct($permissions_for_new_directories)."' |
|
1898 | 1898 | WHERE variable = 'permissions_for_new_directories'"; |
1899 | 1899 | Database::query($sql); |
1900 | 1900 | |
1901 | - $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable = 'permissions_for_new_files'"; |
|
1901 | + $sql = "update $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable = 'permissions_for_new_files'"; |
|
1902 | 1902 | Database::query($sql); |
1903 | 1903 | |
1904 | 1904 | if (isset($_SESSION['permissions_for_new_directories'])) { |
@@ -1977,7 +1977,7 @@ discard block |
||
1977 | 1977 | //Check fsockopen (not sure it works with https). If that is your case, you might want to try the |
1978 | 1978 | // suggestion at https://support.chamilo.org/issues/8260#note-3 (although it ignores SSL peer checks) |
1979 | 1979 | if ($fp = @fsockopen(str_replace('http://', $scheme, $url), $port, $sock_errno, $sock_errmsg, 60)) { |
1980 | - $out = "GET $path HTTP/1.1\r\n"; |
|
1980 | + $out = "get $path HTTP/1.1\r\n"; |
|
1981 | 1981 | $out .= "Host: $host\r\n"; |
1982 | 1982 | $out .= "Connection: Close\r\n\r\n"; |
1983 | 1983 | |
@@ -2285,7 +2285,7 @@ discard block |
||
2285 | 2285 | $data = $connection->fetchAssoc($sql); |
2286 | 2286 | if (!empty($data)) { |
2287 | 2287 | $newGroupId = $data['iid']; |
2288 | - $sql = "UPDATE $table SET group_id = $newGroupId |
|
2288 | + $sql = "update $table SET group_id = $newGroupId |
|
2289 | 2289 | WHERE iid = $iid"; |
2290 | 2290 | $connection->executeQuery($sql); |
2291 | 2291 | } else { |
@@ -2481,7 +2481,7 @@ discard block |
||
2481 | 2481 | $path['dir'] |
2482 | 2482 | ); |
2483 | 2483 | $command = "mv {$path['dir']} $newPath "; |
2484 | - error_log("Executing $command"); |
|
2484 | + error_log("executing $command"); |
|
2485 | 2485 | system($command); |
2486 | 2486 | } |
2487 | 2487 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * This function return the value of a php.ini setting if not "" or if exists, |
124 | 124 | * otherwise return false |
125 | 125 | * @param string $phpSetting The name of a PHP setting |
126 | - * @return mixed The value of the setting, or false if not found |
|
126 | + * @return string|false The value of the setting, or false if not found |
|
127 | 127 | */ |
128 | 128 | function checkPhpSettingExists($phpSetting) |
129 | 129 | { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * Returns a textual value ('ON' or 'OFF') based on a requester 2-state ini- configuration setting. |
155 | 155 | * |
156 | 156 | * @param string $val a php ini value |
157 | - * @return bool ON or OFF |
|
157 | + * @return string ON or OFF |
|
158 | 158 | * @author Joomla <http://www.joomla.org> |
159 | 159 | */ |
160 | 160 | function getPhpSetting($val) |
@@ -1358,6 +1358,10 @@ discard block |
||
1358 | 1358 | * @param string Extra notice (to show on the right side) |
1359 | 1359 | * @param boolean Whether to display in update mode |
1360 | 1360 | * @param string Additional attribute for the <tr> element |
1361 | + * @param string $installType |
|
1362 | + * @param string $parameterName |
|
1363 | + * @param string $formFieldName |
|
1364 | + * @param string $extra_notice |
|
1361 | 1365 | * @return void Direct output |
1362 | 1366 | */ |
1363 | 1367 | function displayDatabaseParameter( |
@@ -1561,6 +1565,11 @@ discard block |
||
1561 | 1565 | <?php |
1562 | 1566 | } |
1563 | 1567 | |
1568 | +/** |
|
1569 | + * @param string $content |
|
1570 | + * @param string $title |
|
1571 | + * @param string $id |
|
1572 | + */ |
|
1564 | 1573 | function panel($content = null, $title = null, $id = null, $style = null) |
1565 | 1574 | { |
1566 | 1575 | $html = ''; |
@@ -1924,8 +1933,8 @@ discard block |
||
1924 | 1933 | } |
1925 | 1934 | |
1926 | 1935 | /** |
1927 | - * @param $current_value |
|
1928 | - * @param $wanted_value |
|
1936 | + * @param string $current_value |
|
1937 | + * @param string $wanted_value |
|
1929 | 1938 | * @return string |
1930 | 1939 | */ |
1931 | 1940 | function compare_setting_values($current_value, $wanted_value) |
@@ -1942,8 +1951,8 @@ discard block |
||
1942 | 1951 | } |
1943 | 1952 | |
1944 | 1953 | /** |
1945 | - * @param $course_dir |
|
1946 | - * @param $course_attempt_name |
|
1954 | + * @param string $course_dir |
|
1955 | + * @param string $course_attempt_name |
|
1947 | 1956 | * @param string $file |
1948 | 1957 | * @return bool |
1949 | 1958 | */ |
@@ -70,7 +70,8 @@ discard block |
||
70 | 70 | $returnFailure = 'No', |
71 | 71 | $optional = false, |
72 | 72 | $enabledTerm = '' |
73 | -) { |
|
73 | +) |
|
74 | +{ |
|
74 | 75 | if (extension_loaded($extensionName)) { |
75 | 76 | if (!empty($enabledTerm)) { |
76 | 77 | $isEnabled = ini_get($enabledTerm); |
@@ -109,7 +110,8 @@ discard block |
||
109 | 110 | $recommendedValue, |
110 | 111 | $returnSuccess = false, |
111 | 112 | $returnFailure = false |
112 | -) { |
|
113 | +) |
|
114 | +{ |
|
113 | 115 | $currentPhpValue = getPhpSetting($phpSetting); |
114 | 116 | if ($currentPhpValue == $recommendedValue) { |
115 | 117 | return Display::label($currentPhpValue.' '.$returnSuccess, 'success'); |
@@ -563,7 +565,8 @@ discard block |
||
563 | 565 | $dbPassForm, |
564 | 566 | $dbNameForm, |
565 | 567 | $dbPortForm = 3306 |
566 | -) { |
|
568 | +) |
|
569 | +{ |
|
567 | 570 | $dbParams = array( |
568 | 571 | 'driver' => 'pdo_mysql', |
569 | 572 | 'host' => $dbHostForm, |
@@ -610,7 +613,8 @@ discard block |
||
610 | 613 | function display_language_selection_box( |
611 | 614 | $name = 'language_list', |
612 | 615 | $default_language = 'english' |
613 | -) { |
|
616 | +) |
|
617 | +{ |
|
614 | 618 | // Reading language list. |
615 | 619 | $language_list = get_language_folder_list(); |
616 | 620 | |
@@ -712,7 +716,8 @@ discard block |
||
712 | 716 | $badUpdatePath, |
713 | 717 | $updatePath = '', |
714 | 718 | $update_from_version_8 = array() |
715 | -) { |
|
719 | +) |
|
720 | +{ |
|
716 | 721 | global $_setting; |
717 | 722 | echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('Requirements')."</h2></div>"; |
718 | 723 | echo '<div class="RequirementText">'; |
@@ -1032,8 +1037,7 @@ discard block |
||
1032 | 1037 | <?php echo get_lang('Error'); ?>!<br /> |
1033 | 1038 | Chamilo <?php echo implode('|', $update_from_version_8).' '.get_lang('HasNotBeenFoundInThatDir'); ?>. |
1034 | 1039 | </div> |
1035 | - <?php } |
|
1036 | - else { |
|
1040 | + <?php } else { |
|
1037 | 1041 | echo '<br />'; |
1038 | 1042 | } |
1039 | 1043 | ?> |
@@ -1153,7 +1157,10 @@ discard block |
||
1153 | 1157 | <button type="submit" name="step1" class="btn btn-default" onclick="javascript: window.location='index.php'; return false;" value="<?php echo get_lang('Previous'); ?>" > |
1154 | 1158 | <em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?> |
1155 | 1159 | </button> |
1156 | - <button type="submit" name="step2_install" class="btn btn-success" value="<?php echo get_lang("NewInstallation"); ?>" <?php if ($error) echo 'disabled="disabled"'; ?> > |
|
1160 | + <button type="submit" name="step2_install" class="btn btn-success" value="<?php echo get_lang("NewInstallation"); ?>" <?php if ($error) { |
|
1161 | + echo 'disabled="disabled"'; |
|
1162 | +} |
|
1163 | +?> > |
|
1157 | 1164 | <em class="fa fa-forward"> </em> <?php echo get_lang('NewInstallation'); ?> |
1158 | 1165 | </button> |
1159 | 1166 | <input type="hidden" name="is_executable" id="is_executable" value="-" /> |
@@ -1368,7 +1375,8 @@ discard block |
||
1368 | 1375 | $extra_notice, |
1369 | 1376 | $displayWhenUpdate = true, |
1370 | 1377 | $tr_attribute = '' |
1371 | -) { |
|
1378 | +) |
|
1379 | +{ |
|
1372 | 1380 | //echo "<tr ".$tr_attribute.">"; |
1373 | 1381 | echo "<label class='col-sm-4'>$parameterName</label>"; |
1374 | 1382 | |
@@ -1409,7 +1417,8 @@ discard block |
||
1409 | 1417 | $dbNameForm, |
1410 | 1418 | $dbPortForm = 3306, |
1411 | 1419 | $installationProfile = '' |
1412 | -) { |
|
1420 | +) |
|
1421 | +{ |
|
1413 | 1422 | if ($installType == 'update') { |
1414 | 1423 | global $_configuration; |
1415 | 1424 | $dbHostForm = $_configuration['db_host']; |
@@ -1532,9 +1541,12 @@ discard block |
||
1532 | 1541 | Database port: <strong><?php echo $manager->getConnection()->getPort(); ?></strong><br/> |
1533 | 1542 | Database driver: <strong><?php echo $manager->getConnection()->getDriver()->getName(); ?></strong><br/> |
1534 | 1543 | </div> |
1535 | - <?php else: ?> |
|
1544 | + <?php else { |
|
1545 | + : ?> |
|
1536 | 1546 | <div id="db_status" class="alert alert-danger"> |
1537 | - <p><?php echo get_lang('FailedConectionDatabase'); ?></strong></p> |
|
1547 | + <p><?php echo get_lang('FailedConectionDatabase'); |
|
1548 | +} |
|
1549 | +?></strong></p> |
|
1538 | 1550 | <code><?php echo $database_exists_text ?></code> |
1539 | 1551 | </div> |
1540 | 1552 | <?php endif; ?> |
@@ -1594,7 +1606,8 @@ discard block |
||
1594 | 1606 | $formFieldName, |
1595 | 1607 | $parameterValue, |
1596 | 1608 | $displayWhenUpdate = 'true' |
1597 | -) { |
|
1609 | +) |
|
1610 | +{ |
|
1598 | 1611 | $html = '<div class="form-group">'; |
1599 | 1612 | $html .= '<label class="col-sm-6 control-label">'.$parameterName.'</label>'; |
1600 | 1613 | if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) { |
@@ -1641,7 +1654,8 @@ discard block |
||
1641 | 1654 | $allowSelfRegProf, |
1642 | 1655 | $loginForm, |
1643 | 1656 | $passForm |
1644 | -) { |
|
1657 | +) |
|
1658 | +{ |
|
1645 | 1659 | if ($installType != 'update' && empty($languageForm)) { |
1646 | 1660 | $languageForm = $_SESSION['install_language']; |
1647 | 1661 | } |
@@ -1678,7 +1692,8 @@ discard block |
||
1678 | 1692 | if ($installType == 'update') { |
1679 | 1693 | $html .= '<input type="hidden" name="languageForm" value="'.api_htmlentities($languageForm, ENT_QUOTES).'" />'.$languageForm; |
1680 | 1694 | |
1681 | - } else { // new installation |
|
1695 | + } else { |
|
1696 | +// new installation |
|
1682 | 1697 | $html .= '<div class="col-sm-6">'; |
1683 | 1698 | $html .= display_language_selection_box('languageForm', $languageForm); |
1684 | 1699 | $html .= '</div>'; |
@@ -1951,7 +1966,8 @@ discard block |
||
1951 | 1966 | $course_dir, |
1952 | 1967 | $course_attempt_name, |
1953 | 1968 | $file = 'test.php' |
1954 | -) { |
|
1969 | +) |
|
1970 | +{ |
|
1955 | 1971 | $output = false; |
1956 | 1972 | //Write in file |
1957 | 1973 | $file_name = $course_dir.'/'.$file; |
@@ -2061,7 +2077,8 @@ discard block |
||
2061 | 2077 | $allowRegistration, |
2062 | 2078 | $allowTeacherSelfRegistration, |
2063 | 2079 | $installationProfile = '' |
2064 | -) { |
|
2080 | +) |
|
2081 | +{ |
|
2065 | 2082 | $allowTeacherSelfRegistration = $allowTeacherSelfRegistration ? 'true' : 'false'; |
2066 | 2083 | |
2067 | 2084 | // Use PHP 5.3 to avoid issue with weird peripherical auto-installers like travis-ci |
@@ -2759,7 +2776,8 @@ discard block |
||
2759 | 2776 | $allowSelfReg, |
2760 | 2777 | $allowSelfRegProf, |
2761 | 2778 | $installationProfile = '' |
2762 | -) { |
|
2779 | +) |
|
2780 | +{ |
|
2763 | 2781 | $sysPath = !empty($sysPath) ? $sysPath : api_get_path(SYS_PATH); |
2764 | 2782 | |
2765 | 2783 | $connection = $manager->getConnection(); |
@@ -102,7 +102,6 @@ discard block |
||
102 | 102 | * Exports the complete report as a CSV file |
103 | 103 | * @param string $document_path Document path inside the document tool |
104 | 104 | * @param string $hotpotato_name |
105 | - |
|
106 | 105 | * @return boolean False on error |
107 | 106 | */ |
108 | 107 | public function exportCompleteReportCSV($document_path = '', $hotpotato_name = '') |
@@ -140,11 +139,11 @@ discard block |
||
140 | 139 | // Results |
141 | 140 | foreach ($this->results as $row) { |
142 | 141 | if (api_is_western_name_order()) { |
143 | - $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
144 | - $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
142 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
143 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
145 | 144 | } else { |
146 | - $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
147 | - $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
145 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
146 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
148 | 147 | } |
149 | 148 | |
150 | 149 | $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';'; |
@@ -19,6 +19,7 @@ |
||
19 | 19 | * @param string The document path (for HotPotatoes retrieval) |
20 | 20 | * @param integer User ID. Optional. If no user ID is provided, we take all the results. Defauts to null |
21 | 21 | * @param string $document_path |
22 | + * @param string|null $hotpotato_name |
|
22 | 23 | * @return bool |
23 | 24 | */ |
24 | 25 | public function getExercisesReporting($document_path, $hotpotato_name) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $servicesSales = $plugin->getServiceSale(); |
31 | 31 | $serviceSaleList = []; |
32 | 32 | |
33 | -foreach ($servicesSales as $sale) { |
|
33 | +foreach ($servicesSales as $sale) { |
|
34 | 34 | $serviceSaleList[] = [ |
35 | 35 | 'id' => $sale['id'], |
36 | 36 | 'reference' => $sale['reference'], |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $template = new Template($templateName); |
53 | 53 | |
54 | -if ($paypalEnable == 'true' && $commissionsEnable == 'true') { |
|
54 | +if ($paypalEnable == 'true' && $commissionsEnable == 'true') { |
|
55 | 55 | $toolbar = Display::toolbarButton( |
56 | 56 | $plugin->get_lang('PaypalPayoutCommissions'), |
57 | 57 | api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php', |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ); |
67 | 67 | } |
68 | 68 | |
69 | -if ($commissionsEnable == 'true') { |
|
69 | +if ($commissionsEnable == 'true') { |
|
70 | 70 | $toolbar = Display::toolbarButton( |
71 | 71 | $plugin->get_lang('PayoutReport'), |
72 | 72 | api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php', |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | $commissionsEnable = $plugin->get('commissions_enable'); |
19 | 19 | $includeServices = $plugin->get('include_services'); |
20 | 20 | |
21 | -if (isset($_GET['order'])) { |
|
21 | +if (isset($_GET['order'])) { |
|
22 | 22 | $sale = $plugin->getSale($_GET['order']); |
23 | 23 | |
24 | - if (empty($sale)) { |
|
24 | + if (empty($sale)) { |
|
25 | 25 | api_not_allowed(true); |
26 | 26 | } |
27 | 27 | |
28 | 28 | $urlToRedirect = api_get_self().'?'; |
29 | 29 | |
30 | - switch ($_GET['action']) { |
|
30 | + switch ($_GET['action']) { |
|
31 | 31 | case 'confirm': |
32 | 32 | $plugin->completeSale($sale['id']); |
33 | 33 | $plugin->storePayouts($sale['id']); |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | |
76 | 76 | $form = new FormValidator('search', 'get'); |
77 | 77 | |
78 | -if ($form->validate()) { |
|
78 | +if ($form->validate()) { |
|
79 | 79 | $selectedFilterType = $form->getSubmitValue('filter_type'); |
80 | 80 | $selectedStatus = $form->getSubmitValue('status'); |
81 | 81 | $searchTerm = $form->getSubmitValue('user'); |
82 | 82 | |
83 | - if ($selectedStatus === false) { |
|
83 | + if ($selectedStatus === false) { |
|
84 | 84 | $selectedStatus = BuyCoursesPlugin::SALE_STATUS_PENDING; |
85 | 85 | } |
86 | 86 | |
87 | - if ($selectedFilterType === false) { |
|
87 | + if ($selectedFilterType === false) { |
|
88 | 88 | $selectedFilterType = '0'; |
89 | 89 | } |
90 | 90 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'status' => $selectedStatus |
107 | 107 | ]); |
108 | 108 | |
109 | -switch ($selectedFilterType) { |
|
109 | +switch ($selectedFilterType) { |
|
110 | 110 | case '0': |
111 | 111 | $sales = $plugin->getSaleListByStatus($selectedStatus); |
112 | 112 | break; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $saleList = []; |
119 | 119 | |
120 | -foreach ($sales as $sale) { |
|
120 | +foreach ($sales as $sale) { |
|
121 | 121 | $saleList[] = [ |
122 | 122 | 'id' => $sale['id'], |
123 | 123 | 'reference' => $sale['reference'], |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $template = new Template($templateName); |
141 | 141 | |
142 | -if ($paypalEnable == "true" && $commissionsEnable == "true") { |
|
142 | +if ($paypalEnable == "true" && $commissionsEnable == "true") { |
|
143 | 143 | $toolbar = Display::toolbarButton( |
144 | 144 | $plugin->get_lang('PaypalPayoutCommissions'), |
145 | 145 | api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php', |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
157 | -if ($commissionsEnable == "true") { |
|
157 | +if ($commissionsEnable == "true") { |
|
158 | 158 | $toolbar = Display::toolbarButton( |
159 | 159 | $plugin->get_lang('PayoutReport'), |
160 | 160 | api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php', |
@@ -615,7 +615,7 @@ |
||
615 | 615 | * |
616 | 616 | * @param string $id |
617 | 617 | * @param string $text |
618 | - * @return bool |
|
618 | + * @return false|null |
|
619 | 619 | */ |
620 | 620 | public function updateFeedback($id, $text) |
621 | 621 | { |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | // Mark folders to import which are not selected by the user to import, |
554 | 554 | // but in which a document was selected. |
555 | 555 | $documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null; |
556 | - if (!empty($resources) && is_array($resources)) |
|
557 | - foreach ($resources as $id => $obj) { |
|
556 | + if (!empty($resources) && is_array($resources)) { |
|
557 | + foreach ($resources as $id => $obj) { |
|
558 | 558 | if (isset($obj->file_type) && $obj->file_type == 'folder' && |
559 | 559 | !isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) && |
560 | 560 | is_array($documents) |
@@ -562,6 +562,7 @@ discard block |
||
562 | 562 | foreach ($documents as $id_to_check => $post_value) { |
563 | 563 | if (isset($resources[$id_to_check])) { |
564 | 564 | $obj_to_check = $resources[$id_to_check]; |
565 | + } |
|
565 | 566 | $shared_path_part = substr( |
566 | 567 | $obj_to_check->path, |
567 | 568 | 0, |