Minor - format code.

1.10.x
Julio Montoya 10 years ago
parent da7c0b619d
commit 65f5241ef1
  1. 6
      main/inc/email_editor.php
  2. 16
      main/inc/lib/extra_field_value.lib.php
  3. 2
      main/inc/lib/usermanager.lib.php

@ -29,16 +29,16 @@ $action = isset($_GET['action']) ? $_GET['action'] : null;
$form = new FormValidator('email_editor', 'post');
$form->addElement('hidden', 'dest');
$form->addElement('text', 'email_address', get_lang('EmailDestination'));
$form->addElement('text', 'email_title', get_lang('EmailTitle'), array('class' => 'span5'));
$form->addElement('text', 'email_title', get_lang('EmailTitle'));
$form->freeze('email_address');
$form->addElement('textarea', 'email_text', get_lang('EmailText'), array('class' => 'span5', 'rows' => '6'));
$form->addElement('textarea', 'email_text', get_lang('EmailText'), array('rows' => '6'));
$form->addRule('email_address', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('email_title', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('email_text', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('email_address', get_lang('EmailWrong'), 'email');
$form->addElement('button', 'submit', get_lang('SendMail'));
$form->addButtonSend(get_lang('SendMail'));
switch ($action) {
case 'subscribe_me_to_session':

@ -115,8 +115,10 @@ class ExtraFieldValue extends Model
// Parse params.
foreach ($params as $key => $value) {
if (substr($key, 0, 6) == 'extra_' || substr($key, 0, 7) == '_extra_') {
// An extra field.
$field_variable = substr($key, 6);
$extra_field_info = $extra_field->get_handler_field_info_by_field_variable($field_variable);
if ($extra_field_info) {
@ -124,8 +126,7 @@ class ExtraFieldValue extends Model
$comment = isset($params[$commentVariable]) ? $params[$commentVariable] : null;
switch ($extra_field_info['field_type']) {
case ExtraField::FIELD_TYPE_TAG :
case ExtraField::FIELD_TYPE_TAG:
$old = self::getAllValuesByItemAndField(
$params[$this->handler_id],
$extra_field_info['id']
@ -242,12 +243,14 @@ class ExtraFieldValue extends Model
break;
default;
$new_params = array(
$this->handler_id => $params[$this->handler_id],
'field_id' => $extra_field_info['id'],
'field_value' => $value
$this->handler_id => $params[$this->handler_id],
'field_id' => $extra_field_info['id'],
'field_value' => $value
);
if ($this->handler_id !== 'session_id' && $this->handler_id !== 'course_code') {
if ($this->handler_id !== 'session_id' &&
$this->handler_id !== 'course_code'
) {
$new_params['comment'] = $comment;
}
@ -460,6 +463,7 @@ class ExtraFieldValue extends Model
}
} else {
$params['id'] = $field_values['id'];
return parent::update($params, $show_query);
}
}

@ -2734,7 +2734,6 @@ class UserManager
}
if (api_is_allowed_to_create_course()) {
foreach ($sessions as $enreg) {
$session_id = $enreg['id'];
$session_visibility = api_get_session_visibility($session_id);
@ -2742,6 +2741,7 @@ class UserManager
if ($session_visibility == SESSION_INVISIBLE) {
continue;
}
// This query is horribly slow when more than a few thousand
// users and just a few sessions to which they are subscribed
$id_session = $enreg['id'];

Loading…
Cancel
Save