@@ -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', |
@@ -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, |
@@ -123,7 +123,10 @@ |
||
123 | 123 | echo '</div>'; |
124 | 124 | ?> |
125 | 125 | |
126 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
126 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) { |
|
127 | + echo '&add=true'; |
|
128 | +} |
|
129 | +?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
127 | 130 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
128 | 131 | |
129 | 132 |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | $column['course'].'` '; |
35 | 35 | } |
36 | 36 | $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
37 | - foreach ($columns as $key => $column) // fixme sessions |
|
37 | + foreach ($columns as $key => $column) { |
|
38 | + // fixme sessions |
|
38 | 39 | { |
39 | 40 | $query .= 'left outer join '. |
40 | 41 | Database::get_main_table(TABLE_MAIN_REPORTS_VALUES). |
@@ -42,5 +43,6 @@ discard block |
||
42 | 43 | ' on k'.$key.'.key_id = '.$column['kid']. |
43 | 44 | ' and k'.$key.'.user_id = u.user_id '; |
44 | 45 | } |
46 | + } |
|
45 | 47 | return $query; |
46 | 48 | } |
@@ -33,8 +33,7 @@ |
||
33 | 33 | // Include the allowed tags. |
34 | 34 | //include __DIR__.'/allowed_tags.inc.php'; |
35 | 35 | global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page; |
36 | - switch ($mode) |
|
37 | - { |
|
36 | + switch ($mode) { |
|
38 | 37 | case NO_HTML: |
39 | 38 | return array(); |
40 | 39 | break; |
@@ -5,7 +5,9 @@ |
||
5 | 5 | parse_str($HTTP_RAW_POST_DATA, $_POST); |
6 | 6 | } |
7 | 7 | |
8 | - if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__.'/../../../'); |
|
8 | + if (!defined('DOKU_INC')) { |
|
9 | + define('DOKU_INC', __DIR__.'/../../../'); |
|
10 | + } |
|
9 | 11 | require_once(DOKU_INC.'inc/init.php'); |
10 | 12 | require_once(DOKU_INC.'inc/common.php'); |
11 | 13 | require_once(DOKU_INC.'inc/pageutils.php'); |
@@ -19,12 +19,14 @@ discard block |
||
19 | 19 | public $course_settings_callback = true; |
20 | 20 | public $error = ''; |
21 | 21 | |
22 | - static function create() { |
|
22 | + static function create() |
|
23 | + { |
|
23 | 24 | static $result = null; |
24 | 25 | return $result ? $result : $result = new self(); |
25 | 26 | } |
26 | 27 | |
27 | - protected function __construct() { |
|
28 | + protected function __construct() |
|
29 | + { |
|
28 | 30 | parent::__construct('0.1', 'Yannick Warnier, Aliosh Neira', array('tool_enable' => 'boolean')); |
29 | 31 | |
30 | 32 | $this->course_settings = array(); |
@@ -42,12 +44,14 @@ discard block |
||
42 | 44 | } |
43 | 45 | } |
44 | 46 | |
45 | - function install() { |
|
47 | + function install() |
|
48 | + { |
|
46 | 49 | //Installing course settings |
47 | 50 | $this->install_course_fields_in_all_courses(false); |
48 | 51 | } |
49 | 52 | |
50 | - function uninstall() { |
|
53 | + function uninstall() |
|
54 | + { |
|
51 | 55 | //Deleting course settings |
52 | 56 | $this->uninstall_course_fields_in_all_courses($this->course_settings); |
53 | 57 | } |
@@ -57,12 +61,14 @@ discard block |
||
57 | 61 | * @param boolean Whether to add a tool link on the course homepage |
58 | 62 | * @return void |
59 | 63 | */ |
60 | - function course_install($course_id, $add_tool_link = true) { |
|
64 | + function course_install($course_id, $add_tool_link = true) |
|
65 | + { |
|
61 | 66 | //force ignoring the tools table insertion for this plugin |
62 | 67 | $this->install_course_fields($course_id, false); |
63 | 68 | } |
64 | 69 | |
65 | - function course_settings_updated($values = array()) { |
|
70 | + function course_settings_updated($values = array()) |
|
71 | + { |
|
66 | 72 | if (!is_array($values) or count($values) == 0) { |
67 | 73 | return false; |
68 | 74 | } |
@@ -72,7 +78,8 @@ discard block |
||
72 | 78 | * Get a list of options (checked and unchecked) for blacklists as coming |
73 | 79 | * from the Squid files |
74 | 80 | */ |
75 | - function get_blacklist_options() { |
|
81 | + function get_blacklist_options() |
|
82 | + { |
|
76 | 83 | $categories = $blacklists = array(); |
77 | 84 | if (!is_dir($this->blacklists_dir)) { |
78 | 85 | $this->error = 'Could not find blacklists dir '.$this->blacklists_dir; |
@@ -110,7 +117,8 @@ discard block |
||
110 | 117 | * @param array Array of blacklists names |
111 | 118 | * @return boolean False on error, True on success |
112 | 119 | */ |
113 | - function set_blacklist_options($values) { |
|
120 | + function set_blacklist_options($values) |
|
121 | + { |
|
114 | 122 | if (!is_array($values)) { return false; } |
115 | 123 | if (!is_writeable($this->blacklist_enabled_file)) { return false; } |
116 | 124 | $new_blacklist = ''; |
@@ -4,8 +4,9 @@ |
||
4 | 4 | require_once __DIR__.'/../../inc/global.inc.php'; |
5 | 5 | $url = api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php'; |
6 | 6 | |
7 | -if (!isset($_SESSION['conditional_login']['uid'])) |
|
7 | +if (!isset($_SESSION['conditional_login']['uid'])) { |
|
8 | 8 | die("Not Authorised"); |
9 | +} |
|
9 | 10 | ?> |
10 | 11 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
11 | 12 | <html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml"> |