diff --git a/css/swad_desktop.css b/css/swad_desktop.css index 74cfe6c6e..5a51a0e28 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -285,6 +285,7 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .BT_SUBMIT_INLINE { + min-width:180px; color:white; font-size:15px; font-weight:bold; diff --git a/css/swad_mobile.css b/css/swad_mobile.css index b247af17f..c45745adc 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -237,6 +237,7 @@ form {margin:0; display:inline;} } .BT_SUBMIT_INLINE { + min-width:180px; color:white; font-size:15px; font-weight:bold; diff --git a/swad_centre.c b/swad_centre.c index 5eb456ba4..115cfe842 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -33,6 +33,7 @@ #include "swad_centre.h" #include "swad_constant.h" #include "swad_database.h" +#include "swad_enrollment.h" #include "swad_global.h" #include "swad_institution.h" #include "swad_logo.h" @@ -216,6 +217,9 @@ void Ctr_SeeCtrWithPendingDegs (void) void Ctr_ShowConfiguration (void) { Ctr_Configuration (false); + + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); } /*****************************************************************************/ @@ -513,10 +517,6 @@ void Ctr_ShowCtrsOfCurrentIns (void) /***** Write menu to select country and institution *****/ Deg_WriteMenuAllCourses (); - /***** Put link (form) to edit centres in current institution *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_) - Lay_PutFormToEdit (ActEdiCtr); - /***** List centres *****/ Ctr_ListCentres (); @@ -532,11 +532,25 @@ void Ctr_ShowCtrsOfCurrentIns (void) static void Ctr_ListCentres (void) { extern const char *Txt_No_centres_have_been_created_in_this_institution; + extern const char *Txt_Create_centre; + bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); - if (Gbl.Ctrs.Num) + if (Gbl.Ctrs.Num) // There are centres in the current institution + { + if (ICanEdit) + Lay_PutFormToEdit (ActEdiCtr); Ctr_ListCentresForSeeing (); - else + } + else // No centres created in the current institution + { Lay_ShowAlert (Lay_INFO,Txt_No_centres_have_been_created_in_this_institution); + if (ICanEdit) + { + fprintf (Gbl.F.Out,"
"); + Act_PutContextualLink (ActEdiCtr,NULL,"edit",Txt_Create_centre); + fprintf (Gbl.F.Out,"
"); + } + } } /*****************************************************************************/ @@ -673,7 +687,6 @@ static void Ctr_GetParamCtrOrderType (void) void Ctr_EditCentres (void) { - extern const char *Txt_No_centres_have_been_created_in_this_institution; extern const char *Txt_There_is_no_list_of_institutions; extern const char *Txt_You_must_create_at_least_one_institution_before_creating_centres; @@ -690,9 +703,6 @@ void Ctr_EditCentres (void) if (Gbl.Ctrs.Num) /***** Put link (form) to view centres *****/ Lay_PutFormToView (ActSeeCtr); - else - /***** Help message *****/ - Lay_ShowAlert (Lay_INFO,Txt_No_centres_have_been_created_in_this_institution); /***** Put a form to create a new centre *****/ Ctr_PutFormToCreateCentre (); diff --git a/swad_changelog.h b/swad_changelog.h index e75350fed..d9aa85ac1 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -98,13 +98,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.8 (2015/10/04)" +#define Log_PLATFORM_VERSION "SWAD 15.9 (2015/10/05)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* TODO: If photo zoom is out of the screen at left, put on right + Version 15.9: Oct 05, 2015 Contextual help to encourage enrollment. (185512 lines) Version 15.8: Oct 04, 2015 Changes in file browser layout. Folder owners are not displayed. (185022 lines) Version 15.7.2: Oct 04, 2015 New layout in enrollment requests. (185018 lines) diff --git a/swad_country.c b/swad_country.c index 8a3e2db39..550218648 100644 --- a/swad_country.c +++ b/swad_country.c @@ -33,6 +33,7 @@ #include "swad_constant.h" #include "swad_country.h" #include "swad_database.h" +#include "swad_enrollment.h" #include "swad_global.h" #include "swad_institution.h" #include "swad_parameter.h" @@ -196,6 +197,9 @@ void Cty_SeeCtyWithPendingInss (void) void Cty_ShowConfiguration (void) { Cty_Configuration (false); + + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); } /*****************************************************************************/ diff --git a/swad_course.c b/swad_course.c index 9c1874565..ce80a8e7f 100644 --- a/swad_course.c +++ b/swad_course.c @@ -119,6 +119,9 @@ void Crs_ShowIntroduction (void) /***** Course introduction *****/ Inf_ShowInfo (); + + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); } /*****************************************************************************/ @@ -1006,10 +1009,6 @@ void Crs_ShowCrssOfCurrentDeg (void) /***** Write menu to select country, institution, centre and degree *****/ Deg_WriteMenuAllCourses (); - /***** Put link (form) to edit courses in current degree *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_) - Lay_PutFormToEdit (ActEdiCrs); - /***** Show list of courses *****/ Crs_ListCourses (); @@ -1216,11 +1215,25 @@ void Crs_WriteSelectorMyCourses (void) static void Crs_ListCourses (void) { extern const char *Txt_No_courses_have_been_created_in_this_degree; + extern const char *Txt_Create_course; + bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); - if (Gbl.CurrentDeg.Deg.NumCourses) + if (Gbl.CurrentDeg.Deg.NumCourses) // There are courses in the current degree + { + if (ICanEdit) + Lay_PutFormToEdit (ActEdiCrs); Crs_ListCoursesForSeeing (); - else + } + else // No courses created in the current degree + { Lay_ShowAlert (Lay_INFO,Txt_No_courses_have_been_created_in_this_degree); + if (ICanEdit) + { + fprintf (Gbl.F.Out,"
"); + Act_PutContextualLink (ActEdiCrs,NULL,"edit",Txt_Create_course); + fprintf (Gbl.F.Out,"
"); + } + } } /*****************************************************************************/ @@ -1229,14 +1242,9 @@ static void Crs_ListCourses (void) static void Crs_EditCourses (void) { - extern const char *Txt_No_courses_have_been_created_in_this_degree; - if (Gbl.CurrentDeg.Deg.NumCourses) /***** Put link (form) to view courses *****/ Lay_PutFormToView (ActSeeCrs); - else - /***** Help message *****/ - Lay_ShowAlert (Lay_INFO,Txt_No_courses_have_been_created_in_this_degree); /***** Put a form to create or request a new course *****/ Crs_PutFormToCreateCourse (); @@ -1856,7 +1864,8 @@ static void Crs_PutHeadCoursesForSeeing (void) static void Crs_PutHeadCoursesForEdition (void) { extern const char *Txt_Code; - extern const char *Txt_Institutional_BR_code; + extern const char *Txt_Institutional_code; + extern const char *Txt_optional; extern const char *Txt_Degree; extern const char *Txt_Year_OF_A_DEGREE; extern const char *Txt_Semester_ABBREVIATION; @@ -1873,7 +1882,7 @@ static void Crs_PutHeadCoursesForEdition (void) "%s" "" "" - "%s" + "%s (%s)" "" "" "%s" @@ -1904,7 +1913,7 @@ static void Crs_PutHeadCoursesForEdition (void) "" "", Txt_Code, - Txt_Institutional_BR_code, + Txt_Institutional_code,Txt_optional, Txt_Degree, Txt_Year_OF_A_DEGREE, Txt_Semester_ABBREVIATION, @@ -2980,10 +2989,6 @@ static void Crs_PutLinkToGoToCrs (struct Course *Crs) void Crs_ReqSelectOneOfMyCourses (void) { - extern const char *Txt_You_are_not_enrolled_in_any_course[Usr_NUM_SEXS]; - extern const char *Txt_You_can_search_for_courses_select_them_and_request_your_enrollment_in_them; - extern const char *Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them; - /***** Search / select more courses *****/ fprintf (Gbl.F.Out,"
"); Crs_PutLinkToSearchCourses (); @@ -2994,15 +2999,11 @@ void Crs_ReqSelectOneOfMyCourses (void) Usr_GetMyCourses (); if (Gbl.Usrs.Me.MyCourses.Num) + /* Show my courses */ Crs_WriteListMyCoursesToSelectOne (); - else - { - sprintf (Gbl.Message,"%s
%s
%s", - Txt_You_are_not_enrolled_in_any_course[Gbl.Usrs.Me.UsrDat.Sex], - Txt_You_can_search_for_courses_select_them_and_request_your_enrollment_in_them, - Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them); - Lay_ShowAlert (Lay_INFO,Gbl.Message); - } + else // I am not enrolled in any course + /* Show help to enroll me */ + Enr_HelpToEnroll (); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index e418865c9..9d82fe16c 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -37,6 +37,7 @@ #include "swad_config.h" #include "swad_database.h" #include "swad_degree.h" +#include "swad_enrollment.h" #include "swad_exam.h" #include "swad_global.h" #include "swad_indicator.h" @@ -267,6 +268,9 @@ void Deg_SeeDegWithPendingCrss (void) void Deg_ShowConfiguration (void) { Deg_Configuration (false); + + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); } /*****************************************************************************/ @@ -1001,10 +1005,6 @@ void Deg_ShowDegsOfCurrentCtr (void) /***** Write menu to select country, institution and centre *****/ Deg_WriteMenuAllCourses (); - /***** Put link (form) to edit degrees of the current centre *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_) - Lay_PutFormToEdit (ActEdiDeg); - /***** Show list of degrees *****/ Deg_ListDegrees (); @@ -2190,11 +2190,25 @@ static void Deg_CreateDegree (struct Degree *Deg,unsigned Status) static void Deg_ListDegrees (void) { extern const char *Txt_No_degrees_have_been_created_in_this_centre; + extern const char *Txt_Create_degree; + bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); - if (Gbl.CurrentCtr.Ctr.NumDegs) // If there are degrees in the centre... + if (Gbl.CurrentCtr.Ctr.NumDegs) // There are degrees in the current centre + { + if (ICanEdit) + Lay_PutFormToEdit (ActEdiDeg); Deg_ListDegreesForSeeing (); - else + } + else // No degrees created in the current centre + { Lay_ShowAlert (Lay_INFO,Txt_No_degrees_have_been_created_in_this_centre); + if (ICanEdit) + { + fprintf (Gbl.F.Out,"
"); + Act_PutContextualLink (ActEdiDeg,NULL,"edit",Txt_Create_degree); + fprintf (Gbl.F.Out,"
"); + } + } } /*****************************************************************************/ @@ -2203,7 +2217,6 @@ static void Deg_ListDegrees (void) void Deg_EditDegrees (void) { - extern const char *Txt_No_degrees_have_been_created_in_this_centre; extern const char *Txt_There_is_no_list_of_centres; extern const char *Txt_You_must_create_at_least_one_centre_before_creating_degrees; extern const char *Txt_There_is_no_list_of_types_of_degree; @@ -2215,9 +2228,6 @@ void Deg_EditDegrees (void) /***** Get list of degrees in the current centre *****/ Deg_GetListDegsOfCurrentCtr (); - if (!Gbl.CurrentCtr.Ctr.NumDegs) // There aren't degrees in the current centre - Lay_ShowAlert (Lay_INFO,Txt_No_degrees_have_been_created_in_this_centre); - /***** Get list of centres of the current institution *****/ Ctr_GetListCentres (Gbl.CurrentIns.Ins.InsCod); diff --git a/swad_enrollment.c b/swad_enrollment.c index 53f2bb987..7378aa568 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -3712,3 +3712,220 @@ static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope, Lay_ShowAlert (Lay_ERROR,Gbl.Message); } } + +/*****************************************************************************/ +/************************ Help to enroll in a course *************************/ +/*****************************************************************************/ + +void Enr_HelpToEnroll (void) + { + extern const char *Txt_You_are_not_enrolled_in_any_course[Usr_NUM_SEXS]; + extern const char *Txt_You_can_search_for_courses_select_them_and_request_your_enrollment_in_them; + extern const char *Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them; + extern const char *Txt_What_would_you_like_to_do; + extern const char *Txt_Go_to_one_of_my_courses; + extern const char *Txt_My_courses; + extern const char *Txt_Sign_up; + extern const char *Txt_Remove_me_from_the_course_X; + extern const char *Txt_Remove_me; + extern const char *Txt_Register_me_in_the_course_X; + extern const char *Txt_Select_another_course_of_the_degree_X; + extern const char *Txt_Select_one_course_of_the_degree_X; + extern const char *Txt_Courses; + extern const char *Txt_Select_another_degree_of_the_centre_X; + extern const char *Txt_Select_one_degree_of_the_centre_X; + extern const char *Txt_Degrees; + extern const char *Txt_Select_another_centre_of_the_institution_X; + extern const char *Txt_Select_one_centre_of_the_institution_X; + extern const char *Txt_Centres; + extern const char *Txt_Select_another_institution_of_COUNTRY_X; + extern const char *Txt_Select_one_institution_of_COUNTRY_X; + extern const char *Txt_Institutions; + extern const char *Txt_Select_another_country; + extern const char *Txt_Select_one_country; + extern const char *Txt_Countries; + extern const char *Txt_Log_in; + extern const char *Txt_New_on_PLATFORM_Sign_up; + extern const char *Txt_Create_account; + + /***** Alert message *****/ + if (Gbl.Usrs.Me.Logged && + !Gbl.Usrs.Me.MyCourses.Num) + { + sprintf (Gbl.Message,"%s
%s
%s", + Txt_You_are_not_enrolled_in_any_course[Gbl.Usrs.Me.UsrDat.Sex], + Txt_You_can_search_for_courses_select_them_and_request_your_enrollment_in_them, + Txt_If_you_can_not_find_your_institution_your_centre_your_degree_or_your_courses_you_can_create_them); + Lay_ShowAlert (Lay_INFO,Gbl.Message); + } + + /***** Contextual buttons *****/ + /* Start table */ + Lay_StartRoundFrameTable (NULL,2,Txt_What_would_you_like_to_do); + + if (Gbl.Usrs.Me.Logged) // I am logged + { + if (Gbl.Usrs.Me.MyCourses.Num) // I am enrolled in some courses + { + if (Gbl.CurrentAct != ActMyCrs) // I am not seeing the action to list my courses + { + /* Request list my courses */ + fprintf (Gbl.F.Out,"" + "" + "%s:" + "" + "", + Txt_Go_to_one_of_my_courses); + Act_FormStart (ActMyCrs); + Lay_PutConfirmButtonInline (Txt_My_courses); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + } + + if (Gbl.CurrentDeg.Deg.DegCod > 0) // Degree selected + { + /* Select a course */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Gbl.CurrentCrs.Crs.CrsCod > 0 ? Txt_Select_another_course_of_the_degree_X : + Txt_Select_one_course_of_the_degree_X, + Gbl.CurrentDeg.Deg.ShortName); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActSeeCrs); + Lay_PutConfirmButtonInline (Txt_Courses); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + else if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // Centre selected + { + /* Select a degree */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Gbl.CurrentDeg.Deg.DegCod > 0 ? Txt_Select_another_degree_of_the_centre_X : + Txt_Select_one_degree_of_the_centre_X, + Gbl.CurrentCtr.Ctr.ShortName); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActSeeDeg); + Lay_PutConfirmButtonInline (Txt_Degrees); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + else if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected + { + /* Select a centre */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Gbl.CurrentCtr.Ctr.CtrCod > 0 ? Txt_Select_another_centre_of_the_institution_X : + Txt_Select_one_centre_of_the_institution_X, + Gbl.CurrentIns.Ins.ShortName); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActSeeCtr); + Lay_PutConfirmButtonInline (Txt_Centres); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected + { + /* Select an institution */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Gbl.CurrentIns.Ins.InsCod > 0 ? Txt_Select_another_institution_of_COUNTRY_X : + Txt_Select_one_institution_of_COUNTRY_X, + Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActSeeIns); + Lay_PutConfirmButtonInline (Txt_Institutions); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + else + { + /* Select a country */ + fprintf (Gbl.F.Out,"" + "%s:" + "", + Gbl.CurrentCty.Cty.CtyCod > 0 ? Txt_Select_another_country : + Txt_Select_one_country); + Act_FormStart (ActSeeCty); + Lay_PutConfirmButtonInline (Txt_Countries); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + + if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected + { + if (Gbl.Usrs.Me.IBelongToCurrentCrs) // I belong to this course + { + if (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT) + { + /* Request my removing from this course */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Txt_Remove_me_from_the_course_X, + Gbl.CurrentCrs.Crs.ShortName); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActReqMdfOneStd); + Lay_PutRemoveButtonInline (Txt_Remove_me); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + } + else // I do not belong to this course + { + /* Request my registration in this course */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Txt_Register_me_in_the_course_X, + Gbl.CurrentCrs.Crs.ShortName); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActReqSignUp); + Lay_PutCreateButtonInline (Txt_Sign_up); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + } + } + else // I am not logged + { + /* Log in */ + fprintf (Gbl.F.Out,"" + "%s:" + "", + Txt_Log_in); + Act_FormStart (ActFrmLogIn); + Lay_PutConfirmButtonInline (Txt_Log_in); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + + /* Sign up */ + fprintf (Gbl.F.Out,"" + ""); + fprintf (Gbl.F.Out,Txt_New_on_PLATFORM_Sign_up,Cfg_PLATFORM_SHORT_NAME); + fprintf (Gbl.F.Out,":" + ""); + Act_FormStart (ActFrmUsrAcc); + Lay_PutCreateButtonInline (Txt_Create_account); + Act_FormEnd (); + fprintf (Gbl.F.Out,"" + ""); + } + + /* End table */ + Lay_EndRoundFrameTable (); + } diff --git a/swad_enrollment.h b/swad_enrollment.h index a6e58b8d0..491626302 100644 --- a/swad_enrollment.h +++ b/swad_enrollment.h @@ -135,4 +135,6 @@ void Enr_CreateNewUsr (void); void Enr_ModifyUsr (void); void Enr_AcceptUsrInCrs (long UsrCod); +void Enr_HelpToEnroll (void); + #endif diff --git a/swad_file_browser.c b/swad_file_browser.c index 9a79f5f6d..72a9bd67b 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -2968,7 +2968,7 @@ static void Brw_ShowFileBrowsersAsgWrkCrs (void) Brw_WriteTopBeforeShowingFileBrowser (); /***** Header of the table with the list of users *****/ - Lay_StartRoundFrameTable ("95%",0,Txt_Assignments_and_other_works); + Lay_StartRoundFrameTable ("97%",0,Txt_Assignments_and_other_works); /***** List the assignments and works of the selected users *****/ Ptr = Gbl.Usrs.Select.All; @@ -3315,7 +3315,7 @@ static void Brw_ShowFileBrowser (void) /***** Start frame *****/ Gbl.FileBrowser.Id++; fprintf (Gbl.F.Out,"
",Gbl.FileBrowser.Id); - Lay_StartRoundFrameTable ("95%",0,Brw_TitleOfFileBrowser[Gbl.FileBrowser.Type]); + Lay_StartRoundFrameTable ("97%",0,Brw_TitleOfFileBrowser[Gbl.FileBrowser.Type]); /***** Title *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_info.c b/swad_info.c index 8d981d863..f9afb0eae 100644 --- a/swad_info.c +++ b/swad_info.c @@ -341,11 +341,14 @@ void Inf_ShowInfo (void) switch (InfoSrc) { case Inf_INFO_SRC_NONE: - Lay_ShowAlert (Lay_WARNING,Txt_No_information_available); + if (InfoType != Inf_INTRODUCTION) + Lay_ShowAlert (Lay_WARNING,Txt_No_information_available); break; case Inf_INFO_SRC_EDITOR: switch (InfoType) { + case Inf_INTRODUCTION: + break; case Inf_LECTURES: case Inf_PRACTICALS: @@ -365,7 +368,6 @@ void Inf_ShowInfo (void) Syl_EditSyllabus (); break; - case Inf_INTRODUCTION: case Inf_TEACHING_GUIDE: case Inf_BIBLIOGRAPHY: case Inf_FAQ: diff --git a/swad_institution.c b/swad_institution.c index e83c91bfb..7c2979df4 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -32,6 +32,7 @@ #include "swad_config.h" #include "swad_constant.h" #include "swad_database.h" +#include "swad_enrollment.h" #include "swad_global.h" #include "swad_institution.h" #include "swad_logo.h" @@ -64,6 +65,7 @@ extern struct Globals Gbl; static void Ins_Configuration (bool PrintView); +static void Ins_ListInstitutions (void); static void Ins_ListInstitutionsForSeeing (void); static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned NumIns); static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable); @@ -205,6 +207,9 @@ void Ins_SeeInsWithPendingCtrs (void) void Ins_ShowConfiguration (void) { Ins_Configuration (false); + + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); } /*****************************************************************************/ @@ -462,12 +467,8 @@ void Ins_ShowInssOfCurrentCty (void) /***** Write menu to select country *****/ Deg_WriteMenuAllCourses (); - /***** Put link (form) to edit institutions *****/ - if (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_) - Lay_PutFormToEdit (ActEdiIns); - /***** List institutions *****/ - Ins_ListInstitutionsForSeeing (); + Ins_ListInstitutions (); /***** Free list of institutions *****/ Ins_FreeListInstitutions (); @@ -478,6 +479,34 @@ void Ins_ShowInssOfCurrentCty (void) /*************** List the institutions of the current country ****************/ /*****************************************************************************/ +static void Ins_ListInstitutions (void) + { + extern const char *Txt_No_institutions_have_been_created_in_this_country; + extern const char *Txt_Create_institution; + bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); + + if (Gbl.Inss.Num) // There are institutions in the current country + { + if (ICanEdit) + Lay_PutFormToEdit (ActEdiIns); + Ins_ListInstitutionsForSeeing (); + } + else // No institutions created in the current country + { + Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country); + if (ICanEdit) + { + fprintf (Gbl.F.Out,"
"); + Act_PutContextualLink (ActEdiIns,NULL,"edit",Txt_Create_institution); + fprintf (Gbl.F.Out,"
"); + } + } + } + +/*****************************************************************************/ +/*************** List the institutions of the current country ****************/ +/*****************************************************************************/ + static void Ins_ListInstitutionsForSeeing (void) { extern const char *Txt_Institutions_of_COUNTRY_X; @@ -675,17 +704,12 @@ static void Ins_GetParamInsOrderType (void) void Ins_EditInstitutions (void) { - extern const char *Txt_No_institutions_have_been_created_in_this_country; - /***** Get list of institutions *****/ Ins_GetListInstitutions (Gbl.CurrentCty.Cty.CtyCod,Ins_GET_EXTRA_DATA); if (Gbl.Inss.Num) /***** Put link (form) to view institutions *****/ Lay_PutFormToView (ActSeeIns); - else - /***** Help message *****/ - Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country); /***** Put a form to create a new institution *****/ Ins_PutFormToCreateInstitution (); diff --git a/swad_record.c b/swad_record.c index c89c3d8a6..6741f5faa 100644 --- a/swad_record.c +++ b/swad_record.c @@ -3377,7 +3377,7 @@ void Rec_ShowFormMyInsCtrDpt (void) Lay_ShowAlert (Lay_WARNING,Txt_Please_fill_in_your_centre_and_department); /***** Start table *****/ - Lay_StartRoundFrameTable ("700px",3, + Lay_StartRoundFrameTable ("800px",2, IAmTeacher ? Txt_Institution_centre_and_department : Txt_Institution); diff --git a/swad_text.c b/swad_text.c index fd075f1ee..7c2a145ae 100644 --- a/swad_text.c +++ b/swad_text.c @@ -12533,6 +12533,27 @@ const char *Txt_Go_to_course_and_reply_again = "Ir para a disciplina e responder novamente"; #endif +const char *Txt_Go_to_one_of_my_courses = +#if L==0 + "Anar a una de les meves assignatures"; +#elif L==1 + "Gehen Sie zu einem meiner Kurse"; +#elif L==2 + "Go to one of my courses"; +#elif L==3 + "Ir a una de mis asignaturas"; +#elif L==4 + "Allez à l'une de mes matières"; +#elif L==5 + "Ir a una de mis asignaturas"; // Okoteve traducción +#elif L==6 + "Vai a uno dei miei corsi"; +#elif L==7 + "Idź do jednej z moich kursów"; +#elif L==8 + "Vá para uma das minha disciplinas"; +#endif + const char *Txt_Group = #if L==0 "Grup"; @@ -21982,7 +22003,7 @@ const char *Txt_Multiple_enrollment = // (to a type of group) const char *Txt_My_courses = #if L==0 - "Els meus assignatures"; + "Les meves assignatures"; #elif L==1 "Meine Kursen"; #elif L==2 @@ -28699,6 +28720,27 @@ const char *Txt_Remove_logo = "Remover logotipo"; #endif +const char *Txt_Remove_me = +#if L==0 + "Eliminarme"; +#elif L==1 + "Entfernen Sie"; +#elif L==2 + "Remove me"; +#elif L==3 + "Eliminarme"; +#elif L==4 + "Enlever-moi"; +#elif L==5 + "Eliminarme"; // Okoteve traducción +#elif L==6 + "Rimuovimi"; +#elif L==7 + "Usuñ"; +#elif L==8 + "Tirar me"; +#endif + const char *Txt_Remove_me_as_an_administrator = #if L==0 "Eliminarme com a administrador"; @@ -28810,7 +28852,7 @@ const char *Txt_Remove_me_as_an_administrator_of_the_institution_X = // Warning: " da institução %s"; #endif -const char *Txt_Remove_me_from_this_course = // Warning: it is very important to include %s in the following sentences +const char *Txt_Remove_me_from_this_course = #if L==0 "Eliminarme d'aquesta assignatura"; #elif L==1 @@ -33485,6 +33527,216 @@ const char *Txt_See_page_X_of_Y = // Warning: it is very important to include tw "Veja página %u de %u"; #endif +const char *Txt_Select_another_centre_of_the_institution_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar un altre centre de la institució %s"; +#elif L==1 + "Wählen Sie einen anderen Lehrinstitut der Hochschule %s"; +#elif L==2 + "Select another centre of the institution %s"; +#elif L==3 + "Seleccionar otro centro de la institución %s"; +#elif L==4 + "Sélectionnez un autre étude du établissement %s"; +#elif L==5 + "Seleccionar otro centro de la institución %s"; // Okoteve traducción +#elif L==6 + "Selezionare un altro centro di istituzione %s"; +#elif L==7 + "Select another degree of the institution %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar um outro centro da institução %s"; +#endif + +const char *Txt_Select_another_country = +#if L==0 + "Seleccionar un altre país"; +#elif L==1 + "Wählen Sie eine anderes Land"; +#elif L==2 + "Select another country"; +#elif L==3 + "Seleccionar otro país"; +#elif L==4 + "Sélectionnez un autre pays"; +#elif L==5 + "Seleccionar otro país"; // Okoteve traducción +#elif L==6 + "Selezionare un altro paese"; +#elif L==7 + "Wybierz inny kraj"; +#elif L==8 + "Selecionar outro país"; +#endif + +const char *Txt_Select_another_course_of_the_degree_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar una altra assignatura de la titulació %s"; +#elif L==1 + "Wählen Sie einen anderen Kurs der Studiengang %s"; +#elif L==2 + "Select another course of the degree %s"; +#elif L==3 + "Seleccionar otra asignatura de la titulación %s"; +#elif L==4 + "Sélectionnez une autre matière du étude %s"; +#elif L==5 + "Seleccionar otra asignatura de la titulación %s"; // Okoteve traducción +#elif L==6 + "Selezionare un altro corso di laurea %s"; +#elif L==7 + "Select another course of the degree %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar uma outra disciplina da titulação %s"; +#endif + +const char *Txt_Select_another_degree_of_the_centre_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar una altra titulació del centre %s"; +#elif L==1 + "Wählen Sie einen anderen Studiengang der Lehrinstitut %s"; +#elif L==2 + "Select another degree of the centre %s"; +#elif L==3 + "Seleccionar otra titulación del centro %s"; +#elif L==4 + "Sélectionnez un autre étude du centre %s"; +#elif L==5 + "Seleccionar otra titulación del centro %s"; // Okoteve traducción +#elif L==6 + "Selezionare una altra laurea di centro %s"; +#elif L==7 + "Select another degree of the centre %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar uma outra titulação do centro %s"; +#endif + +const char *Txt_Select_another_institution_of_COUNTRY_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar una altra institució de %s"; +#elif L==1 + "Wählen Sie einen anderen Hochschule von %s"; +#elif L==2 + "Select another institution of %s"; +#elif L==3 + "Seleccionar otra institución de %s"; +#elif L==4 + "Sélectionnez un autre établissement de %s"; +#elif L==5 + "Seleccionar otra institución de %s"; // Okoteve traducción +#elif L==6 + "Selezionare una altra istituzione di %s"; +#elif L==7 + "Select another institution of %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar uma outra institução de %s"; +#endif + +const char *Txt_Select_one_centre_of_the_institution_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar un centre de la institució %s"; +#elif L==1 + "Wählen Sie einen Lehrinstitut der Hochschule %s"; +#elif L==2 + "Select one centre of the institution %s"; +#elif L==3 + "Seleccionar un centro de la institución %s"; +#elif L==4 + "Sélectionnez un étude du établissement %s"; +#elif L==5 + "Seleccionar un centro de la institución %s"; // Okoteve traducción +#elif L==6 + "Selezionare un centro di istituzione %s"; +#elif L==7 + "Select one degree of the institution %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar um centro da institução %s"; +#endif + +const char *Txt_Select_one_course_of_the_degree_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar una assignatura de la titulació %s"; +#elif L==1 + "Wählen Sie eine Kurs der Studiengang %s"; +#elif L==2 + "Select one course of the degree %s"; +#elif L==3 + "Seleccionar una asignatura de la titulación %s"; +#elif L==4 + "Sélectionnez une matière du étude %s"; +#elif L==5 + "Seleccionar una asignatura de la titulación %s"; // Okoteve traducción +#elif L==6 + "Selezionare un corso di laurea %s"; +#elif L==7 + "Select one course of the degree %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar uma disciplina da titulação %s"; +#endif + +const char *Txt_Select_one_country = +#if L==0 + "Seleccionar un país"; +#elif L==1 + "Wählen Sie ein Land"; +#elif L==2 + "Select one country"; +#elif L==3 + "Seleccionar un país"; +#elif L==4 + "Sélectionnez un pays"; +#elif L==5 + "Seleccionar un país"; // Okoteve traducción +#elif L==6 + "Selezionare un paese"; +#elif L==7 + "Wybierz jeden kraj"; +#elif L==8 + "Selecionar um país"; +#endif + +const char *Txt_Select_one_degree_of_the_centre_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar una titulació del centre %s"; +#elif L==1 + "Wählen Sie einen Studiengang der Lehrinstitut %s"; +#elif L==2 + "Select one degree of the centre %s"; +#elif L==3 + "Seleccionar una titulación del centro %s"; +#elif L==4 + "Sélectionnez un étude du centre %s"; +#elif L==5 + "Seleccionar una titulación del centro %s"; // Okoteve traducción +#elif L==6 + "Selezionare una laurea di centro %s"; +#elif L==7 + "Select one degree of the centre %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar uma titulação do centro %s"; +#endif + +const char *Txt_Select_one_institution_of_COUNTRY_X = // Warning: it is very important to include %s in the following sentences +#if L==0 + "Seleccionar una institució de %s"; +#elif L==1 + "Wählen Sie einen Hochschule von %s"; +#elif L==2 + "Select one institution of %s"; +#elif L==3 + "Seleccionar una institución de %s"; +#elif L==4 + "Sélectionnez un établissement de %s"; +#elif L==5 + "Seleccionar una institución de %s"; // Okoteve traducción +#elif L==6 + "Selezionare una istituzione di %s"; +#elif L==7 + "Select one institution of %s"; // Potrzebujesz tlumaczenie +#elif L==8 + "Selecionar uma institução de %s"; +#endif + const char *Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here = #if L==0 "Seleccioneu un o més fitxers del seu ordinador
" @@ -47092,27 +47344,6 @@ const char *Txt_View_in_a_new_window = "Ver em uma nova janela"; #endif -const char *Txt_View_my_courses = -#if L==0 - "Veure els meus assignatures"; -#elif L==1 - "Anzeigen meine Kursen"; -#elif L==2 - "View my courses"; -#elif L==3 - "Ver mis asignaturas"; -#elif L==4 - "Voir mes matières"; -#elif L==5 - "Ver mis asignaturas"; // Okoteve traducción -#elif L==6 - "Vedi i miei corsi"; -#elif L==7 - "View my courses"; // Potrzebujesz tlumaczenie -#elif L==8 - "Ver as minha disciplinas"; -#endif - const char *Txt_View_public_profile = #if L==0 "Veure perfil públic"; @@ -47740,6 +47971,27 @@ const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS] = // Warning: it is v #endif }; +const char *Txt_What_would_you_like_to_do = +#if L==0 + "Què voleu fer?"; +#elif L==1 + "Was würden Sie tun?"; +#elif L==2 + "What would you like to do?"; +#elif L==3 + "¿Qué desea hacer?"; +#elif L==4 + "Que feriez-vous?"; +#elif L==5 + "¿Qué desea hacer?"; // Okoteve traducción +#elif L==6 + "Cosa si dovrebbe fare?"; +#elif L==7 + "Co byś zrobił?"; +#elif L==8 + "O que você faria?"; +#endif + const char *Txt_With_centres = #if L==0 "Amb centres"; @@ -49988,27 +50240,6 @@ const char *Txt_You_dont_have_permission_to_perform_this_action = " para realizar esta ação."; #endif -const char *Txt_You_dont_have_photo = -#if L==0 - "Usted no tiene fotografía."; // Necessita traduccio -#elif L==1 - "Sie haben keine Foto."; -#elif L==2 - "You don't have photo."; -#elif L==3 - "Usted no tiene fotografía."; -#elif L==4 - "Vous n'avez pas de photo."; -#elif L==5 - "Usted no tiene fotografía."; // Okoteve traducción -#elif L==6 - "Non hai foto."; -#elif L==7 - "You don't have photo."; // Potrzebujesz tlumaczenie -#elif L==8 - "Você não tem foto."; -#endif - const char *Txt_You_have_confirmed_that_you_have_read_this_information = #if L==0 "Usted ha confirmado que ha leido esta información."; // Necessita traduccio diff --git a/swad_user.c b/swad_user.c index 111033cf6..aa90886bf 100644 --- a/swad_user.c +++ b/swad_user.c @@ -1375,8 +1375,13 @@ bool Usr_ChkIfEncryptedUsrCodExists (const char *EncryptedUsrCod) void Usr_WriteFormLoginLogout (void) { if (Gbl.Session.IsOpen) + { /***** Form to change my role *****/ Usr_ShowFormsLogoutAndRole (); + + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); + } else /***** Form to log in *****/ Usr_WriteFormLogin (); @@ -1506,7 +1511,6 @@ void Usr_WelcomeUsr (void) extern const char *Txt_Welcome[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X[Usr_NUM_SEXS]; extern const char *Txt_Welcome_X_and_happy_birthday[Usr_NUM_SEXS]; - extern const char *Txt_You_dont_have_photo; extern const char *Txt_Switching_to_LANGUAGE[Txt_NUM_LANGUAGES]; bool CongratulateMyBirthday; @@ -1514,6 +1518,17 @@ void Usr_WelcomeUsr (void) { if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Txt_Current_CGI_SWAD_Language) { + /***** Contextual menu *****/ + if (Gbl.Usrs.Me.UsrDat.Password[0] && + Gbl.Usrs.Me.UsrDat.FirstName[0] && + Gbl.Usrs.Me.UsrDat.Surname1[0] && + !Gbl.Usrs.Me.MyPhotoExists) // Check if I have no photo + { + fprintf (Gbl.F.Out,"
"); + Pho_PutLinkToChangeMyPhoto (); + fprintf (Gbl.F.Out,"
"); + } + fprintf (Gbl.F.Out,"
"); @@ -1543,14 +1558,8 @@ void Usr_WelcomeUsr (void) else Lay_ShowAlert (Lay_INFO,Txt_Welcome[Gbl.Usrs.Me.UsrDat.Sex]); - if (Gbl.Usrs.Me.UsrDat.Password[0] && - Gbl.Usrs.Me.UsrDat.FirstName[0] && - Gbl.Usrs.Me.UsrDat.Surname1[0] && - !Gbl.Usrs.Me.MyPhotoExists) // Check if I have no photo - { - Lay_ShowAlert (Lay_WARNING,Txt_You_dont_have_photo); - Pho_PutLinkToChangeMyPhoto (); - } + /***** Show help to enroll me *****/ + Enr_HelpToEnroll (); fprintf (Gbl.F.Out,"
");