2021-02-21 21:30:06 +01:00
|
|
|
|
// swad_timeline_form.c: social timeline forms
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
|
2021-02-21 21:30:06 +01:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General 3 License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/*********************************** Headers *********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#define _GNU_SOURCE // For asprintf
|
|
|
|
|
#include <stdio.h> // For asprintf
|
2021-04-23 22:57:57 +02:00
|
|
|
|
#include <stdlib.h> // For free
|
2021-02-21 21:30:06 +01:00
|
|
|
|
|
|
|
|
|
#include "swad_action.h"
|
2022-11-06 18:11:10 +01:00
|
|
|
|
#include "swad_action_list.h"
|
2022-10-19 18:07:49 +02:00
|
|
|
|
#include "swad_alert.h"
|
2021-04-26 15:27:27 +02:00
|
|
|
|
#include "swad_error.h"
|
2021-02-21 21:30:06 +01:00
|
|
|
|
#include "swad_global.h"
|
|
|
|
|
#include "swad_timeline.h"
|
2021-03-03 02:15:32 +01:00
|
|
|
|
#include "swad_timeline_favourite.h"
|
2021-02-21 21:30:06 +01:00
|
|
|
|
#include "swad_timeline_form.h"
|
2021-03-03 02:15:32 +01:00
|
|
|
|
#include "swad_timeline_share.h"
|
2021-02-21 21:30:06 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Private constants and types ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2024-03-20 09:39:04 +01:00
|
|
|
|
Act_Action_t TmlFrm_ActionGbl[TmlFrm_NUM_ACTIONS] =
|
2021-02-21 21:30:06 +01:00
|
|
|
|
{
|
2021-12-31 14:51:44 +01:00
|
|
|
|
[TmlFrm_RECEIVE_POST] = ActRcvPstGblTL,
|
|
|
|
|
[TmlFrm_RECEIVE_COMM] = ActRcvComGblTL,
|
|
|
|
|
[TmlFrm_REQ_REM_NOTE] = ActReqRemPubGblTL,
|
|
|
|
|
[TmlFrm_REQ_REM_COMM] = ActReqRemComGblTL,
|
|
|
|
|
[TmlFrm_REM_NOTE ] = ActRemPubGblTL,
|
|
|
|
|
[TmlFrm_REM_COMM ] = ActRemComGblTL,
|
|
|
|
|
[TmlFrm_SHA_NOTE ] = ActShaNotGblTL,
|
|
|
|
|
[TmlFrm_UNS_NOTE ] = ActUnsNotGblTL,
|
|
|
|
|
[TmlFrm_FAV_NOTE ] = ActFavNotGblTL,
|
|
|
|
|
[TmlFrm_FAV_COMM ] = ActFavComGblTL,
|
|
|
|
|
[TmlFrm_UNF_NOTE ] = ActUnfNotGblTL,
|
|
|
|
|
[TmlFrm_UNF_COMM ] = ActUnfComGblTL,
|
|
|
|
|
[TmlFrm_ALL_SHA_NOTE] = ActAllShaNotGblTL,
|
|
|
|
|
[TmlFrm_ALL_FAV_NOTE] = ActAllFavNotGblTL,
|
|
|
|
|
[TmlFrm_ALL_FAV_COMM] = ActAllFavComGblTL,
|
|
|
|
|
[TmlFrm_SHO_HID_COMM] = ActShoHidComGblTL,
|
2021-02-21 21:30:06 +01:00
|
|
|
|
};
|
2024-03-20 09:39:04 +01:00
|
|
|
|
Act_Action_t TmlFrm_ActionUsr[TmlFrm_NUM_ACTIONS] =
|
2021-02-21 21:30:06 +01:00
|
|
|
|
{
|
2021-12-31 14:51:44 +01:00
|
|
|
|
[TmlFrm_RECEIVE_POST] = ActRcvPstUsrTL,
|
|
|
|
|
[TmlFrm_RECEIVE_COMM] = ActRcvComUsrTL,
|
|
|
|
|
[TmlFrm_REQ_REM_NOTE] = ActReqRemPubUsrTL,
|
|
|
|
|
[TmlFrm_REQ_REM_COMM] = ActReqRemComUsrTL,
|
|
|
|
|
[TmlFrm_REM_NOTE ] = ActRemPubUsrTL,
|
|
|
|
|
[TmlFrm_REM_COMM ] = ActRemComUsrTL,
|
|
|
|
|
[TmlFrm_SHA_NOTE ] = ActShaNotUsrTL,
|
|
|
|
|
[TmlFrm_UNS_NOTE ] = ActUnsNotUsrTL,
|
|
|
|
|
[TmlFrm_FAV_NOTE ] = ActFavNotUsrTL,
|
|
|
|
|
[TmlFrm_FAV_COMM ] = ActFavComUsrTL,
|
|
|
|
|
[TmlFrm_UNF_NOTE ] = ActUnfNotUsrTL,
|
|
|
|
|
[TmlFrm_UNF_COMM ] = ActUnfComUsrTL,
|
|
|
|
|
[TmlFrm_ALL_SHA_NOTE] = ActAllShaNotUsrTL,
|
|
|
|
|
[TmlFrm_ALL_FAV_NOTE] = ActAllFavNotUsrTL,
|
|
|
|
|
[TmlFrm_ALL_FAV_COMM] = ActAllFavComUsrTL,
|
|
|
|
|
[TmlFrm_SHO_HID_COMM] = ActShoHidComUsrTL,
|
2021-02-21 21:30:06 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************** External global variables from others modules ****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
extern struct Globals Gbl;
|
|
|
|
|
|
2021-03-03 02:15:32 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******************** Form to fav/unfav or share/unshare *********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_PutFormToFavUnfShaUns (TmlUsr_FavSha_t FavSha,long Cod)
|
2021-03-03 02:15:32 +01:00
|
|
|
|
{
|
2021-12-31 14:51:44 +01:00
|
|
|
|
struct Tml_Form Form[TmlUsr_NUM_FAV_SHA][2] =
|
2021-03-03 02:15:32 +01:00
|
|
|
|
{
|
2021-12-31 14:51:44 +01:00
|
|
|
|
[TmlUsr_FAV_UNF_NOTE] =
|
2021-03-03 02:15:32 +01:00
|
|
|
|
{
|
|
|
|
|
[false] = // I have not faved ==> fav
|
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
.Action = TmlFrm_FAV_NOTE,
|
|
|
|
|
.ParFormat = "NotCod=%ld",
|
|
|
|
|
.ParCod = Cod,
|
|
|
|
|
.Icon = TmlFav_ICON_FAV,
|
|
|
|
|
.Color = Ico_BLACK,
|
2021-03-03 02:15:32 +01:00
|
|
|
|
},
|
|
|
|
|
[true] = // I have faved ==> unfav
|
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
.Action = TmlFrm_UNF_NOTE,
|
|
|
|
|
.ParFormat = "NotCod=%ld",
|
|
|
|
|
.ParCod = Cod,
|
|
|
|
|
.Icon = TmlFav_ICON_FAV,
|
|
|
|
|
.Color = Ico_RED,
|
2021-03-03 02:15:32 +01:00
|
|
|
|
},
|
|
|
|
|
},
|
2021-12-31 14:51:44 +01:00
|
|
|
|
[TmlUsr_FAV_UNF_COMM] =
|
2021-03-03 02:15:32 +01:00
|
|
|
|
{
|
|
|
|
|
[false] = // I have not faved ==> fav
|
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
.Action = TmlFrm_FAV_COMM,
|
|
|
|
|
.ParFormat = "PubCod=%ld",
|
|
|
|
|
.ParCod = Cod,
|
|
|
|
|
.Icon = TmlFav_ICON_FAV,
|
|
|
|
|
.Color = Ico_BLACK,
|
2021-03-03 02:15:32 +01:00
|
|
|
|
},
|
|
|
|
|
[true] = // I have faved ==> unfav
|
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
.Action = TmlFrm_UNF_COMM,
|
|
|
|
|
.ParFormat = "PubCod=%ld",
|
|
|
|
|
.ParCod = Cod,
|
|
|
|
|
.Icon = TmlFav_ICON_FAV,
|
|
|
|
|
.Color = Ico_RED,
|
2021-03-03 02:15:32 +01:00
|
|
|
|
},
|
|
|
|
|
},
|
2021-12-31 14:51:44 +01:00
|
|
|
|
[TmlUsr_SHA_UNS_NOTE] =
|
2021-03-03 02:15:32 +01:00
|
|
|
|
{
|
|
|
|
|
[false] = // I have not shared ==> share
|
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
.Action = TmlFrm_SHA_NOTE,
|
|
|
|
|
.ParFormat = "NotCod=%ld",
|
|
|
|
|
.ParCod = Cod,
|
|
|
|
|
.Icon = TmlSha_ICON_SHARE,
|
|
|
|
|
.Color = Ico_BLACK,
|
2021-03-03 02:15:32 +01:00
|
|
|
|
},
|
|
|
|
|
[true] = // I have shared ==> unshare
|
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
.Action = TmlFrm_UNS_NOTE,
|
|
|
|
|
.ParFormat = "NotCod=%ld",
|
|
|
|
|
.ParCod = Cod,
|
|
|
|
|
.Icon = TmlSha_ICON_SHARE,
|
|
|
|
|
.Color = Ico_GREEN,
|
2021-03-03 02:15:32 +01:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
bool FavedShared;
|
|
|
|
|
|
|
|
|
|
/***** Form and icon to fav/unfav note *****/
|
2021-12-31 14:51:44 +01:00
|
|
|
|
FavedShared = TmlUsr_CheckIfFavedSharedByUsr (FavSha,Cod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
|
|
|
|
TmlFrm_FormFavSha (&Form[FavSha][FavedShared]);
|
2021-03-03 02:15:32 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-02-21 21:30:06 +01:00
|
|
|
|
/*****************************************************************************/
|
2021-03-02 00:54:26 +01:00
|
|
|
|
/***************** Begin a form in global or user timeline *******************/
|
2021-02-21 21:30:06 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_BeginForm (const struct Tml_Timeline *Timeline,
|
|
|
|
|
TmlFrm_Action_t Action)
|
2021-02-21 21:30:06 +01:00
|
|
|
|
{
|
|
|
|
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
|
|
|
|
{
|
2021-03-02 00:54:26 +01:00
|
|
|
|
/***** Begin form in user timeline *****/
|
2021-12-31 14:51:44 +01:00
|
|
|
|
Frm_BeginFormAnchor (TmlFrm_ActionUsr[Action],"timeline");
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Usr_PutParOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
|
2021-02-21 21:30:06 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-03-02 00:54:26 +01:00
|
|
|
|
/***** Begin form in global timeline *****/
|
2021-12-31 14:51:44 +01:00
|
|
|
|
Frm_BeginForm (TmlFrm_ActionGbl[Action]);
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Usr_PutParWho (Timeline->Who);
|
2021-02-21 21:30:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_EndForm (void)
|
2021-03-02 00:54:26 +01:00
|
|
|
|
{
|
|
|
|
|
Frm_EndForm ();
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-21 21:30:06 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/******* Form to fav/unfav or share/unshare in global or user timeline *******/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_FormFavSha (const struct Tml_Form *Form)
|
2021-02-21 21:30:06 +01:00
|
|
|
|
{
|
|
|
|
|
char *OnSubmit;
|
2024-06-20 10:51:17 +02:00
|
|
|
|
char ParStr[7 + Cns_MAX_DIGITS_LONG + 1];
|
2021-02-21 21:30:06 +01:00
|
|
|
|
|
|
|
|
|
/***** Create parameter string *****/
|
2023-03-10 00:13:55 +01:00
|
|
|
|
sprintf (ParStr,Form->ParFormat,Form->ParCod);
|
2021-02-21 21:30:06 +01:00
|
|
|
|
|
|
|
|
|
/*
|
2021-11-12 01:12:15 +01:00
|
|
|
|
___________________________________________________________________________
|
2021-02-21 21:30:06 +01:00
|
|
|
|
| div which content will be updated (parent of parent of form) |
|
2021-11-12 01:12:15 +01:00
|
|
|
|
| _____________________ _______ _____________________________________ |
|
2021-02-21 21:30:06 +01:00
|
|
|
|
| | div (parent of form)| | div | | div for users | |
|
2021-11-12 01:12:15 +01:00
|
|
|
|
| | _________________ | | for | | ______ ______ ______ ______ | |
|
2021-02-21 21:30:06 +01:00
|
|
|
|
| | | this form | | | num. | | | | | | | | | form | | |
|
2021-11-12 01:12:15 +01:00
|
|
|
|
| | | _____________ | | | of | | | user | | user | | user | | to | | |
|
2021-02-21 21:30:06 +01:00
|
|
|
|
| | | | fav icon | | | | users | | | 1 | | 2 | | 3 | | show | | |
|
2021-11-12 01:12:15 +01:00
|
|
|
|
| | | |_____________| | | | | | | | | | | | | all | | |
|
|
|
|
|
| | |_________________| | | | | |______| |______| |______| |______| | |
|
|
|
|
|
| |_____________________| |_______| |_____________________________________| |
|
|
|
|
|
|___________________________________________________________________________|
|
2021-02-21 21:30:06 +01:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/***** Form and icon to mark note as favourite *****/
|
|
|
|
|
/* Form with icon */
|
|
|
|
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
|
|
|
|
{
|
|
|
|
|
if (asprintf (&OnSubmit,"updateDivFaversSharers(this,"
|
|
|
|
|
"'act=%ld&ses=%s&%s&OtherUsrCod=%s');"
|
|
|
|
|
" return false;", // return false is necessary to not submit form
|
2021-12-31 14:51:44 +01:00
|
|
|
|
Act_GetActCod (TmlFrm_ActionUsr[Form->Action]),
|
2021-02-21 21:30:06 +01:00
|
|
|
|
Gbl.Session.Id,
|
2023-03-10 00:13:55 +01:00
|
|
|
|
ParStr,
|
2021-02-21 21:30:06 +01:00
|
|
|
|
Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0)
|
2021-04-26 15:27:27 +02:00
|
|
|
|
Err_NotEnoughMemoryExit ();
|
2022-10-15 10:42:32 +02:00
|
|
|
|
Frm_BeginFormAnchorOnSubmit (ActUnk,"timeline",OnSubmit);
|
2022-06-30 11:53:24 +02:00
|
|
|
|
free (OnSubmit);
|
|
|
|
|
Ico_PutIconLink (Form->Icon,Form->Color,
|
2022-06-30 13:39:57 +02:00
|
|
|
|
TmlFrm_ActionUsr[Form->Action]);
|
2021-02-21 21:30:06 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (asprintf (&OnSubmit,"updateDivFaversSharers(this,"
|
|
|
|
|
"'act=%ld&ses=%s&%s');"
|
|
|
|
|
" return false;", // return false is necessary to not submit form
|
2021-12-31 14:51:44 +01:00
|
|
|
|
Act_GetActCod (TmlFrm_ActionGbl[Form->Action]),
|
2021-02-21 21:30:06 +01:00
|
|
|
|
Gbl.Session.Id,
|
2023-03-10 00:13:55 +01:00
|
|
|
|
ParStr) < 0)
|
2021-04-26 15:27:27 +02:00
|
|
|
|
Err_NotEnoughMemoryExit ();
|
2022-10-15 10:42:32 +02:00
|
|
|
|
Frm_BeginFormAnchorOnSubmit (ActUnk,NULL,OnSubmit);
|
2022-06-30 11:53:24 +02:00
|
|
|
|
free (OnSubmit);
|
|
|
|
|
Ico_PutIconLink (Form->Icon,Form->Color,
|
2022-06-30 13:39:57 +02:00
|
|
|
|
TmlFrm_ActionGbl[Form->Action]);
|
2021-02-21 21:30:06 +01:00
|
|
|
|
}
|
2021-11-12 01:12:15 +01:00
|
|
|
|
Frm_EndForm ();
|
2021-02-21 21:30:06 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********** Form to show hidden coments in global or user timeline ***********/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_FormToShowHiddenComms (long NotCod,
|
|
|
|
|
char IdComms[Frm_MAX_BYTES_ID + 1],
|
|
|
|
|
unsigned NumInitialComms)
|
2021-02-21 21:30:06 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_See_the_previous_X_COMMENTS;
|
|
|
|
|
char *OnSubmit;
|
2021-11-12 01:12:15 +01:00
|
|
|
|
const char *Anchor;
|
2021-12-29 23:41:26 +01:00
|
|
|
|
char *Text;
|
2021-02-21 21:30:06 +01:00
|
|
|
|
|
2021-03-03 20:30:49 +01:00
|
|
|
|
/***** Begin container which content will be updated via AJAX *****/
|
2021-11-12 01:12:15 +01:00
|
|
|
|
HTM_DIV_Begin ("id=\"%s\" class=\"Tml_RIGHT_WIDTH\"",IdComms);
|
2021-03-02 00:54:26 +01:00
|
|
|
|
|
2021-03-03 20:30:49 +01:00
|
|
|
|
/***** Begin container *****/
|
2021-11-12 01:12:15 +01:00
|
|
|
|
HTM_DIV_Begin ("id=\"exp_%s\" class=\"Tml_EXPAND_COM Tml_RIGHT_WIDTH\"",
|
2021-03-03 20:30:49 +01:00
|
|
|
|
IdComms);
|
|
|
|
|
|
|
|
|
|
/***** Form and icon-text to show hidden comments *****/
|
|
|
|
|
/* Begin form */
|
|
|
|
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
|
|
|
|
{
|
|
|
|
|
if (asprintf (&OnSubmit,"toggleComments('%s');"
|
|
|
|
|
"updateDivHiddenComments(this,"
|
|
|
|
|
"'act=%ld&ses=%s&NotCod=%ld&IdComments=%s&NumHidCom=%u&OtherUsrCod=%s');"
|
|
|
|
|
" return false;", // return false is necessary to not submit form
|
|
|
|
|
IdComms,
|
2021-12-31 14:51:44 +01:00
|
|
|
|
Act_GetActCod (TmlFrm_ActionUsr[TmlFrm_SHO_HID_COMM]),
|
2021-03-03 20:30:49 +01:00
|
|
|
|
Gbl.Session.Id,
|
|
|
|
|
NotCod,
|
|
|
|
|
IdComms,
|
|
|
|
|
NumInitialComms,
|
|
|
|
|
Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0)
|
2021-04-26 15:27:27 +02:00
|
|
|
|
Err_NotEnoughMemoryExit ();
|
2021-11-12 01:12:15 +01:00
|
|
|
|
Anchor = "timeline";
|
2021-03-03 20:30:49 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (asprintf (&OnSubmit,"toggleComments('%s');"
|
|
|
|
|
"updateDivHiddenComments(this,"
|
|
|
|
|
"'act=%ld&ses=%s&NotCod=%ld&IdComments=%s&NumHidCom=%u');"
|
|
|
|
|
" return false;", // return false is necessary to not submit form
|
|
|
|
|
IdComms,
|
2021-12-31 14:51:44 +01:00
|
|
|
|
Act_GetActCod (TmlFrm_ActionGbl[TmlFrm_SHO_HID_COMM]),
|
2021-03-03 20:30:49 +01:00
|
|
|
|
Gbl.Session.Id,
|
|
|
|
|
NotCod,
|
|
|
|
|
IdComms,
|
|
|
|
|
NumInitialComms) < 0)
|
2021-04-26 15:27:27 +02:00
|
|
|
|
Err_NotEnoughMemoryExit ();
|
2021-11-12 01:12:15 +01:00
|
|
|
|
Anchor = NULL;
|
2021-03-03 20:30:49 +01:00
|
|
|
|
}
|
2022-10-15 10:42:32 +02:00
|
|
|
|
Frm_BeginFormAnchorOnSubmit (ActUnk,Anchor,OnSubmit);
|
2021-11-12 01:12:15 +01:00
|
|
|
|
free (OnSubmit);
|
2021-03-03 20:30:49 +01:00
|
|
|
|
|
2021-11-12 01:12:15 +01:00
|
|
|
|
/* Put icon and text with link to show the first hidden comments */
|
2022-04-01 01:06:44 +02:00
|
|
|
|
HTM_BUTTON_Submit_Begin (NULL,
|
|
|
|
|
"class=\"BT_LINK FORM_IN_%s\"",
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-12-29 23:41:26 +01:00
|
|
|
|
if (asprintf (&Text,Txt_See_the_previous_X_COMMENTS,NumInitialComms) < 0)
|
|
|
|
|
Err_NotEnoughMemoryExit ();
|
|
|
|
|
Ico_PutIconTextLink ("angle-up.svg",Ico_BLACK,Text);
|
|
|
|
|
free (Text);
|
2021-11-12 01:12:15 +01:00
|
|
|
|
HTM_BUTTON_End ();
|
2021-03-03 20:30:49 +01:00
|
|
|
|
|
|
|
|
|
/* End form */
|
|
|
|
|
Frm_EndForm ();
|
|
|
|
|
|
|
|
|
|
/***** End container *****/
|
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
|
|
|
|
|
/***** Begin container which content will be updated via AJAX *****/
|
2021-02-21 21:30:06 +01:00
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
}
|
2021-02-22 09:16:57 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2021-02-22 10:03:36 +01:00
|
|
|
|
/********************** Form to remove note / comment ************************/
|
2021-02-22 09:16:57 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_BeginAlertRemove (const char *QuestionTxt)
|
2021-02-22 10:03:36 +01:00
|
|
|
|
{
|
2023-11-05 19:44:03 +01:00
|
|
|
|
Ale_ShowAlertAndButtonBegin (Ale_QUESTION,QuestionTxt);
|
2021-02-22 10:03:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-12-31 14:51:44 +01:00
|
|
|
|
void TmlFrm_EndAlertRemove (struct Tml_Timeline *Timeline,
|
|
|
|
|
TmlFrm_Action_t Action,
|
2023-03-10 00:13:55 +01:00
|
|
|
|
void (*FuncPars) (void *Args))
|
2021-02-22 09:16:57 +01:00
|
|
|
|
{
|
|
|
|
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
2023-11-05 19:44:03 +01:00
|
|
|
|
Ale_ShowAlertAndButtonEnd (TmlFrm_ActionUsr[Action],"timeline",NULL,
|
|
|
|
|
FuncPars,Timeline,
|
|
|
|
|
Btn_REMOVE_BUTTON,Act_GetActionText (TmlFrm_ActionUsr[Action]));
|
2021-02-22 09:16:57 +01:00
|
|
|
|
else
|
2023-11-05 19:44:03 +01:00
|
|
|
|
Ale_ShowAlertAndButtonEnd (TmlFrm_ActionGbl[Action],NULL,NULL,
|
|
|
|
|
FuncPars,Timeline,
|
|
|
|
|
Btn_REMOVE_BUTTON,Act_GetActionText (TmlFrm_ActionGbl[Action]));
|
2021-02-22 09:16:57 +01:00
|
|
|
|
}
|