Version 20.66.3: Apr 23, 2021 Fixed bug in course information.

This commit is contained in:
acanas 2021-04-23 12:40:26 +02:00
parent 28e67f1f9a
commit 9c905259a2
9 changed files with 423 additions and 14444 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1328,12 +1328,11 @@ int swad__getCourseInfo (struct soap *soap,
{ {
int ReturnCode; int ReturnCode;
struct Syl_Syllabus Syllabus; struct Syl_Syllabus Syllabus;
Inf_InfoType_t InfoType; Inf_Type_t InfoType;
size_t Length; size_t Length;
Inf_InfoSrc_t InfoSrc; struct Inf_FromDB FromDB;
bool MustBeRead;
int Result = SOAP_OK; int Result = SOAP_OK;
const char *NamesInWSForInfoType[Inf_NUM_INFO_TYPES] = const char *NamesInWSForInfoType[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = "introduction", [Inf_INTRODUCTION ] = "introduction",
[Inf_TEACHING_GUIDE] = "guide", [Inf_TEACHING_GUIDE] = "guide",
@ -1344,14 +1343,14 @@ int swad__getCourseInfo (struct soap *soap,
[Inf_LINKS ] = "links", [Inf_LINKS ] = "links",
[Inf_ASSESSMENT ] = "assessment", [Inf_ASSESSMENT ] = "assessment",
}; };
const char *NamesInWSForInfoSrc[Inf_NUM_INFO_SOURCES] = const char *NamesInWSForInfoSrc[Inf_NUM_SOURCES] =
{ {
[Inf_INFO_SRC_NONE ] = "none", [Inf_NONE ] = "none",
[Inf_INFO_SRC_EDITOR ] = "editor", [Inf_EDITOR ] = "editor",
[Inf_INFO_SRC_PLAIN_TEXT] = "plainText", [Inf_PLAIN_TEXT] = "plainText",
[Inf_INFO_SRC_RICH_TEXT ] = "richText", [Inf_RICH_TEXT ] = "richText",
[Inf_INFO_SRC_PAGE ] = "page", [Inf_PAGE ] = "page",
[Inf_INFO_SRC_URL ] = "URL", [Inf_URL ] = "URL",
}; };
/***** Initializations *****/ /***** Initializations *****/
@ -1396,12 +1395,12 @@ int swad__getCourseInfo (struct soap *soap,
Syl_ResetSyllabus (&Syllabus); Syl_ResetSyllabus (&Syllabus);
/***** Get info source *****/ /***** Get info source *****/
for (InfoType = (Inf_InfoType_t) 0; for (InfoType = (Inf_Type_t) 0;
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1); InfoType <= (Inf_Type_t) (Inf_NUM_TYPES - 1);
InfoType++) InfoType++)
if (!strcmp (infoType,NamesInWSForInfoType[InfoType])) if (!strcmp (infoType,NamesInWSForInfoType[InfoType]))
break; break;
if (InfoType == Inf_NUM_INFO_TYPES) // Not found! if (InfoType == Inf_NUM_TYPES) // Not found!
return soap_receiver_fault (soap, return soap_receiver_fault (soap,
"Bad info type", "Bad info type",
"Unknown requested info type"); "Unknown requested info type");
@ -1409,18 +1408,18 @@ int swad__getCourseInfo (struct soap *soap,
Inf_GetAndCheckInfoSrcFromDB (&Syllabus, Inf_GetAndCheckInfoSrcFromDB (&Syllabus,
Gbl.Hierarchy.Crs.CrsCod, Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type, Gbl.Crs.Info.Type,
&InfoSrc,&MustBeRead); &FromDB);
Length = strlen (NamesInWSForInfoSrc[InfoSrc]); Length = strlen (NamesInWSForInfoSrc[FromDB.Src]);
getCourseInfo->infoSrc = soap_malloc (soap,Length + 1); getCourseInfo->infoSrc = soap_malloc (soap,Length + 1);
Str_Copy (getCourseInfo->infoSrc,NamesInWSForInfoSrc[InfoSrc],Length); Str_Copy (getCourseInfo->infoSrc,NamesInWSForInfoSrc[FromDB.Src],Length);
/***** Get info text *****/ /***** Get info text *****/
getCourseInfo->infoTxt = NULL; getCourseInfo->infoTxt = NULL;
switch (InfoSrc) switch (FromDB.Src)
{ {
case Inf_INFO_SRC_NONE: // No info available case Inf_NONE: // No info available
break; break;
case Inf_INFO_SRC_EDITOR: // Internal editor (only for syllabus) case Inf_EDITOR: // Internal editor (only for syllabus)
switch (Gbl.Crs.Info.Type) switch (Gbl.Crs.Info.Type)
{ {
case Inf_LECTURES: // Syllabus (lectures) case Inf_LECTURES: // Syllabus (lectures)
@ -1431,14 +1430,14 @@ int swad__getCourseInfo (struct soap *soap,
break; break;
} }
break; break;
case Inf_INFO_SRC_PLAIN_TEXT: // Plain text case Inf_PLAIN_TEXT: // Plain text
case Inf_INFO_SRC_RICH_TEXT: // Rich text (not yet available) case Inf_RICH_TEXT: // Rich text (not yet available)
Result = API_WritePlainTextIntoHTMLBuffer (soap,&(getCourseInfo->infoTxt)); Result = API_WritePlainTextIntoHTMLBuffer (soap,&(getCourseInfo->infoTxt));
break; break;
case Inf_INFO_SRC_PAGE: // Web page hosted in SWAD server case Inf_PAGE: // Web page hosted in SWAD server
Result = API_WritePageIntoHTMLBuffer (soap,&(getCourseInfo->infoTxt)); Result = API_WritePageIntoHTMLBuffer (soap,&(getCourseInfo->infoTxt));
break; break;
case Inf_INFO_SRC_URL: // Link to a web page case Inf_URL: // Link to a web page
getCourseInfo->infoTxt = soap_malloc (soap,Cns_MAX_BYTES_WWW + 1); getCourseInfo->infoTxt = soap_malloc (soap,Cns_MAX_BYTES_WWW + 1);
Inf_WriteURLIntoTxtBuffer (getCourseInfo->infoTxt); Inf_WriteURLIntoTxtBuffer (getCourseInfo->infoTxt);
break; break;
@ -1537,7 +1536,7 @@ static int API_WriteSyllabusIntoHTMLBuffer (struct soap *soap,
static int API_WritePlainTextIntoHTMLBuffer (struct soap *soap, static int API_WritePlainTextIntoHTMLBuffer (struct soap *soap,
char **HTMLBuffer) char **HTMLBuffer)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
char FileNameHTMLTmp[PATH_MAX + 1]; char FileNameHTMLTmp[PATH_MAX + 1];
FILE *FileHTMLTmp; FILE *FileHTMLTmp;

View File

@ -600,13 +600,14 @@ TODO: Salvador Romero Cort
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria. TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
*/ */
#define Log_PLATFORM_VERSION "SWAD 20.66.2 (2021-04-22)" #define Log_PLATFORM_VERSION "SWAD 20.66.3 (2021-04-23)"
#define CSS_FILE "swad20.45.css" #define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js" #define JS_FILE "swad20.6.2.js"
/* /*
TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 20.66.3: Apr 23, 2021 Fixed bug in course information. (309108 lines)
Version 20.66.2: Apr 22, 2021 Clicks-without-photo database table renamed. (309126 lines) Version 20.66.2: Apr 22, 2021 Clicks-without-photo database table renamed. (309126 lines)
1 change necessary in database: 1 change necessary in database:
RENAME TABLE pho_clicks_without_photo TO usr_clicks_without_photo; RENAME TABLE pho_clicks_without_photo TO usr_clicks_without_photo;

View File

@ -837,7 +837,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *I
extern const char *Txt_Indicators; extern const char *Txt_Indicators;
extern const char *Txt_No_INDEX; extern const char *Txt_No_INDEX;
extern const char *Txt_Syllabus_of_the_course; extern const char *Txt_Syllabus_of_the_course;
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Txt_Number_of_files_in_SHARE_zones; extern const char *Txt_Number_of_files_in_SHARE_zones;
extern const char *Txt_Number_of_files_in_DOCUM_zones; extern const char *Txt_Number_of_files_in_DOCUM_zones;
extern const char *Txt_Guided_academic_assignments; extern const char *Txt_Guided_academic_assignments;
@ -852,7 +852,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *I
extern const char *Txt_Assessment_criteria; extern const char *Txt_Assessment_criteria;
extern const char *Txt_YES; extern const char *Txt_YES;
extern const char *Txt_NO; extern const char *Txt_NO;
extern const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES]; extern const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_SOURCES];
extern const char *Txt_Courses; extern const char *Txt_Courses;
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumCrs; unsigned NumCrs;
@ -1190,21 +1190,21 @@ static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *I
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"%s LM COLOR%u\"", HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.SyllabusLecSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (IndicatorsCrs.SyllabusLecSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusLecSrc]); HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusLecSrc]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"%s LM COLOR%u\"", HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.SyllabusPraSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (IndicatorsCrs.SyllabusPraSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusPraSrc]); HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.SyllabusPraSrc]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"%s LM COLOR%u\">", HTM_TD_Begin ("class=\"%s LM COLOR%u\">",
(IndicatorsCrs.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (IndicatorsCrs.TeachingGuideSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]); HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
@ -1315,14 +1315,14 @@ static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *I
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"%s LM COLOR%u\"", HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.AssessmentSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (IndicatorsCrs.AssessmentSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.AssessmentSrc]); HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.AssessmentSrc]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"%s LM COLOR%u\"", HTM_TD_Begin ("class=\"%s LM COLOR%u\"",
(IndicatorsCrs.TeachingGuideSrc != Inf_INFO_SRC_NONE) ? "DAT_SMALL_GREEN" : (IndicatorsCrs.TeachingGuideSrc != Inf_NONE) ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]); HTM_Txt (Txt_INFO_SRC_SHORT_TEXT[IndicatorsCrs.TeachingGuideSrc]);
@ -1431,9 +1431,9 @@ void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB,
IndicatorsCrs->SyllabusLecSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_LECTURES); IndicatorsCrs->SyllabusLecSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_LECTURES);
IndicatorsCrs->SyllabusPraSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_PRACTICALS); IndicatorsCrs->SyllabusPraSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_PRACTICALS);
IndicatorsCrs->TeachingGuideSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_TEACHING_GUIDE); IndicatorsCrs->TeachingGuideSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_TEACHING_GUIDE);
IndicatorsCrs->ThereIsSyllabus = (IndicatorsCrs->SyllabusLecSrc != Inf_INFO_SRC_NONE) || IndicatorsCrs->ThereIsSyllabus = (IndicatorsCrs->SyllabusLecSrc != Inf_NONE) ||
(IndicatorsCrs->SyllabusPraSrc != Inf_INFO_SRC_NONE) || (IndicatorsCrs->SyllabusPraSrc != Inf_NONE) ||
(IndicatorsCrs->TeachingGuideSrc != Inf_INFO_SRC_NONE); (IndicatorsCrs->TeachingGuideSrc != Inf_NONE);
if (IndicatorsCrs->ThereIsSyllabus) if (IndicatorsCrs->ThereIsSyllabus)
IndicatorsCrs->NumIndicators++; IndicatorsCrs->NumIndicators++;
@ -1465,8 +1465,8 @@ void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB,
/***** Indicator #5: information about assessment *****/ /***** Indicator #5: information about assessment *****/
IndicatorsCrs->AssessmentSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_ASSESSMENT); IndicatorsCrs->AssessmentSrc = Inf_GetInfoSrcFromDB (CrsCod,Inf_ASSESSMENT);
IndicatorsCrs->ThereIsAssessment = (IndicatorsCrs->AssessmentSrc != Inf_INFO_SRC_NONE) || IndicatorsCrs->ThereIsAssessment = (IndicatorsCrs->AssessmentSrc != Inf_NONE) ||
(IndicatorsCrs->TeachingGuideSrc != Inf_INFO_SRC_NONE); (IndicatorsCrs->TeachingGuideSrc != Inf_NONE);
if (IndicatorsCrs->ThereIsAssessment) if (IndicatorsCrs->ThereIsAssessment)
IndicatorsCrs->NumIndicators++; IndicatorsCrs->NumIndicators++;

View File

@ -39,9 +39,9 @@ struct Ind_IndicatorsCrs
unsigned NumFilesInDocumentZones; unsigned NumFilesInDocumentZones;
unsigned NumFilesInSharedZones; unsigned NumFilesInSharedZones;
bool ThereIsSyllabus; bool ThereIsSyllabus;
Inf_InfoSrc_t TeachingGuideSrc; Inf_Src_t TeachingGuideSrc;
Inf_InfoSrc_t SyllabusLecSrc; Inf_Src_t SyllabusLecSrc;
Inf_InfoSrc_t SyllabusPraSrc; Inf_Src_t SyllabusPraSrc;
bool ThereAreAssignments; bool ThereAreAssignments;
unsigned NumAssignments; unsigned NumAssignments;
unsigned NumFilesAssignments; unsigned NumFilesAssignments;
@ -53,7 +53,7 @@ struct Ind_IndicatorsCrs
unsigned NumMsgsSentByTchs; unsigned NumMsgsSentByTchs;
bool ThereAreMaterials; bool ThereAreMaterials;
bool ThereIsAssessment; bool ThereIsAssessment;
Inf_InfoSrc_t AssessmentSrc; Inf_Src_t AssessmentSrc;
unsigned NumIndicators; unsigned NumIndicators;
bool CoursePartiallyOK; bool CoursePartiallyOK;
bool CourseAllOK; bool CourseAllOK;

View File

@ -53,7 +53,7 @@ extern struct Globals Gbl;
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
const Act_Action_t Inf_ActionsSeeInfo[Inf_NUM_INFO_TYPES] = const Act_Action_t Inf_ActionsSeeInfo[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActSeeCrsInf, [Inf_INTRODUCTION ] = ActSeeCrsInf,
[Inf_TEACHING_GUIDE] = ActSeeTchGui, [Inf_TEACHING_GUIDE] = ActSeeTchGui,
@ -73,7 +73,7 @@ const Act_Action_t Inf_ActionsSeeInfo[Inf_NUM_INFO_TYPES] =
/***************************** Private constants *****************************/ /***************************** Private constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
static const char *Inf_FileNamesForInfoType[Inf_NUM_INFO_TYPES] = static const char *Inf_FileNamesForInfoType[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Cfg_CRS_INFO_INTRODUCTION, [Inf_INTRODUCTION ] = Cfg_CRS_INFO_INTRODUCTION,
[Inf_TEACHING_GUIDE] = Cfg_CRS_INFO_TEACHING_GUIDE, [Inf_TEACHING_GUIDE] = Cfg_CRS_INFO_TEACHING_GUIDE,
@ -86,27 +86,27 @@ static const char *Inf_FileNamesForInfoType[Inf_NUM_INFO_TYPES] =
}; };
/* Functions to write forms in course edition (FAQ, links, etc.) */ /* Functions to write forms in course edition (FAQ, links, etc.) */
static void (*Inf_FormsForEditionTypes[Inf_NUM_INFO_SOURCES])(Inf_InfoSrc_t InfoSrc) = static void (*Inf_FormsForEditionTypes[Inf_NUM_SOURCES])(Inf_Src_t InfoSrc) =
{ {
[Inf_INFO_SRC_NONE ] = NULL, [Inf_NONE ] = NULL,
[Inf_INFO_SRC_EDITOR ] = Inf_FormToEnterIntegratedEditor, [Inf_EDITOR ] = Inf_FormToEnterIntegratedEditor,
[Inf_INFO_SRC_PLAIN_TEXT] = Inf_FormToEnterPlainTextEditor, [Inf_PLAIN_TEXT] = Inf_FormToEnterPlainTextEditor,
[Inf_INFO_SRC_RICH_TEXT ] = Inf_FormToEnterRichTextEditor, [Inf_RICH_TEXT ] = Inf_FormToEnterRichTextEditor,
[Inf_INFO_SRC_PAGE ] = Inf_FormToSendPage, [Inf_PAGE ] = Inf_FormToSendPage,
[Inf_INFO_SRC_URL ] = Inf_FormToSendURL, [Inf_URL ] = Inf_FormToSendURL,
}; };
static const char *Inf_NamesInDBForInfoSrc[Inf_NUM_INFO_SOURCES] = static const char *Inf_NamesInDBForInfoSrc[Inf_NUM_SOURCES] =
{ {
[Inf_INFO_SRC_NONE ] = "none", [Inf_NONE ] = "none",
[Inf_INFO_SRC_EDITOR ] = "editor", [Inf_EDITOR ] = "editor",
[Inf_INFO_SRC_PLAIN_TEXT] = "plain_text", [Inf_PLAIN_TEXT] = "plain_text",
[Inf_INFO_SRC_RICH_TEXT ] = "rich_text", [Inf_RICH_TEXT ] = "rich_text",
[Inf_INFO_SRC_PAGE ] = "page", [Inf_PAGE ] = "page",
[Inf_INFO_SRC_URL ] = "URL", [Inf_URL ] = "URL",
}; };
static const Act_Action_t Inf_ActionsEditInfo[Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsEditInfo[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActEdiCrsInf, [Inf_INTRODUCTION ] = ActEdiCrsInf,
[Inf_TEACHING_GUIDE] = ActEdiTchGui, [Inf_TEACHING_GUIDE] = ActEdiTchGui,
@ -118,7 +118,7 @@ static const Act_Action_t Inf_ActionsEditInfo[Inf_NUM_INFO_TYPES] =
[Inf_ASSESSMENT ] = ActEdiAss, [Inf_ASSESSMENT ] = ActEdiAss,
}; };
static const Act_Action_t Inf_ActionsChangeForceReadInfo[Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsChangeForceReadInfo[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActChgFrcReaCrsInf, [Inf_INTRODUCTION ] = ActChgFrcReaCrsInf,
[Inf_TEACHING_GUIDE] = ActChgFrcReaTchGui, [Inf_TEACHING_GUIDE] = ActChgFrcReaTchGui,
@ -130,7 +130,7 @@ static const Act_Action_t Inf_ActionsChangeForceReadInfo[Inf_NUM_INFO_TYPES] =
[Inf_ASSESSMENT ] = ActChgFrcReaAss, [Inf_ASSESSMENT ] = ActChgFrcReaAss,
}; };
static const Act_Action_t Inf_ActionsIHaveReadInfo[Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsIHaveReadInfo[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActChgHavReaCrsInf, [Inf_INTRODUCTION ] = ActChgHavReaCrsInf,
[Inf_TEACHING_GUIDE] = ActChgHavReaTchGui, [Inf_TEACHING_GUIDE] = ActChgHavReaTchGui,
@ -142,7 +142,7 @@ static const Act_Action_t Inf_ActionsIHaveReadInfo[Inf_NUM_INFO_TYPES] =
[Inf_ASSESSMENT ] = ActChgHavReaAss, [Inf_ASSESSMENT ] = ActChgHavReaAss,
}; };
static const Act_Action_t Inf_ActionsSelecInfoSrc[Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsSelecInfoSrc[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActSelInfSrcCrsInf, [Inf_INTRODUCTION ] = ActSelInfSrcCrsInf,
[Inf_TEACHING_GUIDE] = ActSelInfSrcTchGui, [Inf_TEACHING_GUIDE] = ActSelInfSrcTchGui,
@ -154,64 +154,64 @@ static const Act_Action_t Inf_ActionsSelecInfoSrc[Inf_NUM_INFO_TYPES] =
[Inf_ASSESSMENT ] = ActSelInfSrcAss, [Inf_ASSESSMENT ] = ActSelInfSrcAss,
}; };
static const Act_Action_t Inf_ActionsInfo[Inf_NUM_INFO_SOURCES][Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsInfo[Inf_NUM_SOURCES][Inf_NUM_TYPES] =
{ {
[Inf_INFO_SRC_NONE ][Inf_INTRODUCTION ] = ActUnk, [Inf_NONE ][Inf_INTRODUCTION ] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_TEACHING_GUIDE] = ActUnk, [Inf_NONE ][Inf_TEACHING_GUIDE] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_LECTURES ] = ActUnk, [Inf_NONE ][Inf_LECTURES ] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_PRACTICALS ] = ActUnk, [Inf_NONE ][Inf_PRACTICALS ] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_BIBLIOGRAPHY ] = ActUnk, [Inf_NONE ][Inf_BIBLIOGRAPHY ] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_FAQ ] = ActUnk, [Inf_NONE ][Inf_FAQ ] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_LINKS ] = ActUnk, [Inf_NONE ][Inf_LINKS ] = ActUnk,
[Inf_INFO_SRC_NONE ][Inf_ASSESSMENT ] = ActUnk, [Inf_NONE ][Inf_ASSESSMENT ] = ActUnk,
[Inf_INFO_SRC_EDITOR ][Inf_INTRODUCTION ] = ActEditorCrsInf, [Inf_EDITOR ][Inf_INTRODUCTION ] = ActEditorCrsInf,
[Inf_INFO_SRC_EDITOR ][Inf_TEACHING_GUIDE] = ActEditorTchGui, [Inf_EDITOR ][Inf_TEACHING_GUIDE] = ActEditorTchGui,
[Inf_INFO_SRC_EDITOR ][Inf_LECTURES ] = ActEditorSylLec, [Inf_EDITOR ][Inf_LECTURES ] = ActEditorSylLec,
[Inf_INFO_SRC_EDITOR ][Inf_PRACTICALS ] = ActEditorSylPra, [Inf_EDITOR ][Inf_PRACTICALS ] = ActEditorSylPra,
[Inf_INFO_SRC_EDITOR ][Inf_BIBLIOGRAPHY ] = ActEditorBib, [Inf_EDITOR ][Inf_BIBLIOGRAPHY ] = ActEditorBib,
[Inf_INFO_SRC_EDITOR ][Inf_FAQ ] = ActEditorFAQ, [Inf_EDITOR ][Inf_FAQ ] = ActEditorFAQ,
[Inf_INFO_SRC_EDITOR ][Inf_LINKS ] = ActEditorCrsLnk, [Inf_EDITOR ][Inf_LINKS ] = ActEditorCrsLnk,
[Inf_INFO_SRC_EDITOR ][Inf_ASSESSMENT ] = ActEditorAss, [Inf_EDITOR ][Inf_ASSESSMENT ] = ActEditorAss,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_INTRODUCTION ] = ActPlaTxtEdiCrsInf, [Inf_PLAIN_TEXT][Inf_INTRODUCTION ] = ActPlaTxtEdiCrsInf,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_TEACHING_GUIDE] = ActPlaTxtEdiTchGui, [Inf_PLAIN_TEXT][Inf_TEACHING_GUIDE] = ActPlaTxtEdiTchGui,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_LECTURES ] = ActPlaTxtEdiSylLec, [Inf_PLAIN_TEXT][Inf_LECTURES ] = ActPlaTxtEdiSylLec,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_PRACTICALS ] = ActPlaTxtEdiSylPra, [Inf_PLAIN_TEXT][Inf_PRACTICALS ] = ActPlaTxtEdiSylPra,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_BIBLIOGRAPHY ] = ActPlaTxtEdiBib, [Inf_PLAIN_TEXT][Inf_BIBLIOGRAPHY ] = ActPlaTxtEdiBib,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_FAQ ] = ActPlaTxtEdiFAQ, [Inf_PLAIN_TEXT][Inf_FAQ ] = ActPlaTxtEdiFAQ,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_LINKS ] = ActPlaTxtEdiCrsLnk, [Inf_PLAIN_TEXT][Inf_LINKS ] = ActPlaTxtEdiCrsLnk,
[Inf_INFO_SRC_PLAIN_TEXT][Inf_ASSESSMENT ] = ActPlaTxtEdiAss, [Inf_PLAIN_TEXT][Inf_ASSESSMENT ] = ActPlaTxtEdiAss,
[Inf_INFO_SRC_RICH_TEXT ][Inf_INTRODUCTION ] = ActRchTxtEdiCrsInf, [Inf_RICH_TEXT ][Inf_INTRODUCTION ] = ActRchTxtEdiCrsInf,
[Inf_INFO_SRC_RICH_TEXT ][Inf_TEACHING_GUIDE] = ActRchTxtEdiTchGui, [Inf_RICH_TEXT ][Inf_TEACHING_GUIDE] = ActRchTxtEdiTchGui,
[Inf_INFO_SRC_RICH_TEXT ][Inf_LECTURES ] = ActRchTxtEdiSylLec, [Inf_RICH_TEXT ][Inf_LECTURES ] = ActRchTxtEdiSylLec,
[Inf_INFO_SRC_RICH_TEXT ][Inf_PRACTICALS ] = ActRchTxtEdiSylPra, [Inf_RICH_TEXT ][Inf_PRACTICALS ] = ActRchTxtEdiSylPra,
[Inf_INFO_SRC_RICH_TEXT ][Inf_BIBLIOGRAPHY ] = ActRchTxtEdiBib, [Inf_RICH_TEXT ][Inf_BIBLIOGRAPHY ] = ActRchTxtEdiBib,
[Inf_INFO_SRC_RICH_TEXT ][Inf_FAQ ] = ActRchTxtEdiFAQ, [Inf_RICH_TEXT ][Inf_FAQ ] = ActRchTxtEdiFAQ,
[Inf_INFO_SRC_RICH_TEXT ][Inf_LINKS ] = ActRchTxtEdiCrsLnk, [Inf_RICH_TEXT ][Inf_LINKS ] = ActRchTxtEdiCrsLnk,
[Inf_INFO_SRC_RICH_TEXT ][Inf_ASSESSMENT ] = ActRchTxtEdiAss, [Inf_RICH_TEXT ][Inf_ASSESSMENT ] = ActRchTxtEdiAss,
[Inf_INFO_SRC_PAGE ][Inf_INTRODUCTION ] = ActRcvPagCrsInf, [Inf_PAGE ][Inf_INTRODUCTION ] = ActRcvPagCrsInf,
[Inf_INFO_SRC_PAGE ][Inf_TEACHING_GUIDE] = ActRcvPagTchGui, [Inf_PAGE ][Inf_TEACHING_GUIDE] = ActRcvPagTchGui,
[Inf_INFO_SRC_PAGE ][Inf_LECTURES ] = ActRcvPagSylLec, [Inf_PAGE ][Inf_LECTURES ] = ActRcvPagSylLec,
[Inf_INFO_SRC_PAGE ][Inf_PRACTICALS ] = ActRcvPagSylPra, [Inf_PAGE ][Inf_PRACTICALS ] = ActRcvPagSylPra,
[Inf_INFO_SRC_PAGE ][Inf_BIBLIOGRAPHY ] = ActRcvPagBib, [Inf_PAGE ][Inf_BIBLIOGRAPHY ] = ActRcvPagBib,
[Inf_INFO_SRC_PAGE ][Inf_FAQ ] = ActRcvPagFAQ, [Inf_PAGE ][Inf_FAQ ] = ActRcvPagFAQ,
[Inf_INFO_SRC_PAGE ][Inf_LINKS ] = ActRcvPagCrsLnk, [Inf_PAGE ][Inf_LINKS ] = ActRcvPagCrsLnk,
[Inf_INFO_SRC_PAGE ][Inf_ASSESSMENT ] = ActRcvPagAss, [Inf_PAGE ][Inf_ASSESSMENT ] = ActRcvPagAss,
[Inf_INFO_SRC_URL ][Inf_INTRODUCTION ] = ActRcvURLCrsInf, [Inf_URL ][Inf_INTRODUCTION ] = ActRcvURLCrsInf,
[Inf_INFO_SRC_URL ][Inf_TEACHING_GUIDE] = ActRcvURLTchGui, [Inf_URL ][Inf_TEACHING_GUIDE] = ActRcvURLTchGui,
[Inf_INFO_SRC_URL ][Inf_LECTURES ] = ActRcvURLSylLec, [Inf_URL ][Inf_LECTURES ] = ActRcvURLSylLec,
[Inf_INFO_SRC_URL ][Inf_PRACTICALS ] = ActRcvURLSylPra, [Inf_URL ][Inf_PRACTICALS ] = ActRcvURLSylPra,
[Inf_INFO_SRC_URL ][Inf_BIBLIOGRAPHY ] = ActRcvURLBib, [Inf_URL ][Inf_BIBLIOGRAPHY ] = ActRcvURLBib,
[Inf_INFO_SRC_URL ][Inf_FAQ ] = ActRcvURLFAQ, [Inf_URL ][Inf_FAQ ] = ActRcvURLFAQ,
[Inf_INFO_SRC_URL ][Inf_LINKS ] = ActRcvURLCrsLnk, [Inf_URL ][Inf_LINKS ] = ActRcvURLCrsLnk,
[Inf_INFO_SRC_URL ][Inf_ASSESSMENT ] = ActRcvURLAss, [Inf_URL ][Inf_ASSESSMENT ] = ActRcvURLAss,
}; };
static const Act_Action_t Inf_ActionsRcvPlaTxtInfo[Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsRcvPlaTxtInfo[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActRcvPlaTxtCrsInf, [Inf_INTRODUCTION ] = ActRcvPlaTxtCrsInf,
[Inf_TEACHING_GUIDE] = ActRcvPlaTxtTchGui, [Inf_TEACHING_GUIDE] = ActRcvPlaTxtTchGui,
@ -223,7 +223,7 @@ static const Act_Action_t Inf_ActionsRcvPlaTxtInfo[Inf_NUM_INFO_TYPES] =
[Inf_ASSESSMENT ] = ActRcvPlaTxtAss, [Inf_ASSESSMENT ] = ActRcvPlaTxtAss,
}; };
static const Act_Action_t Inf_ActionsRcvRchTxtInfo[Inf_NUM_INFO_TYPES] = static const Act_Action_t Inf_ActionsRcvRchTxtInfo[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = ActRcvRchTxtCrsInf, [Inf_INTRODUCTION ] = ActRcvRchTxtCrsInf,
[Inf_TEACHING_GUIDE] = ActRcvRchTxtTchGui, [Inf_TEACHING_GUIDE] = ActRcvRchTxtTchGui,
@ -235,7 +235,7 @@ static const Act_Action_t Inf_ActionsRcvRchTxtInfo[Inf_NUM_INFO_TYPES] =
[Inf_ASSESSMENT ] = ActRcvRchTxtAss, [Inf_ASSESSMENT ] = ActRcvRchTxtAss,
}; };
static const char *Inf_NamesInDBForInfoType[Inf_NUM_INFO_TYPES] = static const char *Inf_NamesInDBForInfoType[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = "intro", // TODO: Change this to "introduction"! [Inf_INTRODUCTION ] = "intro", // TODO: Change this to "introduction"!
[Inf_TEACHING_GUIDE] = "description", // TODO: Change this to "guide"! [Inf_TEACHING_GUIDE] = "description", // TODO: Change this to "guide"!
@ -278,26 +278,26 @@ static bool Inf_GetIfIHaveReadFromForm (void);
static void Inf_SetForceReadIntoDB (bool MustBeRead); static void Inf_SetForceReadIntoDB (bool MustBeRead);
static void Inf_SetIHaveReadIntoDB (bool IHaveRead); static void Inf_SetIHaveReadIntoDB (bool IHaveRead);
static bool Inf_CheckPage (long CrsCod,Inf_InfoType_t InfoType); static bool Inf_CheckPage (long CrsCod,Inf_Type_t InfoType);
static bool Inf_CheckAndShowPage (void); static bool Inf_CheckAndShowPage (void);
static bool Inf_CheckURL (long CrsCod,Inf_InfoType_t InfoType); static bool Inf_CheckURL (long CrsCod,Inf_Type_t InfoType);
static bool Inf_CheckAndShowURL (void); static bool Inf_CheckAndShowURL (void);
static void Inf_BuildPathURL (long CrsCod,Inf_InfoType_t InfoType, static void Inf_BuildPathURL (long CrsCod,Inf_Type_t InfoType,
char PathFile[PATH_MAX + 1]); char PathFile[PATH_MAX + 1]);
static void Inf_ShowPage (const char *URL); static void Inf_ShowPage (const char *URL);
static bool Inf_CheckIfInfoAvailable (struct Syl_Syllabus *Syllabus, static bool Inf_CheckIfInfoAvailable (struct Syl_Syllabus *Syllabus,
Inf_InfoSrc_t InfoSrc); Inf_Src_t InfoSrc);
static void Inf_AsignInfoType (struct Inf_Info *Info, static void Inf_AsignInfoType (struct Inf_Info *Info,
struct Syl_Syllabus *Syllabus); struct Syl_Syllabus *Syllabus);
static void Inf_SetInfoTxtIntoDB (const char *InfoTxtHTML,const char *InfoTxtMD); static void Inf_SetInfoTxtIntoDB (const char *InfoTxtHTML,const char *InfoTxtMD);
static bool Inf_CheckPlainTxt (long CrsCod,Inf_InfoType_t InfoType); static bool Inf_CheckPlainTxt (long CrsCod,Inf_Type_t InfoType);
static bool Inf_CheckAndShowPlainTxt (void); static bool Inf_CheckAndShowPlainTxt (void);
static bool Inf_CheckRichTxt (long CrsCod,Inf_InfoType_t InfoType); static bool Inf_CheckRichTxt (long CrsCod,Inf_Type_t InfoType);
static bool Inf_CheckAndShowRichTxt (void); static bool Inf_CheckAndShowRichTxt (void);
/*****************************************************************************/ /*****************************************************************************/
@ -306,16 +306,15 @@ static bool Inf_CheckAndShowRichTxt (void);
void Inf_ShowInfo (void) void Inf_ShowInfo (void)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Txt_No_information; extern const char *Txt_No_information;
struct Syl_Syllabus Syllabus; struct Syl_Syllabus Syllabus;
Inf_InfoSrc_t InfoSrc; struct Inf_FromDB FromDB;
bool MustBeRead;
bool Disabled; bool Disabled;
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH || bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
bool ShowWarningNoInfo = false; bool ShowWarningNoInfo = false;
const char *Help[Inf_NUM_INFO_TYPES] = const char *Help[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
@ -337,7 +336,7 @@ void Inf_ShowInfo (void)
Inf_GetAndCheckInfoSrcFromDB (&Syllabus, Inf_GetAndCheckInfoSrcFromDB (&Syllabus,
Gbl.Hierarchy.Crs.CrsCod, Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type, Gbl.Crs.Info.Type,
&InfoSrc,&MustBeRead); &FromDB);
switch (Gbl.Crs.Info.Type) switch (Gbl.Crs.Info.Type)
{ {
@ -352,7 +351,7 @@ void Inf_ShowInfo (void)
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_STD: case Rol_STD:
if (MustBeRead) if (FromDB.MustBeRead)
{ {
/***** Contextual menu *****/ /***** Contextual menu *****/
Mnu_ContextMenuBegin (); Mnu_ContextMenuBegin ();
@ -365,12 +364,12 @@ void Inf_ShowInfo (void)
case Rol_TCH: case Rol_TCH:
case Rol_SYS_ADM: case Rol_SYS_ADM:
/* Put */ /* Put */
if (InfoSrc != Inf_INFO_SRC_NONE) if (FromDB.Src != Inf_NONE)
{ {
/***** Contextual menu *****/ /***** Contextual menu *****/
Mnu_ContextMenuBegin (); Mnu_ContextMenuBegin ();
Disabled = (Gbl.Usrs.Me.Role.Logged == Rol_NET); // Non-editing teachers can not change the status of checkbox Disabled = (Gbl.Usrs.Me.Role.Logged == Rol_NET); // Non-editing teachers can not change the status of checkbox
Inf_PutCheckboxForceStdsToReadInfo (MustBeRead,Disabled); // Checkbox to force students... Inf_PutCheckboxForceStdsToReadInfo (FromDB.MustBeRead,Disabled); // Checkbox to force students...
// ...to read this couse info // ...to read this couse info
Mnu_ContextMenuEnd (); Mnu_ContextMenuEnd ();
} }
@ -379,12 +378,12 @@ void Inf_ShowInfo (void)
break; break;
} }
switch (InfoSrc) switch (FromDB.Src)
{ {
case Inf_INFO_SRC_NONE: case Inf_NONE:
ShowWarningNoInfo = true; ShowWarningNoInfo = true;
break; break;
case Inf_INFO_SRC_EDITOR: case Inf_EDITOR:
switch (Gbl.Crs.Info.Type) switch (Gbl.Crs.Info.Type)
{ {
case Inf_LECTURES: case Inf_LECTURES:
@ -401,17 +400,17 @@ void Inf_ShowInfo (void)
break; break;
} }
break; break;
case Inf_INFO_SRC_PLAIN_TEXT: case Inf_PLAIN_TEXT:
ShowWarningNoInfo = !Inf_CheckAndShowPlainTxt (); ShowWarningNoInfo = !Inf_CheckAndShowPlainTxt ();
break; break;
case Inf_INFO_SRC_RICH_TEXT: case Inf_RICH_TEXT:
ShowWarningNoInfo = !Inf_CheckAndShowRichTxt (); ShowWarningNoInfo = !Inf_CheckAndShowRichTxt ();
break; break;
case Inf_INFO_SRC_PAGE: case Inf_PAGE:
/***** Open file with web page *****/ /***** Open file with web page *****/
ShowWarningNoInfo = !Inf_CheckAndShowPage (); ShowWarningNoInfo = !Inf_CheckAndShowPage ();
break; break;
case Inf_INFO_SRC_URL: case Inf_URL:
/***** Check if file with URL exists *****/ /***** Check if file with URL exists *****/
ShowWarningNoInfo = !Inf_CheckAndShowURL (); ShowWarningNoInfo = !Inf_CheckAndShowURL ();
break; break;
@ -454,14 +453,14 @@ static void Inf_PutButtonToEditInfo (void)
static void Inf_PutIconToViewInfo (void *Type) static void Inf_PutIconToViewInfo (void *Type)
{ {
if (Type) if (Type)
Ico_PutContextualIconToView (Inf_ActionsSeeInfo[*((Inf_InfoType_t *) Type)], Ico_PutContextualIconToView (Inf_ActionsSeeInfo[*((Inf_Type_t *) Type)],
NULL,NULL); NULL,NULL);
} }
void Inf_PutIconToEditInfo (void *Type) void Inf_PutIconToEditInfo (void *Type)
{ {
if (Type) if (Type)
Ico_PutContextualIconToEdit (Inf_ActionsEditInfo[*((Inf_InfoType_t *) Type)],NULL, Ico_PutContextualIconToEdit (Inf_ActionsEditInfo[*((Inf_Type_t *) Type)],NULL,
NULL,NULL); NULL,NULL);
} }
@ -526,11 +525,11 @@ bool Inf_GetIfIMustReadAnyCrsInfoInThisCrs (void)
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumInfos; unsigned NumInfos;
unsigned NumInfo; unsigned NumInfo;
Inf_InfoType_t InfoType; Inf_Type_t InfoType;
/***** Reset must-be-read to false for all info types *****/ /***** Reset must-be-read to false for all info types *****/
for (InfoType = (Inf_InfoType_t) 0; for (InfoType = (Inf_Type_t) 0;
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1); InfoType <= (Inf_Type_t) (Inf_NUM_TYPES - 1);
InfoType++) InfoType++)
Gbl.Crs.Info.MustBeRead[InfoType] = false; Gbl.Crs.Info.MustBeRead[InfoType] = false;
@ -578,7 +577,7 @@ void Inf_WriteMsgYouMustReadInfo (void)
extern const char *The_ClassFormLinkInBox[The_NUM_THEMES]; extern const char *The_ClassFormLinkInBox[The_NUM_THEMES];
extern const char *Txt_Required_reading; extern const char *Txt_Required_reading;
extern const char *Txt_You_should_read_the_following_information; extern const char *Txt_You_should_read_the_following_information;
Inf_InfoType_t InfoType; Inf_Type_t InfoType;
/***** Begin box *****/ /***** Begin box *****/
Box_BoxBegin (NULL,Txt_Required_reading, Box_BoxBegin (NULL,Txt_Required_reading,
@ -591,8 +590,8 @@ void Inf_WriteMsgYouMustReadInfo (void)
/***** Write every information I must read *****/ /***** Write every information I must read *****/
HTM_DIV_Begin ("class=\"CM\""); HTM_DIV_Begin ("class=\"CM\"");
HTM_UL_Begin ("class=\"LIST_I_MUST_READ\""); HTM_UL_Begin ("class=\"LIST_I_MUST_READ\"");
for (InfoType = (Inf_InfoType_t) 0; for (InfoType = (Inf_Type_t) 0;
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1); InfoType <= (Inf_Type_t) (Inf_NUM_TYPES - 1);
InfoType++) InfoType++)
if (Gbl.Crs.Info.MustBeRead[InfoType]) if (Gbl.Crs.Info.MustBeRead[InfoType])
{ {
@ -753,7 +752,7 @@ void Inf_RemoveUsrFromCrsInfoRead (long UsrCod,long CrsCod)
/*****************************************************************************/ /*****************************************************************************/
// Return true if info available // Return true if info available
static bool Inf_CheckPage (long CrsCod,Inf_InfoType_t InfoType) static bool Inf_CheckPage (long CrsCod,Inf_Type_t InfoType)
{ {
char PathRelDirHTML[PATH_MAX + 1]; char PathRelDirHTML[PATH_MAX + 1];
char PathRelFileHTML[PATH_MAX + 1 + 10 + 1]; char PathRelFileHTML[PATH_MAX + 1 + 10 + 1];
@ -831,7 +830,7 @@ static bool Inf_CheckAndShowPage (void)
/* Build path inside a course for a given a info type to store web page file */ /* Build path inside a course for a given a info type to store web page file */
/*****************************************************************************/ /*****************************************************************************/
void Inf_BuildPathPage (long CrsCod,Inf_InfoType_t InfoType,char PathDir[PATH_MAX + 1]) void Inf_BuildPathPage (long CrsCod,Inf_Type_t InfoType,char PathDir[PATH_MAX + 1])
{ {
snprintf (PathDir,PATH_MAX + 1,"%s/%ld/%s", snprintf (PathDir,PATH_MAX + 1,"%s/%ld/%s",
Cfg_PATH_CRS_PUBLIC,CrsCod,Inf_FileNamesForInfoType[InfoType]); Cfg_PATH_CRS_PUBLIC,CrsCod,Inf_FileNamesForInfoType[InfoType]);
@ -842,7 +841,7 @@ void Inf_BuildPathPage (long CrsCod,Inf_InfoType_t InfoType,char PathDir[PATH_MA
/*****************************************************************************/ /*****************************************************************************/
// Return true if info available // Return true if info available
static bool Inf_CheckURL (long CrsCod,Inf_InfoType_t InfoType) static bool Inf_CheckURL (long CrsCod,Inf_Type_t InfoType)
{ {
char PathFile[PATH_MAX + 1]; char PathFile[PATH_MAX + 1];
FILE *FileURL; FILE *FileURL;
@ -900,7 +899,7 @@ static bool Inf_CheckAndShowURL (void)
/*** Build path inside a course for a given a info type to store URL file ****/ /*** Build path inside a course for a given a info type to store URL file ****/
/*****************************************************************************/ /*****************************************************************************/
static void Inf_BuildPathURL (long CrsCod,Inf_InfoType_t InfoType, static void Inf_BuildPathURL (long CrsCod,Inf_Type_t InfoType,
char PathFile[PATH_MAX + 1]) char PathFile[PATH_MAX + 1])
{ {
snprintf (PathFile,PATH_MAX + 1,"%s/%ld/%s.url", snprintf (PathFile,PATH_MAX + 1,"%s/%ld/%s.url",
@ -941,10 +940,10 @@ static void Inf_ShowPage (const char *URL)
{ {
extern const char *The_ClassFormOutBoxBold[The_NUM_THEMES]; extern const char *The_ClassFormOutBoxBold[The_NUM_THEMES];
extern const char *Txt_View_in_a_new_window; extern const char *Txt_View_in_a_new_window;
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH || bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
const char *Help[Inf_NUM_INFO_TYPES] = const char *Help[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
@ -984,7 +983,7 @@ static void Inf_ShowPage (const char *URL)
void Inf_SetInfoSrc (void) void Inf_SetInfoSrc (void)
{ {
struct Syl_Syllabus Syllabus; struct Syl_Syllabus Syllabus;
Inf_InfoSrc_t InfoSrcSelected = Inf_GetInfoSrcFromForm (); Inf_Src_t InfoSrcSelected = Inf_GetInfoSrcFromForm ();
/***** Reset syllabus context *****/ /***** Reset syllabus context *****/
Syl_ResetSyllabus (&Syllabus); Syl_ResetSyllabus (&Syllabus);
@ -1007,14 +1006,13 @@ void Inf_FormsToSelSendInfo (void)
{ {
extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *Txt_Source_of_information; extern const char *Txt_Source_of_information;
extern const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES]; extern const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_SOURCES];
extern const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES]; extern const char *Txt_INFO_SRC_HELP[Inf_NUM_SOURCES];
struct Syl_Syllabus Syllabus; struct Syl_Syllabus Syllabus;
Inf_InfoSrc_t InfoSrc; struct Inf_FromDB FromDB;
Inf_InfoSrc_t InfoSrcSelected; Inf_Src_t InfoSrc;
bool InfoAvailable[Inf_NUM_INFO_SOURCES]; bool InfoAvailable[Inf_NUM_SOURCES];
bool MustBeRead; const char *HelpEdit[Inf_NUM_TYPES] =
const char *HelpEdit[Inf_NUM_INFO_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit,
@ -1036,21 +1034,21 @@ void Inf_FormsToSelSendInfo (void)
Inf_GetAndCheckInfoSrcFromDB (&Syllabus, Inf_GetAndCheckInfoSrcFromDB (&Syllabus,
Gbl.Hierarchy.Crs.CrsCod, Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type, Gbl.Crs.Info.Type,
&InfoSrcSelected,&MustBeRead); &FromDB);
/***** Check if info available *****/ /***** Check if info available *****/
for (InfoSrc = (Inf_InfoSrc_t) 0; for (InfoSrc = (Inf_Src_t) 0;
InfoSrc <= (Inf_InfoSrc_t) (Inf_NUM_INFO_SOURCES - 1); InfoSrc <= (Inf_Src_t) (Inf_NUM_SOURCES - 1);
InfoSrc++) InfoSrc++)
InfoAvailable[InfoSrc] = Inf_CheckIfInfoAvailable (&Syllabus,InfoSrc); InfoAvailable[InfoSrc] = Inf_CheckIfInfoAvailable (&Syllabus,InfoSrc);
/***** Set info source to none /***** Set info source to none
when no info available for the current source *****/ when no info available for the current source *****/
if (InfoSrcSelected != Inf_INFO_SRC_NONE && if (FromDB.Src != Inf_NONE &&
!InfoAvailable[InfoSrcSelected]) !InfoAvailable[FromDB.Src])
{ {
InfoSrcSelected = Inf_INFO_SRC_NONE; FromDB.Src = Inf_NONE;
Inf_SetInfoSrcIntoDB (Inf_INFO_SRC_NONE); Inf_SetInfoSrcIntoDB (Inf_NONE);
} }
/***** Form to choice between alternatives *****/ /***** Form to choice between alternatives *****/
@ -1060,33 +1058,33 @@ void Inf_FormsToSelSendInfo (void)
HelpEdit[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE,4); HelpEdit[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE,4);
/* Options */ /* Options */
for (InfoSrc = (Inf_InfoSrc_t) 0; for (InfoSrc = (Inf_Src_t) 0;
InfoSrc <= (Inf_InfoSrc_t) (Inf_NUM_INFO_SOURCES - 1); InfoSrc <= (Inf_Src_t) (Inf_NUM_SOURCES - 1);
InfoSrc++) InfoSrc++)
{ {
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Select info source */ /* Select info source */
if (InfoSrc == InfoSrcSelected) if (InfoSrc == FromDB.Src)
HTM_TD_Begin ("class=\"DAT LT LIGHT_BLUE\""); HTM_TD_Begin ("class=\"DAT LT LIGHT_BLUE\"");
else else
HTM_TD_Begin ("class=\"DAT LT\""); HTM_TD_Begin ("class=\"DAT LT\"");
Frm_BeginForm (Inf_ActionsSelecInfoSrc[Gbl.Crs.Info.Type]); Frm_BeginForm (Inf_ActionsSelecInfoSrc[Gbl.Crs.Info.Type]);
HTM_INPUT_RADIO ("InfoSrc",InfoSrc != InfoSrcSelected && HTM_INPUT_RADIO ("InfoSrc",InfoSrc != FromDB.Src &&
(InfoSrc == Inf_INFO_SRC_NONE || (InfoSrc == Inf_NONE ||
InfoAvailable[InfoSrc]), // Info available for this source InfoAvailable[InfoSrc]), // Info available for this source
"id=\"InfoSrc%u\" value=\"%u\"%s", "id=\"InfoSrc%u\" value=\"%u\"%s",
(unsigned) InfoSrc,(unsigned) InfoSrc, (unsigned) InfoSrc,(unsigned) InfoSrc,
InfoSrc == InfoSrcSelected ? " checked=\"checked\"" : InfoSrc == FromDB.Src ? " checked=\"checked\"" :
(InfoSrc == Inf_INFO_SRC_NONE || (InfoSrc == Inf_NONE ||
InfoAvailable[InfoSrc]) ? "" : // Info available for this source InfoAvailable[InfoSrc]) ? "" : // Info available for this source
" disabled=\"disabled\""); " disabled=\"disabled\"");
Frm_EndForm (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
/* Form for this info source */ /* Form for this info source */
if (InfoSrc == InfoSrcSelected) if (InfoSrc == FromDB.Src)
HTM_TD_Begin ("class=\"LT LIGHT_BLUE\""); HTM_TD_Begin ("class=\"LT LIGHT_BLUE\"");
else else
HTM_TD_Begin ("class=\"LT\""); HTM_TD_Begin ("class=\"LT\"");
@ -1117,13 +1115,13 @@ void Inf_FormsToSelSendInfo (void)
/*****************************************************************************/ /*****************************************************************************/
static bool Inf_CheckIfInfoAvailable (struct Syl_Syllabus *Syllabus, static bool Inf_CheckIfInfoAvailable (struct Syl_Syllabus *Syllabus,
Inf_InfoSrc_t InfoSrc) Inf_Src_t InfoSrc)
{ {
switch (InfoSrc) switch (InfoSrc)
{ {
case Inf_INFO_SRC_NONE: case Inf_NONE:
return false; return false;
case Inf_INFO_SRC_EDITOR: case Inf_EDITOR:
switch (Gbl.Crs.Info.Type) switch (Gbl.Crs.Info.Type)
{ {
case Inf_LECTURES: case Inf_LECTURES:
@ -1136,16 +1134,16 @@ static bool Inf_CheckIfInfoAvailable (struct Syl_Syllabus *Syllabus,
return false; return false;
} }
return false; // Not reached return false; // Not reached
case Inf_INFO_SRC_PLAIN_TEXT: case Inf_PLAIN_TEXT:
return Inf_CheckPlainTxt (Gbl.Hierarchy.Crs.CrsCod, return Inf_CheckPlainTxt (Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type); Gbl.Crs.Info.Type);
case Inf_INFO_SRC_RICH_TEXT: case Inf_RICH_TEXT:
return Inf_CheckRichTxt (Gbl.Hierarchy.Crs.CrsCod, return Inf_CheckRichTxt (Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type); Gbl.Crs.Info.Type);
case Inf_INFO_SRC_PAGE: case Inf_PAGE:
return Inf_CheckPage (Gbl.Hierarchy.Crs.CrsCod, return Inf_CheckPage (Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type); Gbl.Crs.Info.Type);
case Inf_INFO_SRC_URL: case Inf_URL:
return Inf_CheckURL (Gbl.Hierarchy.Crs.CrsCod, return Inf_CheckURL (Gbl.Hierarchy.Crs.CrsCod,
Gbl.Crs.Info.Type); Gbl.Crs.Info.Type);
} }
@ -1157,7 +1155,7 @@ static bool Inf_CheckIfInfoAvailable (struct Syl_Syllabus *Syllabus,
/****************** Form to enter in integrated editor ***********************/ /****************** Form to enter in integrated editor ***********************/
/*****************************************************************************/ /*****************************************************************************/
void Inf_FormToEnterIntegratedEditor (Inf_InfoSrc_t InfoSrc) void Inf_FormToEnterIntegratedEditor (Inf_Src_t InfoSrc)
{ {
extern const char *Txt_Edit; extern const char *Txt_Edit;
@ -1170,7 +1168,7 @@ void Inf_FormToEnterIntegratedEditor (Inf_InfoSrc_t InfoSrc)
/****************** Form to enter in plain text editor ***********************/ /****************** Form to enter in plain text editor ***********************/
/*****************************************************************************/ /*****************************************************************************/
void Inf_FormToEnterPlainTextEditor (Inf_InfoSrc_t InfoSrc) void Inf_FormToEnterPlainTextEditor (Inf_Src_t InfoSrc)
{ {
extern const char *Txt_Edit_plain_text; extern const char *Txt_Edit_plain_text;
@ -1183,7 +1181,7 @@ void Inf_FormToEnterPlainTextEditor (Inf_InfoSrc_t InfoSrc)
/******************* Form to enter in rich text editor ***********************/ /******************* Form to enter in rich text editor ***********************/
/*****************************************************************************/ /*****************************************************************************/
void Inf_FormToEnterRichTextEditor (Inf_InfoSrc_t InfoSrc) void Inf_FormToEnterRichTextEditor (Inf_Src_t InfoSrc)
{ {
extern const char *Txt_Edit_rich_text; extern const char *Txt_Edit_rich_text;
@ -1196,7 +1194,7 @@ void Inf_FormToEnterRichTextEditor (Inf_InfoSrc_t InfoSrc)
/******************* Form to upload a file with a page ***********************/ /******************* Form to upload a file with a page ***********************/
/*****************************************************************************/ /*****************************************************************************/
void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc) void Inf_FormToSendPage (Inf_Src_t InfoSrc)
{ {
extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *Txt_File; extern const char *Txt_File;
@ -1226,7 +1224,7 @@ void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc)
/********************* Form to send a link to a web page *********************/ /********************* Form to send a link to a web page *********************/
/*****************************************************************************/ /*****************************************************************************/
void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc) void Inf_FormToSendURL (Inf_Src_t InfoSrc)
{ {
extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *Txt_URL; extern const char *Txt_URL;
@ -1401,22 +1399,22 @@ static void Inf_AsignInfoType (struct Inf_Info *Info,
/********** Get info source for bibliography, FAQ, etc. from form ************/ /********** Get info source for bibliography, FAQ, etc. from form ************/
/*****************************************************************************/ /*****************************************************************************/
Inf_InfoSrc_t Inf_GetInfoSrcFromForm (void) Inf_Src_t Inf_GetInfoSrcFromForm (void)
{ {
/***** Get info source for a specific type of course information /***** Get info source for a specific type of course information
(introduction, teaching guide, bibliography, FAQ, links or evaluation) *****/ (introduction, teaching guide, bibliography, FAQ, links or evaluation) *****/
return (Inf_InfoSrc_t) return (Inf_Src_t)
Par_GetParToUnsignedLong ("InfoSrc", Par_GetParToUnsignedLong ("InfoSrc",
0, 0,
Inf_NUM_INFO_SOURCES - 1, Inf_NUM_SOURCES - 1,
(unsigned long) Inf_INFO_SRC_NONE); (unsigned long) Inf_NONE);
} }
/*****************************************************************************/ /*****************************************************************************/
/********* Set info source for a type of course info from database ***********/ /********* Set info source for a type of course info from database ***********/
/*****************************************************************************/ /*****************************************************************************/
void Inf_SetInfoSrcIntoDB (Inf_InfoSrc_t InfoSrc) void Inf_SetInfoSrcIntoDB (Inf_Src_t InfoSrc)
{ {
/***** Get if info source is already stored in database *****/ /***** Get if info source is already stored in database *****/
if (DB_QueryCOUNT ("can not get if info source is already stored in database", if (DB_QueryCOUNT ("can not get if info source is already stored in database",
@ -1428,14 +1426,14 @@ void Inf_SetInfoSrcIntoDB (Inf_InfoSrc_t InfoSrc)
Inf_NamesInDBForInfoType[Gbl.Crs.Info.Type])) Inf_NamesInDBForInfoType[Gbl.Crs.Info.Type]))
// Info is already stored in database, so update it // Info is already stored in database, so update it
{ // Update info source { // Update info source
if (InfoSrc == Inf_INFO_SRC_NONE) if (InfoSrc == Inf_NONE)
DB_QueryUPDATE ("can not update info source", DB_QueryUPDATE ("can not update info source",
"UPDATE crs_info_src" "UPDATE crs_info_src"
" SET InfoSrc='%s'," " SET InfoSrc='%s',"
"MustBeRead='N'" "MustBeRead='N'"
" WHERE CrsCod=%ld" " WHERE CrsCod=%ld"
" AND InfoType='%s'", " AND InfoType='%s'",
Inf_NamesInDBForInfoSrc[Inf_INFO_SRC_NONE], Inf_NamesInDBForInfoSrc[Inf_NONE],
Gbl.Hierarchy.Crs.CrsCod, Gbl.Hierarchy.Crs.CrsCod,
Inf_NamesInDBForInfoType[Gbl.Crs.Info.Type]); Inf_NamesInDBForInfoType[Gbl.Crs.Info.Type]);
else // MustBeRead remains unchanged else // MustBeRead remains unchanged
@ -1464,11 +1462,11 @@ void Inf_SetInfoSrcIntoDB (Inf_InfoSrc_t InfoSrc)
/***** Get and check info source for a type of course info from database *****/ /***** Get and check info source for a type of course info from database *****/
/*****************************************************************************/ /*****************************************************************************/
Inf_InfoSrc_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType) Inf_Src_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_Type_t InfoType)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
Inf_InfoSrc_t InfoSrc; Inf_Src_t InfoSrc;
/***** Get info source for a specific type of info from database *****/ /***** Get info source for a specific type of info from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get info source", if (DB_QuerySELECT (&mysql_res,"can not get info source",
@ -1486,7 +1484,7 @@ Inf_InfoSrc_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType)
InfoSrc = Inf_ConvertFromStrDBToInfoSrc (row[0]); InfoSrc = Inf_ConvertFromStrDBToInfoSrc (row[0]);
} }
else else
InfoSrc = Inf_INFO_SRC_NONE; InfoSrc = Inf_NONE;
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -1500,65 +1498,54 @@ Inf_InfoSrc_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType)
void Inf_GetAndCheckInfoSrcFromDB (struct Syl_Syllabus *Syllabus, void Inf_GetAndCheckInfoSrcFromDB (struct Syl_Syllabus *Syllabus,
long CrsCod, long CrsCod,
Inf_InfoType_t InfoType, Inf_Type_t Type,
Inf_InfoSrc_t *InfoSrc,bool *MustBeRead) struct Inf_FromDB *FromDB)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
/***** Set default values *****/ /***** Set default values *****/
*InfoSrc = Inf_INFO_SRC_NONE; FromDB->Src = Inf_NONE;
*MustBeRead = false; FromDB->MustBeRead = false;
/***** Get info source for a specific type of info from database *****/ /***** Get info source for a specific type of info from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get info source", if (DB_QuerySELECT (&mysql_res,"can not get info source",
"SELECT InfoSrc," // row[0] "SELECT InfoSrc," // row[0]
"MustBeRead" // row[1] "MustBeRead" // row[1]
" FROM crs_info_src" " FROM crs_info_src"
" WHERE CrsCod=%ld" " WHERE CrsCod=%ld"
" AND InfoType='%s'", " AND InfoType='%s'",
CrsCod, CrsCod,
Inf_NamesInDBForInfoType[InfoType]) == 1) Inf_NamesInDBForInfoType[Type]) == 1)
{ {
/* Get row */ /* Get row */
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/* Get info source (row[0]) */ /* Get info source (row[0]) and if students must read info (row[1]) */
*InfoSrc = Inf_ConvertFromStrDBToInfoSrc (row[0]); FromDB->Src = Inf_ConvertFromStrDBToInfoSrc (row[0]);
FromDB->MustBeRead = (row[1][0] == 'Y');
/* Get if students must read info (row[1]) */
*MustBeRead = (row[1][0] == 'Y');
} }
else
Lay_ShowErrorAndExit ("Error when getting info source.");
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
/***** If info is empty, return Inf_INFO_SRC_NONE *****/ /***** If info is empty, return Inf_INFO_SRC_NONE *****/
switch (*InfoSrc) switch (FromDB->Src)
{ {
case Inf_INFO_SRC_NONE: case Inf_NONE:
*MustBeRead = false;
break; break;
case Inf_INFO_SRC_EDITOR: case Inf_EDITOR:
switch (InfoType) switch (Type)
{ {
case Inf_LECTURES: case Inf_LECTURES:
Syllabus->WhichSyllabus = Syl_LECTURES; Syllabus->WhichSyllabus = Syl_LECTURES;
if (!Syl_CheckSyllabus (Syllabus,CrsCod)) if (!Syl_CheckSyllabus (Syllabus,CrsCod))
{ FromDB->Src = Inf_NONE;
*InfoSrc = Inf_INFO_SRC_NONE;
*MustBeRead = false;
}
break; break;
case Inf_PRACTICALS: case Inf_PRACTICALS:
Syllabus->WhichSyllabus = Syl_PRACTICALS; Syllabus->WhichSyllabus = Syl_PRACTICALS;
if (!Syl_CheckSyllabus (Syllabus,CrsCod)) if (!Syl_CheckSyllabus (Syllabus,CrsCod))
{ FromDB->Src = Inf_NONE;
*InfoSrc = Inf_INFO_SRC_NONE;
*MustBeRead = false;
}
break; break;
case Inf_INTRODUCTION: case Inf_INTRODUCTION:
case Inf_TEACHING_GUIDE: case Inf_TEACHING_GUIDE:
@ -1566,74 +1553,64 @@ void Inf_GetAndCheckInfoSrcFromDB (struct Syl_Syllabus *Syllabus,
case Inf_FAQ: case Inf_FAQ:
case Inf_LINKS: case Inf_LINKS:
case Inf_ASSESSMENT: case Inf_ASSESSMENT:
*InfoSrc = Inf_INFO_SRC_NONE; FromDB->Src = Inf_NONE;
*MustBeRead = false;
break; // Internal editor is not yet available break; // Internal editor is not yet available
} }
break; break;
case Inf_INFO_SRC_PLAIN_TEXT: case Inf_PLAIN_TEXT:
if (!Inf_CheckPlainTxt (CrsCod,InfoType)) if (!Inf_CheckPlainTxt (CrsCod,Type))
{ FromDB->Src = Inf_NONE;
*InfoSrc = Inf_INFO_SRC_NONE;
*MustBeRead = false;
}
break; break;
case Inf_INFO_SRC_RICH_TEXT: case Inf_RICH_TEXT:
if (!Inf_CheckRichTxt (CrsCod,InfoType)) if (!Inf_CheckRichTxt (CrsCod,Type))
{ FromDB->Src = Inf_NONE;
*InfoSrc = Inf_INFO_SRC_NONE;
*MustBeRead = false;
}
break; break;
case Inf_INFO_SRC_PAGE: case Inf_PAGE:
if (!Inf_CheckPage (CrsCod,InfoType)) if (!Inf_CheckPage (CrsCod,Type))
{ FromDB->Src = Inf_NONE;
*InfoSrc = Inf_INFO_SRC_NONE;
*MustBeRead = false;
}
break; break;
case Inf_INFO_SRC_URL: case Inf_URL:
if (!Inf_CheckURL (CrsCod,InfoType)) if (!Inf_CheckURL (CrsCod,Type))
{ FromDB->Src = Inf_NONE;
*InfoSrc = Inf_INFO_SRC_NONE;
*MustBeRead = false;
}
break; break;
} }
if (FromDB->Src == Inf_NONE)
FromDB->MustBeRead = false;
} }
/*****************************************************************************/ /*****************************************************************************/
/*** Convert a string with info type in database to a Inf_InfoType_t value ***/ /*** Convert a string with info type in database to a Inf_InfoType_t value ***/
/*****************************************************************************/ /*****************************************************************************/
Inf_InfoType_t Inf_ConvertFromStrDBToInfoType (const char *StrInfoTypeDB) Inf_Type_t Inf_ConvertFromStrDBToInfoType (const char *StrInfoTypeDB)
{ {
Inf_InfoType_t InfoType; Inf_Type_t InfoType;
for (InfoType = (Inf_InfoType_t) 0; for (InfoType = (Inf_Type_t) 0;
InfoType <= (Inf_InfoType_t) (Inf_NUM_INFO_TYPES - 1); InfoType <= (Inf_Type_t) (Inf_NUM_TYPES - 1);
InfoType++) InfoType++)
if (!strcmp (StrInfoTypeDB,Inf_NamesInDBForInfoType[InfoType])) if (!strcmp (StrInfoTypeDB,Inf_NamesInDBForInfoType[InfoType]))
return InfoType; return InfoType;
return (Inf_InfoType_t) 0; return (Inf_Type_t) 0;
} }
/*****************************************************************************/ /*****************************************************************************/
/** Convert a string with info source in database to a Inf_InfoSrc_t value ***/ /** Convert a string with info source in database to a Inf_InfoSrc_t value ***/
/*****************************************************************************/ /*****************************************************************************/
Inf_InfoSrc_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB) Inf_Src_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB)
{ {
Inf_InfoSrc_t InfoSrc; Inf_Src_t InfoSrc;
for (InfoSrc = (Inf_InfoSrc_t) 0; for (InfoSrc = (Inf_Src_t) 0;
InfoSrc <= (Inf_InfoSrc_t) (Inf_NUM_INFO_SOURCES - 1); InfoSrc <= (Inf_Src_t) (Inf_NUM_SOURCES - 1);
InfoSrc++) InfoSrc++)
if (!strcmp (StrInfoSrcDB,Inf_NamesInDBForInfoSrc[InfoSrc])) if (!strcmp (StrInfoSrcDB,Inf_NamesInDBForInfoSrc[InfoSrc]))
return InfoSrc; return InfoSrc;
return Inf_INFO_SRC_NONE; return Inf_NONE;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1658,7 +1635,7 @@ static void Inf_SetInfoTxtIntoDB (const char *InfoTxtHTML,const char *InfoTxtMD)
/********** Get info text for a type of course info from database ************/ /********** Get info text for a type of course info from database ************/
/*****************************************************************************/ /*****************************************************************************/
void Inf_GetInfoTxtFromDB (long CrsCod,Inf_InfoType_t InfoType, void Inf_GetInfoTxtFromDB (long CrsCod,Inf_Type_t InfoType,
char InfoTxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1], char InfoTxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1],
char InfoTxtMD [Cns_MAX_BYTES_LONG_TEXT + 1]) char InfoTxtMD [Cns_MAX_BYTES_LONG_TEXT + 1])
{ {
@ -1704,7 +1681,7 @@ void Inf_GetInfoTxtFromDB (long CrsCod,Inf_InfoType_t InfoType,
/*****************************************************************************/ /*****************************************************************************/
// Return true if info available // Return true if info available
static bool Inf_CheckPlainTxt (long CrsCod,Inf_InfoType_t InfoType) static bool Inf_CheckPlainTxt (long CrsCod,Inf_Type_t InfoType)
{ {
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
@ -1721,11 +1698,11 @@ static bool Inf_CheckPlainTxt (long CrsCod,Inf_InfoType_t InfoType)
static bool Inf_CheckAndShowPlainTxt (void) static bool Inf_CheckAndShowPlainTxt (void)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH || bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
const char *Help[Inf_NUM_INFO_TYPES] = const char *Help[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
@ -1782,7 +1759,7 @@ static bool Inf_CheckAndShowPlainTxt (void)
/*****************************************************************************/ /*****************************************************************************/
// Return true if info available // Return true if info available
static bool Inf_CheckRichTxt (long CrsCod,Inf_InfoType_t InfoType) static bool Inf_CheckRichTxt (long CrsCod,Inf_Type_t InfoType)
{ {
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
char TxtMD[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtMD[Cns_MAX_BYTES_LONG_TEXT + 1];
@ -1801,7 +1778,7 @@ static bool Inf_CheckRichTxt (long CrsCod,Inf_InfoType_t InfoType)
static bool Inf_CheckAndShowRichTxt (void) static bool Inf_CheckAndShowRichTxt (void)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
char TxtMD[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtMD[Cns_MAX_BYTES_LONG_TEXT + 1];
char PathFileMD[PATH_MAX + 1]; char PathFileMD[PATH_MAX + 1];
@ -1813,7 +1790,7 @@ static bool Inf_CheckAndShowRichTxt (void)
int ReturnCode; int ReturnCode;
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH || bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
const char *Help[Inf_NUM_INFO_TYPES] = const char *Help[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
@ -1933,11 +1910,11 @@ static bool Inf_CheckAndShowRichTxt (void)
void Inf_EditPlainTxtInfo (void) void Inf_EditPlainTxtInfo (void)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Txt_Save_changes; extern const char *Txt_Save_changes;
struct Syl_Syllabus Syllabus; struct Syl_Syllabus Syllabus;
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
const char *HelpEdit[Inf_NUM_INFO_TYPES] = const char *HelpEdit[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit,
@ -1988,11 +1965,11 @@ void Inf_EditPlainTxtInfo (void)
void Inf_EditRichTxtInfo (void) void Inf_EditRichTxtInfo (void)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Txt_Save_changes; extern const char *Txt_Save_changes;
struct Syl_Syllabus Syllabus; struct Syl_Syllabus Syllabus;
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
const char *HelpEdit[Inf_NUM_INFO_TYPES] = const char *HelpEdit[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit, [Inf_INTRODUCTION ] = Hlp_COURSE_Information_edit,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit, [Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide_edit,
@ -2066,8 +2043,8 @@ void Inf_RecAndChangePlainTxtInfo (void)
Inf_SetInfoTxtIntoDB (Txt_HTMLFormat,Txt_MarkdownFormat); Inf_SetInfoTxtIntoDB (Txt_HTMLFormat,Txt_MarkdownFormat);
/***** Change info source to "plain text" in database *****/ /***** Change info source to "plain text" in database *****/
Inf_SetInfoSrcIntoDB (Txt_HTMLFormat[0] ? Inf_INFO_SRC_PLAIN_TEXT : Inf_SetInfoSrcIntoDB (Txt_HTMLFormat[0] ? Inf_PLAIN_TEXT :
Inf_INFO_SRC_NONE); Inf_NONE);
if (Txt_HTMLFormat[0]) if (Txt_HTMLFormat[0])
/***** Show the updated info *****/ /***** Show the updated info *****/
Inf_ShowInfo (); Inf_ShowInfo ();
@ -2105,8 +2082,8 @@ void Inf_RecAndChangeRichTxtInfo (void)
Inf_SetInfoTxtIntoDB (Txt_HTMLFormat,Txt_MarkdownFormat); Inf_SetInfoTxtIntoDB (Txt_HTMLFormat,Txt_MarkdownFormat);
/***** Change info source to "rich text" in database *****/ /***** Change info source to "rich text" in database *****/
Inf_SetInfoSrcIntoDB (Txt_HTMLFormat[0] ? Inf_INFO_SRC_RICH_TEXT : Inf_SetInfoSrcIntoDB (Txt_HTMLFormat[0] ? Inf_RICH_TEXT :
Inf_INFO_SRC_NONE); Inf_NONE);
if (Txt_HTMLFormat[0]) if (Txt_HTMLFormat[0])
/***** Show the updated info *****/ /***** Show the updated info *****/
Inf_ShowInfo (); Inf_ShowInfo ();
@ -2159,7 +2136,7 @@ void Inf_ReceiveURLInfo (void)
if (URLIsOK) if (URLIsOK)
{ {
/***** Change info source to URL in database *****/ /***** Change info source to URL in database *****/
Inf_SetInfoSrcIntoDB (Inf_INFO_SRC_URL); Inf_SetInfoSrcIntoDB (Inf_URL);
/***** Show the updated info *****/ /***** Show the updated info *****/
Inf_ShowInfo (); Inf_ShowInfo ();
@ -2167,7 +2144,7 @@ void Inf_ReceiveURLInfo (void)
else else
{ {
/***** Change info source to none in database *****/ /***** Change info source to none in database *****/
Inf_SetInfoSrcIntoDB (Inf_INFO_SRC_NONE); Inf_SetInfoSrcIntoDB (Inf_NONE);
/***** Show again the form to select and send course info *****/ /***** Show again the form to select and send course info *****/
Inf_FormsToSelSendInfo (); Inf_FormsToSelSendInfo ();
@ -2296,7 +2273,7 @@ void Inf_ReceivePagInfo (void)
if (FileIsOK) if (FileIsOK)
{ {
/***** Change info source to page in database *****/ /***** Change info source to page in database *****/
Inf_SetInfoSrcIntoDB (Inf_INFO_SRC_PAGE); Inf_SetInfoSrcIntoDB (Inf_PAGE);
/***** Show the updated info *****/ /***** Show the updated info *****/
Inf_ShowInfo (); Inf_ShowInfo ();
@ -2304,7 +2281,7 @@ void Inf_ReceivePagInfo (void)
else else
{ {
/***** Change info source to none in database *****/ /***** Change info source to none in database *****/
Inf_SetInfoSrcIntoDB (Inf_INFO_SRC_NONE); Inf_SetInfoSrcIntoDB (Inf_NONE);
/***** Show again the form to select and send course info *****/ /***** Show again the form to select and send course info *****/
Inf_FormsToSelSendInfo (); Inf_FormsToSelSendInfo ();

View File

@ -40,7 +40,7 @@
/******************************* Public types ********************************/ /******************************* Public types ********************************/
/*****************************************************************************/ /*****************************************************************************/
#define Inf_NUM_INFO_TYPES 8 #define Inf_NUM_TYPES 8
typedef enum typedef enum
{ {
Inf_INTRODUCTION = 0, Inf_INTRODUCTION = 0,
@ -51,27 +51,33 @@ typedef enum
Inf_FAQ = 5, Inf_FAQ = 5,
Inf_LINKS = 6, Inf_LINKS = 6,
Inf_ASSESSMENT = 7, Inf_ASSESSMENT = 7,
} Inf_InfoType_t; } Inf_Type_t;
#define Inf_NUM_INFO_SOURCES 6 #define Inf_NUM_SOURCES 6
typedef enum typedef enum
{ {
Inf_INFO_SRC_NONE = 0, Inf_NONE = 0,
Inf_INFO_SRC_EDITOR = 1, Inf_EDITOR = 1,
Inf_INFO_SRC_PLAIN_TEXT = 2, Inf_PLAIN_TEXT = 2,
Inf_INFO_SRC_RICH_TEXT = 3, Inf_RICH_TEXT = 3,
Inf_INFO_SRC_PAGE = 4, Inf_PAGE = 4,
Inf_INFO_SRC_URL = 5, Inf_URL = 5,
} Inf_InfoSrc_t; } Inf_Src_t;
struct Inf_Info struct Inf_Info
{ {
Inf_InfoType_t Type; Inf_Type_t Type;
char URL[Cns_MAX_BYTES_WWW + 1]; char URL[Cns_MAX_BYTES_WWW + 1];
bool MustBeRead[Inf_NUM_INFO_TYPES]; // Students must read info? bool MustBeRead[Inf_NUM_TYPES]; // Students must read info?
bool ShowMsgMustBeRead; bool ShowMsgMustBeRead;
}; };
struct Inf_FromDB
{
Inf_Src_t Src; // Info source
bool MustBeRead; // Must be read by students?
};
/*****************************************************************************/ /*****************************************************************************/
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -83,26 +89,26 @@ void Inf_ChangeForceReadInfo (void);
void Inf_ChangeIHaveReadInfo (void); void Inf_ChangeIHaveReadInfo (void);
bool Inf_GetIfIMustReadAnyCrsInfoInThisCrs (void); bool Inf_GetIfIMustReadAnyCrsInfoInThisCrs (void);
void Inf_RemoveUsrFromCrsInfoRead (long UsrCod,long CrsCod); void Inf_RemoveUsrFromCrsInfoRead (long UsrCod,long CrsCod);
void Inf_BuildPathPage (long CrsCod,Inf_InfoType_t InfoType,char PathDir[PATH_MAX + 1]); void Inf_BuildPathPage (long CrsCod,Inf_Type_t InfoType,char PathDir[PATH_MAX + 1]);
void Inf_WriteURLIntoTxtBuffer (char TxtBuffer[Cns_MAX_BYTES_WWW + 1]); void Inf_WriteURLIntoTxtBuffer (char TxtBuffer[Cns_MAX_BYTES_WWW + 1]);
void Inf_SetInfoSrc (void); void Inf_SetInfoSrc (void);
void Inf_FormsToSelSendInfo (void); void Inf_FormsToSelSendInfo (void);
void Inf_FormToEnterIntegratedEditor (Inf_InfoSrc_t InfoSrc); void Inf_FormToEnterIntegratedEditor (Inf_Src_t InfoSrc);
void Inf_FormToEnterPlainTextEditor (Inf_InfoSrc_t InfoSrc); void Inf_FormToEnterPlainTextEditor (Inf_Src_t InfoSrc);
void Inf_FormToEnterRichTextEditor (Inf_InfoSrc_t InfoSrc); void Inf_FormToEnterRichTextEditor (Inf_Src_t InfoSrc);
void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc); void Inf_FormToSendPage (Inf_Src_t InfoSrc);
void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc); void Inf_FormToSendURL (Inf_Src_t InfoSrc);
Inf_InfoSrc_t Inf_GetInfoSrcFromForm (void); Inf_Src_t Inf_GetInfoSrcFromForm (void);
void Inf_SetInfoSrcIntoDB (Inf_InfoSrc_t InfoSrc); void Inf_SetInfoSrcIntoDB (Inf_Src_t InfoSrc);
Inf_InfoSrc_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_InfoType_t InfoType); Inf_Src_t Inf_GetInfoSrcFromDB (long CrsCod,Inf_Type_t InfoType);
void Inf_GetAndCheckInfoSrcFromDB (struct Syl_Syllabus *Syllabus, void Inf_GetAndCheckInfoSrcFromDB (struct Syl_Syllabus *Syllabus,
long CrsCod, long CrsCod,
Inf_InfoType_t InfoType, Inf_Type_t Type,
Inf_InfoSrc_t *InfoSrc,bool *MustBeRead); struct Inf_FromDB *FromDB);
Inf_InfoType_t Inf_ConvertFromStrDBToInfoType (const char *StrInfoTypeDB); Inf_Type_t Inf_ConvertFromStrDBToInfoType (const char *StrInfoTypeDB);
Inf_InfoSrc_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB); Inf_Src_t Inf_ConvertFromStrDBToInfoSrc (const char *StrInfoSrcDB);
void Inf_GetInfoTxtFromDB (long CrsCod,Inf_InfoType_t InfoType, void Inf_GetInfoTxtFromDB (long CrsCod,Inf_Type_t InfoType,
char InfoTxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1], char InfoTxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1],
char InfoTxtMD [Cns_MAX_BYTES_LONG_TEXT + 1]); char InfoTxtMD [Cns_MAX_BYTES_LONG_TEXT + 1]);

View File

@ -220,7 +220,7 @@ bool Syl_CheckSyllabus (struct Syl_Syllabus *Syllabus,long CrsCod)
bool Syl_CheckAndEditSyllabus (struct Syl_Syllabus *Syllabus) bool Syl_CheckAndEditSyllabus (struct Syl_Syllabus *Syllabus)
{ {
extern const Act_Action_t Inf_ActionsSeeInfo[Inf_NUM_INFO_TYPES]; extern const Act_Action_t Inf_ActionsSeeInfo[Inf_NUM_TYPES];
extern const char *Txt_Done; extern const char *Txt_Done;
bool ICanEdit; bool ICanEdit;
bool PutIconToEdit; bool PutIconToEdit;
@ -528,7 +528,7 @@ int Syl_ReadLevelItemSyllabus (void)
static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus, static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus,
bool PutIconToEdit) bool PutIconToEdit)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Hlp_COURSE_Syllabus_edit; extern const char *Hlp_COURSE_Syllabus_edit;
extern const char *Hlp_COURSE_Syllabus; extern const char *Hlp_COURSE_Syllabus;
unsigned NumItem; unsigned NumItem;
@ -760,7 +760,7 @@ static void Syl_ShowRowSyllabus (struct Syl_Syllabus *Syllabus,unsigned NumItem,
void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp) void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp)
{ {
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
unsigned NumItem; unsigned NumItem;
int i; int i;
@ -963,8 +963,8 @@ void Syl_RemoveItemSyllabus (void)
/***** We are editing a syllabus with the internal editor, /***** We are editing a syllabus with the internal editor,
so change info source to internal editor in database *****/ so change info source to internal editor in database *****/
Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_INFO_SRC_EDITOR : Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_EDITOR :
Inf_INFO_SRC_NONE); Inf_NONE);
/***** Show the updated syllabus to continue editing it *****/ /***** Show the updated syllabus to continue editing it *****/
Syl_FreeListItemsSyllabus (); Syl_FreeListItemsSyllabus ();
@ -1069,8 +1069,8 @@ static void Syl_ChangePlaceItemSyllabus (Syl_ChangePosItem_t UpOrDownPos)
/***** We are editing a syllabus with the internal editor, /***** We are editing a syllabus with the internal editor,
so change info source to internal editor in database *****/ so change info source to internal editor in database *****/
Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_INFO_SRC_EDITOR : Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_EDITOR :
Inf_INFO_SRC_NONE); Inf_NONE);
/***** Show the updated syllabus to continue editing it *****/ /***** Show the updated syllabus to continue editing it *****/
Syl_FreeListItemsSyllabus (); Syl_FreeListItemsSyllabus ();
@ -1238,8 +1238,8 @@ static void Syl_ChangeLevelItemSyllabus (Syl_ChangeLevelItem_t IncreaseOrDecreas
/***** We are editing a syllabus with the internal editor, /***** We are editing a syllabus with the internal editor,
so change info source to internal editor in database *****/ so change info source to internal editor in database *****/
Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_INFO_SRC_EDITOR : Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_EDITOR :
Inf_INFO_SRC_NONE); Inf_NONE);
/***** Show the updated syllabus to continue editing it *****/ /***** Show the updated syllabus to continue editing it *****/
Syl_FreeListItemsSyllabus (); Syl_FreeListItemsSyllabus ();
@ -1309,8 +1309,8 @@ void Syl_InsertItemSyllabus (void)
/***** We are editing a syllabus with the internal editor, /***** We are editing a syllabus with the internal editor,
so change info source to internal editor in database *****/ so change info source to internal editor in database *****/
Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_INFO_SRC_EDITOR : Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_EDITOR :
Inf_INFO_SRC_NONE); Inf_NONE);
/***** Show the updated syllabus to continue editing it *****/ /***** Show the updated syllabus to continue editing it *****/
Syl_FreeListItemsSyllabus (); Syl_FreeListItemsSyllabus ();
@ -1361,8 +1361,8 @@ void Syl_ModifyItemSyllabus (void)
/***** We are editing a syllabus with the internal editor, /***** We are editing a syllabus with the internal editor,
so change info source to internal editor in database *****/ so change info source to internal editor in database *****/
Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_INFO_SRC_EDITOR : Inf_SetInfoSrcIntoDB (Syl_LstItemsSyllabus.NumItems ? Inf_EDITOR :
Inf_INFO_SRC_NONE); Inf_NONE);
/***** Show the updated syllabus to continue editing it *****/ /***** Show the updated syllabus to continue editing it *****/
Syl_FreeListItemsSyllabus (); Syl_FreeListItemsSyllabus ();

View File

@ -16776,7 +16776,7 @@ const char *Txt_Info =
"Info"; "Info";
#endif #endif
const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES] = const char *Txt_INFO_TITLE[Inf_NUM_TYPES] =
{ {
[Inf_INTRODUCTION] = [Inf_INTRODUCTION] =
#if L==1 // ca #if L==1 // ca
@ -16947,9 +16947,9 @@ const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES] =
#endif #endif
}; };
const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] = const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_SOURCES] =
{ {
[Inf_INFO_SRC_NONE] = [Inf_NONE] =
#if L==1 // ca #if L==1 // ca
"No ofrecer ninguna informaci&oacute;n" // Necessita traduccio "No ofrecer ninguna informaci&oacute;n" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -16970,7 +16970,7 @@ const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] =
"N&atilde;o d&ecirc; nenhuma informa&ccedil;&atilde;o" "N&atilde;o d&ecirc; nenhuma informa&ccedil;&atilde;o"
#endif #endif
, ,
[Inf_INFO_SRC_EDITOR] = [Inf_EDITOR] =
#if L==1 // ca #if L==1 // ca
"Editor interno" // Necessita traduccio "Editor interno" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -16991,7 +16991,7 @@ const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] =
"Interno editor" "Interno editor"
#endif #endif
, ,
[Inf_INFO_SRC_PLAIN_TEXT] = [Inf_PLAIN_TEXT] =
#if L==1 // ca #if L==1 // ca
"Text sense format" "Text sense format"
#elif L==2 // de #elif L==2 // de
@ -17012,7 +17012,7 @@ const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] =
"Texto plano" "Texto plano"
#endif #endif
, ,
[Inf_INFO_SRC_RICH_TEXT] = [Inf_RICH_TEXT] =
#if L==1 // ca #if L==1 // ca
"Text enriquit" "Text enriquit"
#elif L==2 // de #elif L==2 // de
@ -17033,7 +17033,7 @@ const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] =
"Texto enriquecido" "Texto enriquecido"
#endif #endif
, ,
[Inf_INFO_SRC_PAGE] = [Inf_PAGE] =
#if L==1 // ca #if L==1 // ca
"P&aacute;gina web alojada aqu&iacute;" // Necessita traduccio "P&aacute;gina web alojada aqu&iacute;" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17054,7 +17054,7 @@ const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] =
"P&aacute;gina Web hospedada aqui" "P&aacute;gina Web hospedada aqui"
#endif #endif
, ,
[Inf_INFO_SRC_URL] = [Inf_URL] =
#if L==1 // ca #if L==1 // ca
"P&aacute;gina web alojada en otro servidor" // Necessita traduccio "P&aacute;gina web alojada en otro servidor" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17076,11 +17076,11 @@ const char *Txt_INFO_SRC_FULL_TEXT[Inf_NUM_INFO_SOURCES] =
#endif #endif
}; };
const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] = const char *Txt_INFO_SRC_HELP[Inf_NUM_SOURCES] =
{ {
[Inf_INFO_SRC_NONE] = [Inf_NONE] =
NULL, NULL,
[Inf_INFO_SRC_EDITOR] = [Inf_EDITOR] =
#if L==1 // ca #if L==1 // ca
"editor integrado, solo para los temarios de teor&iacute;a y pr&aacute;cticas"// Necessita traduccio "editor integrado, solo para los temarios de teor&iacute;a y pr&aacute;cticas"// Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17101,7 +17101,7 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] =
"interno editor, apenas para programas de teoria y pr&aacute;tica" "interno editor, apenas para programas de teoria y pr&aacute;tica"
#endif #endif
, ,
[Inf_INFO_SRC_PLAIN_TEXT] = [Inf_PLAIN_TEXT] =
#if L==1 // ca #if L==1 // ca
"editor de text sense format" "editor de text sense format"
#elif L==2 // de #elif L==2 // de
@ -17122,7 +17122,7 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] =
"editor de texto simples" "editor de texto simples"
#endif #endif
, ,
[Inf_INFO_SRC_RICH_TEXT] = [Inf_RICH_TEXT] =
#if L==1 // ca #if L==1 // ca
"editor de text enriquit" "editor de text enriquit"
#elif L==2 // de #elif L==2 // de
@ -17143,7 +17143,7 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] =
"editor de texto rico" "editor de texto rico"
#endif #endif
, ,
[Inf_INFO_SRC_PAGE] = [Inf_PAGE] =
#if L==1 // ca #if L==1 // ca
"env&iacute;e un archivo HTML, o bien un archivo ZIP que contenga un archivo index.html/index.htm y archivos con im&aacute;genes"// Necessita traduccio "env&iacute;e un archivo HTML, o bien un archivo ZIP que contenga un archivo index.html/index.htm y archivos con im&aacute;genes"// Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17164,7 +17164,7 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] =
"enviar um arquivo HTML, ou um arquivo ZIP que cont&eacute;m um arquivo index.html / index.htm e limas da imagem" "enviar um arquivo HTML, ou um arquivo ZIP que cont&eacute;m um arquivo index.html / index.htm e limas da imagem"
#endif #endif
, ,
[Inf_INFO_SRC_URL] = [Inf_URL] =
#if L==1 // ca #if L==1 // ca
"escriba la direcci&oacute;n web de una p&aacute;gina que se encuentre alojada en otro servidor" // Necessita traduccio "escriba la direcci&oacute;n web de una p&aacute;gina que se encuentre alojada en otro servidor" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17186,9 +17186,9 @@ const char *Txt_INFO_SRC_HELP[Inf_NUM_INFO_SOURCES] =
#endif #endif
}; };
const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES] = const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_SOURCES] =
{ {
[Inf_INFO_SRC_NONE] = [Inf_NONE] =
#if L==1 // ca #if L==1 // ca
"Ninguna informaci&oacute;n" // Necessita traduccio "Ninguna informaci&oacute;n" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17209,7 +17209,7 @@ const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES] =
"Sem informa&ccedil;&atilde;o" "Sem informa&ccedil;&atilde;o"
#endif #endif
, ,
[Inf_INFO_SRC_EDITOR] = [Inf_EDITOR] =
#if L==1 // ca #if L==1 // ca
"Editor interno" // Necessita traduccio "Editor interno" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17230,7 +17230,7 @@ const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES] =
"Interno editor" "Interno editor"
#endif #endif
, ,
[Inf_INFO_SRC_PLAIN_TEXT] = [Inf_PLAIN_TEXT] =
#if L==1 // ca #if L==1 // ca
"Text sense format" "Text sense format"
#elif L==2 // de #elif L==2 // de
@ -17251,7 +17251,7 @@ const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES] =
"Texto plano" "Texto plano"
#endif #endif
, ,
[Inf_INFO_SRC_RICH_TEXT] = [Inf_RICH_TEXT] =
#if L==1 // ca #if L==1 // ca
"Text enriquit" "Text enriquit"
#elif L==2 // de #elif L==2 // de
@ -17272,7 +17272,7 @@ const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES] =
"Texto enriquecido" "Texto enriquecido"
#endif #endif
, ,
[Inf_INFO_SRC_PAGE] = [Inf_PAGE] =
#if L==1 // ca #if L==1 // ca
"P&aacute;gina interna" // Necessita traduccio "P&aacute;gina interna" // Necessita traduccio
#elif L==2 // de #elif L==2 // de
@ -17293,7 +17293,7 @@ const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES] =
"Interna p&aacute;gina" "Interna p&aacute;gina"
#endif #endif
, ,
[Inf_INFO_SRC_URL] = [Inf_URL] =
#if L==1 // ca #if L==1 // ca
"P&aacute;gina externa" // Necessita traduccio "P&aacute;gina externa" // Necessita traduccio
#elif L==2 // de #elif L==2 // de