Bug #1007 - Historique : icone document

Task #1007 - Historique : icone document
This commit is contained in:
Dany De Bontridder 2014-06-27 21:10:38 +02:00
parent 7d45e42039
commit f3f58f06fe
3 changed files with 21 additions and 3 deletions

BIN
html/image/documents.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -995,9 +995,7 @@ class Acc_Ledger extends jrn_def_sql
//document
if ($row['jr_pj_name'] != "")
{
$image = '<IMG SRC="image/insert_table.gif" title="' . $row['jr_pj_name'] . '" border="0">';
$r.="<TD>" . sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s&%s">%s</A>', $row['jrn_def_id'], $row['jr_grpt_id'], $str_dossier, $image)
. "</TD>";
$r.='<td>'.HtmlInput::show_receipt_document($row['jr_id']).'</td>';
}
else
$r.="<TD></TD>";

View file

@ -822,5 +822,25 @@ class HtmlInput
echo $hid_jrn;
echo '</span>';
}
/**
* Returns HTML code for displaying a icon with a link to a receipt document from
* the ledger
* @global $cn database connx
* @param $p_jr_id jrn.jr_id
* @return nothing or HTML Code for a link to the document
*/
static function show_receipt_document($p_jr_id)
{
global $cn;
$array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',array($p_jr_id));
if (count($array)==0) return "";
if ($array[0]['jr_pj_name'] == "") return "";
$str_dossier=Dossier::get();
$image='<IMG style="width:24px;height:24px;border:0px" SRC="image/documents.png" title="' . $array[0]['jr_pj_name'] . '" >';
$r=sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s&%s">%s</A>', $array[0]['jr_def_id'], $array[0]['jr_grpt_id'], $str_dossier, $image);
return $r;
}
}