Overview
Comment:Improve label truncate in pie graph
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 06a302654ed4f7b1536e367dceca8ccbe1e0e50f
User & Date: bohwaz on 2020-11-10 04:49:24
Other Links: branch diff | manifest | tags
Context
2020-11-10
18:45
Update debian default config so that the package can be installed and used with a web server, eg. apache check-in: f9d3fe02dc user: bohwaz tags: dev
04:49
Improve label truncate in pie graph check-in: 06a302654e user: bohwaz tags: dev
04:34
Only show details for first 95% in pie charts, enable percentage check-in: 9efb5b3b67 user: bohwaz tags: dev, 1.0.0-alpha6
Changes

Modified src/include/lib/Garradin/Accounting/Graph.php from [8035d9b7a3] to [1337a9da5d].

146
147
148
149
150
151
152

153
154
155
156
157
158
159
160
		{
			if ($i++ >= $max || $count > $total*0.95)
			{
				$others += $row->sum;
			}
			else
			{

				$pie->add(new Pie_Data(abs($row->sum) / 100, substr($row->label, 0, 50), $colors[$i-1]));
			}

			$count += $row->sum;
		}

		if ($others != 0)
		{







>
|







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
		{
			if ($i++ >= $max || $count > $total*0.95)
			{
				$others += $row->sum;
			}
			else
			{
				$label = strlen($row->label) > 40 ? substr($row->label, 0, 38) . '…' : $row->label;
				$pie->add(new Pie_Data(abs($row->sum) / 100, $label, $colors[$i-1]));
			}

			$count += $row->sum;
		}

		if ($others != 0)
		{

Modified src/templates/acc/transactions/details.tpl from [0529903ae9] to [680b63f47f].

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
106
107
108
109
110
111
112





113
114
115
116
117
118
	<dt>Exercice</dt>
	<dd>
		<a href="{$admin_url}acc/reports/ledger.php?year={$transaction.id_year}">{$tr_year.label}</a>
		| Du {$tr_year.start_date|date_fr:'d/m/Y'} au {$tr_year.end_date|date_fr:'d/m/Y'}
		| <strong>{if $tr_year.closed}Clôturé{else}En cours{/if}</strong>
	</dd>

	{if $transaction.id_projet}
		<dt>Projet</dt>
		<dd>
			<a href="{$admin_url}compta/projets/">{$projet.libelle}</a>
		</dd>
	{/if}

	<dt>Écriture créée par</dt>
	<dd>
		{if $transaction.id_creator}
			{if $session->canAccess('compta', Membres::DROIT_ACCES)}
				<a href="{$admin_url}membres/fiche.php?id={$transaction.id_creator}">{$creator_name}</a>
			{else}
				{$creator_name}
................................................................................
		<tr>
			<td class="num"><a href="{$admin_url}acc/accounts/journal.php?id={$line.id_account}&amp;year={$transaction.id_year}">{$line.account_code}</a></td>
			<td>{$line.account_name}</td>
			<td class="money">{if $line.debit}{$line.debit|escape|html_money}{/if}</td>
			<td class="money">{if $line.credit}{$line.credit|escape|html_money}{/if}</td>
			<td>{$line.label}</td>
			<td>{$line.reference}</td>





		</tr>
		{/foreach}
	</tbody>
</table>

{include file="admin/_foot.tpl"}







<
<
<
<
<
<
<







 







>
>
>
>
>






38
39
40
41
42
43
44







45
46
47
48
49
50
51
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
	<dt>Exercice</dt>
	<dd>
		<a href="{$admin_url}acc/reports/ledger.php?year={$transaction.id_year}">{$tr_year.label}</a>
		| Du {$tr_year.start_date|date_fr:'d/m/Y'} au {$tr_year.end_date|date_fr:'d/m/Y'}
		| <strong>{if $tr_year.closed}Clôturé{else}En cours{/if}</strong>
	</dd>








	<dt>Écriture créée par</dt>
	<dd>
		{if $transaction.id_creator}
			{if $session->canAccess('compta', Membres::DROIT_ACCES)}
				<a href="{$admin_url}membres/fiche.php?id={$transaction.id_creator}">{$creator_name}</a>
			{else}
				{$creator_name}
................................................................................
		<tr>
			<td class="num"><a href="{$admin_url}acc/accounts/journal.php?id={$line.id_account}&amp;year={$transaction.id_year}">{$line.account_code}</a></td>
			<td>{$line.account_name}</td>
			<td class="money">{if $line.debit}{$line.debit|escape|html_money}{/if}</td>
			<td class="money">{if $line.credit}{$line.credit|escape|html_money}{/if}</td>
			<td>{$line.label}</td>
			<td>{$line.reference}</td>
			<td>
				{if $line.id_analytical}
					<a href="{$admin_url}acc/reports/analytical.php?id={$line.id_analytical}">{*FIXME*}</a>
				{/if}
			</td>
		</tr>
		{/foreach}
	</tbody>
</table>

{include file="admin/_foot.tpl"}