Applied fixes from FlintCI

pull/2798/head
Nosolored SL 7 years ago
parent 2f7dd282d4
commit 03e3474edc
  1. 4
      main/forum/forumfunction.inc.php
  2. 2
      main/inc/lib/display.lib.php
  3. 2
      main/wiki/wiki.inc.php
  4. 2
      plugin/buycourses/database.php
  5. 1
      plugin/buycourses/lang/english.php
  6. 19
      plugin/buycourses/src/buy_course_plugin.class.php
  7. 54
      plugin/buycourses/src/invoice.php
  8. 14
      plugin/buycourses/src/paymentsetup.php
  9. 2
      plugin/keycloak/KeycloakPlugin.php
  10. 1
      plugin/keycloak/start.php
  11. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRecycler.php

@ -4345,8 +4345,8 @@ function send_notification_mails($forumId, $thread_id, $reply_info)
* be new posts and the user might have indicated that (s)he wanted to be
* informed about the new posts by mail.
*
* @param string $content Content type (post, thread, forum, forum_category)
* @param int $id Item DB ID of the corresponding content type
* @param string $content Content type (post, thread, forum, forum_category)
* @param int $id Item DB ID of the corresponding content type
*
* @return string language variable
*

@ -2794,7 +2794,5 @@ HTML;
});';
return $frameReady;
}
}

@ -6100,7 +6100,7 @@ class Wiki
get_lang('RecentChanges'),
'',
ICON_SIZE_MEDIUM
) .'</a>';
).'</a>';
echo Display::toolbarAction('toolbar-wiki', [$actionsLeft]);
}

@ -716,4 +716,4 @@ $fieldlabel = 'buycourses_address';
$fieldtype = '1';
$fieldtitle = BuyCoursesPlugin::get_lang('Address');
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);

@ -183,4 +183,3 @@ $strings['PurchaseDetailsIntro'] = "Purchase details";
$strings['PurchaseDetailsEnd'] = "Regards";
$strings['ProductName'] = "Product name";
$strings['BankAccountIntro'] = "Bank Account Info";

