38@phan-var-force int $withproject
39@phan-var-force int $idcomment
42require_once DOL_DOCUMENT_ROOT.
'/core/class/comment.class.php';
44$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
51if ($action ==
'addcomment') {
52 $description =
GETPOST(
'comment_description',
'restricthtml');
53 if (!empty($description)) {
54 $comment->description = $description;
57 $comment->element_type =
GETPOST(
'comment_element_type',
'alpha');
58 $comment->fk_user_author = $user->id;
59 $comment->entity =
$conf->entity;
60 if ($comment->create($user) > 0) {
62 header(
'Location: '.$varpage.
'?id='.
$id.($withproject ?
'&withproject=1' :
''));
70if ($action ===
'updatecomment') {
71 if ($comment->fetch($idcomment) >= 0) {
72 $comment->description =
GETPOST(
'comment_description',
'restricthtml');
73 if ($comment->update($user) > 0) {
75 header(
'Location: '.$varpage.
'?id='.
$id.($withproject ?
'&withproject=1#comment' :
''));
83if ($action ==
'deletecomment') {
84 if ($comment->fetch($idcomment) >= 0) {
85 if ($comment->delete($user) > 0) {
87 header(
'Location: '.$varpage.
'?id='.
$id.($withproject ?
'&withproject=1' :
''));
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...