Bug : ajax followup list

This commit is contained in:
sparkyx 2024-05-25 16:39:10 +02:00
parent 744b36b260
commit c63d4b462a
3 changed files with 27 additions and 3 deletions

View file

@ -149,8 +149,9 @@ if ($op =="view_followup_card")
$div=$http->get("div");
$card=new Fiche($cn,$http->get("f_id","number"));
echo HtmlInput::title_box("Suivi ".h($card->strAttribut(ATTR_DEF_NAME)),$div);
$query=Follow_Up::create_query($cn,["qcode"=>$card->strAttribut(ATTR_DEF_QUICKCODE),
'closed_action'=>true]);
$query="where true=true ".Follow_Up::create_query($cn,["qcode"=>$card->strAttribut(ATTR_DEF_QUICKCODE),
'closed_action'=>true]);
$followup=new Follow_Up($cn);
echo $followup->view_list($query,' limit 25');
echo \HtmlInput::button_close($div);

View file

@ -22,6 +22,7 @@
* \brief display list of followup
*/
global $cn;
$cn=$this->db;
$array=$cn->get_array($sql);
if (empty ($array)) {
echo_warning("Aucun suivi ");
@ -62,7 +63,7 @@ echo \HtmlInput::filter_table("view_list_tb", "0,1,2,3,4,5", 1);
</td>
<td><?=h($item['ag_title'])?></td>
<td><?=h($item['qcode'])?></td>
<td><?=$item['str_last_comment']?></td>
<td><?=$item['last_comment_date_str']?></td>
<td><?=h($item['s_value'])?></td>
<td>

View file

@ -119,4 +119,26 @@ class FollowupTest extends TestCase
ob_end_clean();
$this->assertStringContainsString("COURRI6-1", $content);
}
/**
* @testdox test the output of view_followup_card
* @covers Follow_Up::view_list,Follow_Up::create_query
* @backupGlobals enabled
*/
function testAjax_View_list()
{
global $g_user;
$g_user=new Noalyss_User($this->connection);
$CARD_ID=22;
$get=array( "op"=>"view_followup_card",'f_id'=>22,'gDossier'=>DOSSIER,'div'=>'unit_test');
$_REQUEST=$_POST=$_GET=$get;
ob_start();
require_once NOALYSS_HOME.'/ajax_misc.php';
$content=ob_get_contents();
ob_end_clean();
$this->assertStringContainsString("BONDEC3-1", $content);
$this->assertTrue(mb_strlen($content)==1613,"error result not valid $content size = ".mb_strlen($content));
}
}