mirror of https://github.com/acanas/swad-core.git
Version18.101.1
This commit is contained in:
parent
bafd41dbe7
commit
5293e133b3
|
@ -1863,7 +1863,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActEdiCrs */{ 555,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Crs_EditCourses ,NULL},
|
||||
/* ActReqCrs */{1053,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RecFormReqCrs ,Crs_ContEditAfterChgCrs ,NULL},
|
||||
/* ActNewCrs */{ 556,-1,TabUnk,ActSeeCrs , 0, 0,0x3C0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RecFormNewCrs ,Crs_ContEditAfterChgCrs ,NULL},
|
||||
/* ActRemCrs */{ 560,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Crs_RemoveCourse ,NULL},
|
||||
/* ActRemCrs */{ 560,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RemoveCourse ,Crs_ContEditAfterChgCrs ,NULL},
|
||||
/* ActChgInsCrsCod */{1025,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeInsCrsCod ,Crs_ContEditAfterChgCrs ,NULL},
|
||||
/* ActChgCrsYea */{ 561,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_ChangeCrsYear ,Crs_ContEditAfterChgCrs ,NULL},
|
||||
/* ActRenCrsSho */{ 563,-1,TabUnk,ActSeeCrs , 0, 0,0x3C6, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Crs_RenameCourseShort ,Crs_ContEditAfterChgCrs ,NULL},
|
||||
|
|
|
@ -468,8 +468,8 @@ ps2pdf source.ps destination.pdf
|
|||
#define CSS_FILE "swad18.92.css"
|
||||
#define JS_FILE "swad18.92.js"
|
||||
/*
|
||||
¿Por qué Crs_RemoveCourse () no está como función a priori igual que las otras? Ver si se puede poner a priori
|
||||
En degree, centre, institution y country, hacer más funciones a priori al estilo de como está hecha la edición de course
|
||||
Version 18.101.1: Apr 08, 2019 Code refactoring in edition of courses. (241921 lines)
|
||||
Version 18.101: Apr 08, 2019 Code refactoring in edition of degree types. (241926 lines)
|
||||
Version 18.100: Apr 07, 2019 Code refactoring in edition of courses. (241882 lines)
|
||||
Version 18.99: Apr 07, 2019 Code refactoring in edition of degrees. (241822 lines)
|
||||
|
|
|
@ -2007,40 +2007,33 @@ void Crs_RemoveCourse (void)
|
|||
{
|
||||
extern const char *Txt_To_remove_a_course_you_must_first_remove_all_users_in_the_course;
|
||||
extern const char *Txt_Course_X_removed;
|
||||
struct Course Crs;
|
||||
|
||||
/***** Course constructor *****/
|
||||
Crs_EditingCourseConstructor ();
|
||||
|
||||
/***** Get course code *****/
|
||||
Crs.CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
Crs_EditingCrs->CrsCod = Crs_GetAndCheckParamOtherCrsCod (1);
|
||||
|
||||
/***** Get data of the course from database *****/
|
||||
Crs_GetDataOfCourseByCod (&Crs);
|
||||
Crs_GetDataOfCourseByCod (Crs_EditingCrs);
|
||||
|
||||
if (Crs_CheckIfICanEdit (&Crs))
|
||||
if (Crs_CheckIfICanEdit (Crs_EditingCrs))
|
||||
{
|
||||
/***** Check if this course has users *****/
|
||||
if (Crs.NumUsrs[Rol_UNK]) // Course has users ==> don't remove
|
||||
if (Crs_EditingCrs->NumUsrs[Rol_UNK]) // Course has users ==> don't remove
|
||||
Ale_ShowAlert (Ale_WARNING,Txt_To_remove_a_course_you_must_first_remove_all_users_in_the_course);
|
||||
else // Course has no users ==> remove it
|
||||
{
|
||||
/***** Remove course *****/
|
||||
Crs_RemoveCourseCompletely (Crs.CrsCod);
|
||||
Crs_RemoveCourseCompletely (Crs_EditingCrs->CrsCod);
|
||||
|
||||
/***** Write message to show the change made *****/
|
||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Course_X_removed,
|
||||
Crs.FullName);
|
||||
Crs_EditingCrs->FullName);
|
||||
}
|
||||
}
|
||||
else
|
||||
Lay_NoPermissionExit ();
|
||||
|
||||
/***** Show the form again *****/
|
||||
Crs_EditCoursesInternal ();
|
||||
|
||||
/***** Course destructor *****/
|
||||
Crs_EditingCourseDestructor ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue