From 58277e91686aebad2a4737f3374a5bdbd3fb2251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 1 Nov 2015 20:21:59 +0100 Subject: [PATCH] Version 15.34 --- css/swad_desktop.css | 9 + css/swad_mobile.css | 9 + sql/swad.sql | 4 +- swad_action.c | 534 ++++++++++++++++++++++--------------------- swad_action.h | 320 +++++++++++++------------- swad_announcement.c | 151 ++++++++++-- swad_announcement.h | 9 + swad_changelog.h | 10 +- swad_database.c | 22 +- swad_notice.c | 56 ++--- swad_notice.h | 2 +- 11 files changed, 640 insertions(+), 486 deletions(-) diff --git a/css/swad_desktop.css b/css/swad_desktop.css index b5986e851..b7b160781 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -350,6 +350,15 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} text-align:center; overflow:hidden; } +.NOTICE_SUBJECT_OBSOLETE + { + margin:12px auto; + font-size:15pt; + font-weight:bold; + color:#808080; + text-align:center; + overflow:hidden; + } .NOTICE_TEXT_ACTIVE { clear:both; diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 23047b79a..f84389930 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -302,6 +302,15 @@ form {margin:0; display:inline;} text-align:center; overflow:hidden; } +.NOTICE_SUBJECT_OBSOLETE + { + margin:12px auto; + font-size:15pt; + font-weight:bold; + color:#808080; + text-align:center; + overflow:hidden; + } .NOTICE_TEXT_ACTIVE { clear:both; diff --git a/sql/swad.sql b/sql/swad.sql index 7313179e9..95620b225 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -63,10 +63,12 @@ CREATE TABLE IF NOT EXISTS ann_seen ( -- CREATE TABLE IF NOT EXISTS announcements ( AnnCod INT NOT NULL AUTO_INCREMENT, + Status TINYINT NOT NULL DEFAULT 0, Roles INT NOT NULL DEFAULT 0, Subject TEXT NOT NULL, Content TEXT NOT NULL, - UNIQUE INDEX(AnnCod)); + UNIQUE INDEX(AnnCod), + INDEX(Status)); -- -- Table asg_grp: stores the groups associated to assigments -- diff --git a/swad_action.c b/swad_action.c index d2ed8cf3c..ea61fa4c2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -75,7 +75,7 @@ extern struct Globals Gbl; /************************ Internal global variables **************************/ /*****************************************************************************/ /* -1107 actions in one CGI: +1109 actions in one CGI: 0. ActAll Any action (used for statistics) 1. ActUnk Unknown action 2. ActHom Show home menu @@ -1012,281 +1012,283 @@ Messages: 842. ActMaiStd Send an e-mail to students 843. ActWriAnn Show form to create a new global announcement 844. ActRcvAnn Receive and create a new global announcement - 845. ActRemAnn Remove global announcement - 846. ActShoNot Show (expand) a notice - 847. ActWriNot Write a new notice - 848. ActRcvNot Receive and create a new notice - 849. ActHidNot Hide a notice that was active - 850. ActRevNot Reveal a notice that was hidden - 851. ActRemNot Remove a notice - 852. ActSeeNewNtf Show my recent notifications (link in top heading) - 853. ActMrkNtfSee Mark all my notifications as seen - 854. ActSeeForCrsUsr Show top level of forum of users of the course - 855. ActSeeForCrsTch Show top level of forum of teachers of the course - 856. ActSeeForDegUsr Show top level of forum of users of the degree - 857. ActSeeForDegTch Show top level of forum of teachers of the degree - 858. ActSeeForCtrUsr Show top level of forum of users of the centre - 859. ActSeeForCtrTch Show top level of forum of teachers of the centre - 860. ActSeeForInsUsr Show top level of forum of users of the institution - 861. ActSeeForInsTch Show top level of forum of teachers of the institution - 862. ActSeeForGenUsr Show top level of forum of users general - 863. ActSeeForGenTch Show top level of forum of teachers general - 864. ActSeeForSWAUsr Show top level of forum of users of the platform - 865. ActSeeForSWATch Show top level of forum of teachers of the platform - 866. ActSeePstForCrsUsr Show the messages of a thread of the forum of users of the course - 867. ActSeePstForCrsTch Show the messages of a thread of the forum of teachers of the course - 868. ActSeePstForDegUsr Show the messages of a thread of the forum of users of the degree - 869. ActSeePstForDegTch Show the messages of a thread of the forum of teachers of the degree - 870. ActSeePstForCtrUsr Show the messages of a thread of the forum of users of the centre - 871. ActSeePstForCtrTch Show the messages of a thread of the forum of teachers of the centre - 872. ActSeePstForInsUsr Show the messages of a thread of the forum of users of the institution - 873. ActSeePstForInsTch Show the messages of a thread of the forum of teachers of the institution - 874. ActSeePstForGenUsr Show the messages of a thread of the forum of users general - 875. ActSeePstForGenTch Show the messages of a thread of the forum of teachers general - 876. ActSeePstForSWAUsr Show the messages of a thread of the forum of users of the platform - 877. ActSeePstForSWATch Show the messages of a thread of the forum of teachers of the platform - 878. ActRcvThrForCrsUsr Receive the first message of a new thread of forum of users of the course - 879. ActRcvThrForCrsTch Receive the first message of a new thread of forum of teachers of the course - 880. ActRcvThrForDegUsr Receive the first message of a new thread of forum of users of the degree - 881. ActRcvThrForDegTch Receive the first message of a new thread of forum of teachers of the degree - 882. ActRcvThrForCtrUsr Receive the first message of a new thread of forum of users of centre - 883. ActRcvThrForCtrTch Receive the first message of a new thread of forum of teachers of centre - 884. ActRcvThrForInsUsr Receive the first message of a new thread of forum of users of the institution - 885. ActRcvThrForInsTch Receive the first message of a new thread of forum of teachers of the institution - 886. ActRcvThrForGenUsr Receive the first message of a new thread of forum of users general - 887. ActRcvThrForGenTch Receive the first message of a new thread of forum of teachers general - 888. ActRcvThrForSWAUsr Receive the first message of a new thread of forum of users of the platform - 889. ActRcvThrForSWATch Receive the first message of a new thread of forum of teachers of the platform - 890. ActRcvRepForCrsUsr Receive a message of answer in a thread existente in the forum of users of the course - 891. ActRcvRepForCrsTch Receive a message of answer in a thread existente in the forum of teachers of the course - 892. ActRcvRepForDegUsr Receive a message of answer in a thread existente in the forum of users of the degree - 893. ActRcvRepForDegTch Receive a message of answer in a thread existente in the forum of teachers of the degree - 894. ActRcvRepForCtrUsr Receive a message of answer in a thread existente in the forum of users of centre - 895. ActRcvRepForCtrTch Receive a message of answer in a thread existente in the forum of teachers of centre - 896. ActRcvRepForInsUsr Receive a message of answer in a thread existente in the forum of users of the institution - 897. ActRcvRepForInsTch Receive a message of answer in a thread existente in the forum of teachers of the institution - 898. ActRcvRepForGenUsr Receive a message of answer in a thread existente in the forum of users general - 899. ActRcvRepForGenTch Receive a message of answer in a thread existente in the forum of teachers general - 900. ActRcvRepForSWAUsr Receive a message of answer in a thread existente in the forum of users of the platform - 901. ActRcvRepForSWATch Receive a message of answer in a thread existente in the forum of teachers of the platform - 902. ActReqDelThrCrsUsr Request the removal of a thread of forum of users of the course - 903. ActReqDelThrCrsTch Request the removal of a thread of forum of teachers of the course - 904. ActReqDelThrDegUsr Request the removal of a thread of forum of users of the degree - 905. ActReqDelThrDegTch Request the removal of a thread of forum of teachers of the degree - 906. ActReqDelThrCtrUsr Request the removal of a thread of forum of users of centre - 907. ActReqDelThrCtrTch Request the removal of a thread of forum of teachers of centre - 908. ActReqDelThrInsUsr Request the removal of a thread of forum of users of the institution - 909. ActReqDelThrInsTch Request the removal of a thread of forum of teachers of the institution - 910. ActReqDelThrGenUsr Request the removal of a thread of forum of users general - 911. ActReqDelThrGenTch Request the removal of a thread of forum of teachers general - 912. ActReqDelThrSWAUsr Request the removal of a thread of forum of users of the platform - 913. ActReqDelThrSWATch Request the removal of a thread of forum of teachers of the platform - 914. ActDelThrForCrsUsr Remove a thread of forum of users of the course - 915. ActDelThrForCrsTch Remove a thread of forum of teachers of the course - 916. ActDelThrForDegUsr Remove a thread of forum of users of the degree - 917. ActDelThrForDegTch Remove a thread of forum of teachers of the degree - 918. ActDelThrForCtrUsr Remove a thread of forum of users of centre - 919. ActDelThrForCtrTch Remove a thread of forum of teachers of centre - 920. ActDelThrForInsUsr Remove a thread of forum of users of the institution - 921. ActDelThrForInsTch Remove a thread of forum of teachers of the institution - 922. ActDelThrForGenUsr Remove a thread of forum of users general - 923. ActDelThrForGenTch Remove a thread of forum of teachers general - 924. ActDelThrForSWAUsr Remove a thread of forum of users of the platform - 925. ActDelThrForSWATch Remove a thread of forum of teachers of the platform - 926. ActCutThrForCrsUsr Cut a thread of forum of users of the course - 927. ActCutThrForCrsTch Cut a thread of forum of teachers of the course - 928. ActCutThrForDegUsr Cut a thread of forum of users of the degree - 929. ActCutThrForDegTch Cut a thread of forum of teachers of the degree - 930. ActCutThrForCtrUsr Cut a thread of forum of users of centre - 931. ActCutThrForCtrTch Cut a thread of forum of teachers of centre - 932. ActCutThrForInsUsr Cut a thread of forum of users of the institution - 933. ActCutThrForInsTch Cut a thread of forum of teachers of the institution - 934. ActCutThrForGenUsr Cut a thread of forum of users general - 935. ActCutThrForGenTch Cut a thread of forum of teachers general - 936. ActCutThrForSWAUsr Cut a thread of forum of users of the platform - 937. ActCutThrForSWATch Cut a thread of forum of teachers of the platform - 938. ActPasThrForCrsUsr Paste a thread of forum of users of the course - 939. ActPasThrForCrsTch Paste a thread of forum of teachers of the course - 940. ActPasThrForDegUsr Paste a thread of forum of users of the degree - 941. ActPasThrForDegTch Paste a thread of forum of teachers of the degree - 942. ActPasThrForCtrUsr Paste a thread of forum of users of centre - 943. ActPasThrForCtrTch Paste a thread of forum of teachers of centre - 944. ActPasThrForInsUsr Paste a thread of forum of users of the institution - 945. ActPasThrForInsTch Paste a thread of forum of teachers of the institution - 946. ActPasThrForGenUsr Paste a thread of forum of users general - 947. ActPasThrForGenTch Paste a thread of forum of teachers general - 948. ActPasThrForSWAUsr Paste a thread of forum of users of the platform - 949. ActPasThrForSWATch Paste a thread of forum of teachers of the platform - 950. ActDelPstForCrsUsr Remove a message of forum of users of the course - 951. ActDelPstForCrsTch Remove a message of forum of teachers of the course - 952. ActDelPstForDegUsr Remove a message of forum of users of the degree - 953. ActDelPstForDegTch Remove a message of forum of teachers of the degree - 954. ActDelPstForCtrUsr Remove a message of forum of users of centre - 955. ActDelPstForCtrTch Remove a message of forum of teachers of centre - 956. ActDelPstForInsUsr Remove a message of forum of users of the institution - 957. ActDelPstForInsTch Remove a message of forum of teachers of the institution - 958. ActDelPstForGenUsr Remove a message of forum of users general - 959. ActDelPstForGenTch Remove a message of forum of teachers general - 960. ActDelPstForSWAUsr Remove a message of forum of users of the platform - 961. ActDelPstForSWATch Remove a message of forum of teachers of the platform - 962. ActEnbPstForCrsUsr Enable a message of forum of users of the course - 963. ActEnbPstForCrsTch Enable a message of forum of teachers of the course - 964. ActEnbPstForDegUsr Enable a message of forum of users of the degree - 965. ActEnbPstForDegTch Enable a message of forum of teachers of the degree - 966. ActEnbPstForCtrUsr Enable a message of forum of users of centre - 967. ActEnbPstForCtrTch Enable a message of forum of teachers of centre - 968. ActEnbPstForInsUsr Enable a message of forum of users of the institution - 969. ActEnbPstForInsTch Enable a message of forum of teachers of the institution - 970. ActEnbPstForGenUsr Enable a message of forum of users general - 971. ActEnbPstForGenTch Enable a message of forum of teachers general - 972. ActEnbPstForSWAUsr Enable a message of forum of users of the platform - 973. ActEnbPstForSWATch Enable a message of forum of teachers of the platform - 974. ActDisPstForCrsUsr Disable a message of forum of users of the course - 975. ActDisPstForCrsTch Disable a message of forum of teachers of the course - 976. ActDisPstForDegUsr Disable a message of forum of users of the degree - 977. ActDisPstForDegTch Disable a message of forum of teachers of the degree - 978. ActDisPstForCtrUsr Disable a message of forum of users of centre - 979. ActDisPstForCtrTch Disable a message of forum of teachers of centre - 980. ActDisPstForInsUsr Disable a message of forum of users of the institution - 981. ActDisPstForInsTch Disable a message of forum of teachers of the institution - 982. ActDisPstForGenUsr Disable a message of forum of users general - 983. ActDisPstForGenTch Disable a message of forum of teachers general - 984. ActDisPstForSWAUsr Disable a message of forum of users of the platform - 985. ActDisPstForSWATch Disable a message of forum of teachers of the platform - 986. ActRcvMsgUsr Sent/Receive a message of a user - 987. ActReqDelAllSntMsg Request the removal of todos the messages sent to other users - 988. ActReqDelAllRcvMsg Request the removal of todos the messages received from other users - 989. ActDelAllSntMsg Remove todos the messages sent to other users - 990. ActDelAllRcvMsg Remove todos the messages received from other users - 991. ActDelSntMsg Remove a message sent to other users - 992. ActDelRcvMsg Remove a message received from other user - 993. ActExpSntMsg See (expand) sent message - 994. ActExpRcvMsg See (expand) received message - 995. ActConSntMsg Hide (contract) sent message - 996. ActConRcvMsg Hide (contract) received message - 997. ActLstBanUsr List banned users - 998. ActBanUsrMsg Ban the sender of a message when showing received messages - 999. ActUnbUsrMsg Unban the sender of a message when showing received messages - 1000. ActUnbUsrLst Unban a user when listing banned users - 1001. ActCht Enter in a chat room to chat + 845. ActHidAnn Hide a global announcement that was active + 846. ActRevAnn Reveal a global announcement that was hidden + 847. ActRemAnn Remove global announcement + 848. ActShoNot Show (expand) a notice + 849. ActWriNot Write a new notice + 850. ActRcvNot Receive and create a new notice + 851. ActHidNot Hide a notice that was active + 852. ActRevNot Reveal a notice that was hidden + 853. ActRemNot Remove a notice + 854. ActSeeNewNtf Show my recent notifications (link in top heading) + 855. ActMrkNtfSee Mark all my notifications as seen + 856. ActSeeForCrsUsr Show top level of forum of users of the course + 857. ActSeeForCrsTch Show top level of forum of teachers of the course + 858. ActSeeForDegUsr Show top level of forum of users of the degree + 859. ActSeeForDegTch Show top level of forum of teachers of the degree + 860. ActSeeForCtrUsr Show top level of forum of users of the centre + 861. ActSeeForCtrTch Show top level of forum of teachers of the centre + 862. ActSeeForInsUsr Show top level of forum of users of the institution + 863. ActSeeForInsTch Show top level of forum of teachers of the institution + 864. ActSeeForGenUsr Show top level of forum of users general + 865. ActSeeForGenTch Show top level of forum of teachers general + 866. ActSeeForSWAUsr Show top level of forum of users of the platform + 867. ActSeeForSWATch Show top level of forum of teachers of the platform + 868. ActSeePstForCrsUsr Show the messages of a thread of the forum of users of the course + 869. ActSeePstForCrsTch Show the messages of a thread of the forum of teachers of the course + 870. ActSeePstForDegUsr Show the messages of a thread of the forum of users of the degree + 871. ActSeePstForDegTch Show the messages of a thread of the forum of teachers of the degree + 872. ActSeePstForCtrUsr Show the messages of a thread of the forum of users of the centre + 873. ActSeePstForCtrTch Show the messages of a thread of the forum of teachers of the centre + 874. ActSeePstForInsUsr Show the messages of a thread of the forum of users of the institution + 875. ActSeePstForInsTch Show the messages of a thread of the forum of teachers of the institution + 876. ActSeePstForGenUsr Show the messages of a thread of the forum of users general + 877. ActSeePstForGenTch Show the messages of a thread of the forum of teachers general + 878. ActSeePstForSWAUsr Show the messages of a thread of the forum of users of the platform + 879. ActSeePstForSWATch Show the messages of a thread of the forum of teachers of the platform + 880. ActRcvThrForCrsUsr Receive the first message of a new thread of forum of users of the course + 881. ActRcvThrForCrsTch Receive the first message of a new thread of forum of teachers of the course + 882. ActRcvThrForDegUsr Receive the first message of a new thread of forum of users of the degree + 883. ActRcvThrForDegTch Receive the first message of a new thread of forum of teachers of the degree + 884. ActRcvThrForCtrUsr Receive the first message of a new thread of forum of users of centre + 885. ActRcvThrForCtrTch Receive the first message of a new thread of forum of teachers of centre + 886. ActRcvThrForInsUsr Receive the first message of a new thread of forum of users of the institution + 887. ActRcvThrForInsTch Receive the first message of a new thread of forum of teachers of the institution + 888. ActRcvThrForGenUsr Receive the first message of a new thread of forum of users general + 889. ActRcvThrForGenTch Receive the first message of a new thread of forum of teachers general + 890. ActRcvThrForSWAUsr Receive the first message of a new thread of forum of users of the platform + 891. ActRcvThrForSWATch Receive the first message of a new thread of forum of teachers of the platform + 892. ActRcvRepForCrsUsr Receive a message of answer in a thread existente in the forum of users of the course + 893. ActRcvRepForCrsTch Receive a message of answer in a thread existente in the forum of teachers of the course + 894. ActRcvRepForDegUsr Receive a message of answer in a thread existente in the forum of users of the degree + 895. ActRcvRepForDegTch Receive a message of answer in a thread existente in the forum of teachers of the degree + 896. ActRcvRepForCtrUsr Receive a message of answer in a thread existente in the forum of users of centre + 897. ActRcvRepForCtrTch Receive a message of answer in a thread existente in the forum of teachers of centre + 898. ActRcvRepForInsUsr Receive a message of answer in a thread existente in the forum of users of the institution + 899. ActRcvRepForInsTch Receive a message of answer in a thread existente in the forum of teachers of the institution + 900. ActRcvRepForGenUsr Receive a message of answer in a thread existente in the forum of users general + 901. ActRcvRepForGenTch Receive a message of answer in a thread existente in the forum of teachers general + 902. ActRcvRepForSWAUsr Receive a message of answer in a thread existente in the forum of users of the platform + 903. ActRcvRepForSWATch Receive a message of answer in a thread existente in the forum of teachers of the platform + 904. ActReqDelThrCrsUsr Request the removal of a thread of forum of users of the course + 905. ActReqDelThrCrsTch Request the removal of a thread of forum of teachers of the course + 906. ActReqDelThrDegUsr Request the removal of a thread of forum of users of the degree + 907. ActReqDelThrDegTch Request the removal of a thread of forum of teachers of the degree + 908. ActReqDelThrCtrUsr Request the removal of a thread of forum of users of centre + 909. ActReqDelThrCtrTch Request the removal of a thread of forum of teachers of centre + 910. ActReqDelThrInsUsr Request the removal of a thread of forum of users of the institution + 911. ActReqDelThrInsTch Request the removal of a thread of forum of teachers of the institution + 912. ActReqDelThrGenUsr Request the removal of a thread of forum of users general + 913. ActReqDelThrGenTch Request the removal of a thread of forum of teachers general + 914. ActReqDelThrSWAUsr Request the removal of a thread of forum of users of the platform + 915. ActReqDelThrSWATch Request the removal of a thread of forum of teachers of the platform + 916. ActDelThrForCrsUsr Remove a thread of forum of users of the course + 917. ActDelThrForCrsTch Remove a thread of forum of teachers of the course + 918. ActDelThrForDegUsr Remove a thread of forum of users of the degree + 919. ActDelThrForDegTch Remove a thread of forum of teachers of the degree + 920. ActDelThrForCtrUsr Remove a thread of forum of users of centre + 921. ActDelThrForCtrTch Remove a thread of forum of teachers of centre + 922. ActDelThrForInsUsr Remove a thread of forum of users of the institution + 923. ActDelThrForInsTch Remove a thread of forum of teachers of the institution + 924. ActDelThrForGenUsr Remove a thread of forum of users general + 925. ActDelThrForGenTch Remove a thread of forum of teachers general + 926. ActDelThrForSWAUsr Remove a thread of forum of users of the platform + 927. ActDelThrForSWATch Remove a thread of forum of teachers of the platform + 928. ActCutThrForCrsUsr Cut a thread of forum of users of the course + 929. ActCutThrForCrsTch Cut a thread of forum of teachers of the course + 930. ActCutThrForDegUsr Cut a thread of forum of users of the degree + 931. ActCutThrForDegTch Cut a thread of forum of teachers of the degree + 932. ActCutThrForCtrUsr Cut a thread of forum of users of centre + 933. ActCutThrForCtrTch Cut a thread of forum of teachers of centre + 934. ActCutThrForInsUsr Cut a thread of forum of users of the institution + 935. ActCutThrForInsTch Cut a thread of forum of teachers of the institution + 936. ActCutThrForGenUsr Cut a thread of forum of users general + 937. ActCutThrForGenTch Cut a thread of forum of teachers general + 938. ActCutThrForSWAUsr Cut a thread of forum of users of the platform + 939. ActCutThrForSWATch Cut a thread of forum of teachers of the platform + 940. ActPasThrForCrsUsr Paste a thread of forum of users of the course + 941. ActPasThrForCrsTch Paste a thread of forum of teachers of the course + 942. ActPasThrForDegUsr Paste a thread of forum of users of the degree + 943. ActPasThrForDegTch Paste a thread of forum of teachers of the degree + 944. ActPasThrForCtrUsr Paste a thread of forum of users of centre + 945. ActPasThrForCtrTch Paste a thread of forum of teachers of centre + 946. ActPasThrForInsUsr Paste a thread of forum of users of the institution + 947. ActPasThrForInsTch Paste a thread of forum of teachers of the institution + 948. ActPasThrForGenUsr Paste a thread of forum of users general + 949. ActPasThrForGenTch Paste a thread of forum of teachers general + 950. ActPasThrForSWAUsr Paste a thread of forum of users of the platform + 951. ActPasThrForSWATch Paste a thread of forum of teachers of the platform + 952. ActDelPstForCrsUsr Remove a message of forum of users of the course + 953. ActDelPstForCrsTch Remove a message of forum of teachers of the course + 954. ActDelPstForDegUsr Remove a message of forum of users of the degree + 955. ActDelPstForDegTch Remove a message of forum of teachers of the degree + 956. ActDelPstForCtrUsr Remove a message of forum of users of centre + 957. ActDelPstForCtrTch Remove a message of forum of teachers of centre + 958. ActDelPstForInsUsr Remove a message of forum of users of the institution + 959. ActDelPstForInsTch Remove a message of forum of teachers of the institution + 960. ActDelPstForGenUsr Remove a message of forum of users general + 961. ActDelPstForGenTch Remove a message of forum of teachers general + 962. ActDelPstForSWAUsr Remove a message of forum of users of the platform + 963. ActDelPstForSWATch Remove a message of forum of teachers of the platform + 964. ActEnbPstForCrsUsr Enable a message of forum of users of the course + 965. ActEnbPstForCrsTch Enable a message of forum of teachers of the course + 966. ActEnbPstForDegUsr Enable a message of forum of users of the degree + 967. ActEnbPstForDegTch Enable a message of forum of teachers of the degree + 968. ActEnbPstForCtrUsr Enable a message of forum of users of centre + 969. ActEnbPstForCtrTch Enable a message of forum of teachers of centre + 970. ActEnbPstForInsUsr Enable a message of forum of users of the institution + 971. ActEnbPstForInsTch Enable a message of forum of teachers of the institution + 972. ActEnbPstForGenUsr Enable a message of forum of users general + 973. ActEnbPstForGenTch Enable a message of forum of teachers general + 974. ActEnbPstForSWAUsr Enable a message of forum of users of the platform + 975. ActEnbPstForSWATch Enable a message of forum of teachers of the platform + 976. ActDisPstForCrsUsr Disable a message of forum of users of the course + 977. ActDisPstForCrsTch Disable a message of forum of teachers of the course + 978. ActDisPstForDegUsr Disable a message of forum of users of the degree + 979. ActDisPstForDegTch Disable a message of forum of teachers of the degree + 980. ActDisPstForCtrUsr Disable a message of forum of users of centre + 981. ActDisPstForCtrTch Disable a message of forum of teachers of centre + 982. ActDisPstForInsUsr Disable a message of forum of users of the institution + 983. ActDisPstForInsTch Disable a message of forum of teachers of the institution + 984. ActDisPstForGenUsr Disable a message of forum of users general + 985. ActDisPstForGenTch Disable a message of forum of teachers general + 986. ActDisPstForSWAUsr Disable a message of forum of users of the platform + 987. ActDisPstForSWATch Disable a message of forum of teachers of the platform + 988. ActRcvMsgUsr Sent/Receive a message of a user + 989. ActReqDelAllSntMsg Request the removal of todos the messages sent to other users + 990. ActReqDelAllRcvMsg Request the removal of todos the messages received from other users + 991. ActDelAllSntMsg Remove todos the messages sent to other users + 992. ActDelAllRcvMsg Remove todos the messages received from other users + 993. ActDelSntMsg Remove a message sent to other users + 994. ActDelRcvMsg Remove a message received from other user + 995. ActExpSntMsg See (expand) sent message + 996. ActExpRcvMsg See (expand) received message + 997. ActConSntMsg Hide (contract) sent message + 998. ActConRcvMsg Hide (contract) received message + 999. ActLstBanUsr List banned users + 1000. ActBanUsrMsg Ban the sender of a message when showing received messages + 1001. ActUnbUsrMsg Unban the sender of a message when showing received messages + 1002. ActUnbUsrLst Unban a user when listing banned users + 1003. ActCht Enter in a chat room to chat Statistics: - 1002. ActSeeAllSvy List all surveys in pages - 1003. ActReqUseGbl Request showing use of the platform - 1004. ActSeePhoDeg Show a class photo with the average photos of the students of each degree - 1005. ActReqStaCrs Request statistics of courses - 1006. ActReqAccGbl Request query of clicks to the complete platform + 1004. ActSeeAllSvy List all surveys in pages + 1005. ActReqUseGbl Request showing use of the platform + 1006. ActSeePhoDeg Show a class photo with the average photos of the students of each degree + 1007. ActReqStaCrs Request statistics of courses + 1008. ActReqAccGbl Request query of clicks to the complete platform - 1007. ActSeeOneSvy Show one survey - 1008. ActAnsSvy Answer a survey - 1009. ActFrmNewSvy Form to create a new survey - 1010. ActEdiOneSvy Edit one survey - 1011. ActNewSvy Create new survey - 1012. ActChgSvy Modify data of an existing survey - 1013. ActReqRemSvy Request the removal of a survey - 1014. ActRemSvy Remove survey - 1015. ActReqRstSvy Request the reset of answers of a survey - 1016. ActRstSvy Reset answers of survey - 1017. ActHidSvy Hide survey - 1018. ActShoSvy Show survey - 1019. ActEdiOneSvyQst Edit a new question for a survey - 1020. ActRcvSvyQst Receive a question of a survey - 1021. ActRemSvyQst Remove a question of a survey - 1022. ActSeeUseGbl Show use of the platform - 1023. ActPrnPhoDeg Show vista of impresión of the class photo with the average photos of the students of each degree. - 1024. ActCalPhoDeg Compute the average photos of the students of each degree - 1025. ActSeeAccGbl Query clicks to the complete platform - 1026. ActReqAccCrs Request query of clicks in the course - 1027. ActSeeAccCrs Query clicks to current course - 1028. ActSeeAllStaCrs Show statistics of courses + 1009. ActSeeOneSvy Show one survey + 1010. ActAnsSvy Answer a survey + 1011. ActFrmNewSvy Form to create a new survey + 1012. ActEdiOneSvy Edit one survey + 1013. ActNewSvy Create new survey + 1014. ActChgSvy Modify data of an existing survey + 1015. ActReqRemSvy Request the removal of a survey + 1016. ActRemSvy Remove survey + 1017. ActReqRstSvy Request the reset of answers of a survey + 1018. ActRstSvy Reset answers of survey + 1019. ActHidSvy Hide survey + 1020. ActShoSvy Show survey + 1021. ActEdiOneSvyQst Edit a new question for a survey + 1022. ActRcvSvyQst Receive a question of a survey + 1023. ActRemSvyQst Remove a question of a survey + 1024. ActSeeUseGbl Show use of the platform + 1025. ActPrnPhoDeg Show vista of impresión of the class photo with the average photos of the students of each degree. + 1026. ActCalPhoDeg Compute the average photos of the students of each degree + 1027. ActSeeAccGbl Query clicks to the complete platform + 1028. ActReqAccCrs Request query of clicks in the course + 1029. ActSeeAccCrs Query clicks to current course + 1030. ActSeeAllStaCrs Show statistics of courses Profile: - 1029. ActFrmLogIn Show form to log in - 1030. ActMyCrs Select one of my courses - 1031. ActSeeMyTimTbl Show the timetable of all courses of the logged user - 1032. ActFrmUsrAcc Show form to the creation or change of user's account - 1033. ActReqEdiRecCom Request the edition of the record with the personal data of the user - 1034. ActEdiPrf Show forms to edit preferences - 1035. ActAdmBrf Show the briefcase of private archives - 1036. ActMFUAct Show most frequently used actions + 1031. ActFrmLogIn Show form to log in + 1032. ActMyCrs Select one of my courses + 1033. ActSeeMyTimTbl Show the timetable of all courses of the logged user + 1034. ActFrmUsrAcc Show form to the creation or change of user's account + 1035. ActReqEdiRecCom Request the edition of the record with the personal data of the user + 1036. ActEdiPrf Show forms to edit preferences + 1037. ActAdmBrf Show the briefcase of private archives + 1038. ActMFUAct Show most frequently used actions - 1037. ActAutUsrInt Authentify user internally (directly from the platform) - 1038. ActAutUsrExt Authentify user externally (remotely from an external site) - 1039. ActAutUsrChgLan Change language to my language just after authentication - 1040. ActLogOut Close session - 1041. ActAnnSee Mark announcement as seen + 1039. ActAutUsrInt Authentify user internally (directly from the platform) + 1040. ActAutUsrExt Authentify user externally (remotely from an external site) + 1041. ActAutUsrChgLan Change language to my language just after authentication + 1042. ActLogOut Close session + 1043. ActAnnSee Mark announcement as seen - 1042. ActReqSndNewPwd Show form to send a new password via e-mail - 1043. ActSndNewPwd Send a new password via e-mail - 1044. ActChgMyRol Change type of logged user + 1044. ActReqSndNewPwd Show form to send a new password via e-mail + 1045. ActSndNewPwd Send a new password via e-mail + 1046. ActChgMyRol Change type of logged user - 1045. ActCreUsrAcc Create new user account - 1046. ActRemIDMe Remove one of my user's IDs - 1047. ActNewIDMe Create a new user's ID for me - 1048. ActRemOldNic Remove one of my old nicknames - 1049. ActChgNic Change my nickname - 1050. ActRemOldMai Remove one of my old e-mails - 1051. ActChgMai Change my e-mail address - 1052. ActCnfMai Confirm e-mail address - 1053. ActFrmChgMyPwd Show form to the change of the password - 1054. ActChgPwd Change the password - 1055. ActReqRemMyAcc Request the removal of my account - 1056. ActRemMyAcc Remove my account + 1047. ActCreUsrAcc Create new user account + 1048. ActRemIDMe Remove one of my user's IDs + 1049. ActNewIDMe Create a new user's ID for me + 1050. ActRemOldNic Remove one of my old nicknames + 1051. ActChgNic Change my nickname + 1052. ActRemOldMai Remove one of my old e-mails + 1053. ActChgMai Change my e-mail address + 1054. ActCnfMai Confirm e-mail address + 1055. ActFrmChgMyPwd Show form to the change of the password + 1056. ActChgPwd Change the password + 1057. ActReqRemMyAcc Request the removal of my account + 1058. ActRemMyAcc Remove my account - 1057. ActChgMyData Update my personal data + 1059. ActChgMyData Update my personal data - 1058. ActReqMyPho Show form to send my photo - 1059. ActDetMyPho Receive my photo and detect faces on it - 1060. ActUpdMyPho Update my photo - 1061. ActRemMyPho Remove my photo + 1060. ActReqMyPho Show form to send my photo + 1061. ActDetMyPho Receive my photo and detect faces on it + 1062. ActUpdMyPho Update my photo + 1063. ActRemMyPho Remove my photo - 1062. ActEdiPri Edit my privacy - 1063. ActChgPriPho Change privacy of my photo - 1064. ActChgPriPrf Change privacy of my public profile + 1064. ActEdiPri Edit my privacy + 1065. ActChgPriPho Change privacy of my photo + 1066. ActChgPriPrf Change privacy of my public profile - 1065. ActReqEdiMyIns Request the edition of my institution, centre and department - 1066. ActChgCtyMyIns Change the country of my institution - 1067. ActChgMyIns Change my institution - 1068. ActChgMyCtr Change my centre - 1069. ActChgMyDpt Change my department - 1070. ActChgMyOff Change my office - 1071. ActChgMyOffPho Change my office phone + 1067. ActReqEdiMyIns Request the edition of my institution, centre and department + 1068. ActChgCtyMyIns Change the country of my institution + 1069. ActChgMyIns Change my institution + 1070. ActChgMyCtr Change my centre + 1071. ActChgMyDpt Change my department + 1072. ActChgMyOff Change my office + 1073. ActChgMyOffPho Change my office phone - 1072. ActReqEdiMyNet Request the edition of my social networks - 1073. ActChgMyNet Change my web and social networks + 1074. ActReqEdiMyNet Request the edition of my social networks + 1075. ActChgMyNet Change my web and social networks - 1074. ActChgLay Change layout - 1075. ActChgThe Change theme - 1076. ActReqChgLan Ask if change language - 1077. ActChgLan Change language - 1078. ActChgCol Change side columns - 1079. ActHidLftCol Hide left side column - 1080. ActHidRgtCol Hide right side column - 1081. ActShoLftCol Show left side column - 1082. ActShoRgtCol Show right side column - 1083. ActChgIco Change icon set - 1084. ActChgMnu Change menu - 1085. ActChgNtfPrf Change whether to notify by e-mail new messages - 1086. ActPrnUsrQR Show my QR code ready to print - 1087. ActPrnMyTimTbl Show the timetable listo to impresión of all my courses - 1088. ActEdiTut Edit the timetable of tutorías - 1089. ActChgTut Modify the timetable of tutorías - 1090. ActReqRemFilBrf Request removal of a file of the briefcase - 1091. ActRemFilBrf Remove a file of the briefcase - 1092. ActRemFolBrf Remove a folder empty of the briefcase - 1093. ActCopBrf Set source of copy in the briefcase - 1094. ActPasBrf Paste a folder or file in the briefcase - 1095. ActRemTreBrf Remove a folder no empty of the briefcase - 1096. ActFrmCreBrf Form to crear a folder or file in the briefcase - 1097. ActCreFolBrf Create a new folder in the briefcase - 1098. ActCreLnkBrf Create a new link in the briefcase - 1099. ActRenFolBrf Rename a folder of the briefcase - 1100. ActRcvFilBrfDZ Receive a file in the briefcase using Dropzone.js - 1101. ActRcvFilBrfCla Receive a file in the briefcase using the classic way - 1102. ActExpBrf Expand a folder in briefcase - 1103. ActConBrf Contract a folder in briefcase - 1104. ActZIPBrf Compress a folder in briefcase - 1105. ActReqDatBrf Ask for metadata of a file in the briefcase - 1106. ActChgDatBrf Change metadata of a file in the briefcase - 1107. ActDowBrf Download a file in the briefcase + 1076. ActChgLay Change layout + 1077. ActChgThe Change theme + 1078. ActReqChgLan Ask if change language + 1079. ActChgLan Change language + 1080. ActChgCol Change side columns + 1081. ActHidLftCol Hide left side column + 1082. ActHidRgtCol Hide right side column + 1083. ActShoLftCol Show left side column + 1084. ActShoRgtCol Show right side column + 1085. ActChgIco Change icon set + 1086. ActChgMnu Change menu + 1087. ActChgNtfPrf Change whether to notify by e-mail new messages + 1088. ActPrnUsrQR Show my QR code ready to print + 1089. ActPrnMyTimTbl Show the timetable listo to impresión of all my courses + 1090. ActEdiTut Edit the timetable of tutorías + 1091. ActChgTut Modify the timetable of tutorías + 1092. ActReqRemFilBrf Request removal of a file of the briefcase + 1093. ActRemFilBrf Remove a file of the briefcase + 1094. ActRemFolBrf Remove a folder empty of the briefcase + 1095. ActCopBrf Set source of copy in the briefcase + 1096. ActPasBrf Paste a folder or file in the briefcase + 1097. ActRemTreBrf Remove a folder no empty of the briefcase + 1098. ActFrmCreBrf Form to crear a folder or file in the briefcase + 1099. ActCreFolBrf Create a new folder in the briefcase + 1100. ActCreLnkBrf Create a new link in the briefcase + 1101. ActRenFolBrf Rename a folder of the briefcase + 1102. ActRcvFilBrfDZ Receive a file in the briefcase using Dropzone.js + 1103. ActRcvFilBrfCla Receive a file in the briefcase using the classic way + 1104. ActExpBrf Expand a folder in briefcase + 1105. ActConBrf Contract a folder in briefcase + 1106. ActZIPBrf Compress a folder in briefcase + 1107. ActReqDatBrf Ask for metadata of a file in the briefcase + 1108. ActChgDatBrf Change metadata of a file in the briefcase + 1109. ActDowBrf Download a file in the briefcase */ const struct Act_Menu Act_Menu[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] = @@ -2450,6 +2452,8 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = // Actions not in menu: /* ActWriAnn */{1237,-1,TabMsg,ActSeeAnn ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ann_ShowFormAnnouncement ,NULL}, /* ActRcvAnn */{1238,-1,TabMsg,ActSeeAnn ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ann_ReceiveAnnouncement ,NULL}, + /* ActHidAnn */{1470,-1,TabMsg,ActSeeAnn ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ann_HideActiveAnnouncement ,Ann_ShowAllAnnouncements ,NULL}, + /* ActRevAnn */{1471,-1,TabMsg,ActSeeAnn ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ann_RevealHiddenAnnouncement,Ann_ShowAllAnnouncements ,NULL}, /* ActRemAnn */{1236,-1,TabMsg,ActSeeAnn ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ann_RemoveAnnouncement ,NULL}, /* ActShoNot */{1164,-1,TabMsg,ActSeeNot ,0x1FF,0x1FF,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,Not_ShowANotice ,Not_ListNotices ,NULL}, @@ -4235,6 +4239,8 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActChgPwdOth, // #1467 ActChgPwdStd, // #1468 ActChgPwdTch, // #1469 + ActHidAnn, // #1470 + ActRevAnn, // #1471 }; /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index a06e10323..4500bc314 100644 --- a/swad_action.h +++ b/swad_action.h @@ -70,9 +70,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 (7+52+15+90+73+68+204+182+143+168+27+79) +#define Act_NUM_ACTIONS (7+52+15+90+73+68+204+182+143+170+27+79) -#define Act_MAX_ACTION_COD 1469 +#define Act_MAX_ACTION_COD 1471 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20 @@ -1047,163 +1047,165 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica // Secondary actions #define ActWriAnn (ActSeeFlr+ 10) #define ActRcvAnn (ActSeeFlr+ 11) -#define ActRemAnn (ActSeeFlr+ 12) -#define ActShoNot (ActSeeFlr+ 13) -#define ActWriNot (ActSeeFlr+ 14) -#define ActRcvNot (ActSeeFlr+ 15) -#define ActHidNot (ActSeeFlr+ 16) -#define ActRevNot (ActSeeFlr+ 17) -#define ActRemNot (ActSeeFlr+ 18) -#define ActSeeNewNtf (ActSeeFlr+ 19) -#define ActMrkNtfSee (ActSeeFlr+ 20) -#define ActSeeForCrsUsr (ActSeeFlr+ 21) -#define ActSeeForCrsTch (ActSeeFlr+ 22) -#define ActSeeForDegUsr (ActSeeFlr+ 23) -#define ActSeeForDegTch (ActSeeFlr+ 24) -#define ActSeeForCtrUsr (ActSeeFlr+ 25) -#define ActSeeForCtrTch (ActSeeFlr+ 26) -#define ActSeeForInsUsr (ActSeeFlr+ 27) -#define ActSeeForInsTch (ActSeeFlr+ 28) -#define ActSeeForGenUsr (ActSeeFlr+ 29) -#define ActSeeForGenTch (ActSeeFlr+ 30) -#define ActSeeForSWAUsr (ActSeeFlr+ 31) -#define ActSeeForSWATch (ActSeeFlr+ 32) -#define ActSeePstForCrsUsr (ActSeeFlr+ 33) -#define ActSeePstForCrsTch (ActSeeFlr+ 34) -#define ActSeePstForDegUsr (ActSeeFlr+ 35) -#define ActSeePstForDegTch (ActSeeFlr+ 36) -#define ActSeePstForCtrUsr (ActSeeFlr+ 37) -#define ActSeePstForCtrTch (ActSeeFlr+ 38) -#define ActSeePstForInsUsr (ActSeeFlr+ 39) -#define ActSeePstForInsTch (ActSeeFlr+ 40) -#define ActSeePstForGenUsr (ActSeeFlr+ 41) -#define ActSeePstForGenTch (ActSeeFlr+ 42) -#define ActSeePstForSWAUsr (ActSeeFlr+ 43) -#define ActSeePstForSWATch (ActSeeFlr+ 44) -#define ActRcvThrForCrsUsr (ActSeeFlr+ 45) -#define ActRcvThrForCrsTch (ActSeeFlr+ 46) -#define ActRcvThrForDegUsr (ActSeeFlr+ 47) -#define ActRcvThrForDegTch (ActSeeFlr+ 48) -#define ActRcvThrForCtrUsr (ActSeeFlr+ 49) -#define ActRcvThrForCtrTch (ActSeeFlr+ 50) -#define ActRcvThrForInsUsr (ActSeeFlr+ 51) -#define ActRcvThrForInsTch (ActSeeFlr+ 52) -#define ActRcvThrForGenUsr (ActSeeFlr+ 53) -#define ActRcvThrForGenTch (ActSeeFlr+ 54) -#define ActRcvThrForSWAUsr (ActSeeFlr+ 55) -#define ActRcvThrForSWATch (ActSeeFlr+ 56) -#define ActRcvRepForCrsUsr (ActSeeFlr+ 57) -#define ActRcvRepForCrsTch (ActSeeFlr+ 58) -#define ActRcvRepForDegUsr (ActSeeFlr+ 59) -#define ActRcvRepForDegTch (ActSeeFlr+ 60) -#define ActRcvRepForCtrUsr (ActSeeFlr+ 61) -#define ActRcvRepForCtrTch (ActSeeFlr+ 62) -#define ActRcvRepForInsUsr (ActSeeFlr+ 63) -#define ActRcvRepForInsTch (ActSeeFlr+ 64) -#define ActRcvRepForGenUsr (ActSeeFlr+ 65) -#define ActRcvRepForGenTch (ActSeeFlr+ 66) -#define ActRcvRepForSWAUsr (ActSeeFlr+ 67) -#define ActRcvRepForSWATch (ActSeeFlr+ 68) -#define ActReqDelThrCrsUsr (ActSeeFlr+ 69) -#define ActReqDelThrCrsTch (ActSeeFlr+ 70) -#define ActReqDelThrDegUsr (ActSeeFlr+ 71) -#define ActReqDelThrDegTch (ActSeeFlr+ 72) -#define ActReqDelThrCtrUsr (ActSeeFlr+ 73) -#define ActReqDelThrCtrTch (ActSeeFlr+ 74) -#define ActReqDelThrInsUsr (ActSeeFlr+ 75) -#define ActReqDelThrInsTch (ActSeeFlr+ 76) -#define ActReqDelThrGenUsr (ActSeeFlr+ 77) -#define ActReqDelThrGenTch (ActSeeFlr+ 78) -#define ActReqDelThrSWAUsr (ActSeeFlr+ 79) -#define ActReqDelThrSWATch (ActSeeFlr+ 80) -#define ActDelThrForCrsUsr (ActSeeFlr+ 81) -#define ActDelThrForCrsTch (ActSeeFlr+ 82) -#define ActDelThrForDegUsr (ActSeeFlr+ 83) -#define ActDelThrForDegTch (ActSeeFlr+ 84) -#define ActDelThrForCtrUsr (ActSeeFlr+ 85) -#define ActDelThrForCtrTch (ActSeeFlr+ 86) -#define ActDelThrForInsUsr (ActSeeFlr+ 87) -#define ActDelThrForInsTch (ActSeeFlr+ 88) -#define ActDelThrForGenUsr (ActSeeFlr+ 89) -#define ActDelThrForGenTch (ActSeeFlr+ 90) -#define ActDelThrForSWAUsr (ActSeeFlr+ 91) -#define ActDelThrForSWATch (ActSeeFlr+ 92) -#define ActCutThrForCrsUsr (ActSeeFlr+ 93) -#define ActCutThrForCrsTch (ActSeeFlr+ 94) -#define ActCutThrForDegUsr (ActSeeFlr+ 95) -#define ActCutThrForDegTch (ActSeeFlr+ 96) -#define ActCutThrForCtrUsr (ActSeeFlr+ 97) -#define ActCutThrForCtrTch (ActSeeFlr+ 98) -#define ActCutThrForInsUsr (ActSeeFlr+ 99) -#define ActCutThrForInsTch (ActSeeFlr+100) -#define ActCutThrForGenUsr (ActSeeFlr+101) -#define ActCutThrForGenTch (ActSeeFlr+102) -#define ActCutThrForSWAUsr (ActSeeFlr+103) -#define ActCutThrForSWATch (ActSeeFlr+104) -#define ActPasThrForCrsUsr (ActSeeFlr+105) -#define ActPasThrForCrsTch (ActSeeFlr+106) -#define ActPasThrForDegUsr (ActSeeFlr+107) -#define ActPasThrForDegTch (ActSeeFlr+108) -#define ActPasThrForCtrUsr (ActSeeFlr+109) -#define ActPasThrForCtrTch (ActSeeFlr+110) -#define ActPasThrForInsUsr (ActSeeFlr+111) -#define ActPasThrForInsTch (ActSeeFlr+112) -#define ActPasThrForGenUsr (ActSeeFlr+113) -#define ActPasThrForGenTch (ActSeeFlr+114) -#define ActPasThrForSWAUsr (ActSeeFlr+115) -#define ActPasThrForSWATch (ActSeeFlr+116) -#define ActDelPstForCrsUsr (ActSeeFlr+117) -#define ActDelPstForCrsTch (ActSeeFlr+118) -#define ActDelPstForDegUsr (ActSeeFlr+119) -#define ActDelPstForDegTch (ActSeeFlr+120) -#define ActDelPstForCtrUsr (ActSeeFlr+121) -#define ActDelPstForCtrTch (ActSeeFlr+122) -#define ActDelPstForInsUsr (ActSeeFlr+123) -#define ActDelPstForInsTch (ActSeeFlr+124) -#define ActDelPstForGenUsr (ActSeeFlr+125) -#define ActDelPstForGenTch (ActSeeFlr+126) -#define ActDelPstForSWAUsr (ActSeeFlr+127) -#define ActDelPstForSWATch (ActSeeFlr+128) -#define ActEnbPstForCrsUsr (ActSeeFlr+129) -#define ActEnbPstForCrsTch (ActSeeFlr+130) -#define ActEnbPstForDegUsr (ActSeeFlr+131) -#define ActEnbPstForDegTch (ActSeeFlr+132) -#define ActEnbPstForCtrUsr (ActSeeFlr+133) -#define ActEnbPstForCtrTch (ActSeeFlr+134) -#define ActEnbPstForInsUsr (ActSeeFlr+135) -#define ActEnbPstForInsTch (ActSeeFlr+136) -#define ActEnbPstForGenUsr (ActSeeFlr+137) -#define ActEnbPstForGenTch (ActSeeFlr+138) -#define ActEnbPstForSWAUsr (ActSeeFlr+139) -#define ActEnbPstForSWATch (ActSeeFlr+140) -#define ActDisPstForCrsUsr (ActSeeFlr+141) -#define ActDisPstForCrsTch (ActSeeFlr+142) -#define ActDisPstForDegUsr (ActSeeFlr+143) -#define ActDisPstForDegTch (ActSeeFlr+144) -#define ActDisPstForCtrUsr (ActSeeFlr+145) -#define ActDisPstForCtrTch (ActSeeFlr+146) -#define ActDisPstForInsUsr (ActSeeFlr+147) -#define ActDisPstForInsTch (ActSeeFlr+148) -#define ActDisPstForGenUsr (ActSeeFlr+149) -#define ActDisPstForGenTch (ActSeeFlr+150) -#define ActDisPstForSWAUsr (ActSeeFlr+151) -#define ActDisPstForSWATch (ActSeeFlr+152) -#define ActRcvMsgUsr (ActSeeFlr+153) -#define ActReqDelAllSntMsg (ActSeeFlr+154) -#define ActReqDelAllRcvMsg (ActSeeFlr+155) -#define ActDelAllSntMsg (ActSeeFlr+156) -#define ActDelAllRcvMsg (ActSeeFlr+157) -#define ActDelSntMsg (ActSeeFlr+158) -#define ActDelRcvMsg (ActSeeFlr+159) -#define ActExpSntMsg (ActSeeFlr+160) -#define ActExpRcvMsg (ActSeeFlr+161) -#define ActConSntMsg (ActSeeFlr+162) -#define ActConRcvMsg (ActSeeFlr+163) -#define ActLstBanUsr (ActSeeFlr+164) -#define ActBanUsrMsg (ActSeeFlr+165) -#define ActUnbUsrMsg (ActSeeFlr+166) -#define ActUnbUsrLst (ActSeeFlr+167) -#define ActCht (ActSeeFlr+168) +#define ActHidAnn (ActSeeFlr+ 12) +#define ActRevAnn (ActSeeFlr+ 13) +#define ActRemAnn (ActSeeFlr+ 14) +#define ActShoNot (ActSeeFlr+ 15) +#define ActWriNot (ActSeeFlr+ 16) +#define ActRcvNot (ActSeeFlr+ 17) +#define ActHidNot (ActSeeFlr+ 18) +#define ActRevNot (ActSeeFlr+ 19) +#define ActRemNot (ActSeeFlr+ 20) +#define ActSeeNewNtf (ActSeeFlr+ 21) +#define ActMrkNtfSee (ActSeeFlr+ 22) +#define ActSeeForCrsUsr (ActSeeFlr+ 23) +#define ActSeeForCrsTch (ActSeeFlr+ 24) +#define ActSeeForDegUsr (ActSeeFlr+ 25) +#define ActSeeForDegTch (ActSeeFlr+ 26) +#define ActSeeForCtrUsr (ActSeeFlr+ 27) +#define ActSeeForCtrTch (ActSeeFlr+ 28) +#define ActSeeForInsUsr (ActSeeFlr+ 29) +#define ActSeeForInsTch (ActSeeFlr+ 30) +#define ActSeeForGenUsr (ActSeeFlr+ 31) +#define ActSeeForGenTch (ActSeeFlr+ 32) +#define ActSeeForSWAUsr (ActSeeFlr+ 33) +#define ActSeeForSWATch (ActSeeFlr+ 34) +#define ActSeePstForCrsUsr (ActSeeFlr+ 35) +#define ActSeePstForCrsTch (ActSeeFlr+ 36) +#define ActSeePstForDegUsr (ActSeeFlr+ 37) +#define ActSeePstForDegTch (ActSeeFlr+ 38) +#define ActSeePstForCtrUsr (ActSeeFlr+ 39) +#define ActSeePstForCtrTch (ActSeeFlr+ 40) +#define ActSeePstForInsUsr (ActSeeFlr+ 41) +#define ActSeePstForInsTch (ActSeeFlr+ 42) +#define ActSeePstForGenUsr (ActSeeFlr+ 43) +#define ActSeePstForGenTch (ActSeeFlr+ 44) +#define ActSeePstForSWAUsr (ActSeeFlr+ 45) +#define ActSeePstForSWATch (ActSeeFlr+ 46) +#define ActRcvThrForCrsUsr (ActSeeFlr+ 47) +#define ActRcvThrForCrsTch (ActSeeFlr+ 48) +#define ActRcvThrForDegUsr (ActSeeFlr+ 49) +#define ActRcvThrForDegTch (ActSeeFlr+ 50) +#define ActRcvThrForCtrUsr (ActSeeFlr+ 51) +#define ActRcvThrForCtrTch (ActSeeFlr+ 52) +#define ActRcvThrForInsUsr (ActSeeFlr+ 53) +#define ActRcvThrForInsTch (ActSeeFlr+ 54) +#define ActRcvThrForGenUsr (ActSeeFlr+ 55) +#define ActRcvThrForGenTch (ActSeeFlr+ 56) +#define ActRcvThrForSWAUsr (ActSeeFlr+ 57) +#define ActRcvThrForSWATch (ActSeeFlr+ 58) +#define ActRcvRepForCrsUsr (ActSeeFlr+ 59) +#define ActRcvRepForCrsTch (ActSeeFlr+ 60) +#define ActRcvRepForDegUsr (ActSeeFlr+ 61) +#define ActRcvRepForDegTch (ActSeeFlr+ 62) +#define ActRcvRepForCtrUsr (ActSeeFlr+ 63) +#define ActRcvRepForCtrTch (ActSeeFlr+ 64) +#define ActRcvRepForInsUsr (ActSeeFlr+ 65) +#define ActRcvRepForInsTch (ActSeeFlr+ 66) +#define ActRcvRepForGenUsr (ActSeeFlr+ 67) +#define ActRcvRepForGenTch (ActSeeFlr+ 68) +#define ActRcvRepForSWAUsr (ActSeeFlr+ 69) +#define ActRcvRepForSWATch (ActSeeFlr+ 70) +#define ActReqDelThrCrsUsr (ActSeeFlr+ 71) +#define ActReqDelThrCrsTch (ActSeeFlr+ 72) +#define ActReqDelThrDegUsr (ActSeeFlr+ 73) +#define ActReqDelThrDegTch (ActSeeFlr+ 74) +#define ActReqDelThrCtrUsr (ActSeeFlr+ 75) +#define ActReqDelThrCtrTch (ActSeeFlr+ 76) +#define ActReqDelThrInsUsr (ActSeeFlr+ 77) +#define ActReqDelThrInsTch (ActSeeFlr+ 78) +#define ActReqDelThrGenUsr (ActSeeFlr+ 79) +#define ActReqDelThrGenTch (ActSeeFlr+ 80) +#define ActReqDelThrSWAUsr (ActSeeFlr+ 81) +#define ActReqDelThrSWATch (ActSeeFlr+ 82) +#define ActDelThrForCrsUsr (ActSeeFlr+ 83) +#define ActDelThrForCrsTch (ActSeeFlr+ 84) +#define ActDelThrForDegUsr (ActSeeFlr+ 85) +#define ActDelThrForDegTch (ActSeeFlr+ 86) +#define ActDelThrForCtrUsr (ActSeeFlr+ 87) +#define ActDelThrForCtrTch (ActSeeFlr+ 88) +#define ActDelThrForInsUsr (ActSeeFlr+ 89) +#define ActDelThrForInsTch (ActSeeFlr+ 90) +#define ActDelThrForGenUsr (ActSeeFlr+ 91) +#define ActDelThrForGenTch (ActSeeFlr+ 92) +#define ActDelThrForSWAUsr (ActSeeFlr+ 93) +#define ActDelThrForSWATch (ActSeeFlr+ 94) +#define ActCutThrForCrsUsr (ActSeeFlr+ 95) +#define ActCutThrForCrsTch (ActSeeFlr+ 96) +#define ActCutThrForDegUsr (ActSeeFlr+ 97) +#define ActCutThrForDegTch (ActSeeFlr+ 98) +#define ActCutThrForCtrUsr (ActSeeFlr+ 99) +#define ActCutThrForCtrTch (ActSeeFlr+100) +#define ActCutThrForInsUsr (ActSeeFlr+101) +#define ActCutThrForInsTch (ActSeeFlr+102) +#define ActCutThrForGenUsr (ActSeeFlr+103) +#define ActCutThrForGenTch (ActSeeFlr+104) +#define ActCutThrForSWAUsr (ActSeeFlr+105) +#define ActCutThrForSWATch (ActSeeFlr+106) +#define ActPasThrForCrsUsr (ActSeeFlr+107) +#define ActPasThrForCrsTch (ActSeeFlr+108) +#define ActPasThrForDegUsr (ActSeeFlr+109) +#define ActPasThrForDegTch (ActSeeFlr+110) +#define ActPasThrForCtrUsr (ActSeeFlr+111) +#define ActPasThrForCtrTch (ActSeeFlr+112) +#define ActPasThrForInsUsr (ActSeeFlr+113) +#define ActPasThrForInsTch (ActSeeFlr+114) +#define ActPasThrForGenUsr (ActSeeFlr+115) +#define ActPasThrForGenTch (ActSeeFlr+116) +#define ActPasThrForSWAUsr (ActSeeFlr+117) +#define ActPasThrForSWATch (ActSeeFlr+118) +#define ActDelPstForCrsUsr (ActSeeFlr+119) +#define ActDelPstForCrsTch (ActSeeFlr+120) +#define ActDelPstForDegUsr (ActSeeFlr+121) +#define ActDelPstForDegTch (ActSeeFlr+122) +#define ActDelPstForCtrUsr (ActSeeFlr+123) +#define ActDelPstForCtrTch (ActSeeFlr+124) +#define ActDelPstForInsUsr (ActSeeFlr+125) +#define ActDelPstForInsTch (ActSeeFlr+126) +#define ActDelPstForGenUsr (ActSeeFlr+127) +#define ActDelPstForGenTch (ActSeeFlr+128) +#define ActDelPstForSWAUsr (ActSeeFlr+129) +#define ActDelPstForSWATch (ActSeeFlr+130) +#define ActEnbPstForCrsUsr (ActSeeFlr+131) +#define ActEnbPstForCrsTch (ActSeeFlr+132) +#define ActEnbPstForDegUsr (ActSeeFlr+133) +#define ActEnbPstForDegTch (ActSeeFlr+134) +#define ActEnbPstForCtrUsr (ActSeeFlr+135) +#define ActEnbPstForCtrTch (ActSeeFlr+136) +#define ActEnbPstForInsUsr (ActSeeFlr+137) +#define ActEnbPstForInsTch (ActSeeFlr+138) +#define ActEnbPstForGenUsr (ActSeeFlr+139) +#define ActEnbPstForGenTch (ActSeeFlr+140) +#define ActEnbPstForSWAUsr (ActSeeFlr+141) +#define ActEnbPstForSWATch (ActSeeFlr+142) +#define ActDisPstForCrsUsr (ActSeeFlr+143) +#define ActDisPstForCrsTch (ActSeeFlr+144) +#define ActDisPstForDegUsr (ActSeeFlr+145) +#define ActDisPstForDegTch (ActSeeFlr+146) +#define ActDisPstForCtrUsr (ActSeeFlr+147) +#define ActDisPstForCtrTch (ActSeeFlr+148) +#define ActDisPstForInsUsr (ActSeeFlr+149) +#define ActDisPstForInsTch (ActSeeFlr+150) +#define ActDisPstForGenUsr (ActSeeFlr+151) +#define ActDisPstForGenTch (ActSeeFlr+152) +#define ActDisPstForSWAUsr (ActSeeFlr+153) +#define ActDisPstForSWATch (ActSeeFlr+154) +#define ActRcvMsgUsr (ActSeeFlr+155) +#define ActReqDelAllSntMsg (ActSeeFlr+156) +#define ActReqDelAllRcvMsg (ActSeeFlr+157) +#define ActDelAllSntMsg (ActSeeFlr+158) +#define ActDelAllRcvMsg (ActSeeFlr+159) +#define ActDelSntMsg (ActSeeFlr+160) +#define ActDelRcvMsg (ActSeeFlr+161) +#define ActExpSntMsg (ActSeeFlr+162) +#define ActExpRcvMsg (ActSeeFlr+163) +#define ActConSntMsg (ActSeeFlr+164) +#define ActConRcvMsg (ActSeeFlr+165) +#define ActLstBanUsr (ActSeeFlr+166) +#define ActBanUsrMsg (ActSeeFlr+167) +#define ActUnbUsrMsg (ActSeeFlr+168) +#define ActUnbUsrLst (ActSeeFlr+169) +#define ActCht (ActSeeFlr+170) /*****************************************************************************/ /****************************** Statistics tab *******************************/ diff --git a/swad_announcement.c b/swad_announcement.c index 5b774d0ca..19f0daa08 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -27,6 +27,7 @@ #include // For strncpy... +#include "swad_announcement.h" #include "swad_database.h" #include "swad_global.h" #include "swad_parameter.h" @@ -57,7 +58,8 @@ extern struct Globals Gbl; /***************************** Internal prototypes ***************************/ /*****************************************************************************/ -static void Ann_DrawAnAnnouncement (long AnnCod,const char *Subject,const char *Content, +static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status, + const char *Subject,const char *Content, unsigned Roles,bool ShowAllAnnouncements, bool ICanEditAnnouncements); static void Ann_PutHiddenParamAnnCod (long AnnCod); @@ -82,6 +84,8 @@ void Ann_ShowAllAnnouncements (void) unsigned Roles; char Subject[Cns_MAX_BYTES_SUBJECT+1]; char Content[Cns_MAX_BYTES_TEXT+1]; + unsigned UnsignedNum; + Ann_Status_t Status; bool ICanEditAnnouncements = (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); /***** Put link (form) to create a new announcement *****/ @@ -93,7 +97,8 @@ void Ann_ShowAllAnnouncements (void) } /***** Get announcements from database *****/ - sprintf (Query,"SELECT AnnCod,Roles,Subject,Content FROM announcements" + sprintf (Query,"SELECT AnnCod,Status,Roles,Subject,Content" + " FROM announcements" " ORDER BY AnnCod DESC"); NumAnnouncements = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get announcements"); @@ -114,21 +119,28 @@ void Ann_ShowAllAnnouncements (void) if (sscanf (row[0],"%ld",&AnnCod) != 1) Lay_ShowErrorAndExit ("Wrong code of announcement."); - /* Get roles (row[1]) */ - if (sscanf (row[1],"%u",&Roles) != 1) + /* Get status of the announcement (row[1]) */ + Status = Ann_OBSOLETE_ANNOUNCEMENT; + if (sscanf (row[1],"%u",&UnsignedNum) == 1) + if (UnsignedNum < Ann_NUM_STATUS) + Status = (Ann_Status_t) UnsignedNum; + + /* Get roles (row[2]) */ + if (sscanf (row[2],"%u",&Roles) != 1) Lay_ShowErrorAndExit ("Error when reading roles of announcement."); - /* Get the content (row[2]) */ - strncpy (Subject,row[2],Cns_MAX_BYTES_SUBJECT); + /* Get the content (row[3]) */ + strncpy (Subject,row[3],Cns_MAX_BYTES_SUBJECT); Content[Cns_MAX_BYTES_SUBJECT] = '\0'; - /* Get the content (row[3]) and insert links */ - strncpy (Content,row[3],Cns_MAX_BYTES_TEXT); + /* Get the content (row[4]) and insert links */ + strncpy (Content,row[4],Cns_MAX_BYTES_TEXT); Content[Cns_MAX_BYTES_TEXT] = '\0'; Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,50); /* Show the announcement */ - Ann_DrawAnAnnouncement (AnnCod,Subject,Content,Roles,true, + Ann_DrawAnAnnouncement (AnnCod,Status,Subject,Content, + Roles,true, ICanEditAnnouncements); } @@ -158,9 +170,11 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void) /***** Select announcements not seen *****/ // Roles == 24 ==> Teachers and students sprintf (Query,"SELECT AnnCod,Subject,Content FROM announcements" - " WHERE (Roles&%u)<>0 AND AnnCod NOT IN" + " WHERE (Roles&%u)<>0 AND Status='%u'" + " AND AnnCod NOT IN" " (SELECT AnnCod FROM ann_seen WHERE UsrCod='%ld')" " ORDER BY AnnCod DESC", // Newest first + (unsigned) Ann_ACTIVE_ANNOUNCEMENT, Gbl.Usrs.Me.UsrDat.Roles, // All my roles in different courses Gbl.Usrs.Me.UsrDat.UsrCod); NumAnnouncements = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get announcements"); @@ -190,7 +204,8 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void) Str_InsertLinkInURLs (Content,Cns_MAX_BYTES_TEXT,50); /* Show the announcement */ - Ann_DrawAnAnnouncement (AnnCod,Subject,Content,0,false,false); + Ann_DrawAnAnnouncement (AnnCod,Ann_ACTIVE_ANNOUNCEMENT,Subject,Content, + 0,false,false); } fprintf (Gbl.F.Out,""); @@ -201,7 +216,8 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void) /****************** Draw an announcement as a yellow note ********************/ /*****************************************************************************/ -static void Ann_DrawAnAnnouncement (long AnnCod,const char *Subject,const char *Content, +static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status, + const char *Subject,const char *Content, unsigned Roles,bool ShowAllAnnouncements, bool ICanEditAnnouncements) { @@ -209,13 +225,35 @@ static void Ann_DrawAnAnnouncement (long AnnCod,const char *Subject,const char * extern const char *Txt_Users; extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_Remove; + extern const char *Txt_NOTICE_Active_Mark_as_obsolete; + extern const char *Txt_NOTICE_Obsolete_Mark_as_active; extern const char *Txt_Do_not_show_again; + static const char *ContainerClass[Ann_NUM_STATUS] = + { + "NOTICE_CONTAINER_ACTIVE", // Ann_ACTIVE_ANNOUNCEMENT + "NOTICE_CONTAINER_OBSOLETE", // Ann_OBSOLETE_ANNOUNCEMENT + }; + static const char *SubjectClass[Ann_NUM_STATUS] = + { + "NOTICE_SUBJECT_ACTIVE", // Ann_ACTIVE_ANNOUNCEMENT + "NOTICE_SUBJECT_OBSOLETE", // Ann_OBSOLETE_ANNOUNCEMENT + }; + static const char *ContentClass[Ann_NUM_STATUS] = + { + "NOTICE_TEXT_ACTIVE", // Ann_ACTIVE_ANNOUNCEMENT + "NOTICE_TEXT_OBSOLETE", // Ann_OBSOLETE_ANNOUNCEMENT + }; + static const char *UsersClass[Ann_NUM_STATUS] = + { + "NOTICE_AUTHOR_ACTIVE", // Ann_ACTIVE_ANNOUNCEMENT + "NOTICE_AUTHOR_OBSOLETE", // Ann_OBSOLETE_ANNOUNCEMENT + }; Rol_Role_t Role; bool RolesSelected; /***** Start yellow note *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
", + ContainerClass[Status]); if (ICanEditAnnouncements) { @@ -232,15 +270,47 @@ static void Ann_DrawAnAnnouncement (long AnnCod,const char *Subject,const char * Txt_Remove, Txt_Remove); Act_FormEnd (); + + /* Put form to change the status of the notice */ + switch (Status) + { + case Ann_ACTIVE_ANNOUNCEMENT: + Act_FormStart (ActHidAnn); + Ann_PutHiddenParamAnnCod (AnnCod); + fprintf (Gbl.F.Out,"
" + "" + "
", + Gbl.Prefs.IconsURL, + Txt_NOTICE_Active_Mark_as_obsolete, + Txt_NOTICE_Active_Mark_as_obsolete); + break; + case Ann_OBSOLETE_ANNOUNCEMENT: + Act_FormStart (ActRevAnn); + Ann_PutHiddenParamAnnCod (AnnCod); + fprintf (Gbl.F.Out,"
" + "" + "
", + Gbl.Prefs.IconsURL, + Txt_NOTICE_Obsolete_Mark_as_active, + Txt_NOTICE_Obsolete_Mark_as_active); + break; + } + Act_FormEnd (); } - /***** Write the content of the announcement *****/ - fprintf (Gbl.F.Out,"
%s
", - Subject); + /***** Write the subject of the announcement *****/ + fprintf (Gbl.F.Out,"
%s
", + SubjectClass[Status],Subject); /***** Write the content of the announcement *****/ - fprintf (Gbl.F.Out,"
%s
", - Content); + fprintf (Gbl.F.Out,"
%s
", + ContentClass[Status],Content); /***** Write form *****/ fprintf (Gbl.F.Out,"
"); @@ -248,8 +318,8 @@ static void Ann_DrawAnAnnouncement (long AnnCod,const char *Subject,const char * if (ShowAllAnnouncements) { /* Users' roles who can view this announcement */ - fprintf (Gbl.F.Out,"

%s:", - Txt_Users); + fprintf (Gbl.F.Out,"

%s:", + UsersClass[Status],Txt_Users); for (Role = Rol_STUDENT, RolesSelected = false; Role <= Rol_TEACHER; Role++) @@ -422,6 +492,45 @@ 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 ************/ +/*****************************************************************************/ + +void Ann_HideActiveAnnouncement (void) + { + char Query[256]; + long AnnCod; + + /***** Get the code of the global announcement to hide *****/ + AnnCod = Ann_GetParamAnnCod (); + + /***** Set global announcement as hidden *****/ + sprintf (Query,"UPDATE announcements SET Status='%u'" + " WHERE AnnCod='%ld'", + (unsigned) Ann_OBSOLETE_ANNOUNCEMENT,AnnCod); + DB_QueryUPDATE (Query,"can not hide announcement"); + } + +/*****************************************************************************/ +/*********** Mark as active a global announcement that was hidden ************/ +/*****************************************************************************/ + +void Ann_RevealHiddenAnnouncement (void) + { + char Query[256]; + long AnnCod; + + /***** Get the code of the global announcement to show *****/ + AnnCod = Ann_GetParamAnnCod (); + + /***** Set global announcement as shown *****/ + sprintf (Query,"UPDATE announcements SET Status='%u'" + " WHERE AnnCod='%ld'", + (unsigned) Ann_ACTIVE_ANNOUNCEMENT,AnnCod); + DB_QueryUPDATE (Query,"can not reveal announcement"); + } + /*****************************************************************************/ /********************** Remove a global announcement *************************/ /*****************************************************************************/ diff --git a/swad_announcement.h b/swad_announcement.h index 46bb6960d..bfb037dcc 100644 --- a/swad_announcement.h +++ b/swad_announcement.h @@ -35,6 +35,13 @@ /******************************* Public types ********************************/ /*****************************************************************************/ +#define Ann_NUM_STATUS 2 +typedef enum + { + Ann_ACTIVE_ANNOUNCEMENT = 0, + Ann_OBSOLETE_ANNOUNCEMENT = 1, + } Ann_Status_t; // Don't change these numbers because they are used in database + /*****************************************************************************/ /***************************** Public prototypes *****************************/ /*****************************************************************************/ @@ -44,6 +51,8 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void); void Ann_ShowFormAnnouncement (void); void Ann_ReceiveAnnouncement (void); +void Ann_HideActiveAnnouncement (void); +void Ann_RevealHiddenAnnouncement (void); void Ann_RemoveAnnouncement (void); void Ann_MarkAnnouncementAsSeen (void); void Ann_RemoveUsrFromSeenAnnouncements (long UsrCod); diff --git a/swad_changelog.h b/swad_changelog.h index f1b7aaa21..73d1280fa 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -109,12 +109,18 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.33.1 (2015/11/01)" +#define Log_PLATFORM_VERSION "SWAD 15.34 (2015/11/01)" // 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.33.1: Nov 01, 2015 New layout of announcements. (186755 lines) + Version 15.34: Nov 01, 2015 Global announcements can be hidden. (186896 lines) + 3 changes necessary in database: +ALTER TABLE announcements ADD COLUMN Status TINYINT NOT NULL DEFAULT 0 AFTER AnnCod,ADD INDEX (Status); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1470','es','N','Ocultar anuncio global'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1471','es','N','Mostrar anuncio global'); + + Version 15.33.1: Nov 01, 2015 New layout of global announcements. (186755 lines) Version 15.33: Nov 01, 2015 New layout of notices. (186708 lines) Version 15.32.2: Oct 31, 2015 Fixed bug in form submit. (186618 lines) Version 15.32.1: Oct 31, 2015 Dates in holidays are shown in big-endian. diff --git a/swad_database.c b/swad_database.c index e1a94e9de..28ff665e8 100644 --- a/swad_database.c +++ b/swad_database.c @@ -206,22 +206,24 @@ mysql> DESCRIBE ann_seen; /***** Table announcements *****/ /* mysql> DESCRIBE announcements; -+---------+---------+------+-----+---------+----------------+ -| Field | Type | Null | Key | Default | Extra | -+---------+---------+------+-----+---------+----------------+ -| AnnCod | int(11) | NO | PRI | NULL | auto_increment | -| Roles | int(11) | NO | | 0 | | -| Subject | text | NO | | NULL | | -| Content | text | NO | | NULL | | -+---------+---------+------+-----+---------+----------------+ -4 rows in set (0.00 sec) ++---------+------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++---------+------------+------+-----+---------+----------------+ +| AnnCod | int(11) | NO | PRI | NULL | auto_increment | +| Status | tinyint(4) | NO | MUL | 0 | | +| Roles | int(11) | NO | | 0 | | +| Subject | text | NO | | NULL | | +| Content | text | NO | | NULL | | ++---------+------------+------+-----+---------+----------------+ +5 rows in set (0.00 sec) */ DB_CreateTable ("CREATE TABLE IF NOT EXISTS announcements (" "AnnCod INT NOT NULL AUTO_INCREMENT," + "Status TINYINT NOT NULL DEFAULT 0," "Roles INT NOT NULL DEFAULT 0," "Subject TEXT NOT NULL," "Content TEXT NOT NULL," - "UNIQUE INDEX(AnnCod))"); + "UNIQUE INDEX(AnnCod),INDEX(Status))"); /***** Table asg_grp *****/ /* diff --git a/swad_notice.c b/swad_notice.c index daa307a6f..711ac36b2 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -70,7 +70,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, time_t TimeUTC, const char *Content, long UsrCod, - Not_Status_t NoticeStatus, + Not_Status_t Status, bool ICanEditNotices); static long Not_InsertNoticeInDB (const char *Content); static void Not_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod,unsigned NumUsrsToBeNotifiedByEMail); @@ -220,22 +220,22 @@ void Not_RevealHiddenNotice (void) char Query[256]; long NotCod; - /***** Get the code of the notice to show *****/ + /***** Get the code of the notice to reveal *****/ NotCod = Not_GetParamNotCod (); - /***** Set notice as shown *****/ + /***** Set notice as active *****/ sprintf (Query,"UPDATE notices SET Status='%u'" " WHERE NotCod='%ld' AND CrsCod='%ld'", (unsigned) Not_ACTIVE_NOTICE, NotCod,Gbl.CurrentCrs.Crs.CrsCod); - DB_QueryUPDATE (Query,"can not show notice"); + DB_QueryUPDATE (Query,"can not reveal notice"); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.CurrentCrs.Crs); } /*****************************************************************************/ -/******************************* Delete a notice *****************************/ +/******************************* Remove a notice *****************************/ /*****************************************************************************/ void Not_DeleteNotice (void) @@ -299,7 +299,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing) time_t TimeUTC; long UsrCod; unsigned UnsignedNum; - Not_Status_t NoticeStatus; + Not_Status_t Status; bool ICanEditNotices; /***** A course must be selected (Gbl.CurrentCrs.Crs.CrsCod > 0) *****/ @@ -343,15 +343,15 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing) Str_LimitLengthHTMLStr (Content,Not_MAX_CHARS_ON_NOTICE); /* Get status of the notice (row[3]) */ - NoticeStatus = Not_OBSOLETE_NOTICE; + Status = Not_OBSOLETE_NOTICE; if (sscanf (row[3],"%u",&UnsignedNum) == 1) if (UnsignedNum < Not_NUM_STATUS) - NoticeStatus = (Not_Status_t) UnsignedNum; + Status = (Not_Status_t) UnsignedNum; /* Draw the notice */ Not_DrawANotice (TypeNoticesListing, Gbl.CurrentCrs.Notices.HighlightNotCod, - TimeUTC,Content,UsrCod,NoticeStatus, + TimeUTC,Content,UsrCod,Status, ICanEditNotices); } @@ -440,15 +440,15 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing) Str_LimitLengthHTMLStr (Content,Not_MAX_CHARS_ON_NOTICE); /* Get status of the notice (row[4]) */ - NoticeStatus = Not_OBSOLETE_NOTICE; + Status = Not_OBSOLETE_NOTICE; if (sscanf (row[4],"%u",&UnsignedNum) == 1) if (UnsignedNum < Not_NUM_STATUS) - NoticeStatus = (Not_Status_t) UnsignedNum; + Status = (Not_Status_t) UnsignedNum; /* Draw the notice */ Not_DrawANotice (TypeNoticesListing, NotCod, - TimeUTC,Content,UsrCod,NoticeStatus, + TimeUTC,Content,UsrCod,Status, ICanEditNotices); } @@ -475,7 +475,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, time_t TimeUTC, const char *Content, long UsrCod, - Not_Status_t NoticeStatus, + Not_Status_t Status, bool ICanEditNotices) { extern const char *The_ClassForm[The_NUM_THEMES]; @@ -510,7 +510,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, /***** Start yellow note *****/ fprintf (Gbl.F.Out,"

", - ContainerClass[NoticeStatus], + ContainerClass[Status], Not_ContainerWidth[TypeNoticesListing]); /***** Write the date in the top part of the yellow note *****/ @@ -533,8 +533,8 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, Txt_Remove); Act_FormEnd (); - /* Put form to change the state of the notice */ - switch (NoticeStatus) + /* Put form to change the status of the notice */ + switch (Status) { case Not_ACTIVE_NOTICE: Act_FormStart (ActHidNot); @@ -567,7 +567,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, } else // Don't put forms /* Status of the notice */ - switch (NoticeStatus) + switch (Status) { case Not_ACTIVE_NOTICE: fprintf (Gbl.F.Out,"" @@ -597,13 +597,13 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, /* Write the date */ UniqueId++; fprintf (Gbl.F.Out,"
", - DateClass[NoticeStatus]); + DateClass[Status]); if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) { /* Form to view full notice */ Act_FormStart (ActShoNot); Not_PutHiddenParamNotCod (NotCod); - Act_LinkFormSubmit (Txt_See_full_notice,DateClass[NoticeStatus]); + Act_LinkFormSubmit (Txt_See_full_notice,DateClass[Status]); } fprintf (Gbl.F.Out,"", UniqueId); @@ -620,7 +620,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, /***** Write the content of the notice *****/ fprintf (Gbl.F.Out,"
%s", - TextClass[NoticeStatus],Content); + TextClass[Status],Content); if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) { fprintf (Gbl.F.Out,"
"); @@ -642,7 +642,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, /***** Write the author *****/ fprintf (Gbl.F.Out,"
", - AuthorClass[NoticeStatus]); + AuthorClass[Status]); Usr_UsrDataConstructor (&UsrDat); UsrDat.UsrCod = UsrCod; if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the autor @@ -701,7 +701,7 @@ void Not_GetNotifNotice (char *SummaryStr,char **ContentStr,long NotCod,unsigned // Returns the number of (active or obsolete) notices // sent from this location (all the platform, current degree or current course) -unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned *NumNotif) +unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t Status,unsigned *NumNotif) { char Query[1024]; MYSQL_RES *mysql_res; @@ -715,7 +715,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)" " FROM notices" " WHERE Status='%u'", - NoticeStatus); + Status); break; case Sco_SCOPE_CTY: sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)" @@ -727,7 +727,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned " AND courses.CrsCod=notices.CrsCod" " AND notices.Status='%u'", Gbl.CurrentCty.Cty.CtyCod, - NoticeStatus); + Status); break; case Sco_SCOPE_INS: sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)" @@ -738,7 +738,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned " AND courses.CrsCod=notices.CrsCod" " AND notices.Status='%u'", Gbl.CurrentIns.Ins.InsCod, - NoticeStatus); + Status); break; case Sco_SCOPE_CTR: sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)" @@ -748,7 +748,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned " AND courses.CrsCod=notices.CrsCod" " AND notices.Status='%u'", Gbl.CurrentCtr.Ctr.CtrCod, - NoticeStatus); + Status); break; case Sco_SCOPE_DEG: sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)" @@ -757,7 +757,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned " AND courses.CrsCod=notices.CrsCod" " AND notices.Status='%u'", Gbl.CurrentDeg.Deg.DegCod, - NoticeStatus); + Status); break; case Sco_SCOPE_CRS: sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)" @@ -765,7 +765,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned " WHERE CrsCod='%ld'" " AND Status='%u'", Gbl.CurrentCrs.Crs.CrsCod, - NoticeStatus); + Status); break; default: Lay_ShowErrorAndExit ("Wrong scope."); diff --git a/swad_notice.h b/swad_notice.h index 74c601340..1c07019db 100644 --- a/swad_notice.h +++ b/swad_notice.h @@ -64,7 +64,7 @@ void Not_DeleteNotice (void); void Not_ShowANotice (void); void Not_ShowNotices (Not_Listing_t TypeNoticesListing); void Not_GetNotifNotice (char *SummaryStr,char **ContentStr,long NotCod,unsigned MaxChars,bool GetContent); -unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned *NumNotif); +unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t Status,unsigned *NumNotif); unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif); #endif