send a email to a portal administrator upon course creation see DT#3489

skala
Carlos Vargas 15 years ago
parent f192a82bd8
commit 3a0cc75ad0
  1. 1
      documentation/changelog.html
  2. 13
      main/inc/lib/add_course.lib.inc.php
  3. 7
      main/install/dokeos_main.sql
  4. 4
      main/install/migrate-db-1.8.6.1-1.8.6.2-pre.sql

@ -36,6 +36,7 @@
<li>Reporting: notification of user who have never been active yet</li>
<li>Reporting: the additional user profiles (defined by the platform administrator through platform administration > profiling) can now be displayed also. </li>
<li>Subscribing users in a course: you can also filter on a certain addtional user profile field or search inside the values of the additional user profiles fields when subscribing a user in a course (through user/subscribe_user.php) </li>
<li>Added Send a email to a portal administrator upon course creation (DT#3489)</li>
</ul>
<h3>Debugging</h3>
<ul>

@ -13,6 +13,7 @@
*/
include_once (api_get_path(LIBRARY_PATH).'database.lib.php');
require_once (api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
/*
==============================================================================
@ -2418,6 +2419,18 @@ function register_course($courseSysCode, $courseScreenCode, $courseRepository, $
$user_id = api_get_user_id();
event_system(LOG_COURSE_CREATE, LOG_COURSE_CODE, $courseSysCode, $time, $user_id, $courseSysCode);
$send_mail_to_admin = api_get_setting('send_email_to_admin_when_create_course');
if ($send_mail_to_admin==true){
$siteName=api_get_setting('siteName');
$recipient_email = api_get_setting('emailAdministrator');
$recipient_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'));
$urlsite = api_get_path(WEB_PATH);
$iname = api_get_setting('Institution');
$subject=get_lang('NewCourseCreatedIn').' '.$siteName.' - '.$iname;
$message=sprintf(get_lang('MessageOfNewCourseToAdmin'),$recipient_name, $siteName,$iname,$title,$category,$titular,$course_language);
api_mail($recipient_name, $recipient_email, $subject, $message,$siteName,$recipient_email);
}
}
return 0;

@ -733,7 +733,8 @@ VALUES
('show_courses_descriptions_in_catalog', NULL, 'radio', 'Course', 'true', 'ShowCoursesDescriptionsInCatalogTitle', 'ShowCoursesDescriptionsInCatalogComment', NULL, NULL, 1),
('allow_coach_to_edit_course_session',NULL,'radio','Course','false','AllowCoachsToEditInsideTrainingSessions','AllowCoachsToEditInsideTrainingSessionsComment',NULL,NULL, 0),
('show_glossary_in_extra_tools', NULL, 'radio', 'Course', 'false', 'ShowGlossaryInExtraToolsTitle', 'ShowGlossaryInExtraToolsComment', NULL, NULL,1),
('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.1.8565','DokeosDatabaseVersion','',NULL,NULL,0);
('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.1.8565','DokeosDatabaseVersion','',NULL,NULL,0),
('send_email_to_admin_when_create_course',NULL,'radio','Platform','true','SendEmailToAdminTitle','SendEmailToAdminComment',NULL,NULL, 1);
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@ -918,7 +919,9 @@ VALUES
('allow_coach_to_edit_course_session','true','Yes'),
('allow_coach_to_edit_course_session','false','No'),
('show_glossary_in_extra_tools', 'true', 'Yes'),
('show_glossary_in_extra_tools', 'false', 'No');
('show_glossary_in_extra_tools', 'false', 'No'),
('send_email_to_admin_when_create_course','true','Yes'),
('send_email_to_admin_when_create_course','false','No');
UNLOCK TABLES;

@ -37,7 +37,9 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('show_gloss
CREATE TABLE user_tag (id int NOT NULL auto_increment, tag varchar(255) NOT NULL, field_id int NOT NULL, count int NOT NULL, PRIMARY KEY (id));
CREATE TABLE user_rel_tag (id int NOT NULL auto_increment,user_id int NOT NULL,tag_id int NOT NULL, PRIMARY KEY (id));
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('send_email_to_admin_when_create_course',NULL,'radio','Platform','true','SendEmailToAdminTitle','SendEmailToAdminComment',NULL,NULL, 1);
INSERT INTO settings_options (variable, value, display_text) VALUES ('send_email_to_admin_when_create_course','true','Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('send_email_to_admin_when_create_course','false','No');
-- xxSTATSxx
ALTER TABLE track_e_exercices ADD COLUMN expired_time_control datetime NOT NULL DEFAULT '0000-00-00 00:00:00';

Loading…
Cancel
Save