Internal: Database: Fix internal methods calls with name vs title (8) - plugins - refs #3581 #4706

pull/5096/head
Yannick Warnier 10 months ago
parent 7cab38ec49
commit a27ff91588
  1. 6
      public/plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php
  2. 2
      public/plugin/advanced_subscription/src/HookAdvancedSubscription.php
  3. 2
      public/plugin/advanced_subscription/src/open_session.php
  4. 8
      public/plugin/buycourses/src/buy_course_plugin.class.php
  5. 8
      public/plugin/buycourses/src/buycourses.ajax.php
  6. 4
      public/plugin/buycourses/src/service_process_confirm.php
  7. 4
      public/plugin/buycourses/src/service_success.php
  8. 2
      public/plugin/buycourses/src/services_edit.php
  9. 2
      public/plugin/courselegal/CourseLegalPlugin.php
  10. 2
      public/plugin/dashboard/block_session/block_session.class.php
  11. 4
      public/plugin/justification/Justification.php
  12. 8
      public/plugin/justification/README.md
  13. 6
      public/plugin/learning_calendar/LearningCalendarPlugin.php
  14. 8
      public/plugin/learning_calendar/README.md
  15. 2
      public/plugin/learning_calendar/calendar_users.php
  16. 2
      public/plugin/studentfollowup/my_students.php
  17. 6
      public/plugin/vchamilo/README.md
  18. 2
      public/plugin/vchamilo/install.php
  19. 2
      public/plugin/vchamilo/lib/Virtual.php

