* Copyright 2016 Nicolas Goaziou * * This file is part of FAI Gestion forked from CHD Gestion. * * FAI Gestion is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * FAI Gestion is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with FAI Gestion. If not, see . **/ /* * This config file is used twice when "cake bake all" is run : * * -> config/bootstrap_cli.php : Plugin::load('CustomTheme',['bootstrap' => true,...]) * (1)->plugins/CustomTheme/src/Shell/BakeShell.php * startup() include this file and set Model->skipTables * all() set $this->{$task}->params at each task run * * So "all" subcommand is limited/tweaked by $skipTables and $taskParams * * (2)->plugins/CustomTheme/config/bootstrap.php: * EventManager::instance()->on('Bake.initialize',...) * $extra = include(); * $view->loadHelper('CustomTheme.BakeExtra', $extra); * EventManager::instance()->on('Bake.beforeRender.Controller.controller',...) * set $view->viewVars['actions'] with $extra * * So the whole config it goes into CustomTheme\BakeExtraHelper $config * and becomes available in all .twig via BakeExtraHelper methods. */ $skipTables = [ 'network_edge_list_tree' ]; $taskParams = [ 'default' => [ 'theme' => 'CustomTheme', 'no-fixture' => true, 'no-test' => true, 'no-rules' => true, 'index-columns' => 6 #'components' => 'hello,world', ], 'Adherents' => [ 'index-columns' => 7 ], ]; $controllerActions = [ 'default' => [ 'index', 'view', 'add', 'edit'], 'AdherentRoles' => [ 'index', 'add', 'delete' ], 'AdherentRoleTypes' => [ ], ]; $templateExtra = [ 'Adherents' => [ 'title' => [ 'custom_code' => <<<'EOT' "ADT" . $this->_properties['id'] . " - " . ( $this->_properties['raison']?($this->_properties['raison'] . " (" . $this->_properties['nom'] . ")" ):($this->_properties['nom'] . " " . $this->_properties['prenom']) ) EOT ], 'filters' => [ 'q' => [ 'mode' => 'like', 'before' => 'true', 'after' => 'true', 'columns' => ['id','nom','nom2','prenom','prenom2','raison','proprio','tel_mobile1','tel_mobile2'], 'colspan' => 3, 'hint' => 'Find...', ], 'adherent_type_id' => [ 'mode' => 'value', 'before' => 'false', 'after' => 'false', 'model' => 'AdherentTypes', 'colspan' => 2, 'hint' => 'AdherentTypes', ], 'ville_id' => [ 'mode' => 'value', 'before' => 'false', 'after' => 'false', 'model' => 'Villes', 'colspan' => 2, 'hint' => 'Villes', ], ], ], ]; return compact('skipTables', 'taskParams', 'controllerActions', 'templateExtra');