id="ag_description";
//---------------------------------- Description -------------------------------------------------------------------
if ( count($acomment)> 0) {
$has_description = true;
$editable_description = Document_Option::is_enable_editable_description($this->dt_id);
if ( $p_view != 'READ' && $editable_description == true){
echo h2(_("Description"));
$itDescription=new ITextarea("ag_description");
$itDescription->style='class="input_text field_follow_up" style="height:21rem;width:98%"';
$ag_description_id= $acomment[0]['agc_id'];
$itDescription->value=$acomment[0]['agc_comment'];
$itDescription->id="ag_description";
// One editable comment is available
$editable_description=new Inplace_Edit($itDescription);
$editable_description->add_json_param("op", "followup_comment_oneedit");
$editable_description->add_json_param("agc_id", $ag_description_id);
$editable_description->add_json_param("ag_id", $ag_id);
$editable_description->add_json_param("gDossier", Dossier::id());
$editable_description->set_callback("ajax_misc.php");
echo $editable_description->input();
}
elseif ($p_view == 'READ' || $editable_description == false)
{
echo h2(_("Description"));
echo '
';
echo h($acomment[0]['agc_comment']);
echo '';
}
} else {
echo h2(_("Description"));
echo $description->input();
}
//---------------------------------- Comment -----------------------------------------------------------------------
if ( Document_Option::can_add_comment($ag_id) &&
Document_Option::option_comment($this->dt_id) == "ONE_EDIT" )
{
if (count($acomment) > 1 ) {
echo h2(_("Commentaire"));
$comment=new ITextarea("ag_comment_edit");
$comment->style='class="input_text field_follow_up" style="height:21rem;width:98%"';
$ag_comment_id= (count($acomment) > 1)?$acomment[1]['agc_id']:-1;
$comment->value=(count($acomment) > 1 )?$acomment[1]['agc_comment']:'';
$comment->id="ag_comment_edit";
if ( $p_view != 'READ') {
// One editable comment is available
$editable_comment=new Inplace_Edit($comment);
$editable_comment->add_json_param("op", "followup_comment_oneedit");
$editable_comment->add_json_param("agc_id", $ag_comment_id);
$editable_comment->add_json_param("ag_id", $ag_id);
$editable_comment->add_json_param("gDossier", Dossier::id());
$editable_comment->set_callback("ajax_misc.php");
echo '
';
echo $editable_comment->input();
} else {
echo '
';
echo $comment->display();
}
} else {
echo '
';
if ( $p_view == 'UPD' && $has_description && Document_Option::can_add_comment($ag_id) ) {
echo h2(_("Commentaire"));
echo '';
echo $desc->input();
}
echo '';
}
}
if ( count($acomment) > 0
&& Document_Option::can_add_comment($ag_id)
&& Document_Option::option_comment($this->dt_id) == "SOME_FIXED")
{
echo h2(_("Commentaire"));
for( $c=1;$c
0)
{
$rmComment=sprintf("return confirm_box(null,'"._('Voulez-vous effacer ce commentaire').
" ?',function() {remove_comment('%s','%s');});",
dossier::id(),
$acomment[$c]['agc_id']);
$js=Icon_Action::trash("accom".$acomment[$c]['agc_id'], $rmComment);
$comment= h($m_desc.' '.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".
$acomment[$c]['str_agc_date'].')').$js.
''
;
}
else
{
$comment=h($m_desc.' '.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".
$acomment[$c]['str_agc_date'].')').
''
;
}
$comment=preg_replace('/#([0-9]+)/','\1',$comment);
echo '';
echo $comment;
} // end for
if ( $has_description && $p_view == 'UPD' && Document_Option::can_add_comment($ag_id)) {
echo '';
echo '';
echo $desc->input();
}
echo '';
if ($p_view == 'UPD') {
}
}
?>