39@phan-var-force int $withproject
40@phan-var-force int $idcomment
43require_once DOL_DOCUMENT_ROOT.
'/core/class/comment.class.php';
45$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
52if ($action ==
'addcomment') {
53 $description =
GETPOST(
'comment_description',
'restricthtml');
54 if (!empty($description)) {
55 $comment->description = $description;
58 $comment->element_type =
GETPOST(
'comment_element_type',
'alpha');
59 $comment->fk_user_author = $user->id;
60 $comment->entity = $conf->entity;
61 if ($comment->create($user) > 0) {
63 header(
'Location: '.$varpage.
'?id='.
$id.($withproject ?
'&withproject=1' :
''));
71if ($action ===
'updatecomment') {
72 if ($comment->fetch($idcomment) >= 0) {
74 if ($comment->fk_element !=
$id || $comment->element_type !=
$object->element) {
77 $comment->description =
GETPOST(
'comment_description',
'restricthtml');
78 if ($comment->update($user) > 0) {
80 header(
'Location: '.$varpage.
'?id='.
$id.($withproject ?
'&withproject=1#comment' :
''));
88if ($action ==
'deletecomment') {
89 if ($comment->fetch($idcomment) >= 0) {
91 if ($comment->fk_element !=
$id || $comment->element_type !=
$object->element) {
94 if ($comment->delete($user) > 0) {
96 header(
'Location: '.$varpage.
'?id='.
$id.($withproject ?
'&withproject=1' :
''));
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
dol_now($mode='gmt')
Return date for now.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.