MDL-14679 fixed a lot more old style uses of insert_record()
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//TODO: use standard CLI_SCRIPT support here (skodak)
|
||||
|
||||
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
|
||||
require_once(dirname(__FILE__) . '/lib.php');
|
||||
|
||||
@@ -81,11 +83,8 @@ case 'chat':
|
||||
$chatuser->lastmessageping = time() - 2;
|
||||
$DB->update_record('chat_users', $chatuser);
|
||||
|
||||
if (!($DB->insert_record('chat_messages', $message) && $DB->insert_record('chat_messages_current', $message))) {
|
||||
chat_print_error('ERROR', get_string('cantlogin','chat'));
|
||||
} else {
|
||||
echo 200;
|
||||
}
|
||||
$DB->insert_record('chat_messages', $message);
|
||||
$DB->insert_record('chat_messages_current', $message);
|
||||
add_to_log($course->id, 'chat', 'talk', "view.php?id=$cm->id", $chat->id, $cm->id);
|
||||
|
||||
ob_end_flush();
|
||||
|
||||
+13
-14
@@ -110,22 +110,21 @@ function chat_add_instance($chat) {
|
||||
|
||||
$chat->timemodified = time();
|
||||
|
||||
if ($returnid = $DB->insert_record("chat", $chat)) {
|
||||
$returnid = $DB->insert_record("chat", $chat);
|
||||
|
||||
$event = NULL;
|
||||
$event->name = $chat->name;
|
||||
$event->description = format_module_intro('chat', $chat, $chat->coursemodule);
|
||||
$event->courseid = $chat->course;
|
||||
$event->groupid = 0;
|
||||
$event->userid = 0;
|
||||
$event->modulename = 'chat';
|
||||
$event->instance = $returnid;
|
||||
$event->eventtype = 'chattime';
|
||||
$event->timestart = $chat->chattime;
|
||||
$event->timeduration = 0;
|
||||
$event = NULL;
|
||||
$event->name = $chat->name;
|
||||
$event->description = format_module_intro('chat', $chat, $chat->coursemodule);
|
||||
$event->courseid = $chat->course;
|
||||
$event->groupid = 0;
|
||||
$event->userid = 0;
|
||||
$event->modulename = 'chat';
|
||||
$event->instance = $returnid;
|
||||
$event->eventtype = 'chattime';
|
||||
$event->timestart = $chat->chattime;
|
||||
$event->timeduration = 0;
|
||||
|
||||
calendar_event::create($event);
|
||||
}
|
||||
calendar_event::create($event);
|
||||
|
||||
return $returnid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user