Minor - format code

ofaj
jmontoyaa 10 years ago
parent 619574a886
commit 634287c866
  1. 3
      app/Migrations/Schema/V111/Version111.php
  2. 4
      main/inc/lib/AnnouncementManager.php
  3. 76
      main/inc/lib/extra_field.lib.php
  4. 1
      main/social/group_add.php

@ -24,7 +24,6 @@ class Version111 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE extra_field_saved_search ADD CONSTRAINT FK_16ABE32A443707B0 FOREIGN KEY (field_id) REFERENCES extra_field (id)');
$this->addSql('ALTER TABLE extra_field_saved_search ADD CONSTRAINT FK_16ABE32AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE TABLE c_lp_category_user (id INT AUTO_INCREMENT NOT NULL, category_id INT DEFAULT NULL, INDEX IDX_61F042712469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE c_lp_category_user ADD CONSTRAINT FK_61F042712469DE2 FOREIGN KEY (category_id) REFERENCES c_lp_category (iid)');
@ -48,7 +47,6 @@ class Version111 extends AbstractMigrationChamilo
$this->addSql("CREATE TABLE c_quiz_rel_category (iid BIGINT AUTO_INCREMENT NOT NULL, c_id INT NOT NULL, category_id INT NOT NULL, exercise_id INT NOT NULL, count_questions INT NOT NULL, PRIMARY KEY(iid))");
$this->addSql("ALTER TABLE c_quiz ADD COLUMN question_selection_type INT");
$this->addSql("CREATE TABLE faq_question_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, headline VARCHAR(255) NOT NULL, body LONGTEXT DEFAULT NULL, slug VARCHAR(50) NOT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_C2D1A2C2AC5D3 (translatable_id), UNIQUE INDEX faq_question_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;");
$this->addSql("CREATE TABLE faq_category_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, headline VARCHAR(255) NOT NULL, body LONGTEXT DEFAULT NULL, slug VARCHAR(50) NOT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_5493B0FC2C2AC5D3 (translatable_id), UNIQUE INDEX faq_category_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;");
$this->addSql("CREATE TABLE faq_category (id INT AUTO_INCREMENT NOT NULL, rank INT NOT NULL, is_active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX is_active_idx (is_active), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;");
@ -57,7 +55,6 @@ class Version111 extends AbstractMigrationChamilo
$this->addSql("ALTER TABLE faq_category_translation ADD CONSTRAINT FK_5493B0FC2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES faq_category (id) ON DELETE CASCADE;");
$this->addSql("ALTER TABLE faq_question ADD CONSTRAINT FK_4A55B05912469DE2 FOREIGN KEY (category_id) REFERENCES faq_category (id);");
$this->addSql("CREATE TABLE contact_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;");
$table = $schema->getTable('session_rel_user');
if (!$table->hasColumn('duration')) {

@ -732,8 +732,8 @@ class AnnouncementManager
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
if (!empty($user_id) && is_numeric($user_id)) {
$user_id = intval($user_id);
$sql = "SELECT DISTINCT announcement.title, announcement.content
$user_id = (int) $user_id;
$sql = "SELECT DISTINCT announcement.title, announcement.content, display_order
FROM $tbl_announcement announcement, $tbl_item_property toolitemproperties
WHERE
announcement.c_id = $course_id AND

@ -623,6 +623,8 @@ class ExtraField extends Model
if (!isset($params['field_order'])) {
$max_order = self::get_max_field_order();
$params['field_order'] = $max_order;
} else {
$params['field_order'] = (int) $params['field_order'];
}
return $params;
@ -1624,55 +1626,55 @@ EOF;
'align' => 'left',
),
array(
'name' => 'variable',
'index' => 'variable',
'width' => '',
'align' => 'left',
'sortable' => 'true'
'name' => 'variable',
'index' => 'variable',
'width' => '',
'align' => 'left',
'sortable' => 'true',
),
array(
'name' => 'field_type',
'index' => 'field_type',
'width' => '',
'align' => 'left',
'sortable' => 'true'
'name' => 'field_type',
'index' => 'field_type',
'width' => '',
'align' => 'left',
'sortable' => 'true',
),
array(
'name' => 'changeable',
'index' => 'changeable',
'width' => '50',
'align' => 'left',
'sortable' => 'true'
'name' => 'changeable',
'index' => 'changeable',
'width' => '50',
'align' => 'left',
'sortable' => 'true',
),
array(
'name' => 'visible',
'index' => 'visible',
'width' => '40',
'align' => 'left',
'sortable' => 'true'
'name' => 'visible',
'index' => 'visible',
'width' => '40',
'align' => 'left',
'sortable' => 'true',
),
array(
'name' => 'filter',
'index' => 'filter',
'width' => '30',
'align' => 'left',
'sortable' => 'true'
'name' => 'filter',
'index' => 'filter',
'width' => '30',
'align' => 'left',
'sortable' => 'true',
),
array(
'name' => 'field_order',
'index' => 'field_order',
'width' => '40',
'align' => 'left',
'sortable' => 'true'
'name' => 'field_order',
'index' => 'field_order',
'width' => '40',
'align' => 'left',
'sortable' => 'true',
),
array(
'name' => 'actions',
'index' => 'actions',
'width' => '100',
'align' => 'left',
'name' => 'actions',
'index' => 'actions',
'width' => '100',
'align' => 'left',
'formatter' => 'action_formatter',
'sortable' => 'false'
)
'sortable' => 'false',
),
);
}
@ -1777,7 +1779,7 @@ EOF;
$form->addGroup($group, '', get_lang('FieldLoggeable'), '', false);
*/
$form->addElement('text', 'field_order', get_lang('FieldOrder'), array('class' => 'span1'));
$form->addElement('text', 'field_order', get_lang('FieldOrder'));
if ($action == 'edit') {
$option = new ExtraFieldOption($this->type);

@ -29,6 +29,7 @@ if ($form->validate()) {
$values = $form->exportValues();
$values['group_type'] = UserGroup::SOCIAL_CLASS;
$values['relation_type'] = GROUP_USER_PERMISSION_ADMIN;
$groupId = $usergroup->save($values);
Display::addFlash(Display::return_message(get_lang('GroupAdded')));
header('Location: group_view.php?id='.$groupId);

Loading…
Cancel
Save