@ -274,19 +274,19 @@ class BuyCoursesPlugin extends Plugin
false
)
);
$fieldlabel = 'buycourses_company';
$fieldtype = '1';
$fieldtitle = $this->get_lang('Company');
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'buycourses_vat';
$fieldtype = '1';
$fieldtitle = $this->get_lang('VAT');
$fielddefault = '';
$field_id = UserManager::create_extra_field($fieldlabel, $fieldtype, $fieldtitle, $fielddefault);
$fieldlabel = 'buycourses_address';
$fieldtype = '1';
$fieldtitle = $this->get_lang('Address');
@ -1065,7 +1065,7 @@ class BuyCoursesPlugin extends Plugin
/**
* Get data of sales.
*
* @param int $saleId The sale id
* @param int $saleId The sale id
* @param int $isService Check if a service
*
* @return array The sale data
@ -1105,7 +1105,7 @@ class BuyCoursesPlugin extends Plugin
/**
* Get data of invoice.
*
* @param int $saleId The sale id
* @param int $saleId The sale id
* @param int $isService Check if a service
*
* @return array The invoice data
@ -1128,12 +1128,13 @@ class BuyCoursesPlugin extends Plugin
/**
* Get numeration of invoice.
*
* @param int $saleId The sale id
* @param int $saleId The sale id
* @param int $isService Check if a service
*
* @return array The numeration invoice
*/
public function getNumInvoice($saleId, $isService) {
public function getNumInvoice($saleId, $isService)
{
$dataInvoice = $this->getDataInvoice($saleId, $isService);
return $dataInvoice['serie'].$dataInvoice['year'].'/'.$dataInvoice['num_invoice'];
@ -1228,7 +1229,7 @@ class BuyCoursesPlugin extends Plugin
/**
* Register a invoice.
*
* @param int $saleId The sale ID
* @param int $saleId The sale ID
* @param int $isService The service type to filter (default : 0)
*/
public function setInvoice($saleId, $isService = 0)
@ -2608,7 +2609,7 @@ class BuyCoursesPlugin extends Plugin
$sqlParams['tax_applies_to'] = $params['tax_applies_to'];
$sqlParams['tax_name'] = $params['tax_name'];
}
if ($this->get('invoicing_enable') === 'true') {
$sqlParams['seller_name'] = $params['seller_name'];
$sqlParams['seller_id'] = $params['seller_id'];

@ -48,30 +48,30 @@ if ($pdfLogo === 'true') {
$htmlText .= $organization;
// Seller and customer info
$htmlText.= '<table width="100%">';
$htmlText.= '<tr>';
$htmlText.= '<td>';
$htmlText.= '<b>'.$globalParameters['seller_name'].'</b><br/>';
$htmlText.= $globalParameters['seller_id'].'<br/>';
$htmlText.= $globalParameters['seller_address'].'<br/>';
$htmlText.= $globalParameters['seller_email'].'<br/>';
$htmlText.= '</td>';
$htmlText.= '<td style="text-align:right;">';
$htmlText.= '<b>'.$buyer['complete_name'].'</b><br/>';
$htmlText.= ($extraUserInfoData['buycourses_company'] ? $extraUserInfoData['buycourses_company'].'<br>' : '');
$htmlText.= ($extraUserInfoData['buycourses_vat'] ? $extraUserInfoData['buycourses_vat'].'<br>' : '');
$htmlText.= ($extraUserInfoData['buycourses_address'] ? $extraUserInfoData['buycourses_address'].'<br/>' : '');
$htmlText.= ($buyer['phone'] ? $buyer['phone'].'<br/>' : '');
$htmlText.= ($buyer['email'] ? $buyer['email'].'<br>' : '');
$htmlText.= '</td>';
$htmlText.= '</tr>';
$htmlText.= '</table>';
$htmlText.= '<br><br>';
$htmlText.= '<p>';
$htmlText.= $plugin->get_lang('InvoiceDate').': <span style="font-weight:bold;">'.api_format_date($infoInvoice['date_invoice'], DATE_TIME_FORMAT_LONG_24H).'</span><br>';
$htmlText.= $plugin->get_lang('InvoiceNumber').': <span style="font-weight:bold;">'.$infoInvoice['serie'].$infoInvoice['year'].'/'.$infoInvoice['num_invoice'].'</span><br>';
$htmlText.= '</p><br><br>';
$htmlText .= '<table width="100%">';
$htmlText .= '<tr>';
$htmlText .= '<td>';
$htmlText .= '<b>'.$globalParameters['seller_name'].'</b><br/>';
$htmlText .= $globalParameters['seller_id'].'<br/>';
$htmlText .= $globalParameters['seller_address'].'<br/>';
$htmlText .= $globalParameters['seller_email'].'<br/>';
$htmlText .= '</td>';
$htmlText .= '<td style="text-align:right;">';
$htmlText .= '<b>'.$buyer['complete_name'].'</b><br/>';
$htmlText .= ($extraUserInfoData['buycourses_company'] ? $extraUserInfoData['buycourses_company'].'<br>' : '');
$htmlText .= ($extraUserInfoData['buycourses_vat'] ? $extraUserInfoData['buycourses_vat'].'<br>' : '');
$htmlText .= ($extraUserInfoData['buycourses_address'] ? $extraUserInfoData['buycourses_address'].'<br/>' : '');
$htmlText .= ($buyer['phone'] ? $buyer['phone'].'<br/>' : '');
$htmlText .= ($buyer['email'] ? $buyer['email'].'<br>' : '');
$htmlText .= '</td>';
$htmlText .= '</tr>';
$htmlText .= '</table>';
$htmlText .= '<br><br>';
$htmlText .= '<p>';
$htmlText .= $plugin->get_lang('InvoiceDate').': <span style="font-weight:bold;">'.api_format_date($infoInvoice['date_invoice'], DATE_TIME_FORMAT_LONG_24H).'</span><br>';
$htmlText .= $plugin->get_lang('InvoiceNumber').': <span style="font-weight:bold;">'.$infoInvoice['serie'].$infoInvoice['year'].'/'.$infoInvoice['num_invoice'].'</span><br>';
$htmlText .= '</p><br><br>';
$header = [
$plugin->get_lang('OrderReference'),
@ -82,7 +82,7 @@ $header = [
];
$data = [];
$row= [
$row = [
$infoSale['reference'],
$infoSale['product_name'],
$plugin->getCurrency($infoSale['currency_id'])['iso_code'].
@ -91,7 +91,7 @@ $row= [
' '.$infoSale['tax_amount'].
' ('.(int) $infoSale['tax_perc'].'%)',
$plugin->getCurrency($infoSale['currency_id'])['iso_code'].
' '.$infoSale['price']
' '.$infoSale['price'],
];
$data[] = $row;
@ -100,7 +100,7 @@ $row = [
'',
'',
$plugin->get_lang('TotalPayout'),
$plugin->getCurrency($infoSale['currency_id'])['iso_code'].' '.$infoSale['price']
$plugin->getCurrency($infoSale['currency_id'])['iso_code'].' '.$infoSale['price'],
];
$data[] = $row;
$attr = [];

@ -95,7 +95,7 @@ $invoicingEnable = $plugin->get('invoicing_enable') === 'true';
if ($taxEnable) {
$globalSettingForm->addHtml('<hr/>');
$globalSettingForm->addElement(
'number',
'global_tax_perc',
@ -128,38 +128,38 @@ if ($taxEnable) {
if ($invoicingEnable) {
$globalSettingForm->addHtml('<hr/>');
$globalSettingForm->addElement(
'text',
'seller_name',
$plugin->get_lang('SellerName')
);
$globalSettingForm->addElement(
'text',
'seller_id',
$plugin->get_lang('SellerId')
);
$globalSettingForm->addElement(
'text',
'seller_address',
$plugin->get_lang('SellerAddress')
);
$globalSettingForm->addElement(
'text',
'seller_email',
$plugin->get_lang('SellerEmail')
);
$globalSettingForm->addElement(
'number',
'next_number_invoice',
[$plugin->get_lang('NextNumberInvoice'), $plugin->get_lang('NextNumberInvoiceDescription')],
['step' => 1]
);
$globalSettingForm->addElement(
'text',
'invoice_series',

@ -49,7 +49,7 @@ class KeycloakPlugin extends Plugin
}
/**
* Deletes all keycloak chamilo session data
* Deletes all keycloak chamilo session data.
*/
public function logout()
{

@ -25,7 +25,6 @@ if (file_exists('settings.php')) {
api_not_allowed(true, $message);
}
$content = '';
$auth = new Auth($settingsInfo);

@ -308,7 +308,7 @@ class CourseRecycler
/**
* Deletes all forum-categories without forum from the current course.
* Categories with forums in it are dealt with by recycle_forums()
* This requires a check on the status of the forum item in c_item_property
* This requires a check on the status of the forum item in c_item_property.
*/
public function recycle_forum_categories()
{
@ -356,7 +356,6 @@ class CourseRecycler
$sql = "DELETE FROM $linkCategoryTable
WHERE c_id = $courseId AND id NOT IN ($subQuery)";
Database::query($sql);
}
/**
@ -628,7 +627,6 @@ class CourseRecycler
$sql = "DELETE FROM $learningPathCategoryTable WHERE iid = ".$categoryId;
Database::query($sql);
}
}
/**

Loading…
Cancel
Save