Version 16.107.4

This commit is contained in:
Antonio Cañas Vargas 2016-12-26 18:26:40 +01:00
parent 3299bc6592
commit f04ba7d3d2
2 changed files with 29 additions and 26 deletions

View File

@ -68,6 +68,8 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
bool ICanEdit);
static void Ann_PutParams (void);
static long Ann_GetParamAnnCod (void);
static void Ann_PutSubjectMessage (const char *Field,const char *Label,
unsigned Rows);
static void Ann_CreateAnnouncement (unsigned Roles,const char *Subject,const char *Content);
/*****************************************************************************/
@ -420,30 +422,8 @@ void Ann_ShowFormAnnouncement (void)
NULL,Hlp_MESSAGES_Announcements,2);
/***** Announcement subject and body *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_TOP\">"
"<label for=\"Subject\" class=\"%s\">%s:&nbsp;</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"Subject\" name=\"Subject\""
" cols=\"75\" rows=\"2\">"
"</textarea>"
"</td>"
"</tr>"
"<tr>"
"<td class=\"RIGHT_TOP\">"
"<label for=\"Content\" class=\"%s\">%s:&nbsp;</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"Content\" name=\"Content\""
" cols=\"75\" rows=\"20\">"
"</textarea>"
"</td>"
"</tr>",
The_ClassForm[Gbl.Prefs.Theme],
Txt_MSG_Subject,
The_ClassForm[Gbl.Prefs.Theme],
Txt_MSG_Message);
Ann_PutSubjectMessage ("Subject",Txt_MSG_Subject, 2);
Ann_PutSubjectMessage ("Content",Txt_MSG_Message,20);
/***** Users' roles who can view the announcement *****/
fprintf (Gbl.F.Out,"<tr>"
@ -472,6 +452,29 @@ void Ann_ShowFormAnnouncement (void)
Act_FormEnd ();
}
/*****************************************************************************/
/*********** Put form field for message subject or message content ***********/
/*****************************************************************************/
static void Ann_PutSubjectMessage (const char *Field,const char *Label,
unsigned Rows)
{
extern const char *The_ClassForm[The_NUM_THEMES];
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_TOP\">"
"<label for=\"%s\" class=\"%s\">%s:</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"%s\" name=\"%s\""
" cols=\"75\" rows=\"%u\">"
"</textarea>"
"</td>"
"</tr>",
Field,The_ClassForm[Gbl.Prefs.Theme],Label,
Field,Field,Rows);
}
/*****************************************************************************/
/****** Receive a new announcement from a form and store it in database ******/
/*****************************************************************************/
@ -519,7 +522,6 @@ static void Ann_CreateAnnouncement (unsigned Roles,const char *Subject,const cha
DB_QueryINSERT (Query,"can not create announcement");
}
/*****************************************************************************/
/*********** Mark as hidden a global announcement that was active ************/
/*****************************************************************************/

View File

@ -189,13 +189,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.107.3 (2016-12-26)"
#define Log_PLATFORM_VERSION "SWAD 16.107.4 (2016-12-26)"
#define CSS_FILE "swad16.106.5.css"
#define JS_FILE "swad16.101.js"
// 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
/*
Version 16.107.4: Dec 26, 2016 Code refactoring in announcements. (211532 lines)
Version 16.107.3: Dec 26, 2016 Changes in behaviour of labels in forms. (211531 lines)
Version 16.107.2: Dec 26, 2016 Changes in behaviour of labels in forms. (211525 lines)
Version 16.107.1: Dec 26, 2016 Changes in behaviour of labels in forms.