Overview
SHA1:4ab167a244640170fe327586209713c5cea865e4
Date: 2013-09-14 19:02:57
User: bohwaz
Comment:merge 1823585df4a899f5a79d3ce6db45e1f113742822
Timelines: family | ancestors | descendants | both | stable | 0.5.7
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
  • branch=trunk inherited from [e5099a03d9]
  • sym-0.5.7
  • sym-stable
Context
2013-09-15
12:34
[b64cb36115] Merge: Bugfix: comptes dupliqués si credit ET debit sont != de 0, corrigé avec un SUM+GROUP BY, probablement pas très élégant + Correction format monnaie mal affiché (user: bohwaz, tags: stable, 0.5.8)
2013-09-14
19:18
[e2dd055f3c] merge back from stable branch (user: bohwaz, tags: trunk)
19:02
[4ab167a244] merge 1823585df4a899f5a79d3ce6db45e1f113742822 (user: bohwaz, tags: stable, 0.5.7)
18:52
[ac8c82ea1c] Correction oubli valeur en dur dans requête sur le bilan (user: bohwaz, tags: stable, 0.5.7)
Changes

Modified include/lib.template.php from [adf522bd76] to [061878cf78].

237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
        throw new Template_Exception('Paramètres old et new requis.');
    }

    $old = $params['old'];
    $new = $params['new'];

    require_once GARRADIN_ROOT . '/include/libs/diff/class.simplediff.php';
    $diff = simpleDiff::diff_to_array(false, $old, $new, 3);

    $out = '<table class="diff">';
    $prev = key($diff);

    foreach ($diff as $i=>$line)
    {
        if ($i > $prev + 1)
................................................................................
        }

        list($type, $old, $new) = $line;

        $class1 = $class2 = '';
        $t1 = $t2 = '';

        if ($type == simpleDiff::INS)
        {
            $class2 = 'ins';
            $t2 = '<b>+</b>';
            $old = htmlspecialchars($old, ENT_QUOTES, 'UTF-8');
            $new = htmlspecialchars($new, ENT_QUOTES, 'UTF-8');
        }
        elseif ($type == simpleDiff::DEL)
        {
            $class1 = 'del';
            $t1 = '<b>-</b>';
            $old = htmlspecialchars($old, ENT_QUOTES, 'UTF-8');
            $new = htmlspecialchars($new, ENT_QUOTES, 'UTF-8');
        }
        elseif ($type == simpleDiff::CHANGED)
        {
            $class1 = 'del';
            $class2 = 'ins';
            $t1 = '<b>-</b>';
            $t2 = '<b>+</b>';

            $lineDiff = simpleDiff::wdiff($old, $new);
            $lineDiff = htmlspecialchars($lineDiff, ENT_QUOTES, 'UTF-8');

            // Don't show new things in deleted line
            $old = preg_replace('!\{\+(?:.*)\+\}!U', '', $lineDiff);
            $old = str_replace('  ', ' ', $old);
            $old = str_replace('-] [-', ' ', $old);
            $old = preg_replace('!\[-(.*)-\]!U', '<del>\\1</del>', $old);
................................................................................
    $out .= '</select>';

    return $out;
}

function escape_money($number)
{
    return number_format((float)$number, 2, ',', ' ');
}

function tpl_html_champ_membre($params)
{
    if (empty($params['config']) || empty($params['name']))
        throw new \BadFunctionCallException('Paramètres type et name obligatoires.');








|







 







|






|






|






|







 







|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
        throw new Template_Exception('Paramètres old et new requis.');
    }

    $old = $params['old'];
    $new = $params['new'];

    require_once GARRADIN_ROOT . '/include/libs/diff/class.simplediff.php';
    $diff = \simpleDiff::diff_to_array(false, $old, $new, 3);

    $out = '<table class="diff">';
    $prev = key($diff);

    foreach ($diff as $i=>$line)
    {
        if ($i > $prev + 1)
................................................................................
        }

        list($type, $old, $new) = $line;

        $class1 = $class2 = '';
        $t1 = $t2 = '';

        if ($type == \simpleDiff::INS)
        {
            $class2 = 'ins';
            $t2 = '<b>+</b>';
            $old = htmlspecialchars($old, ENT_QUOTES, 'UTF-8');
            $new = htmlspecialchars($new, ENT_QUOTES, 'UTF-8');
        }
        elseif ($type == \simpleDiff::DEL)
        {
            $class1 = 'del';
            $t1 = '<b>-</b>';
            $old = htmlspecialchars($old, ENT_QUOTES, 'UTF-8');
            $new = htmlspecialchars($new, ENT_QUOTES, 'UTF-8');
        }
        elseif ($type == \simpleDiff::CHANGED)
        {
            $class1 = 'del';
            $class2 = 'ins';
            $t1 = '<b>-</b>';
            $t2 = '<b>+</b>';

            $lineDiff = \simpleDiff::wdiff($old, $new);
            $lineDiff = htmlspecialchars($lineDiff, ENT_QUOTES, 'UTF-8');

            // Don't show new things in deleted line
            $old = preg_replace('!\{\+(?:.*)\+\}!U', '', $lineDiff);
            $old = str_replace('  ', ' ', $old);
            $old = str_replace('-] [-', ' ', $old);
            $old = preg_replace('!\[-(.*)-\]!U', '<del>\\1</del>', $old);
................................................................................
    $out .= '</select>';

    return $out;
}

function escape_money($number)
{
    return number_format((float)$number, 2, ',', '&nbsp;');
}

function tpl_html_champ_membre($params)
{
    if (empty($params['config']) || empty($params['name']))
        throw new \BadFunctionCallException('Paramètres type et name obligatoires.');