Overview
Comment:Pour ne pas inclure les fichiers déjà mentionnés dans le texte
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 39cea025d7c5b480d02328b8ce8d9765ba266481
User & Date: bohwaz on 2015-04-14 06:23:10
Other Links: manifest | tags
Context
2015-04-14
14:29
Correction erreur liste fichiers utilisés check-in: 85d06d55c9 user: bohwaz tags: trunk
06:23
Pour ne pas inclure les fichiers déjà mentionnés dans le texte check-in: 39cea025d7 user: bohwaz tags: trunk
06:13
boucles de type documents, images et fichiers dans les squelettes check-in: a3a534bd71 user: bohwaz tags: trunk
Changes

Modified src/include/lib/Garradin/Squelette.php from [417c595c47] to [65f564084a].

538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
...
650
651
652
653
654
655
656











657
658
659
660
661
662
663
664
                        $where .= ' AND '.$criteria['field'].' '.$criteria['comparison'].' ?';
                        $query_args[] = $criteria['value'];
                        break;
                    case \KD2\MiniSkel::ACTION_MATCH_FIELD:
                    {
                        if ($criteria['field'] == 'sauf_mention')
                        {
                            // FIXME marche pas
                            $where .= " AND f.id NOT IN (?) ";
                            $query_args[] = ['implode(",", Fichiers::listFilesUsedInText($this->getVariable(\'texte\')))'];
                            break;
                        }

                        $where .= ' AND '.$criteria['field'].' = ?';

                        if ($criteria['field'] == 'w.id')
                        {
................................................................................
        $out->append(1, '$this->parent =& $parent_hash ? $this->_vars[$parent_hash] : null;');

        if (!empty($search))
        {
            $out->append(1, 'if (trim($this->getVariable(\'recherche\'))) { ');
        }












        $out->append(1, '$statement = $db->prepare('.var_export($query, true).'); ');

        foreach ($query_args as $k=>$arg)
        {
            $out->append(1, '$value = ' . (is_array($arg) ? $arg[0] : var_export($arg, true)) . ';');
            $out->append(1, '$statement->bindValue(' . ($k+1) . ', $value, $db->getArgType($value));');
        }








<
|
|







 







>
>
>
>
>
>
>
>
>
>
>
|







538
539
540
541
542
543
544

545
546
547
548
549
550
551
552
553
...
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
                        $where .= ' AND '.$criteria['field'].' '.$criteria['comparison'].' ?';
                        $query_args[] = $criteria['value'];
                        break;
                    case \KD2\MiniSkel::ACTION_MATCH_FIELD:
                    {
                        if ($criteria['field'] == 'sauf_mention')
                        {

                            $where .= " AND f.id NOT IN (:php_implode) ";
                            $query_args[':php_implode'] = '\'.implode(",", Fichiers::listFilesUsedInText($this->getVariable(\'texte\'))).\'';
                            break;
                        }

                        $where .= ' AND '.$criteria['field'].' = ?';

                        if ($criteria['field'] == 'w.id')
                        {
................................................................................
        $out->append(1, '$this->parent =& $parent_hash ? $this->_vars[$parent_hash] : null;');

        if (!empty($search))
        {
            $out->append(1, 'if (trim($this->getVariable(\'recherche\'))) { ');
        }

        $query = var_export($query, true);

        foreach ($query_args as $k=>$arg)
        {
            if (substr($k, 0, 4) == ':php')
            {
                $query = str_replace($k, $arg, $query);
                unset($query_args[$k]);
            }
        }

        $out->append(1, '$statement = $db->prepare('.$query.'); ');

        foreach ($query_args as $k=>$arg)
        {
            $out->append(1, '$value = ' . (is_array($arg) ? $arg[0] : var_export($arg, true)) . ';');
            $out->append(1, '$statement->bindValue(' . ($k+1) . ', $value, $db->getArgType($value));');
        }