Version 16.194.7

This commit is contained in:
Antonio Cañas Vargas 2017-04-28 11:38:21 +02:00
parent 5b89ff574d
commit 42963cc652
2 changed files with 26 additions and 10 deletions

View File

@ -221,13 +221,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.194.6 (2017-04-28)"
#define Log_PLATFORM_VERSION "SWAD 16.194.7 (2017-04-28)"
#define CSS_FILE "swad16.193.4.css"
#define JS_FILE "swad16.181.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.194.7: Apr 28, 2017 Changed dialog to remove record field. (218359 lines)
Version 16.194.6: Apr 28, 2017 Changed dialog to remove an agenda event. (218347 lines)
Version 16.194.5: Apr 28, 2017 Changed dialog to remove a forum thread. (218347 lines)
Version 16.194.4: Apr 28, 2017 Changed dialog to remove an assignment. (218332 lines)

View File

@ -71,6 +71,8 @@ extern struct Globals Gbl;
/*****************************************************************************/
static void Rec_WriteHeadingRecordFields (void);
static void Rec_PutParamFielCod (void);
static void Rec_GetFieldByCod (long FieldCod,char Name[Rec_MAX_BYTES_NAME_FIELD + 1],
unsigned *NumLines,Rec_VisibilityRecordFields_t *Visibility);
@ -276,7 +278,7 @@ void Rec_ListFieldsRecordsForEdition (void)
fprintf (Gbl.F.Out,"<tr>");
/* Write icon to remove the field */
fprintf (Gbl.F.Out,"<td class=\"BM%u\">",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<td class=\"BM\">");
Act_FormStart (ActReqRemFie);
Par_PutHiddenParamLong ("FieldCod",Gbl.CurrentCrs.Records.LstFields.Lst[NumField].FieldCod);
Lay_PutIconRemove ();
@ -610,7 +612,9 @@ unsigned Rec_CountNumRecordsInCurrCrsWithField (long FieldCod)
/***** Get number of cards with a given field in a course from database *****/
sprintf (Query,"SELECT COUNT(*) FROM crs_records WHERE FieldCod=%ld",
FieldCod);
return (unsigned) DB_QueryCOUNT (Query,"can not get number of cards with a given field not empty in a course");
return (unsigned) DB_QueryCOUNT (Query,"can not get number of cards"
" with a given field not empty"
" in a course");
}
/*****************************************************************************/
@ -631,7 +635,8 @@ void Rec_AskConfirmRemFieldWithRecords (unsigned NumRecords)
&Gbl.CurrentCrs.Records.Field.NumLines,
&Gbl.CurrentCrs.Records.Field.Visibility);
/***** Write mensaje to ask confirmation of deletion *****/
/***** Show question and button to remove my photo *****/
/* Start alert */
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_field_X_from_the_records_of_X,
Gbl.CurrentCrs.Records.Field.Name,Gbl.CurrentCrs.Crs.FullName);
if (NumRecords == 1)
@ -644,13 +649,14 @@ void Rec_AskConfirmRemFieldWithRecords (unsigned NumRecords)
Str_Concat (Gbl.Message,Message_part2,
Lay_MAX_BYTES_ALERT);
}
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
/***** Button to confirm removing *****/
Act_FormStart (ActRemFie);
Par_PutHiddenParamLong ("FieldCod",Gbl.CurrentCrs.Records.Field.FieldCod);
Lay_PutRemoveButton (Txt_Remove_record_field);
Act_FormEnd ();
/* End alert */
Lay_ShowAlertAndButton2 (ActRemFie,NULL,Rec_PutParamFielCod,
Lay_REMOVE_BUTTON,Txt_Remove_record_field);
/***** List record fields again *****/
Rec_ReqEditRecordFields ();
}
/*****************************************************************************/
@ -687,6 +693,15 @@ void Rec_RemoveFieldFromDB (void)
Rec_ReqEditRecordFields ();
}
/*****************************************************************************/
/********************** Put parameter with field code ************************/
/*****************************************************************************/
static void Rec_PutParamFielCod (void)
{
Par_PutHiddenParamLong ("FieldCod",Gbl.CurrentCrs.Records.Field.FieldCod);
}
/*****************************************************************************/
/************** Get the data of a field of records from its code *************/
/*****************************************************************************/