@ -1260,7 +1260,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
}
/**
* List all session (id, name) for select input.
* List all session (id, title) for select input.
*
* @param int $limit
*
@ -1270,11 +1270,11 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
$limit = (int) $limit;
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION);
$columns = 'id, name';
$columns = 'id, title';
$conditions = [];
if ($limit > 0) {
$conditions = [
'order' => 'name',
'order' => 'title',
'limit' => $limit,
];
}

@ -263,7 +263,7 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
'name' => 'coach_id',
'type' => 'xsd:int',
],
// session.name
// session.title
'name' => [
'name' => 'name',
'type' => 'xsd:string',

@ -35,7 +35,7 @@ if (SessionManager::isUserSubscribedAsStudent(
'errorMessages',
[sprintf(
$plugin->get_lang('YouAreAlreadySubscribedToSessionX'),
$sessionInfo['name']
$sessionInfo['title']
)]
);
} else {

@ -2096,7 +2096,7 @@ class BuyCoursesPlugin extends Plugin
$return = Database::insert(
$servicesTable,
[
'name' => Security::remove_XSS($service['name']),
'title' => Security::remove_XSS($service['name']),
'description' => Security::remove_XSS($service['description']),
'price' => $service['price'],
'tax_perc' => '' != $service['tax_perc'] ? (int) $service['tax_perc'] : null,
@ -2151,7 +2151,7 @@ class BuyCoursesPlugin extends Plugin
return Database::update(
$servicesTable,
[
'name' => Security::remove_XSS($service['name']),
'title' => Security::remove_XSS($service['name']),
'description' => Security::remove_XSS($service['description']),
'price' => $service['price'],
'tax_perc' => '' != $service['tax_perc'] ? (int) $service['tax_perc'] : null,
@ -2419,7 +2419,7 @@ class BuyCoursesPlugin extends Plugin
$isoCode = $currency['iso_code'];
$servicesSale = Database::select(
'ss.*, s.name, s.description, s.price as service_price, s.duration_days, s.applies_to, s.owner_id, s.visibility, s.image',
'ss.*, s.title, s.description, s.price as service_price, s.duration_days, s.applies_to, s.owner_id, s.visibility, s.image',
"$servicesSaleTable ss $innerJoins",
$conditions,
'first'
@ -2428,7 +2428,7 @@ class BuyCoursesPlugin extends Plugin
$buyer = api_get_user_info($servicesSale['buyer_id']);
$servicesSale['service']['id'] = $servicesSale['service_id'];
$servicesSale['service']['name'] = $servicesSale['name'];
$servicesSale['service']['title'] = $servicesSale['title'];
$servicesSale['service']['description'] = $servicesSale['description'];
$servicesSale['service']['price'] = $servicesSale['service_price'];
$servicesSale['service']['currency'] = $isoCode;

@ -386,7 +386,7 @@ switch ($action) {
"moneda" => $serviceSale['currency'],
"monto" => intval(floatval($serviceSale['price']) * 100),
"usuario" => $user['username'],
"descripcion" => $serviceSale['service']['name'],
"descripcion" => $serviceSale['service']['title'],
"pedido" => $serviceSale['reference'],
"codigo_pais" => "PE",
"direccion" => get_lang('None'),
@ -405,7 +405,7 @@ switch ($action) {
Display::return_message(
sprintf(
$plugin->get_lang('SubscriptionToCourseXSuccessful'),
$serviceSale['service']['name']
$serviceSale['service']['title']
),
'success'
)
@ -453,7 +453,7 @@ switch ($action) {
$html .= "<br />";
$html .= "<legend>{$plugin->get_lang('ServiceInformation')}</legend>";
$html .= "<ul>";
$html .= "<li><b>{$plugin->get_lang('ServiceName')}:</b> {$serviceSale['service']['name']}</li> ";
$html .= "<li><b>{$plugin->get_lang('ServiceName')}:</b> {$serviceSale['service']['title']}</li> ";
$html .= "<li><b>{$plugin->get_lang('Description')}:</b> {$serviceSale['service']['description']}</li> ";
$nodeType = $serviceSale['node_type'];
$nodeName = '';
@ -563,7 +563,7 @@ switch ($action) {
if ($response) {
$html .= Display::return_message(
sprintf($plugin->get_lang('SubscriptionToServiceXSuccessful'), $serviceSale['service']['name']),
sprintf($plugin->get_lang('SubscriptionToServiceXSuccessful'), $serviceSale['service']['title']),
'success'
);
} else {

@ -128,7 +128,7 @@ switch ($serviceSale['payment_type']) {
$messageTemplate->assign(
'service_sale',
[
'name' => $serviceSale['service']['name'],
'name' => $serviceSale['service']['title'],
'buyer' => $serviceSale['buyer']['name'],
'buy_date' => $serviceSale['buy_date'],
'start_date' => $serviceSale['start_date'],
@ -206,7 +206,7 @@ switch ($serviceSale['payment_type']) {
$template = new Template();
$template->assign('terms', $globalParameters['terms_and_conditions']);
$template->assign('title', $serviceSale['service']['name']);
$template->assign('title', $serviceSale['service']['title']);
$template->assign('price', $serviceSale['price']);
$template->assign('currency', $serviceSale['currency_id']);
$template->assign('buying_service', $serviceSale);

@ -84,7 +84,7 @@ if ($form->validate()) {
if ($serviceSaleIsCompleted) {
Display::addFlash(
Display::return_message(
sprintf($plugin->get_lang('SubscriptionToServiceXSuccessful'), $serviceSale['service']['name']),
sprintf($plugin->get_lang('SubscriptionToServiceXSuccessful'), $serviceSale['service']['title']),
'success'
)
);
@ -171,7 +171,7 @@ $interbreadcrumb[] = [
$templateName = $plugin->get_lang('PaymentMethods');
$tpl = new Template($templateName);
$tpl->assign('title', $serviceSale['service']['name']);
$tpl->assign('title', $serviceSale['service']['title']);
$tpl->assign('price', $serviceSale['price']);
$tpl->assign('currency', $serviceSale['currency_id']);
$tpl->assign('service', $serviceSale);

@ -39,7 +39,7 @@ $globalSettingsParams = $plugin->getGlobalParameters();
$service = $plugin->getService($serviceId);
$formDefaultValues = [
'name' => $service['name'],
'name' => $service['title'],
'description' => $service['description'],
'price' => $service['price'],
'tax_perc' => $service['tax_perc'],

@ -200,7 +200,7 @@ class CourseLegalPlugin extends Plugin
$sesstionTitle = null;
if (!empty($sessionInfo)) {
$sesstionTitle = ' ('.$sessionInfo['name'].')';
$sesstionTitle = ' ('.$sessionInfo['title'].')';
}
$courseTitle = $courseInfo['title'].$sesstionTitle;

@ -89,7 +89,7 @@ class BlockSession extends Block
$i = 1;
foreach ($sessions as $session) {
$session_id = (int) ($session['id']);
$title = $session['name'];
$title = $session['title'];
if (!empty($session['access_start_date'])) {
$dateFrom = api_convert_and_format_date(

@ -57,7 +57,7 @@ class Justification extends Plugin
public function getList()
{
$sql = 'SELECT * FROM justification_document ORDER BY name ';
$sql = 'SELECT * FROM justification_document ORDER BY title ';
$query = Database::query($sql);
return Database::store_result($query, 'ASSOC');
@ -71,7 +71,7 @@ class Justification extends Plugin
$sql = "CREATE TABLE IF NOT EXISTS justification_document (
id INT unsigned NOT NULL auto_increment PRIMARY KEY,
code TEXT NULL,
name TEXT NULL,
title TEXT NULL,
validity_duration INT,
comment TEXT NULL,
date_manual_on INT

@ -3,3 +3,11 @@ Justification
1. Enable the plugin.
2. Create the justification files in plugin/justification/list.php
Changelog
=======
v2.0 (for Chamilo v2.0)
-----------------------
ALTER TABLE justification_document CHANGE COLUMN name title TEXT NULL;

@ -93,7 +93,7 @@ class LearningCalendarPlugin extends Plugin
$sql = "
CREATE TABLE IF NOT EXISTS learning_calendar_events(
id int not null AUTO_INCREMENT primary key,
name varchar(255) default '',
title varchar(255) default '',
calendar_id int not null,
start_date date not null,
end_date date not null,
@ -651,7 +651,7 @@ class LearningCalendarPlugin extends Plugin
$html = '';
if (!empty($list)) {
$html = implode('&nbsp;', array_column($list, 'name'));
$html = implode('&nbsp;', array_column($list, 'title'));
}
return $html;
@ -1011,7 +1011,7 @@ class LearningCalendarPlugin extends Plugin
}
} else {
$params = [
'name' => '',
'title' => '',
'calendar_id' => $calendarId,
'start_date' => $startDate,
'end_date' => $startDate,

@ -1,2 +1,10 @@
## Learning calendar
This plugin allows for a complex scheduling of courses and inactivity times for
students with professional practices.
## Changelog
### v2.0 (for Chamilo v2.0)
ALTER TABLE learning_calendar_events CHANGE COLUMN name title varchar(255) default '';

@ -51,7 +51,7 @@ $column_model = [
$extraParams['autowidth'] = 'true';
// height auto
$extraParams['height'] = 'auto';
$extraParams['sortname'] = 'name';
$extraParams['sortname'] = 'title';
$extraParams['sortorder'] = 'desc';
$extraParams['multiselect'] = true;

@ -165,7 +165,7 @@ $form->addText(
);
if (!empty($fullSessionList)) {
$options = array_column($fullSessionList, 'name', 'id');
$options = array_column($fullSessionList, 'title', 'id');
$options[0] = get_lang('Please select an option');
ksort($options);
$form->addSelect('session_id', get_lang('Session'), $options);

@ -18,6 +18,12 @@ Once the plugin is fully setup, you will be able to create new Chamilo instances
Changelog
=========
*Version 1.8 (Chamilo v2.0)*
Changed field name to match new Chamilo terminology:
ALTER TABLE vchamilo_config CHANGE COLUMN name title varchar(64) NOT NULL;
*Version 1.7*
Added support for (optional) custom CSS folder

@ -59,7 +59,7 @@ $tablename = Database::get_main_table($table);
$sql = "CREATE TABLE IF NOT EXISTS $tablename (
id int(11) NOT NULL AUTO_INCREMENT,
component int(11) NOT NULL,
`name` varchar(64) NOT NULL,
title varchar(64) NOT NULL,
`value` varchar(255) NOT NULL,
longvalue varchar(255) NOT NULL,
PRIMARY KEY (id)

@ -43,7 +43,7 @@ class Virtual
if ($result->rowCount()) {
$data = $result->fetch();
$excludes = ['id', 'name'];
$excludes = ['id', 'title'];
$query = "SELECT * FROM settings_current WHERE subkey = 'vchamilo'";
$virtualSettings = $connection->executeQuery($query);
$virtualSettings = $virtualSettings->fetchAll();

Loading…
Cancel
Save