@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /* For license terms, see /license.txt */ |
| 3 | 3 | /** |
| 4 | - * Plugin database installation script. Can only be executed if included |
|
| 5 | - * inside another script loading global.inc.php |
|
| 6 | - * @package chamilo.plugin.buycourses |
|
| 7 | - */ |
|
| 4 | + * Plugin database installation script. Can only be executed if included |
|
| 5 | + * inside another script loading global.inc.php |
|
| 6 | + * @package chamilo.plugin.buycourses |
|
| 7 | + */ |
|
| 8 | 8 | /** |
| 9 | - * Check if script can be called |
|
| 10 | - */ |
|
| 9 | + * Check if script can be called |
|
| 10 | + */ |
|
| 11 | 11 | if (!function_exists('api_get_path')) { |
| 12 | 12 | die('This script must be loaded through the Chamilo plugin installer sequence'); |
| 13 | 13 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /* For license terms, see /license.txt */ |
| 3 | 3 | /** |
| 4 | - * Configuration script for the Buy Courses plugin |
|
| 5 | - * @package chamilo.plugin.buycourses |
|
| 6 | - */ |
|
| 4 | + * Configuration script for the Buy Courses plugin |
|
| 5 | + * @package chamilo.plugin.buycourses |
|
| 6 | + */ |
|
| 7 | 7 | /** |
| 8 | - * Initialization |
|
| 9 | - */ |
|
| 8 | + * Initialization |
|
| 9 | + */ |
|
| 10 | 10 | $cidReset = true; |
| 11 | 11 | |
| 12 | 12 | require_once '../../../main/inc/global.inc.php'; |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * List of courses |
|
| 4 | - * @package chamilo.plugin.buycourses |
|
| 5 | - */ |
|
| 3 | + * List of courses |
|
| 4 | + * @package chamilo.plugin.buycourses |
|
| 5 | + */ |
|
| 6 | 6 | /** |
| 7 | - * Initialization |
|
| 8 | - */ |
|
| 7 | + * Initialization |
|
| 8 | + */ |
|
| 9 | 9 | $cidReset = true; |
| 10 | 10 | |
| 11 | 11 | require_once '../../../main/inc/global.inc.php'; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * |
| 47 | - * @return StaticPlugin |
|
| 47 | + * @return BuyCoursesPlugin |
|
| 48 | 48 | */ |
| 49 | 49 | static function create() |
| 50 | 50 | {
|
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | /** |
| 217 | 217 | * Save a transfer account information |
| 218 | 218 | * @param array $params The transfer account |
| 219 | - * @return int Rows affected. Otherwise return false |
|
| 219 | + * @return false|string Rows affected. Otherwise return false |
|
| 220 | 220 | */ |
| 221 | 221 | public function saveTransferAccount($params) |
| 222 | 222 | {
|
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | /** |
| 627 | 627 | * Get session info |
| 628 | 628 | * @param array $sessionId The session ID |
| 629 | - * @return array |
|
| 629 | + * @return Chamilo\CoreBundle\Entity\Session |
|
| 630 | 630 | */ |
| 631 | 631 | public function getSessionInfo($sessionId) |
| 632 | 632 | {
|
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | * Register a sale |
| 720 | 720 | * @param int $itemId The product ID |
| 721 | 721 | * @param int $paymentType The payment type |
| 722 | - * @return boolean |
|
| 722 | + * @return false|string |
|
| 723 | 723 | */ |
| 724 | 724 | public function registerSale($itemId, $paymentType) |
| 725 | 725 | {
|
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | |
| 919 | 919 | /** |
| 920 | 920 | * Get payment types |
| 921 | - * @return array |
|
| 921 | + * @return string[] |
|
| 922 | 922 | */ |
| 923 | 923 | public function getPaymentTypes() |
| 924 | 924 | {
|
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | |
| 957 | 957 | /** |
| 958 | 958 | * Get the statuses for sales |
| 959 | - * @return array |
|
| 959 | + * @return string[] |
|
| 960 | 960 | */ |
| 961 | 961 | public function getSaleStatuses() |
| 962 | 962 | {
|
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | |
| 970 | 970 | /** |
| 971 | 971 | * Get the statuses for sales |
| 972 | - * @return array |
|
| 972 | + * @return string[] |
|
| 973 | 973 | */ |
| 974 | 974 | public function getServiceSaleStatuses() |
| 975 | 975 | {
|
@@ -982,7 +982,7 @@ discard block |
||
| 982 | 982 | |
| 983 | 983 | /** |
| 984 | 984 | * Get the statuses for Payouts |
| 985 | - * @return array |
|
| 985 | + * @return string[] |
|
| 986 | 986 | */ |
| 987 | 987 | public function getPayoutStatuses() |
| 988 | 988 | {
|
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | |
| 996 | 996 | /** |
| 997 | 997 | * Get the list of service types |
| 998 | - * @return array |
|
| 998 | + * @return string[] |
|
| 999 | 999 | */ |
| 1000 | 1000 | public function getServiceTypes() |
| 1001 | 1001 | {
|
@@ -1008,7 +1008,7 @@ discard block |
||
| 1008 | 1008 | |
| 1009 | 1009 | /** |
| 1010 | 1010 | * Get the list of product types |
| 1011 | - * @return array |
|
| 1011 | + * @return string[] |
|
| 1012 | 1012 | */ |
| 1013 | 1013 | public function getProductTypes() |
| 1014 | 1014 | {
|
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | /** |
| 1390 | 1390 | * Register a item |
| 1391 | 1391 | * @param array $itemData The item data |
| 1392 | - * @return int The item ID. Otherwise return false |
|
| 1392 | + * @return false|string The item ID. Otherwise return false |
|
| 1393 | 1393 | */ |
| 1394 | 1394 | public function registerItem(array $itemData) |
| 1395 | 1395 | {
|
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | /** |
| 1675 | 1675 | * Register addicional service |
| 1676 | 1676 | * @param array params $service |
| 1677 | - * @return database response |
|
| 1677 | + * @return false|string response |
|
| 1678 | 1678 | */ |
| 1679 | 1679 | public function storeService($service) |
| 1680 | 1680 | {
|
@@ -1872,7 +1872,7 @@ discard block |
||
| 1872 | 1872 | * @param int $serviceId The service ID |
| 1873 | 1873 | * @param int $paymentType The payment type |
| 1874 | 1874 | * @param int $infoSelect The ID for Service Type |
| 1875 | - * @return boolean |
|
| 1875 | + * @return false|string |
|
| 1876 | 1876 | */ |
| 1877 | 1877 | public function registerServiceSale($serviceId, $paymentType, $infoSelect) |
| 1878 | 1878 | {
|
@@ -397,6 +397,7 @@ |
||
| 397 | 397 | * @nvpStr is nvp string. |
| 398 | 398 | * returns an associtive array containing the response from the server. |
| 399 | 399 | * |
| 400 | + * @param string $methodName |
|
| 400 | 401 | */ |
| 401 | 402 | function hash_call($methodName, $nvpStr) |
| 402 | 403 | {
|
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | * phoneNum: the phoneNum entered on the merchant's site |
| 112 | 112 | */ |
| 113 | 113 | function CallMarkExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, |
| 114 | - $cancelURL, $shipToName, $shipToStreet, $shipToCity, $shipToState, |
|
| 115 | - $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum |
|
| 114 | + $cancelURL, $shipToName, $shipToStreet, $shipToCity, $shipToState, |
|
| 115 | + $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum |
|
| 116 | 116 | ) |
| 117 | 117 | {
|
| 118 | 118 | // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | |
| 267 | 267 | function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCardNumber, |
| 268 | - $expDate, $cvv2, $firstName, $lastName, $street, $city, $state, $zip, |
|
| 269 | - $countryCode, $currencyCode) |
|
| 268 | + $expDate, $cvv2, $firstName, $lastName, $street, $city, $state, $zip, |
|
| 269 | + $countryCode, $currencyCode) |
|
| 270 | 270 | {
|
| 271 | 271 | //Construct the parameter string that describes DoDirectPayment |
| 272 | 272 | $nvpstr = "&AMT=" . $paymentAmount; |
@@ -328,7 +328,6 @@ discard block |
||
| 328 | 328 | * @param CurrencyCode: Currency code (default is USD). |
| 329 | 329 | * @param CustomerPaypalAccount: Email address of customer. |
| 330 | 330 | * @param ExtraParams: Extra Info params. |
| 331 | - |
|
| 332 | 331 | * @return: The NVP Collection object of the CreateRecurringPaymentsProfile Call Response. |
| 333 | 332 | * |
| 334 | 333 | * |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | /* For licensing terms, see /license.txt */ |
| 3 | 3 | |
| 4 | 4 | use ChamiloSession as Session; |
| 5 | -use Doctrine\Common\Collections\Criteria; |
|
| 6 | 5 | |
| 7 | 6 | /** |
| 8 | 7 | * Class DocumentManager |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | unset($_SESSION['bc_service_sale_id']); |
| 48 | 48 | |
| 49 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
|
|
| 49 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
|
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | unset($_SESSION['bc_service_sale_id']); |
| 182 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
|
|
| 182 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
|
|
| 183 | 183 | exit; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | $serviceSale['price'], |
| 48 | 48 | $currency['iso_code'], |
| 49 | 49 | 'paypal', |
| 50 | - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_success.php', |
|
| 51 | - api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/error.php', |
|
| 50 | + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_success.php', |
|
| 51 | + api_get_path(WEB_PLUGIN_PATH).'buycourses/src/error.php', |
|
| 52 | 52 | $extra, |
| 53 | 53 | true |
| 54 | 54 | ); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | unset($_SESSION['bc_service_sale_id']); |
| 99 | 99 | |
| 100 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php');
|
|
| 100 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php');
|
|
| 101 | 101 | exit; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ); |
| 137 | 137 | |
| 138 | 138 | unset($_SESSION['bc_service_sale_id']); |
| 139 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
|
|
| 139 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_catalog.php');
|
|
| 140 | 140 | exit; |
| 141 | 141 | } |
| 142 | 142 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $currentUserId = api_get_user_id(); |
| 13 | 13 | |
| 14 | 14 | if (empty($currentUserId)) {
|
| 15 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'auth/inscription.php');
|
|
| 15 | + header('Location: '.api_get_path(WEB_CODE_PATH).'auth/inscription.php');
|
|
| 16 | 16 | exit; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $typeUser = intval($_REQUEST['t']) === BuyCoursesPlugin::SERVICE_TYPE_USER; |
| 36 | 36 | $typeCourse = intval($_REQUEST['t']) === BuyCoursesPlugin::SERVICE_TYPE_COURSE; |
| 37 | 37 | $typeSession = intval($_REQUEST['t']) === BuyCoursesPlugin::SERVICE_TYPE_SESSION; |
| 38 | -$queryString = 'i=' . intval($_REQUEST['i']) . '&t=' . intval($_REQUEST['t']); |
|
| 38 | +$queryString = 'i='.intval($_REQUEST['i']).'&t='.intval($_REQUEST['t']); |
|
| 39 | 39 | |
| 40 | 40 | $serviceInfo = $plugin->getServices(intval($_REQUEST['i'])); |
| 41 | 41 | $userInfo = api_get_user_info(); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | Display::addFlash( |
| 50 | 50 | Display::return_message($plugin->get_lang('AdditionalInfoRequired'), 'error', false)
|
| 51 | 51 | ); |
| 52 | - header('Location:' . api_get_self() . '?' . $queryString);
|
|
| 52 | + header('Location:'.api_get_self().'?'.$queryString);
|
|
| 53 | 53 | exit; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | Display::addFlash( |
| 58 | 58 | Display::return_message($plugin->get_lang('NeedToSelectPaymentType'), 'error', false)
|
| 59 | 59 | ); |
| 60 | - header('Location:' . api_get_self() . '?' . $queryString);
|
|
| 60 | + header('Location:'.api_get_self().'?'.$queryString);
|
|
| 61 | 61 | exit; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | if ($serviceSaleId !== false) {
|
| 67 | 67 | $_SESSION['bc_service_sale_id'] = $serviceSaleId; |
| 68 | - header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_process_confirm.php');
|
|
| 68 | + header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_process_confirm.php');
|
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | exit; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | if ($typeUser) {
|
| 84 | 84 | $users = $em->getRepository('ChamiloUserBundle:User')->findAll();
|
| 85 | - $selectOptions[$userInfo['user_id']] = api_get_person_name($userInfo['firstname'], $userInfo['lastname']) . ' (' . get_lang('Myself') . ')';
|
|
| 85 | + $selectOptions[$userInfo['user_id']] = api_get_person_name($userInfo['firstname'], $userInfo['lastname']).' ('.get_lang('Myself').')';
|
|
| 86 | 86 | if (!empty($users)) {
|
| 87 | 87 | foreach ($users as $user) {
|
| 88 | 88 | if (intval($userInfo['user_id']) !== intval($user->getId())) {
|
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | - $form->addSelect('info_select',get_lang('User'), $selectOptions);
|
|
| 93 | + $form->addSelect('info_select', get_lang('User'), $selectOptions);
|
|
| 94 | 94 | } elseif ($typeCourse) {
|
| 95 | 95 | $user = $em->getRepository('ChamiloUserBundle:User')->find($currentUserId);
|
| 96 | 96 | $courses = $user->getCourses(); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $selectOptions[$course->getCourse()->getId()] = $course->getCourse()->getTitle(); |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | - $form->addSelect('info_select',get_lang('Course'), $selectOptions);
|
|
| 102 | + $form->addSelect('info_select', get_lang('Course'), $selectOptions);
|
|
| 103 | 103 | } elseif ($typeSession) {
|
| 104 | 104 | $user = $em->getRepository('ChamiloUserBundle:User')->find($currentUserId);
|
| 105 | 105 | $sessions = $user->getSessionCourseSubscriptions(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $selectOptions[$session->getSession()->getId()] = $session->getSession()->getName(); |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | - $form->addSelect('info_select',get_lang('Session'), $selectOptions);
|
|
| 111 | + $form->addSelect('info_select', get_lang('Session'), $selectOptions);
|
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $form->addHeader($plugin->get_lang('PaymentMethods'));
|