task #0000813: plan comptable - quick code

Limite des qcode visibles
This commit is contained in:
Dany De Bontridder 2013-05-11 17:30:15 +00:00
parent d350f8476b
commit 374882c7c7
3 changed files with 23 additions and 3 deletions

View file

@ -63,6 +63,7 @@ define ('MAX_COMPTE_CARD',4);
define ('COMPTA_MAX_YEAR',2100);
define ('COMPTA_MIN_YEAR',1990);
define ('MAX_RECONCILE',25);
define ('MAX_QCODE',4);
if ( DEBUG ) error_reporting(2147483647); else error_reporting(0);
// Erreur

View file

@ -251,6 +251,7 @@ $MaxRow=Database::num_row($Ret);
echo HtmlInput::hidden('p_action','pcmn');
//echo HtmlInput::hidden('sa','detail');
echo dossier::hidden();
$limite=MAX_QCODE;
?>
<TABLE class="result">
<TR>
@ -310,10 +311,14 @@ for ($i=0; $i <$MaxRow; $i++)
if (strpos($A['acode'], ",") >0 ) {
$det_qcode= split(",", $A['acode']);
echo '<ul style="paddding:0;margin:0;padding-left:0;list-style-type:none;padding-start-value:0">';
for ($e=0;$e<count($det_qcode);$e++) {
$max=(count($det_qcode)>MAX_QCODE)?MAX_QCODE:count($det_qcode);
for ($e=0;$e<$max;$e++) {
echo '<li style="padding-start-value:0">'.HtmlInput::card_detail($det_qcode[$e]).'</li>';
}
echo '</ol>';
if ($max < count($det_qcode)) {
echo "...";
}
} else {
echo HtmlInput::card_detail($A['acode']);
}

View file

@ -1,7 +1,16 @@
<fieldset id="asearch" style="height:88%">
<legend><? echo _('Résultats')?></legend>
<div style="height:88%;overflow:auto;">
<table>
<?php
$limite=5;
?>
<table
<tr>
<th>Poste comptable</th>
<th>Libellé</th>
<th>Fiche (limite:<?php echo $limite; ?>)</th>
</tr>
<? for ($i=0;$i<sizeof($array);$i++) : ?>
<tr>
<td>
@ -20,12 +29,17 @@
<?php
if ( strlen($array[$i]['acode']) >0 ) {
if (strpos($array[$i]['acode'], ",") >0 ) {
$det_qcode= split(",", $array[$i]['acode']);
$sep="";
for ($e=0;$e<count($det_qcode);$e++) {
$max=(count($det_qcode)>$limite)?$limite:count($det_qcode);
for ($e=0;$e<$max;$e++) {
echo $sep.HtmlInput::card_detail($det_qcode[$e]);
$sep=" , ";
}
if ($max < count($det_qcode)) {
echo "...";
}
} else {
echo HtmlInput::card_detail($array[$i]['acode']);
}