From 2e2f372f7477f1cbc0823bc1ec14633820e90e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 6 Dec 2016 21:08:28 +0100 Subject: [PATCH] Version 16.90 --- swad_action.c | 189 ++++++++++++------------- swad_action.h | 141 +++++++++---------- swad_agenda.c | 346 ++++++++++++++++++++-------------------------- swad_agenda.h | 2 +- swad_changelog.h | 6 +- swad_global.c | 3 - swad_global.h | 1 - swad_pagination.c | 60 +++++--- swad_pagination.h | 5 +- 9 files changed, 366 insertions(+), 387 deletions(-) diff --git a/swad_action.c b/swad_action.c index 3857eb97a..d694acdff 100644 --- a/swad_action.c +++ b/swad_action.c @@ -80,7 +80,7 @@ extern struct Globals Gbl; /************************ Internal global variables **************************/ /*****************************************************************************/ /* -1237 actions in one CGI: +1238 actions in one CGI: 0. ActAll Any action (used for statistics) 1. ActUnk Unknown action 2. ActHom Show home menu @@ -1331,109 +1331,110 @@ Profile: 1144. ActFrmRolSes Show form to log out and to change current role in this session 1145. ActMyCrs Select one of my courses 1146. ActSeeMyTT Show the timetable of all courses of the logged user - 1147. ActSeeMyAgd Show my agenda (personal organizer) - 1148. ActFrmMyAcc Show form to the creation or change of user's account - 1149. ActReqEdiRecCom Request the edition of the record with the personal data of the user - 1150. ActEdiPrf Show forms to edit preferences - 1151. ActAdmBrf Show the briefcase of private archives + 1147. ActSeeMyAgd Show my full agenda (personal organizer) + 1148. ActSeeMyPubAgd Show my public agenda (personal organizer) + 1149. ActFrmMyAcc Show form to the creation or change of user's account + 1150. ActReqEdiRecCom Request the edition of the record with the personal data of the user + 1151. ActEdiPrf Show forms to edit preferences + 1152. ActAdmBrf Show the briefcase of private archives - 1152. ActReqSndNewPwd Show form to send a new password via email - 1153. ActSndNewPwd Send a new password via email - 1154. ActLogOut Close session + 1153. ActReqSndNewPwd Show form to send a new password via email + 1154. ActSndNewPwd Send a new password via email + 1155. ActLogOut Close session - 1155. ActLogIn Authentify user internally (directly from the platform) - 1156. ActLogInNew Authentify user internally (directly from the platform, only if user has not password) - 1157. ActLogInLan Change language to my language just after authentication - 1158. ActAnnSee Mark announcement as seen - 1159. ActChgMyRol Change type of logged user + 1156. ActLogIn Authentify user internally (directly from the platform) + 1157. ActLogInNew Authentify user internally (directly from the platform, only if user has not password) + 1158. ActLogInLan Change language to my language just after authentication + 1159. ActAnnSee Mark announcement as seen + 1160. ActChgMyRol Change type of logged user - 1160. ActFrmNewEvtMyAgd Form to create a new event in my agenda - 1161. ActEdiOneEvtMyAgd Edit one event from my agenda - 1162. ActNewEvtMyAgd Create a new event in my agenda - 1163. ActChgEvtMyAgd Modify data of an event from my agenda - 1164. ActReqRemEvtMyAgd Request the removal of an event from my agenda - 1165. ActRemEvtMyAgd Remove an event from my agenda - 1166. ActHidEvtMyAgd Hide an event from my agenda - 1167. ActShoEvtMyAgd Show an event from my agenda - 1168. ActPrvEvtMyAgd Make private an event from my agenda - 1169. ActPubEvtMyAgd Make public an event from my agenda + 1161. ActFrmNewEvtMyAgd Form to create a new event in my agenda + 1162. ActEdiOneEvtMyAgd Edit one event from my agenda + 1163. ActNewEvtMyAgd Create a new event in my agenda + 1164. ActChgEvtMyAgd Modify data of an event from my agenda + 1165. ActReqRemEvtMyAgd Request the removal of an event from my agenda + 1166. ActRemEvtMyAgd Remove an event from my agenda + 1167. ActHidEvtMyAgd Hide an event from my agenda + 1168. ActShoEvtMyAgd Show an event from my agenda + 1169. ActPrvEvtMyAgd Make private an event from my agenda + 1170. ActPubEvtMyAgd Make public an event from my agenda - 1170. ActChkUsrAcc Check if already exists a new account without password associated to a ID - 1171. ActCreUsrAcc Create new user account - 1172. ActRemID_Me Remove one of my user's IDs - 1173. ActNewIDMe Create a new user's ID for me - 1174. ActRemOldNic Remove one of my old nicknames - 1175. ActChgNic Change my nickname - 1176. ActRemMaiMe Remove one of my old emails - 1177. ActNewMaiMe Change my email address - 1178. ActCnfMai Confirm email address - 1179. ActFrmChgMyPwd Show form to the change of the password - 1180. ActChgPwd Change the password - 1181. ActReqRemMyAcc Request the removal of my account - 1182. ActRemMyAcc Remove my account + 1171. ActChkUsrAcc Check if already exists a new account without password associated to a ID + 1172. ActCreUsrAcc Create new user account + 1173. ActRemID_Me Remove one of my user's IDs + 1174. ActNewIDMe Create a new user's ID for me + 1175. ActRemOldNic Remove one of my old nicknames + 1176. ActChgNic Change my nickname + 1177. ActRemMaiMe Remove one of my old emails + 1178. ActNewMaiMe Change my email address + 1179. ActCnfMai Confirm email address + 1180. ActFrmChgMyPwd Show form to the change of the password + 1181. ActChgPwd Change the password + 1182. ActReqRemMyAcc Request the removal of my account + 1183. ActRemMyAcc Remove my account - 1183. ActChgMyData Update my personal data + 1184. ActChgMyData Update my personal data - 1184. ActReqMyPho Show form to send my photo - 1185. ActDetMyPho Receive my photo and detect faces on it - 1186. ActUpdMyPho Update my photo - 1187. ActReqRemMyPho Request the removal of my photo - 1188. ActRemMyPho Remove my photo + 1185. ActReqMyPho Show form to send my photo + 1186. ActDetMyPho Receive my photo and detect faces on it + 1187. ActUpdMyPho Update my photo + 1188. ActReqRemMyPho Request the removal of my photo + 1189. ActRemMyPho Remove my photo - 1189. ActEdiPri Edit my privacy - 1190. ActChgPriPho Change privacy of my photo - 1191. ActChgPriPrf Change privacy of my public profile + 1190. ActEdiPri Edit my privacy + 1191. ActChgPriPho Change privacy of my photo + 1192. ActChgPriPrf Change privacy of my public profile - 1192. ActReqEdiMyIns Request the edition of my institution, centre and department - 1193. ActChgCtyMyIns Change the country of my institution - 1194. ActChgMyIns Change my institution - 1195. ActChgMyCtr Change my centre - 1196. ActChgMyDpt Change my department - 1197. ActChgMyOff Change my office - 1198. ActChgMyOffPho Change my office phone + 1193. ActReqEdiMyIns Request the edition of my institution, centre and department + 1194. ActChgCtyMyIns Change the country of my institution + 1195. ActChgMyIns Change my institution + 1196. ActChgMyCtr Change my centre + 1197. ActChgMyDpt Change my department + 1198. ActChgMyOff Change my office + 1199. ActChgMyOffPho Change my office phone - 1199. ActReqEdiMyNet Request the edition of my social networks - 1200. ActChgMyNet Change my web and social networks + 1200. ActReqEdiMyNet Request the edition of my social networks + 1201. ActChgMyNet Change my web and social networks - 1201. ActChgThe Change theme - 1202. ActReqChgLan Ask if change language - 1203. ActChgLan Change language - 1204. ActChg1stDay Change first day of the week - 1205. ActChgCol Change side columns - 1206. ActHidLftCol Hide left side column - 1207. ActHidRgtCol Hide right side column - 1208. ActShoLftCol Show left side column - 1209. ActShoRgtCol Show right side column - 1210. ActChgIco Change icon set - 1211. ActChgMnu Change menu - 1212. ActChgNtfPrf Change whether to notify by email new messages - 1213. ActPrnUsrQR Show my QR code ready to print + 1202. ActChgThe Change theme + 1203. ActReqChgLan Ask if change language + 1204. ActChgLan Change language + 1205. ActChg1stDay Change first day of the week + 1206. ActChgCol Change side columns + 1207. ActHidLftCol Hide left side column + 1208. ActHidRgtCol Hide right side column + 1209. ActShoLftCol Show left side column + 1210. ActShoRgtCol Show right side column + 1211. ActChgIco Change icon set + 1212. ActChgMnu Change menu + 1213. ActChgNtfPrf Change whether to notify by email new messages + 1214. ActPrnUsrQR Show my QR code ready to print - 1214. ActPrnMyTT Show the timetable listo to impresión of all my courses - 1215. ActEdiTut Edit the timetable of tutorías - 1216. ActChgTut Modify the timetable of tutorías - 1217. ActChgMyTT1stDay Change first day of week and show timetable of the course + 1215. ActPrnMyTT Show the timetable listo to impresión of all my courses + 1216. ActEdiTut Edit the timetable of tutorías + 1217. ActChgTut Modify the timetable of tutorías + 1218. ActChgMyTT1stDay Change first day of week and show timetable of the course - 1218. ActReqRemFilBrf Request removal of a file of the briefcase - 1219. ActRemFilBrf Remove a file of the briefcase - 1220. ActRemFolBrf Remove a folder empty of the briefcase - 1221. ActCopBrf Set source of copy in the briefcase - 1222. ActPasBrf Paste a folder or file in the briefcase - 1223. ActRemTreBrf Remove a folder no empty of the briefcase - 1224. ActFrmCreBrf Form to crear a folder or file in the briefcase - 1225. ActCreFolBrf Create a new folder in the briefcase - 1226. ActCreLnkBrf Create a new link in the briefcase - 1227. ActRenFolBrf Rename a folder of the briefcase - 1228. ActRcvFilBrfDZ Receive a file in the briefcase using Dropzone.js - 1229. ActRcvFilBrfCla Receive a file in the briefcase using the classic way - 1230. ActExpBrf Expand a folder in briefcase - 1231. ActConBrf Contract a folder in briefcase - 1232. ActZIPBrf Compress a folder in briefcase - 1233. ActReqDatBrf Ask for metadata of a file in the briefcase - 1234. ActChgDatBrf Change metadata of a file in the briefcase - 1235. ActDowBrf Download a file in the briefcase - 1236. ActReqRemOldBrf Ask for removing old files in the briefcase - 1237. ActRemOldBrf Remove old files in the briefcase + 1219. ActReqRemFilBrf Request removal of a file of the briefcase + 1220. ActRemFilBrf Remove a file of the briefcase + 1221. ActRemFolBrf Remove a folder empty of the briefcase + 1222. ActCopBrf Set source of copy in the briefcase + 1223. ActPasBrf Paste a folder or file in the briefcase + 1224. ActRemTreBrf Remove a folder no empty of the briefcase + 1225. ActFrmCreBrf Form to crear a folder or file in the briefcase + 1226. ActCreFolBrf Create a new folder in the briefcase + 1227. ActCreLnkBrf Create a new link in the briefcase + 1228. ActRenFolBrf Rename a folder of the briefcase + 1229. ActRcvFilBrfDZ Receive a file in the briefcase using Dropzone.js + 1230. ActRcvFilBrfCla Receive a file in the briefcase using the classic way + 1231. ActExpBrf Expand a folder in briefcase + 1232. ActConBrf Contract a folder in briefcase + 1233. ActZIPBrf Compress a folder in briefcase + 1234. ActReqDatBrf Ask for metadata of a file in the briefcase + 1235. ActChgDatBrf Change metadata of a file in the briefcase + 1236. ActDowBrf Download a file in the briefcase + 1237. ActReqRemOldBrf Ask for removing old files in the briefcase + 1238. ActRemOldBrf Remove old files in the briefcase */ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = @@ -2811,9 +2812,10 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqRemEvtMyAgd */{1607,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_AskRemEvent ,NULL}, /* ActRemEvtMyAgd */{1608,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_RemoveEvent ,NULL}, /* ActHidEvtMyAgd */{1612,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_HideEvent ,NULL}, - /* ActShoEvtMyAgd */{1613,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_UnhideEvent ,NULL}, + /* ActShoEvtMyAgd */{1613,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_UnhideEvent ,NULL}, /* ActPrvEvtMyAgd */{1609,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_MakeEventPrivate ,NULL}, /* ActPubEvtMyAgd */{1610,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_MakeEventPublic ,NULL}, + /* ActSeeMyPubAgd */{1617,-1,TabUnk,ActSeeMyAgd ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Agd_ShowMyPublicAgenda ,NULL}, /* ActChkUsrAcc */{1584,-1,TabUnk,ActFrmMyAcc ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Acc_CheckIfEmptyAccountExists ,NULL}, /* ActCreUsrAcc */{1163,-1,TabUnk,ActFrmMyAcc ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Acc_AfterCreationNewAccount ,NULL}, @@ -4521,6 +4523,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActFrmLogInUsrAgd, // #1614 ActLogInUsrAgd, // #1615 ActLogInUsrAgdLan, // #1616 + ActSeeMyPubAgd, // #1617 }; /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index 4cb6d34d6..2bf29a51d 100644 --- a/swad_action.h +++ b/swad_action.h @@ -55,9 +55,9 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1+9+51+14+93+73+70+249+186+159+172+36+31+95) +#define Act_NUM_ACTIONS (1+9+51+14+93+73+70+249+186+159+172+36+31+96) -#define Act_MAX_ACTION_COD 1616 +#define Act_MAX_ACTION_COD 1617 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 11 @@ -1395,84 +1395,85 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica #define ActShoEvtMyAgd (ActSeeMyUsgRep+25) #define ActPrvEvtMyAgd (ActSeeMyUsgRep+26) #define ActPubEvtMyAgd (ActSeeMyUsgRep+27) -#define ActChkUsrAcc (ActSeeMyUsgRep+28) -#define ActCreUsrAcc (ActSeeMyUsgRep+29) -#define ActRemID_Me (ActSeeMyUsgRep+30) -#define ActNewIDMe (ActSeeMyUsgRep+31) -#define ActRemOldNic (ActSeeMyUsgRep+32) -#define ActChgNic (ActSeeMyUsgRep+33) -#define ActRemMaiMe (ActSeeMyUsgRep+34) -#define ActNewMaiMe (ActSeeMyUsgRep+35) -#define ActCnfMai (ActSeeMyUsgRep+36) -#define ActFrmChgMyPwd (ActSeeMyUsgRep+37) -#define ActChgPwd (ActSeeMyUsgRep+38) -#define ActReqRemMyAcc (ActSeeMyUsgRep+39) -#define ActRemMyAcc (ActSeeMyUsgRep+40) +#define ActSeeMyPubAgd (ActSeeMyUsgRep+28) +#define ActChkUsrAcc (ActSeeMyUsgRep+29) +#define ActCreUsrAcc (ActSeeMyUsgRep+30) +#define ActRemID_Me (ActSeeMyUsgRep+31) +#define ActNewIDMe (ActSeeMyUsgRep+32) +#define ActRemOldNic (ActSeeMyUsgRep+33) +#define ActChgNic (ActSeeMyUsgRep+34) +#define ActRemMaiMe (ActSeeMyUsgRep+35) +#define ActNewMaiMe (ActSeeMyUsgRep+36) +#define ActCnfMai (ActSeeMyUsgRep+37) +#define ActFrmChgMyPwd (ActSeeMyUsgRep+38) +#define ActChgPwd (ActSeeMyUsgRep+39) +#define ActReqRemMyAcc (ActSeeMyUsgRep+40) +#define ActRemMyAcc (ActSeeMyUsgRep+41) -#define ActChgMyData (ActSeeMyUsgRep+41) +#define ActChgMyData (ActSeeMyUsgRep+42) -#define ActReqMyPho (ActSeeMyUsgRep+42) -#define ActDetMyPho (ActSeeMyUsgRep+43) -#define ActUpdMyPho (ActSeeMyUsgRep+44) -#define ActReqRemMyPho (ActSeeMyUsgRep+45) -#define ActRemMyPho (ActSeeMyUsgRep+46) +#define ActReqMyPho (ActSeeMyUsgRep+43) +#define ActDetMyPho (ActSeeMyUsgRep+44) +#define ActUpdMyPho (ActSeeMyUsgRep+45) +#define ActReqRemMyPho (ActSeeMyUsgRep+46) +#define ActRemMyPho (ActSeeMyUsgRep+47) -#define ActEdiPri (ActSeeMyUsgRep+47) -#define ActChgPriPho (ActSeeMyUsgRep+48) -#define ActChgPriPrf (ActSeeMyUsgRep+49) +#define ActEdiPri (ActSeeMyUsgRep+48) +#define ActChgPriPho (ActSeeMyUsgRep+49) +#define ActChgPriPrf (ActSeeMyUsgRep+50) -#define ActReqEdiMyIns (ActSeeMyUsgRep+50) -#define ActChgCtyMyIns (ActSeeMyUsgRep+51) -#define ActChgMyIns (ActSeeMyUsgRep+52) -#define ActChgMyCtr (ActSeeMyUsgRep+53) -#define ActChgMyDpt (ActSeeMyUsgRep+54) -#define ActChgMyOff (ActSeeMyUsgRep+55) -#define ActChgMyOffPho (ActSeeMyUsgRep+56) +#define ActReqEdiMyIns (ActSeeMyUsgRep+51) +#define ActChgCtyMyIns (ActSeeMyUsgRep+52) +#define ActChgMyIns (ActSeeMyUsgRep+53) +#define ActChgMyCtr (ActSeeMyUsgRep+54) +#define ActChgMyDpt (ActSeeMyUsgRep+55) +#define ActChgMyOff (ActSeeMyUsgRep+56) +#define ActChgMyOffPho (ActSeeMyUsgRep+57) -#define ActReqEdiMyNet (ActSeeMyUsgRep+57) -#define ActChgMyNet (ActSeeMyUsgRep+58) +#define ActReqEdiMyNet (ActSeeMyUsgRep+58) +#define ActChgMyNet (ActSeeMyUsgRep+59) -#define ActChgThe (ActSeeMyUsgRep+59) -#define ActReqChgLan (ActSeeMyUsgRep+60) -#define ActChgLan (ActSeeMyUsgRep+61) -#define ActChg1stDay (ActSeeMyUsgRep+62) -#define ActChgCol (ActSeeMyUsgRep+63) -#define ActHidLftCol (ActSeeMyUsgRep+64) -#define ActHidRgtCol (ActSeeMyUsgRep+65) -#define ActShoLftCol (ActSeeMyUsgRep+66) -#define ActShoRgtCol (ActSeeMyUsgRep+67) -#define ActChgIco (ActSeeMyUsgRep+68) -#define ActChgMnu (ActSeeMyUsgRep+69) -#define ActChgNtfPrf (ActSeeMyUsgRep+70) +#define ActChgThe (ActSeeMyUsgRep+60) +#define ActReqChgLan (ActSeeMyUsgRep+61) +#define ActChgLan (ActSeeMyUsgRep+62) +#define ActChg1stDay (ActSeeMyUsgRep+63) +#define ActChgCol (ActSeeMyUsgRep+64) +#define ActHidLftCol (ActSeeMyUsgRep+65) +#define ActHidRgtCol (ActSeeMyUsgRep+66) +#define ActShoLftCol (ActSeeMyUsgRep+67) +#define ActShoRgtCol (ActSeeMyUsgRep+68) +#define ActChgIco (ActSeeMyUsgRep+69) +#define ActChgMnu (ActSeeMyUsgRep+70) +#define ActChgNtfPrf (ActSeeMyUsgRep+71) -#define ActPrnUsrQR (ActSeeMyUsgRep+71) +#define ActPrnUsrQR (ActSeeMyUsgRep+72) -#define ActPrnMyTT (ActSeeMyUsgRep+72) -#define ActEdiTut (ActSeeMyUsgRep+73) -#define ActChgTut (ActSeeMyUsgRep+74) -#define ActChgMyTT1stDay (ActSeeMyUsgRep+75) +#define ActPrnMyTT (ActSeeMyUsgRep+73) +#define ActEdiTut (ActSeeMyUsgRep+74) +#define ActChgTut (ActSeeMyUsgRep+75) +#define ActChgMyTT1stDay (ActSeeMyUsgRep+76) -#define ActReqRemFilBrf (ActSeeMyUsgRep+76) -#define ActRemFilBrf (ActSeeMyUsgRep+77) -#define ActRemFolBrf (ActSeeMyUsgRep+78) -#define ActCopBrf (ActSeeMyUsgRep+79) -#define ActPasBrf (ActSeeMyUsgRep+80) -#define ActRemTreBrf (ActSeeMyUsgRep+81) -#define ActFrmCreBrf (ActSeeMyUsgRep+82) -#define ActCreFolBrf (ActSeeMyUsgRep+83) -#define ActCreLnkBrf (ActSeeMyUsgRep+84) -#define ActRenFolBrf (ActSeeMyUsgRep+85) -#define ActRcvFilBrfDZ (ActSeeMyUsgRep+86) -#define ActRcvFilBrfCla (ActSeeMyUsgRep+87) -#define ActExpBrf (ActSeeMyUsgRep+88) -#define ActConBrf (ActSeeMyUsgRep+89) -#define ActZIPBrf (ActSeeMyUsgRep+90) -#define ActReqDatBrf (ActSeeMyUsgRep+91) -#define ActChgDatBrf (ActSeeMyUsgRep+92) -#define ActDowBrf (ActSeeMyUsgRep+93) +#define ActReqRemFilBrf (ActSeeMyUsgRep+77) +#define ActRemFilBrf (ActSeeMyUsgRep+78) +#define ActRemFolBrf (ActSeeMyUsgRep+79) +#define ActCopBrf (ActSeeMyUsgRep+80) +#define ActPasBrf (ActSeeMyUsgRep+81) +#define ActRemTreBrf (ActSeeMyUsgRep+82) +#define ActFrmCreBrf (ActSeeMyUsgRep+83) +#define ActCreFolBrf (ActSeeMyUsgRep+84) +#define ActCreLnkBrf (ActSeeMyUsgRep+85) +#define ActRenFolBrf (ActSeeMyUsgRep+86) +#define ActRcvFilBrfDZ (ActSeeMyUsgRep+87) +#define ActRcvFilBrfCla (ActSeeMyUsgRep+88) +#define ActExpBrf (ActSeeMyUsgRep+89) +#define ActConBrf (ActSeeMyUsgRep+90) +#define ActZIPBrf (ActSeeMyUsgRep+91) +#define ActReqDatBrf (ActSeeMyUsgRep+92) +#define ActChgDatBrf (ActSeeMyUsgRep+93) +#define ActDowBrf (ActSeeMyUsgRep+94) -#define ActReqRemOldBrf (ActSeeMyUsgRep+94) -#define ActRemOldBrf (ActSeeMyUsgRep+95) +#define ActReqRemOldBrf (ActSeeMyUsgRep+95) +#define ActRemOldBrf (ActSeeMyUsgRep+96) /*****************************************************************************/ /******************************** Public types *******************************/ diff --git a/swad_agenda.c b/swad_agenda.c index 176dda946..c2f520fa8 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -55,13 +55,15 @@ extern struct Globals Gbl; /******************************* Private types *******************************/ /*****************************************************************************/ -#define Agd_NUM_AGENDA_TYPES 4 +#define Agd_NUM_AGENDA_TYPES 6 typedef enum { - Agd_USR_AGENDA_TODAY, - Agd_USR_AGENDA, - Agd_MY_AGENDA_TODAY, - Agd_MY_AGENDA, + Agd_OTHER_PUBLIC_AGENDA_TODAY, + Agd_OTHER_PUBLIC_AGENDA, + Agd_MY_FULL_AGENDA_TODAY, + Agd_MY_FULL_AGENDA, + Agd_MY_PUBLIC_AGENDA_TODAY, + Agd_MY_PUBLIC_AGENDA, } Agd_AgendaType_t; /*****************************************************************************/ @@ -73,17 +75,20 @@ typedef enum /*****************************************************************************/ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType); -static void Agd_ShowEventsNow (Agd_AgendaType_t AgendaType); +static void Agd_ShowEventsToday (Agd_AgendaType_t AgendaType); static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType); -static void Agd_PutIconToViewEditMyAgenda (void); -static void Agd_PutIconsListEvents (void); +static void Agd_PutIconsMyFullAgenda (void); +static void Agd_PutIconsMyPublicAgenda (void); +static void Agd_PutIconToViewMyPublicAgenda (void); static void Agd_PutIconToCreateNewEvent (void); +static void Agd_PutIconToViewEditMyFullAgenda (void); static void Agd_PutIconToShowQR (void); + static void Agd_PutButtonToCreateNewEvent (void); static void Agd_PutParamsToCreateNewEvent (void); -static void Agd_ShowFormToSelWhichEvents (Act_Action_t Action); -static void Agd_GetParamWhichEvents (void); +// static void Agd_ShowFormToSelWhichEvents (Act_Action_t Action); +// static void Agd_GetParamWhichEvents (void); static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod); static void Agd_WriteEventAuthor (struct AgendaEvent *AgdEvent); static void Agd_GetParamEventOrderType (void); @@ -142,15 +147,15 @@ void Agd_ShowUsrAgendaAfterLogIn (void) sprintf (Gbl.Title,Txt_Public_agenda_USER,Gbl.Usrs.Other.UsrDat.FullName); ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); Lay_StartRoundFrame ("100%",Gbl.Title, - ItsMe ? Agd_PutIconToViewEditMyAgenda : + ItsMe ? Agd_PutIconToViewEditMyFullAgenda : NULL, Hlp_USERS_Teachers_agenda); /***** Show the current events in the user's agenda *****/ - Agd_ShowEventsNow (Agd_USR_AGENDA_TODAY); + Agd_ShowEventsToday (Agd_OTHER_PUBLIC_AGENDA_TODAY); /***** Show all the visible events in the user's agenda *****/ - Agd_ShowEvents (Agd_USR_AGENDA); + Agd_ShowEvents (Agd_OTHER_PUBLIC_AGENDA); /***** End frame *****/ Lay_EndRoundFrame (); @@ -183,15 +188,15 @@ void Agd_ShowUsrAgenda (void) sprintf (Gbl.Title,Txt_Public_agenda_USER,Gbl.Usrs.Other.UsrDat.FullName); ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod); Lay_StartRoundFrame ("100%",Gbl.Title, - ItsMe ? Agd_PutIconToViewEditMyAgenda : + ItsMe ? Agd_PutIconToViewEditMyFullAgenda : NULL, Hlp_USERS_Teachers_agenda); /***** Show the current events in the user's agenda *****/ - Agd_ShowEventsNow (Agd_USR_AGENDA_TODAY); + Agd_ShowEventsToday (Agd_OTHER_PUBLIC_AGENDA_TODAY); /***** Show all the visible events in the user's agenda *****/ - Agd_ShowEvents (Agd_USR_AGENDA); + Agd_ShowEvents (Agd_OTHER_PUBLIC_AGENDA); /***** End frame *****/ Lay_EndRoundFrame (); @@ -210,36 +215,39 @@ void Agd_ShowMyAgenda (void) extern const char *Txt_My_agenda; extern const char *Txt_Public_agenda_USER; - /***** Get whether to show all events or only my events ******/ - Agd_GetParamWhichEvents (); - /***** Start frame *****/ - switch (Gbl.Agenda.WhichEvents) - { - case Agd_ALL_EVENTS: - Lay_StartRoundFrame ("100%",Txt_My_agenda, - Agd_PutIconsListEvents, - Hlp_PROFILE_Agenda); - break; - case Agd_ONLY_PUBLIC_EVENTS: - sprintf (Gbl.Title,Txt_Public_agenda_USER,Gbl.Usrs.Me.UsrDat.FullName); - Lay_StartRoundFrame ("100%",Gbl.Title, - Agd_PutIconsListEvents, - Hlp_PROFILE_Agenda); - break; - } - - /***** Put form to choice whether to show - all events or only public events *****/ - Act_FormStart (ActSeeMyAgd); - Agd_ShowFormToSelWhichEvents (ActSeeMyAgd); - Act_FormEnd (); + Lay_StartRoundFrame ("100%",Txt_My_agenda, + Agd_PutIconsMyFullAgenda,Hlp_PROFILE_Agenda); /***** Show the current events in the user's agenda *****/ - Agd_ShowEventsNow (Agd_MY_AGENDA_TODAY); + Agd_ShowEventsToday (Agd_MY_FULL_AGENDA_TODAY); /***** Show all my events *****/ - Agd_ShowEvents (Agd_MY_AGENDA); + Agd_ShowEvents (Agd_MY_FULL_AGENDA); + + /***** End frame *****/ + Lay_EndRoundFrame (); + } + +/*****************************************************************************/ +/*************************** Show my public agenda ***************************/ +/*****************************************************************************/ + +void Agd_ShowMyPublicAgenda (void) + { + extern const char *Hlp_PROFILE_Agenda; + extern const char *Txt_Public_agenda_USER; + + /***** Start frame *****/ + sprintf (Gbl.Title,Txt_Public_agenda_USER,Gbl.Usrs.Me.UsrDat.FullName); + Lay_StartRoundFrame ("100%",Gbl.Title, + Agd_PutIconsMyPublicAgenda,Hlp_PROFILE_Agenda); + + /***** Show the current events in the user's agenda *****/ + Agd_ShowEventsToday (Agd_MY_PUBLIC_AGENDA_TODAY); + + /***** Show all my events *****/ + Agd_ShowEvents (Agd_MY_PUBLIC_AGENDA); /***** End frame *****/ Lay_EndRoundFrame (); @@ -259,10 +267,12 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType) unsigned NumEvent; Pag_WhatPaginate_t WhatPaginate[Agd_NUM_AGENDA_TYPES] = { - Pag_USR_AGENDA, // Agd_USR_AGENDA_NOW, not used - Pag_USR_AGENDA, // Agd_USR_AGENDA - Pag_MY_AGENDA, // Agd_MY_AGENDA_NOW, not used - Pag_MY_AGENDA, // Agd_MY_AGENDA + Pag_OTHER_PUBLIC_AGENDA, // Agd_OTHER_PUBLIC_AGENDA_TODAY, not used + Pag_OTHER_PUBLIC_AGENDA, // Agd_OTHER_PUBLIC_AGENDA + Pag_MY_FULL_AGENDA, // Agd_MY_FULL_AGENDA_TODAY, not used + Pag_MY_FULL_AGENDA, // Agd_MY_FULL_AGENDA + Pag_MY_PUBLIC_AGENDA, // Agd_MY_PUBLIC_AGENDA_TODAY, not used + Pag_MY_PUBLIC_AGENDA, // Agd_MY_PUBLIC_AGENDA }; /***** Get parameters *****/ @@ -307,8 +317,7 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType) Pag_WriteLinksToPagesCentered (WhatPaginate[AgendaType],0,&Pagination); /***** Button to create a new event *****/ - if (AgendaType == Agd_MY_AGENDA && - Gbl.Agenda.WhichEvents == Agd_ALL_EVENTS) + if (AgendaType == Agd_MY_FULL_AGENDA) Agd_PutButtonToCreateNewEvent (); /***** Free list of events *****/ @@ -316,10 +325,10 @@ static void Agd_ShowEvents (Agd_AgendaType_t AgendaType) } /*****************************************************************************/ -/*********************** Show current events in agenda ***********************/ +/************************ Show today events in agenda ************************/ /*****************************************************************************/ -static void Agd_ShowEventsNow (Agd_AgendaType_t AgendaType) +static void Agd_ShowEventsToday (Agd_AgendaType_t AgendaType) { extern const char *Hlp_PROFILE_Agenda; extern const char *Hlp_USERS_Teachers_agenda; @@ -340,21 +349,20 @@ static void Agd_ShowEventsNow (Agd_AgendaType_t AgendaType) /***** Start frame *****/ switch (AgendaType) { - case Agd_USR_AGENDA_TODAY: + case Agd_OTHER_PUBLIC_AGENDA_TODAY: Lay_StartRoundFrameTableShadow (NULL,Txt_Today, NULL, Hlp_USERS_Teachers_agenda, 2); break; - case Agd_USR_AGENDA: // Not applicable - break; - case Agd_MY_AGENDA_TODAY: + case Agd_MY_FULL_AGENDA_TODAY: + case Agd_MY_PUBLIC_AGENDA_TODAY: Lay_StartRoundFrameTableShadow (NULL,Txt_Today, NULL, Hlp_PROFILE_Agenda, 2); break; - case Agd_MY_AGENDA: // Not applicable + default: break; } @@ -396,17 +404,20 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) fprintf (Gbl.F.Out,""); switch (AgendaType) { - case Agd_USR_AGENDA_TODAY: - case Agd_USR_AGENDA: + case Agd_OTHER_PUBLIC_AGENDA_TODAY: + case Agd_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Usr_PutParamOtherUsrCodEncrypted (); break; - case Agd_MY_AGENDA_TODAY: - case Agd_MY_AGENDA: + case Agd_MY_FULL_AGENDA_TODAY: + case Agd_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); break; + case Agd_MY_PUBLIC_AGENDA_TODAY: + case Agd_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + break; } - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); Act_LinkFormSubmit (Txt_ASG_ATT_SVY_OR_AGD_HELP_ORDER[Order],"TIT_TBL",NULL); @@ -431,37 +442,41 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) } /*****************************************************************************/ -/*************** Put contextual icon to view/edit my agenda ******************/ +/********************** Put contextual icons in agenda ***********************/ /*****************************************************************************/ -static void Agd_PutIconToViewEditMyAgenda (void) - { - extern const char *Txt_Edit; - - /***** Put icon to view/edit my agenda *****/ - Lay_PutContextualLink (ActSeeMyAgd,NULL, - "edit64x64.png", - Txt_Edit,NULL, - NULL); - } - -/*****************************************************************************/ -/***************** Put contextual icons in list of events ********************/ -/*****************************************************************************/ - -static void Agd_PutIconsListEvents (void) +static void Agd_PutIconsMyFullAgenda (void) { /***** Put icon to create a new event *****/ - if (Gbl.Agenda.WhichEvents == Agd_ALL_EVENTS) - Agd_PutIconToCreateNewEvent (); + Agd_PutIconToViewMyPublicAgenda (); + + /***** Put icon to create a new event *****/ + Agd_PutIconToCreateNewEvent (); /***** Put icon to show QR code *****/ Agd_PutIconToShowQR (); } -/*****************************************************************************/ -/********************** Put icon to create a new event ***********************/ -/*****************************************************************************/ +static void Agd_PutIconsMyPublicAgenda (void) + { + /***** Put icon to view/edit my full agenda *****/ + Agd_PutIconToViewEditMyFullAgenda (); + + /***** Put icon to show QR code *****/ + Agd_PutIconToShowQR (); + } + +static void Agd_PutIconToViewMyPublicAgenda (void) + { + extern const char *Txt_Public_agenda_USER; + + /***** Put form to view my public agenda *****/ + sprintf (Gbl.Title,Txt_Public_agenda_USER,Gbl.Usrs.Me.UsrDat.FullName); + Lay_PutContextualLink (ActSeeMyPubAgd,NULL, + "eye-on64x64.png", + Gbl.Title,NULL, + NULL); + } static void Agd_PutIconToCreateNewEvent (void) { @@ -474,9 +489,16 @@ static void Agd_PutIconToCreateNewEvent (void) NULL); } -/*****************************************************************************/ -/********************** Put icon to create a new event ***********************/ -/*****************************************************************************/ +static void Agd_PutIconToViewEditMyFullAgenda (void) + { + extern const char *Txt_Edit; + + /***** Put form to create a new event *****/ + Lay_PutContextualLink (ActSeeMyAgd,NULL, + "edit64x64.png", + Txt_Edit,NULL, + NULL); + } static void Agd_PutIconToShowQR (void) { @@ -515,69 +537,6 @@ static void Agd_PutParamsToCreateNewEvent (void) Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); } -/*****************************************************************************/ -/*** Show form to choice whether to show all events or only public events ****/ -/*****************************************************************************/ - -static void Agd_ShowFormToSelWhichEvents (Act_Action_t Action) - { - extern const char *Txt_Show_WHICH_events[2]; - Agd_WhichEvents_t WhichEvents; - - fprintf (Gbl.F.Out,"
"); - for (WhichEvents = Agd_ALL_EVENTS; - WhichEvents <= Agd_ONLY_PUBLIC_EVENTS; - WhichEvents++) - { - fprintf (Gbl.F.Out,"
", - WhichEvents == Gbl.Agenda.WhichEvents ? "PREF_ON" : - "PREF_OFF"); - Act_FormStart (Action); - Pag_PutHiddenParamWhichEvents (WhichEvents); - fprintf (Gbl.F.Out,"", - Gbl.Prefs.IconsURL, - WhichEvents == Agd_ONLY_PUBLIC_EVENTS ? "unlock64x64.png" : - "lockunlock64x64.png", - Txt_Show_WHICH_events[WhichEvents], - Txt_Show_WHICH_events[WhichEvents]); - Act_FormEnd (); - fprintf (Gbl.F.Out,"
"); - } - fprintf (Gbl.F.Out,"
"); - } - -/*****************************************************************************/ -/****** Put hidden parameter to show all events or only public events ********/ -/*****************************************************************************/ - -void Pag_PutHiddenParamWhichEvents (Agd_WhichEvents_t WhichEvents) - { - Par_PutHiddenParamUnsigned ("WhichEvents",(unsigned) WhichEvents); - } - -/*****************************************************************************/ -/*********** Get whether to show all events or only public events ************/ -/*****************************************************************************/ - -static void Agd_GetParamWhichEvents (void) - { - char UnsignedStr[10+1]; - unsigned UnsignedNum; - - /***** Get which events (all events or my events) *****/ - Par_GetParToText ("WhichEvents",UnsignedStr,1); - if (UnsignedStr[0]) - { - if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1) - Lay_ShowErrorAndExit ("Which events to show is missing."); - if (UnsignedNum >= 2) - Lay_ShowErrorAndExit ("Wrong parameter with which events to show."); - Gbl.Agenda.WhichEvents = (Agd_WhichEvents_t) UnsignedNum; - } - } - /*****************************************************************************/ /******************************* Show one event ******************************/ /*****************************************************************************/ @@ -595,12 +554,14 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod) AgdEvent.AgdCod = AgdCod; switch (AgendaType) { - case Agd_USR_AGENDA_TODAY: - case Agd_USR_AGENDA: + case Agd_OTHER_PUBLIC_AGENDA_TODAY: + case Agd_OTHER_PUBLIC_AGENDA: AgdEvent.UsrCod = Gbl.Usrs.Other.UsrDat.UsrCod; break; - case Agd_MY_AGENDA_TODAY: - case Agd_MY_AGENDA: + case Agd_MY_FULL_AGENDA_TODAY: + case Agd_MY_FULL_AGENDA: + case Agd_MY_PUBLIC_AGENDA_TODAY: + case Agd_MY_PUBLIC_AGENDA: AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; break; } @@ -664,13 +625,12 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod) /* Forms to remove/edit this event */ switch (AgendaType) { - case Agd_USR_AGENDA_TODAY: - case Agd_USR_AGENDA: - break; - case Agd_MY_AGENDA_TODAY: - case Agd_MY_AGENDA: + case Agd_MY_FULL_AGENDA_TODAY: + case Agd_MY_FULL_AGENDA: Agd_PutFormsToRemEditOneEvent (&AgdEvent); break; + default: + break; } fprintf (Gbl.F.Out,""); @@ -871,7 +831,7 @@ static void Agd_GetListEvents (Agd_AgendaType_t AgendaType) } switch (AgendaType) { - case Agd_USR_AGENDA_TODAY: + case Agd_OTHER_PUBLIC_AGENDA_TODAY: sprintf (Query,"SELECT AgdCod FROM agendas" " WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'" " AND DATE(StartTime)<=CURDATE()" @@ -879,52 +839,42 @@ static void Agd_GetListEvents (Agd_AgendaType_t AgendaType) " ORDER BY %s", Gbl.Usrs.Other.UsrDat.UsrCod,OrderBySubQuery); break; - case Agd_USR_AGENDA: + case Agd_OTHER_PUBLIC_AGENDA: sprintf (Query,"SELECT AgdCod FROM agendas" " WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'" " AND DATE(EndTime)>=CURDATE()" // Only today and future events " ORDER BY %s", Gbl.Usrs.Other.UsrDat.UsrCod,OrderBySubQuery); break; - case Agd_MY_AGENDA_TODAY: - switch (Gbl.Agenda.WhichEvents) - { - case Agd_ALL_EVENTS: - sprintf (Query,"SELECT AgdCod FROM agendas" - " WHERE UsrCod='%ld'" - " AND DATE(StartTime)<=CURDATE()" - " AND DATE(EndTime)>=CURDATE()" // Only today events - " ORDER BY %s", - Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); - break; - case Agd_ONLY_PUBLIC_EVENTS: - sprintf (Query,"SELECT AgdCod FROM agendas" - " WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'" - " AND DATE(StartTime)<=CURDATE()" - " AND DATE(EndTime)>=CURDATE()" // Only today events - " ORDER BY %s", - Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); - break; - } - break; - case Agd_MY_AGENDA: - switch (Gbl.Agenda.WhichEvents) - { - case Agd_ALL_EVENTS: - sprintf (Query,"SELECT AgdCod FROM agendas" - " WHERE UsrCod='%ld'" - " ORDER BY %s", - Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); - break; - case Agd_ONLY_PUBLIC_EVENTS: - sprintf (Query,"SELECT AgdCod FROM agendas" - " WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'" - " AND DATE(EndTime)>=CURDATE()" // Only today and future events - " ORDER BY %s", - Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); - break; - } + case Agd_MY_FULL_AGENDA_TODAY: + sprintf (Query,"SELECT AgdCod FROM agendas" + " WHERE UsrCod='%ld'" + " AND DATE(StartTime)<=CURDATE()" + " AND DATE(EndTime)>=CURDATE()" // Only today events + " ORDER BY %s", + Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); + break; + case Agd_MY_FULL_AGENDA: + sprintf (Query,"SELECT AgdCod FROM agendas" + " WHERE UsrCod='%ld'" + " ORDER BY %s", + Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); + break; + case Agd_MY_PUBLIC_AGENDA_TODAY: + sprintf (Query,"SELECT AgdCod FROM agendas" + " WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'" + " AND DATE(StartTime)<=CURDATE()" + " AND DATE(EndTime)>=CURDATE()" // Only today events + " ORDER BY %s", + Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); break; + case Agd_MY_PUBLIC_AGENDA: + sprintf (Query,"SELECT AgdCod FROM agendas" + " WHERE UsrCod='%ld' AND Public='Y' AND Hidden='N'" + " AND DATE(EndTime)>=CURDATE()" // Only today and future events + " ORDER BY %s", + Gbl.Usrs.Me.UsrDat.UsrCod,OrderBySubQuery); + break; } NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get agenda events"); @@ -1137,7 +1087,7 @@ void Agd_AskRemEvent (void) /***** Get parameters *****/ Agd_GetParamEventOrderType (); - Pag_GetParamPagNum (Pag_MY_AGENDA); + Pag_GetParamPagNum (Pag_MY_FULL_AGENDA); /***** Get event code *****/ if ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) == -1L) @@ -1363,7 +1313,7 @@ void Agd_RequestCreatOrEditEvent (void) /***** Get parameters *****/ Agd_GetParamEventOrderType (); - Pag_GetParamPagNum (Pag_MY_AGENDA); + Pag_GetParamPagNum (Pag_MY_FULL_AGENDA); /***** Get the code of the event *****/ ItsANewEvent = ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) == -1L); diff --git a/swad_agenda.h b/swad_agenda.h index 3095724f7..5cd1972b2 100644 --- a/swad_agenda.h +++ b/swad_agenda.h @@ -80,8 +80,8 @@ void Agd_PutParamAgd (void); void Agd_ShowUsrAgendaAfterLogIn (void); void Agd_ShowUsrAgenda (void); void Agd_ShowMyAgenda (void); +void Agd_ShowMyPublicAgenda (void); -void Pag_PutHiddenParamWhichEvents (Agd_WhichEvents_t WhichEvents); void Agd_PutHiddenParamEventsOrderType (void); void Agd_RequestCreatOrEditEvent (void); void Agd_FreeListEvents (void); diff --git a/swad_changelog.h b/swad_changelog.h index ae75105fb..74b0c81cc 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -183,13 +183,17 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.89.2 (2016-12-06)" +#define Log_PLATFORM_VERSION "SWAD 16.90 (2016-12-06)" #define CSS_FILE "swad16.86.5.css" #define JS_FILE "swad16.84.2.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.90: Dec 06, 2016 Changes in layout of agenda. (210147 lines) + 1 change necessary in database: +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1617','es','N','Ver mi agenda pública'); + Version 16.89.2: Dec 06, 2016 Fixed bugs in agenda. Public agenda available for any user, not only teachers. (210167 lines) Version 16.89.1: Dec 06, 2016 Changes in help on agenda. (210166 lines) diff --git a/swad_global.c b/swad_global.c index fcbc79e14..d8784fd52 100644 --- a/swad_global.c +++ b/swad_global.c @@ -418,9 +418,6 @@ void Gbl_InitializeGlobals (void) Gbl.FileBrowser.FileType = Brw_IS_UNKNOWN; Gbl.FileBrowser.UploadingWithDropzone = false; - /* Agenda */ - Gbl.Agenda.WhichEvents = Agd_ALL_EVENTS; - /* To alternate colors where listing rows */ Gbl.RowEvenOdd = 0; Gbl.ColorRows[0] = "COLOR0"; // Darker diff --git a/swad_global.h b/swad_global.h index c67dae84f..9b22e641c 100644 --- a/swad_global.h +++ b/swad_global.h @@ -411,7 +411,6 @@ struct Globals long *LstAgdCods; // List of agenda codes Agd_Order_t SelectedOrderType; long AgdCodToEdit; // Used as parameter in contextual links - Agd_WhichEvents_t WhichEvents; // All events / only public events } Agenda; struct { diff --git a/swad_pagination.c b/swad_pagination.c index 745a5f453..aefdebb99 100644 --- a/swad_pagination.c +++ b/swad_pagination.c @@ -131,7 +131,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_USR_AGENDA: + case Pag_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Pag_PutHiddenParamPagNum (1); Agd_PutHiddenParamEventsOrderType (); @@ -170,10 +170,14 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_MY_AGENDA: + case Pag_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); Pag_PutHiddenParamPagNum (1); - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); + Agd_PutHiddenParamEventsOrderType (); + break; + case Pag_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + Pag_PutHiddenParamPagNum (1); Agd_PutHiddenParamEventsOrderType (); break; } @@ -220,7 +224,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_USR_AGENDA: + case Pag_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Pag_PutHiddenParamPagNum (1); Agd_PutHiddenParamEventsOrderType (); @@ -259,10 +263,14 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_MY_AGENDA: + case Pag_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); Pag_PutHiddenParamPagNum (1); - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); + Agd_PutHiddenParamEventsOrderType (); + break; + case Pag_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + Pag_PutHiddenParamPagNum (1); Agd_PutHiddenParamEventsOrderType (); break; } @@ -292,7 +300,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_USR_AGENDA: + case Pag_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Pag_PutHiddenParamPagNum (Pagination->LeftPage); Agd_PutHiddenParamEventsOrderType (); @@ -331,10 +339,14 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_MY_AGENDA: + case Pag_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); Pag_PutHiddenParamPagNum (Pagination->LeftPage); - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); + Agd_PutHiddenParamEventsOrderType (); + break; + case Pag_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + Pag_PutHiddenParamPagNum (Pagination->LeftPage); Agd_PutHiddenParamEventsOrderType (); break; } @@ -371,7 +383,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_USR_AGENDA: + case Pag_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Pag_PutHiddenParamPagNum (NumPage); Agd_PutHiddenParamEventsOrderType (); @@ -410,10 +422,14 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_MY_AGENDA: + case Pag_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); Pag_PutHiddenParamPagNum (NumPage); - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); + Agd_PutHiddenParamEventsOrderType (); + break; + case Pag_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + Pag_PutHiddenParamPagNum (NumPage); Agd_PutHiddenParamEventsOrderType (); break; } @@ -446,7 +462,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_USR_AGENDA: + case Pag_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Pag_PutHiddenParamPagNum (Pagination->RightPage); Agd_PutHiddenParamEventsOrderType (); @@ -485,10 +501,14 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_MY_AGENDA: + case Pag_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); Pag_PutHiddenParamPagNum (Pagination->RightPage); - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); + Agd_PutHiddenParamEventsOrderType (); + break; + case Pag_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + Pag_PutHiddenParamPagNum (Pagination->RightPage); Agd_PutHiddenParamEventsOrderType (); break; } @@ -518,7 +538,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_USR_AGENDA: + case Pag_OTHER_PUBLIC_AGENDA: Act_FormStart (ActSeeUsrAgd); Pag_PutHiddenParamPagNum (Pagination->NumPags); Agd_PutHiddenParamEventsOrderType (); @@ -557,10 +577,14 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,long ThrCod,struct P Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); break; - case Pag_MY_AGENDA: + case Pag_MY_FULL_AGENDA: Act_FormStart (ActSeeMyAgd); Pag_PutHiddenParamPagNum (Pagination->NumPags); - Pag_PutHiddenParamWhichEvents (Gbl.Agenda.WhichEvents); + Agd_PutHiddenParamEventsOrderType (); + break; + case Pag_MY_PUBLIC_AGENDA: + Act_FormStart (ActSeeMyPubAgd); + Pag_PutHiddenParamPagNum (Pagination->NumPags); Agd_PutHiddenParamEventsOrderType (); break; } diff --git a/swad_pagination.h b/swad_pagination.h index 8d86df76d..a57c01318 100644 --- a/swad_pagination.h +++ b/swad_pagination.h @@ -40,14 +40,15 @@ typedef enum { Pag_ASSIGNMENTS, - Pag_USR_AGENDA, + Pag_OTHER_PUBLIC_AGENDA, Pag_ATT_EVENTS, Pag_MESSAGES_RECEIVED, Pag_MESSAGES_SENT, Pag_THREADS_FORUM, Pag_POSTS_FORUM, Pag_SURVEYS, - Pag_MY_AGENDA, + Pag_MY_FULL_AGENDA, + Pag_MY_PUBLIC_AGENDA, } Pag_WhatPaginate_t; struct Pagination // Used for threads and messages pagination