Version 15.7

This commit is contained in:
Antonio Cañas Vargas 2015-10-03 21:10:47 +02:00
parent b566dc8869
commit 39349a8714
7 changed files with 75 additions and 83 deletions

View File

@ -69,17 +69,17 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
}
.GREY_BACKGROUND
{
background-image:linear-gradient(#383838 0,#404040 26px,#404040 191px,white 191px,white 100%);
background-image:linear-gradient(#383838 0,#404040 26px,#404040 185px,white 185px,white 100%);
background-repeat:no-repeat;
}
.BLUE_BACKGROUND
{
background-image:linear-gradient(#5fa5df 0,#4f90c8 26px,#4f90c8 191px,white 191px,white 100%);
background-image:linear-gradient(#5fa5df 0,#4f90c8 26px,#4f90c8 185px,white 185px,white 100%);
background-repeat:no-repeat;
}
.YELLOW_BACKGROUND
{
background-image:linear-gradient(#201420 0,#201420 191px,white 191px,white 100%);
background-image:linear-gradient(#201420 0,#201420 185px,white 185px,white 100%);
background-repeat:no-repeat;
}
@ -664,13 +664,13 @@ a:hover img.CENTRE_PHOTO_SHOW
#tabs_container
{
width:672px; /* 112 px * 6 visible tabs */
height:70px;
height:64px;
margin:0 auto;
}
.TAB_OFF
{
float:left;
width:108px;height:76px;
width:108px;height:70px;
margin:1px 1px 0 1px;
padding:0 1px 0 1px;
border-radius:6px 6px 0 0;
@ -683,7 +683,7 @@ a:hover img.CENTRE_PHOTO_SHOW
.TAB_ON
{
float:left;
width:110px; height:78px;
width:110px; height:72px;
margin:0;
padding:1px 1px 0 1px;
border-radius:6px 6px 0 0;

View File

@ -64,17 +64,17 @@ form {margin:0; display:inline;}
}
.GREY_BACKGROUND
{
background-image:linear-gradient(#383838 0,#404040 40px,#404040 176px,white 176px,white 100%);
background-image:linear-gradient(#383838 0,#404040 40px,#404040 170px,white 170px,white 100%);
background-repeat:no-repeat;
}
.BLUE_BACKGROUND
{
background-image:linear-gradient(#5fa5df 0,#4f90c8 40px,#4f90c8 176px,white 176px,white 100%);
background-image:linear-gradient(#5fa5df 0,#4f90c8 40px,#4f90c8 170px,white 170px,white 100%);
background-repeat:no-repeat;
}
.YELLOW_BACKGROUND
{
background-image:linear-gradient(#201420 0,#201420 176px,white 176px,white 100%);
background-image:linear-gradient(#201420 0,#201420 170px,white 170px,white 100%);
background-repeat:no-repeat;
}
@ -319,12 +319,12 @@ form {margin:0; display:inline;}
/***************************** Tabs and main zone ****************************/
#tabs_container
{
height:70px;
height:64px;
margin:0 auto;
}
.TAB_ON
{
height:78px;
height:72px;
margin:0;
padding:0 25px;
border-radius:8px 8px 0 0;

View File

@ -2302,10 +2302,10 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActSeeRecOneTch */{1175,-1,TabUsr,ActLstTch ,0x1FE,0x1FE,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_GetUsrAndShowRecordOneTchCrs,NULL},
/* ActSeeRecSevGst */{1187,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_ListRecordsGsts ,NULL},
/* ActSeeRecSevStd */{ 89,-1,TabUsr,ActLstStd ,0x118,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_ListRecordsStds ,NULL},
/* ActSeeRecSevStd */{ 89,-1,TabUsr,ActLstStd ,0x118,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_ListRecordsStdsForEdit ,NULL},
/* ActSeeRecSevTch */{ 22,-1,TabUsr,ActLstTch ,0x1FF,0x1FF,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_ListRecordsTchs ,NULL},
/* ActPrnRecSevGst */{1188,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Rec_ListRecordsGsts ,NULL},
/* ActPrnRecSevStd */{ 111,-1,TabUsr,ActLstStd ,0x118,0x100,0x000,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Rec_ListRecordsStds ,NULL},
/* ActPrnRecSevStd */{ 111,-1,TabUsr,ActLstStd ,0x118,0x100,0x000,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Rec_ListRecordsStdsForPrint ,NULL},
/* ActPrnRecSevTch */{ 127,-1,TabUsr,ActLstTch ,0x1FF,0x1FF,0x000,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Rec_ListRecordsTchs ,NULL},
/* ActRcvRecOthUsr */{ 300,-1,TabUsr,ActLstStd ,0x110,0x100,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rec_UpdateAndShowOtherCrsRecord,NULL},

View File

@ -98,11 +98,13 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.6.3 (2015/10/03)"
#define Log_PLATFORM_VERSION "SWAD 15.7 (2015/10/03)"
// 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 15.7: Oct 03, 2015 Height of tabs reduced.
Changes in layout of students record cards in course. (184962 lines)
Version 15.6.3: Oct 03, 2015 Radius of rounded corners is reduced. (184966 lines)
Version 15.6.2: Oct 03, 2015 Changes in layout of file browsers. (184963 lines)
Version 15.6.1: Oct 03, 2015 Changes in layout of file browsers. (184956 lines)

View File

@ -69,13 +69,16 @@ static void Rec_WriteHeadingRecordFields (void);
static void Rec_GetFieldByCod (long FieldCod,char *Name,unsigned *NumLines,Rec_VisibilityRecordFields_t *Visibility);
static void Rec_ShowRecordOneStdCrs (void);
static void Rec_ListRecordsStds (Rec_RecordViewType_t TypeOfView);
static void Rec_ShowRecordOneTchCrs (void);
static void Rec_ShowLinkToPrintPreviewOfRecords (void);
static void Rec_GetParamRecordsPerPage (void);
static void Rec_WriteFormShowOfficeHours (bool ShowOfficeHours,const char *ListUsrCods);
static bool Rec_GetParamShowOfficeHours (void);
static void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat,
const char *Anchor);
static void Rec_ShowMyCrsRecordUpdated (void);
static void Rec_ShowOtherCrsRecordUpdated (void);
static void Rec_WriteLinkToDataProtectionClause (void);
static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat);
@ -963,8 +966,6 @@ void Rec_GetUsrAndShowRecordOneStdCrs (void)
static void Rec_ShowRecordOneStdCrs (void)
{
bool ItsMe;
/***** Get if student has accepted enrollment in current course *****/
Gbl.Usrs.Other.UsrDat.Accepted = Usr_CheckIfUsrBelongsToCrs (Gbl.Usrs.Other.UsrDat.UsrCod,
Gbl.CurrentCrs.Crs.CrsCod,
@ -998,14 +999,10 @@ static void Rec_ShowRecordOneStdCrs (void)
{
if (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
Rec_ShowCrsRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
else
{
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod ==
Gbl.Usrs.Other.UsrDat.UsrCod); // It's me
if (ItsMe && Gbl.Usrs.Me.LoggedRole == Rol_STUDENT)
Rec_ShowCrsRecord (Rec_FORM_MY_COURSE_RECORD_AS_STUDENT,&Gbl.Usrs.Other.UsrDat);
}
Rec_ShowCrsRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat,NULL);
else if (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT &&
Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) // It's me
Rec_ShowCrsRecord (Rec_FORM_MY_COURSE_RECORD_AS_STUDENT,&Gbl.Usrs.Other.UsrDat,NULL);
}
/* Free list of fields of records */
@ -1016,21 +1013,29 @@ static void Rec_ShowRecordOneStdCrs (void)
/******************** Draw records of several students ***********************/
/*****************************************************************************/
void Rec_ListRecordsStds (void)
void Rec_ListRecordsStdsForEdit (void)
{
Rec_ListRecordsStds (Rec_RECORD_LIST);
}
void Rec_ListRecordsStdsForPrint (void)
{
Rec_ListRecordsStds (Rec_RECORD_PRINT);
}
static void Rec_ListRecordsStds (Rec_RecordViewType_t TypeOfView)
{
extern const char *Txt_You_must_select_one_ore_more_students;
unsigned NumUsrs = 0;
unsigned NumUsr = 0;
const char *Ptr;
bool ItsMe;
Rec_RecordViewType_t TypeOfView = (Gbl.CurrentAct == ActSeeRecSevStd) ? Rec_RECORD_LIST :
Rec_RECORD_PRINT;
char Anchor[32];
struct UsrData UsrDat;
/***** Asign users listing type depending on current action *****/
Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_STUDENTS;
/***** Get parameter with number of user records per page (only for printing) *****/
if (Gbl.CurrentAct == ActPrnRecSevStd)
if (TypeOfView == Rec_RECORD_PRINT)
Rec_GetParamRecordsPerPage ();
/***** Get list of selected students *****/
@ -1047,7 +1052,7 @@ void Rec_ListRecordsStds (void)
/***** Get list of fields of records in current course *****/
Rec_GetListRecordFieldsInCurrentCrs ();
if (Gbl.CurrentAct == ActSeeRecSevStd)
if (TypeOfView == Rec_RECORD_LIST)
{
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
@ -1077,15 +1082,21 @@ void Rec_ListRecordsStds (void)
Gbl.CurrentCrs.Crs.CrsCod,
false))
{
/* Check if this student has accepted
his/her inscription in the current course */
UsrDat.Accepted = Usr_CheckIfUsrBelongsToCrs (UsrDat.UsrCod,
Gbl.CurrentCrs.Crs.CrsCod,
true);
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
" style=\"margin-bottom:12px;");
/* Start records of this student */
sprintf (Anchor,"record_%u",NumUsr);
fprintf (Gbl.F.Out,"<section id=\"%s\""
" class=\"CENTER_MIDDLE\""
" style=\"margin-bottom:12px;",
Anchor);
if (Gbl.CurrentAct == ActPrnRecSevStd &&
NumUsrs != 0 &&
(NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0)
NumUsr != 0 &&
(NumUsr % Gbl.Usrs.Listing.RecsPerPag) == 0)
fprintf (Gbl.F.Out,"page-break-before:always;");
fprintf (Gbl.F.Out,"\">");
@ -1094,17 +1105,15 @@ void Rec_ListRecordsStds (void)
/* Record of the student in the course */
if (Gbl.CurrentCrs.Records.LstFields.Num) // There are fields in the record
{
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat.UsrCod); // It's me
if (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ||
(Gbl.Usrs.Me.LoggedRole == Rol_STUDENT && ItsMe)) // I am student in this course and it's me
Rec_ShowCrsRecord (TypeOfView,&UsrDat);
}
if ( Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ||
(Gbl.Usrs.Me.LoggedRole == Rol_STUDENT && // I am student in this course...
Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat.UsrCod)) // ...and it's me
Rec_ShowCrsRecord (TypeOfView,&UsrDat,Anchor);
fprintf (Gbl.F.Out,"</div>");
fprintf (Gbl.F.Out,"</section>");
NumUsrs++;
NumUsr++;
}
}
@ -1112,7 +1121,7 @@ void Rec_ListRecordsStds (void)
Usr_UsrDataDestructor (&UsrDat);
/***** Free list of fields of records *****/
if (Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS)
// if (Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS)
Rec_FreeListFields ();
/***** Free memory used for by the list of users *****/
@ -1292,7 +1301,7 @@ void Rec_ListRecordsTchs (void)
/*************** Show a link to print preview of users' records **************/
/*****************************************************************************/
void Rec_ShowLinkToPrintPreviewOfRecords (void)
static void Rec_ShowLinkToPrintPreviewOfRecords (void)
{
extern const char *The_ClassFormBold[The_NUM_THEMES];
extern const char *The_ClassForm[The_NUM_THEMES];
@ -1412,15 +1421,15 @@ void Rec_UpdateAndShowMyCrsRecord (void)
}
/*****************************************************************************/
/***** Update record in the course of another user (student) and show it *****/
/***** Update record in the course of one student and show records again *****/
/*****************************************************************************/
void Rec_UpdateAndShowOtherCrsRecord (void)
{
/***** Get the user's code of the student whose record we want to modify *****/
Usr_GetParamOtherUsrCodEncrypted ();
extern const char *Txt_Student_record_card_in_this_course_has_been_updated;
/***** Get data of the student, because we need the name *****/
/***** Get the user whose record we want to modify *****/
Usr_GetParamOtherUsrCodEncrypted ();
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat);
/***** Get list of fields of records in current course *****/
@ -1435,8 +1444,9 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
/***** Update the record *****/
Rec_UpdateCrsRecord (Gbl.Usrs.Other.UsrDat.UsrCod);
/***** Show updated user's record *****/
Rec_ShowOtherCrsRecordUpdated ();
/***** Show records again (including the updated one) *****/
Lay_ShowAlert (Lay_SUCCESS,Txt_Student_record_card_in_this_course_has_been_updated);
Rec_ListRecordsStdsForEdit ();
/***** Free memory used for some fields *****/
Rec_FreeMemFieldsRecordsCrs ();
@ -1447,7 +1457,8 @@ void Rec_UpdateAndShowOtherCrsRecord (void)
/*****************************************************************************/
// Show form or only data depending on TypeOfView
void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat)
static void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat,
const char *Anchor)
{
extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_You_dont_have_permission_to_perform_this_action;
@ -1514,14 +1525,14 @@ void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat)
ClassData = "DAT_REC";
break;
case Rec_CHECK_MY_COURSE_RECORD_AS_STUDENT:
case Rec_CHECK_OTHER_USR_COURSE_RECORD:
FrameWidth = 10;
ClassHead = "HEAD_REC_SMALL";
ClassData = "DAT_REC_SMALL_BOLD";
break;
case Rec_RECORD_LIST:
DataForm = true;
Act_FormStart (ActRcvRecOthUsr);
Act_FormStartAnchor (ActRcvRecOthUsr,Anchor);
Usr_PutHiddenParUsrCodAll (ActRcvRecOthUsr,Gbl.Usrs.Select.All);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
FrameWidth = 10;
ClassHead = "HEAD_REC_SMALL";
@ -1790,25 +1801,7 @@ static void Rec_ShowMyCrsRecordUpdated (void)
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Me.UsrDat);
/***** Show updated user's record *****/
Rec_ShowCrsRecord (Rec_CHECK_MY_COURSE_RECORD_AS_STUDENT,&Gbl.Usrs.Me.UsrDat);
}
/*****************************************************************************/
/**************** Show updated user's record in the course *******************/
/*****************************************************************************/
static void Rec_ShowOtherCrsRecordUpdated (void)
{
extern const char *Txt_Student_record_card_in_this_course_has_been_updated;
/***** Write mensaje of success *****/
Lay_ShowAlert (Lay_SUCCESS,Txt_Student_record_card_in_this_course_has_been_updated);
/***** Common record *****/
Rec_ShowSharedUsrRecord (Rec_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
/***** Show updated user's record *****/
Rec_ShowCrsRecord (Rec_CHECK_OTHER_USR_COURSE_RECORD,&Gbl.Usrs.Other.UsrDat);
Rec_ShowCrsRecord (Rec_CHECK_MY_COURSE_RECORD_AS_STUDENT,&Gbl.Usrs.Me.UsrDat,NULL);
}
/*****************************************************************************/
@ -2088,7 +2081,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
case Rec_MY_COMMON_RECORD_CHECK:
case Rec_CHECK_MY_COURSE_RECORD_AS_STUDENT:
case Rec_CHECK_OTHER_USR_COMMON_RECORD:
case Rec_CHECK_OTHER_USR_COURSE_RECORD:
case Rec_RECORD_LIST:
case Rec_RECORD_PUBLIC:
case Rec_RECORD_PRINT:

View File

@ -68,7 +68,6 @@ typedef enum
Rec_FORM_MY_COURSE_RECORD_AS_STUDENT,
Rec_CHECK_MY_COURSE_RECORD_AS_STUDENT,
Rec_CHECK_OTHER_USR_COURSE_RECORD,
Rec_RECORD_LIST,
Rec_RECORD_PRINT,
@ -132,13 +131,12 @@ void Rec_FreeListFields (void);
void Rec_PutLinkToEditRecordFields (void);
void Rec_ListRecordsGsts (void);
void Rec_GetUsrAndShowRecordOneStdCrs (void);
void Rec_ListRecordsStds (void);
void Rec_ListRecordsStdsForEdit (void);
void Rec_ListRecordsStdsForPrint (void);
void Rec_GetUsrAndShowRecordOneTchCrs (void);
void Rec_ListRecordsTchs (void);
void Rec_ShowLinkToPrintPreviewOfRecords (void);
void Rec_UpdateAndShowMyCrsRecord (void);
void Rec_UpdateAndShowOtherCrsRecord (void);
void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat);
unsigned long Rec_GetFieldFromCrsRecord (long UsrCod,long FieldCod,MYSQL_RES **mysql_res);
void Rec_GetFieldsCrsRecordFromForm (void);
void Rec_UpdateCrsRecord (long UsrCod);

View File

@ -91,7 +91,7 @@ void Tab_DrawTabs (void)
ColspanCentralPart = 2;
}
fprintf (Gbl.F.Out,"<td colspan=\"%u\" class=\"CENTER_TOP\""
" style=\"height:70px;\">"
" style=\"height:64px;\">"
"<div id=\"tabs_container\">",
ColspanCentralPart);
switch (Gbl.Prefs.Layout)
@ -162,7 +162,7 @@ static void Tab_DrawTabsDeskTop (void)
The_ClassTabOff[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s64x64.gif\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON32x32\" style=\"margin:5px;\" />"
" class=\"ICON32x32\" style=\"margin:3px;\" />"
"<div>%s</div>"
"</a>",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
@ -176,7 +176,7 @@ static void Tab_DrawTabsDeskTop (void)
fprintf (Gbl.F.Out,"<div class=\"ICON_HIDDEN\">"
"<img src=\"%s/%s/%s64x64.gif\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON32x32\" style=\"margin:5px;\" />"
" class=\"ICON32x32\" style=\"margin:3px;\" />"
"<div class=\"%s\">%s</div>",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Tab_TabIcons[NumTab],