diff --git a/swad_center.c b/swad_center.c index f29bb7ac..35d2dd50 100644 --- a/swad_center.c +++ b/swad_center.c @@ -896,7 +896,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places) Usr_DONT_GET_ROLE_IN_CURRENT_CRS); HTM_TD_Begin ("class=\"DAT_%s INPUT_REQUESTER LT\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&UsrDat,true); + Usr_WriteAuthor (&UsrDat,Cns_ENABLED); HTM_TD_End (); /* Center status */ @@ -1343,7 +1343,7 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places) /***** Center requester *****/ HTM_TD_Begin ("class=\"DAT_%s INPUT_REQUESTER LT\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true); + Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED); HTM_TD_End (); /***** Center status *****/ diff --git a/swad_changelog.h b/swad_changelog.h index 179a3248..58fe1e80 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -633,6 +633,7 @@ TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la ho #define CSS_FILE "swad22.118.5.css" #define JS_FILE "swad22.49.js" /* + Version 22.118.12:May 30, 2023 Code refactoring in forums and messages. (337408 lines) Version 22.118.11:May 30, 2023 Code refactoring in strings. (337391 lines) Version 22.118.10:May 30, 2023 Draw logo in head even if it does not exist. (337359 lines) Version 22.118.9: May 30, 2023 Code refactoring in user account. (337363 lines) diff --git a/swad_constant.h b/swad_constant.h index 4000e594..aa4c8226 100644 --- a/swad_constant.h +++ b/swad_constant.h @@ -119,4 +119,10 @@ typedef enum Cns_FULL_NAME, } Cns_ShrtOrFullName_t; +typedef enum + { + Cns_DISABLED, + Cns_ENABLED, + } Cns_Enabled_t; + #endif diff --git a/swad_course.c b/swad_course.c index c541fa6c..2a4fcea3 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1251,7 +1251,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) Usr_DONT_GET_ROLE_IN_CURRENT_CRS); HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&UsrDat,true); + Usr_WriteAuthor (&UsrDat,Cns_ENABLED); HTM_TD_End (); /* Course status */ @@ -1371,7 +1371,7 @@ static void Crs_PutFormToCreateCourse (void) /***** Course requester *****/ HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true); + Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED); HTM_TD_End (); /***** Course status *****/ diff --git a/swad_degree.c b/swad_degree.c index 62f9502e..0052484f 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -481,7 +481,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes) Usr_DONT_GET_ROLE_IN_CURRENT_CRS); HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&UsrDat,true); + Usr_WriteAuthor (&UsrDat,Cns_ENABLED); HTM_TD_End (); /* Degree status */ @@ -608,7 +608,7 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes) /***** Degree requester *****/ HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true); + Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED); HTM_TD_End (); /***** Degree status *****/ diff --git a/swad_forum.c b/swad_forum.c index 3cfdb75d..d3667342 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -912,7 +912,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums, char Subject[Cns_MAX_BYTES_SUBJECT + 1]; char Content[Cns_MAX_BYTES_LONG_TEXT + 1]; struct Med_Media Media; - bool Enabled; + Cns_Enabled_t Enabled; char *Title; /***** Initialize structure with user's data *****/ @@ -922,13 +922,13 @@ static void For_ShowAForumPost (struct For_Forums *Forums, Med_MediaConstructor (&Media); /***** Check if post is enabled *****/ - Enabled = !For_DB_GetIfPstIsDisabled (Forums->PstCod); + Enabled = For_DB_GetIfPstIsEnabled (Forums->PstCod); /***** Get data of post *****/ For_GetPstData (Forums->PstCod,&UsrDat.UsrCod,&CreatTimeUTC, Subject,OriginalContent,&Media); - if (Enabled) + if (Enabled == Cns_ENABLED) /* Return this subject as last subject */ Str_Copy (LastSubject,Subject,Cns_MAX_BYTES_SUBJECT); @@ -964,15 +964,18 @@ static void For_ShowAForumPost (struct For_Forums *Forums, NewPst ? "MSG_BG_NEW" : "MSG_BG", The_GetSuffix ()); - if (Enabled) - { - if (Subject[0]) - HTM_Txt (Subject); - else - HTM_TxtF ("[%s]",Txt_no_subject); - } - else - HTM_TxtF ("[%s]",Txt_FORUM_Post_banned); + switch (Enabled) + { + case Cns_DISABLED: + HTM_TxtF ("[%s]",Txt_FORUM_Post_banned); + break; + case Cns_ENABLED: + if (Subject[0]) + HTM_Txt (Subject); + else + HTM_TxtF ("[%s]",Txt_no_subject); + break; + } HTM_TD_End (); HTM_TR_End (); @@ -983,28 +986,28 @@ static void For_ShowAForumPost (struct For_Forums *Forums, if (ICanModerateForum) { - Frm_BeginFormAnchor (Enabled ? For_ActionsDisPstFor[Forums->Forum.Type] : - For_ActionsEnbPstFor[Forums->Forum.Type], + Frm_BeginFormAnchor (Enabled == Cns_ENABLED ? For_ActionsDisPstFor[Forums->Forum.Type] : + For_ActionsEnbPstFor[Forums->Forum.Type], For_FORUM_POSTS_SECTION_ID); For_PutParsForum (Forums); - Ico_PutIconLink (Enabled ? "eye.svg" : - "eye-slash.svg", - Enabled ? Ico_GREEN : - Ico_RED, - Enabled ? For_ActionsDisPstFor[Forums->Forum.Type] : - For_ActionsEnbPstFor[Forums->Forum.Type]); + Ico_PutIconLink (Enabled == Cns_ENABLED ? "eye.svg" : + "eye-slash.svg", + Enabled == Cns_ENABLED ? Ico_GREEN : + Ico_RED, + Enabled == Cns_ENABLED ? For_ActionsDisPstFor[Forums->Forum.Type] : + For_ActionsEnbPstFor[Forums->Forum.Type]); Frm_EndForm (); } else { - if (asprintf (&Title,Enabled ? Txt_FORUM_Post_X_allowed : - Txt_FORUM_Post_X_banned, + if (asprintf (&Title,Enabled == Cns_ENABLED ? Txt_FORUM_Post_X_allowed : + Txt_FORUM_Post_X_banned, PstNum) < 0) Err_NotEnoughMemoryExit (); - Ico_PutIcon (Enabled ? "eye.svg" : - "eye-slash.svg", - Enabled ? Ico_GREEN : - Ico_RED, + Ico_PutIcon (Enabled == Cns_ENABLED ? "eye.svg" : + "eye-slash.svg", + Enabled == Cns_ENABLED ? Ico_GREEN : + Ico_RED, Title, "ICO_HIDDEN ICO16x16"); free (Title); @@ -1027,24 +1030,25 @@ static void For_ShowAForumPost (struct For_Forums *Forums, Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, Usr_DONT_GET_PREFS, Usr_DONT_GET_ROLE_IN_CURRENT_CRS); - Msg_WriteMsgAuthor (&UsrDat,Enabled); - if (Enabled) + Usr_WriteAuthor (&UsrDat,Enabled); + if (Enabled == Cns_ENABLED) /* Write number of posts from this user */ For_WriteNumberOfPosts (Forums,UsrDat.UsrCod); HTM_TD_End (); /***** Write post content *****/ HTM_TD_Begin ("class=\"LT MSG_TXT_%s\"",The_GetSuffix ()); - if (Enabled) - { - Str_Copy (Content,OriginalContent,sizeof (Content) - 1); - Msg_WriteMsgContent (Content,true,false); - - /***** Show image *****/ - Med_ShowMedia (&Media,"FOR_IMG_CONT","FOR_IMG"); - } - else - HTM_Txt (Txt_This_post_has_been_banned_probably_for_not_satisfy_the_rules_of_the_forums); + switch (Enabled) + { + case Cns_DISABLED: + HTM_Txt (Txt_This_post_has_been_banned_probably_for_not_satisfy_the_rules_of_the_forums); + break; + case Cns_ENABLED: + Str_Copy (Content,OriginalContent,sizeof (Content) - 1); + Msg_WriteMsgContent (Content,true,false); + Med_ShowMedia (&Media,"FOR_IMG_CONT","FOR_IMG"); + break; + } HTM_TD_End (); HTM_TR_End (); @@ -2294,7 +2298,7 @@ static void For_ListForumThrs (struct For_Forums *Forums, Usr_DONT_GET_ROLE_IN_CURRENT_CRS); HTM_TD_Begin ("class=\"LT %s_%s %s\"", Class,The_GetSuffix (),BgColor); - Msg_WriteMsgAuthor (&UsrDat,Thr.Enabled[Order]); + Usr_WriteAuthor (&UsrDat,Thr.Enabled[Order]); HTM_TD_End (); /* Write the date of first or last message (it's in YYYYMMDDHHMMSS format) */ @@ -2398,7 +2402,7 @@ void For_GetThreadData (struct For_Thread *Thr) for (Order = (Dat_StartEndTime_t) 0; Order <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1); Order++) - Thr->Enabled[Order] = !For_DB_GetIfPstIsDisabled (Thr->PstCod[Order]); + Thr->Enabled[Order] = For_DB_GetIfPstIsEnabled (Thr->PstCod[Order]); /***** Get number of posts in this thread *****/ Thr->NumPosts = For_DB_GetNumPstsInThr (Thr->ThrCod); diff --git a/swad_forum.h b/swad_forum.h index de7fc3ed..9d2650ec 100644 --- a/swad_forum.h +++ b/swad_forum.h @@ -77,7 +77,7 @@ struct For_Thread long PstCod[Dat_NUM_START_END_TIME]; long UsrCod[Dat_NUM_START_END_TIME]; time_t WriteTime[Dat_NUM_START_END_TIME]; - bool Enabled[Dat_NUM_START_END_TIME]; + Cns_Enabled_t Enabled[Dat_NUM_START_END_TIME]; char Subject[Cns_MAX_BYTES_SUBJECT + 1]; unsigned NumPosts; unsigned NumUnreadPosts; // Number of my unread posts in thread diff --git a/swad_forum_database.c b/swad_forum_database.c index 1d8935e0..8d753c98 100644 --- a/swad_forum_database.c +++ b/swad_forum_database.c @@ -969,11 +969,11 @@ void For_DB_InsertPstIntoDisabled (long PstCod) /*********************** Get if a forum post is disabled *********************/ /*****************************************************************************/ -bool For_DB_GetIfPstIsDisabled (long PstCod) +Cns_Enabled_t For_DB_GetIfPstIsEnabled (long PstCod) { /***** Trivial check: post code should be > 0 *****/ if (PstCod <= 0) - return true; + return Cns_DISABLED; /***** Get if post is disabled from database *****/ return @@ -982,7 +982,8 @@ bool For_DB_GetIfPstIsDisabled (long PstCod) "(SELECT *" " FROM for_disabled" " WHERE PstCod=%ld)", - PstCod); // Post is enabled if it does not appear in table of disabled posts + PstCod) ? Cns_DISABLED : + Cns_ENABLED; // Post is enabled if it does not appear in table of disabled posts } /*****************************************************************************/ diff --git a/swad_forum_database.h b/swad_forum_database.h index d9f308dd..1bf7fe3e 100644 --- a/swad_forum_database.h +++ b/swad_forum_database.h @@ -98,7 +98,7 @@ void For_DB_RemoveExpiredClipboards (void); //--------------------------- Disabled posts ---------------------------------- void For_DB_InsertPstIntoDisabled (long PstCod); -bool For_DB_GetIfPstIsDisabled (long PstCod); +Cns_Enabled_t For_DB_GetIfPstIsEnabled (long PstCod); void For_DB_RemovePstFromDisabled (long PstCod); void For_DB_RemoveDisabledPstsInThread (long ThrCod); diff --git a/swad_institution.c b/swad_institution.c index cafadecd..3756f345 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1033,7 +1033,7 @@ static void Ins_ListInstitutionsForEdition (void) Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, Usr_DONT_GET_PREFS, Usr_DONT_GET_ROLE_IN_CURRENT_CRS); - Msg_WriteMsgAuthor (&UsrDat,true); + Usr_WriteAuthor (&UsrDat,Cns_ENABLED); HTM_TD_End (); /* Institution status */ @@ -1441,7 +1441,7 @@ static void Ins_PutFormToCreateInstitution (void) /***** Institution requester *****/ HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", The_GetSuffix ()); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true); + Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED); HTM_TD_End (); /***** Institution status *****/ diff --git a/swad_message.c b/swad_message.c index a9a115ce..38da3176 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2091,7 +2091,7 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages, Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, Usr_DONT_GET_PREFS, Usr_DONT_GET_ROLE_IN_CURRENT_CRS); - Msg_WriteMsgAuthor (&UsrDat,true); + Usr_WriteAuthor (&UsrDat,Cns_ENABLED); HTM_TD_End (); /***** Subject *****/ @@ -2293,63 +2293,6 @@ static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages, HTM_TD_End (); } -/*****************************************************************************/ -/************************ Write the author of a message **********************/ -/*****************************************************************************/ -// Input: UsrDat must hold user's data - -void Msg_WriteMsgAuthor (struct Usr_Data *UsrDat,bool Enabled) - { - extern const char *Txt_Unknown_or_without_photo; - static const char *ClassPhoto[PhoSha_NUM_SHAPES] = - { - [PhoSha_SHAPE_CIRCLE ] = "PHOTOC30x40", - [PhoSha_SHAPE_ELLIPSE ] = "PHOTOE30x40", - [PhoSha_SHAPE_OVAL ] = "PHOTOO30x40", - [PhoSha_SHAPE_RECTANGLE] = "PHOTOR30x40", - }; - bool WriteAuthor; - - /***** Write author name or don't write it? *****/ - WriteAuthor = false; - if (Enabled) - if (UsrDat->UsrCod > 0) - WriteAuthor = true; - - /***** Begin table and row *****/ - HTM_TABLE_BeginPadding (2); - HTM_TR_Begin (NULL); - - /***** Begin first column with author's photo - (if author has a web page, put a link to it) *****/ - HTM_TD_Begin ("class=\"CT\" style=\"width:30px;\""); - if (WriteAuthor) - Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); - else - Ico_PutIcon ("usr_bl.jpg",Ico_UNCHANGED,Txt_Unknown_or_without_photo, - ClassPhoto[Gbl.Prefs.PhotoShape]); - HTM_TD_End (); - - /***** Second column with user name (if author has a web page, put a link to it) *****/ - if (WriteAuthor) - { - HTM_TD_Begin ("class=\"LT\""); - HTM_DIV_Begin ("class=\"AUTHOR_2_LINES\""); // Limited width - Usr_WriteFirstNameBRSurnames (UsrDat); - HTM_DIV_End (); - } - else - HTM_TD_Begin ("class=\"LM\""); - - /***** End second column *****/ - HTM_TD_End (); - - /***** End row and table *****/ - HTM_TR_End (); - HTM_TABLE_End (); - } - /*****************************************************************************/ /********************* Write course origin of a message **********************/ /*****************************************************************************/ diff --git a/swad_message.h b/swad_message.h index 33c48106..74363256 100644 --- a/swad_message.h +++ b/swad_message.h @@ -113,7 +113,6 @@ void Msg_GetNotifMessage (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], char **ContentStr,long MsgCod,bool GetContent); void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg); -void Msg_WriteMsgAuthor (struct Usr_Data *UsrDat,bool Enabled); void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassTxt,const char *ClassBg); void Msg_WriteMsgContent (char Content[Cns_MAX_BYTES_LONG_TEXT + 1], bool InsertLinks,bool ChangeBRToRet); diff --git a/swad_notification.c b/swad_notification.c index 50300ec9..743a9196 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -528,7 +528,7 @@ void Ntf_ShowMyNotifications (void) HTM_TD_Begin ("class=\"LT %s_%s %s_%s\"", ClassAuthor,The_GetSuffix (), ClassBg,The_GetSuffix ()); - Msg_WriteMsgAuthor (&UsrDat,true); + Usr_WriteAuthor (&UsrDat,Cns_ENABLED); HTM_TD_End (); /* Write location */ diff --git a/swad_pagination.c b/swad_pagination.c index 92ea8b0d..ed0ea48a 100644 --- a/swad_pagination.c +++ b/swad_pagination.c @@ -146,7 +146,7 @@ void Pag_WriteLinksToPagesCentered (Pag_WhatPaginate_t WhatPaginate, { HTM_DIV_Begin ("class=\"CM\""); Pag_WriteLinksToPages (WhatPaginate,Pagination,Context,Cod, - true,NULL,"PAG_TXT",false); // !!!!!!!!!!!!!!!!!!!!!!!!!! + Cns_ENABLED,NULL,"PAG_TXT",false); // !!!!!!!!!!!!!!!!!!!!!!!!!! HTM_DIV_End (); } } @@ -158,7 +158,7 @@ void Pag_WriteLinksToPagesCentered (Pag_WhatPaginate_t WhatPaginate, void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, struct Pag_Pagination *Pagination, const void *Context,long Cod, - bool FirstMsgEnabled, + Cns_Enabled_t FirstMsgEnabled, const char *Subject,const char *ClassTxt, bool LinkToPagCurrent) { @@ -281,10 +281,15 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, } else HTM_SPAN_Begin ("class=\"%s_%s\"",ClassTxt,The_GetSuffix ()); - if (FirstMsgEnabled) - HTM_Txt (Subject); - else - HTM_TxtF ("[%s]",Txt_FORUM_Post_banned); + switch (FirstMsgEnabled) + { + case Cns_DISABLED: + HTM_TxtF ("[%s]",Txt_FORUM_Post_banned); + break; + case Cns_ENABLED: + HTM_Txt (Subject); + break; + } if (LinkToPagCurrent) { HTM_BUTTON_End (); diff --git a/swad_pagination.h b/swad_pagination.h index 2befde79..ca6bb5ce 100644 --- a/swad_pagination.h +++ b/swad_pagination.h @@ -84,7 +84,7 @@ void Pag_WriteLinksToPagesCentered (Pag_WhatPaginate_t WhatPaginate, void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, struct Pag_Pagination *Pagination, const void *Context,long Cod, - bool FirstMsgEnabled, + Cns_Enabled_t FirstMsgEnabled, const char *Subject,const char *ClassTxt, bool LinkToPagCurrent); void Pag_PutParPagNum (Pag_WhatPaginate_t WhatPaginate,unsigned NumPage); diff --git a/swad_user.c b/swad_user.c index 3ecda3cb..a9b8ccb4 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6335,6 +6335,63 @@ unsigned Usr_GetTotalNumberOfUsers (void) } } +/*****************************************************************************/ +/******************** Write the author of a message/post/ ********************/ +/*****************************************************************************/ +// Input: UsrDat must hold user's data + +void Usr_WriteAuthor (struct Usr_Data *UsrDat,Cns_Enabled_t Enabled) + { + extern const char *Txt_Unknown_or_without_photo; + static const char *ClassPhoto[PhoSha_NUM_SHAPES] = + { + [PhoSha_SHAPE_CIRCLE ] = "PHOTOC30x40", + [PhoSha_SHAPE_ELLIPSE ] = "PHOTOE30x40", + [PhoSha_SHAPE_OVAL ] = "PHOTOO30x40", + [PhoSha_SHAPE_RECTANGLE] = "PHOTOR30x40", + }; + bool WriteAuthor; + + /***** Write author name or don't write it? *****/ + WriteAuthor = false; + if (Enabled == Cns_ENABLED) + if (UsrDat->UsrCod > 0) + WriteAuthor = true; + + /***** Begin table and row *****/ + HTM_TABLE_BeginPadding (2); + HTM_TR_Begin (NULL); + + /***** Begin first column with author's photo + (if author has a web page, put a link to it) *****/ + HTM_TD_Begin ("class=\"CT\" style=\"width:30px;\""); + if (WriteAuthor) + Pho_ShowUsrPhotoIfAllowed (UsrDat, + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); + else + Ico_PutIcon ("usr_bl.jpg",Ico_UNCHANGED,Txt_Unknown_or_without_photo, + ClassPhoto[Gbl.Prefs.PhotoShape]); + HTM_TD_End (); + + /***** Second column with user name (if author has a web page, put a link to it) *****/ + if (WriteAuthor) + { + HTM_TD_Begin ("class=\"LT\""); + HTM_DIV_Begin ("class=\"AUTHOR_2_LINES\""); // Limited width + Usr_WriteFirstNameBRSurnames (UsrDat); + HTM_DIV_End (); + } + else + HTM_TD_Begin ("class=\"LM\""); + + /***** End second column *****/ + HTM_TD_End (); + + /***** End row and table *****/ + HTM_TR_End (); + HTM_TABLE_End (); + } + /*****************************************************************************/ /********************* Write the author of an assignment *********************/ /*****************************************************************************/ diff --git a/swad_user.h b/swad_user.h index 2cf7b55d..3d04a86b 100644 --- a/swad_user.h +++ b/swad_user.h @@ -433,6 +433,7 @@ void Usr_ShowWarningNoUsersFound (Rol_Role_t Role); unsigned Usr_GetTotalNumberOfUsers (void); +void Usr_WriteAuthor (struct Usr_Data *UsrDat,Cns_Enabled_t Enabled); void Usr_WriteAuthor1Line (long UsrCod,bool Hidden); void Usr_ShowTableCellWithUsrData (struct Usr_Data *UsrDat,unsigned NumRows);