* 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, 'index-columns' => 7 #'components' => 'hello,world', ], 'Equipements' => [ 'index-columns' => 6 ], ]; $controllerActions = [ 'default' => [ 'index', 'view', 'add', 'edit'], 'AdherentRoles' => [ 'index', 'add', 'delete' ], 'AdherentRoleTypes' => [ ], 'AdherentStatuts' => [ ], 'AdherentTypes' => [ ], 'Civilites' => [ ], #'EquipementInterfaces' => [ ], # TODO in equipements ? 'EquipementModes' => [ ], 'Interesses' => [ 'index', 'view', 'add', 'edit', 'delete'], 'InteresseStatuts' => [ ], 'Ippubliques' => [ 'index', 'view' ], # FIXME rename table to ip_publiques #'LienFilaire' => [ ], # TODO in equipements ? #'LienRadio' => [ ], # TODO in equipements ? #'LienTunnel' => [ ], # TODO in equipements ? 'Periodicites' => [ ], 'Secteurs' => [ ], 'ServiceStatuts' => [ ], 'ServiceTypes' => [ ], # 'Villes' => [ ], # default ]; $templateExtra = [ 'Adherents' => [ 'title' => [ 'customCode' => <<<'EOT' return "ADT" . $this->id . " - " . ($this->raison ?($this->raison . " (" . $this->nom . ")" ) :($this->nom . " " . $this->prenom) ); EOT ], 'filters' => [ 'q' => [ 'mode' => 'like', 'before' => true, 'after' => true, 'field' => ['id','nom','nom2','prenom','prenom2','raison','proprio','tel_mobile1','tel_mobile2'], 'colspan' => 3, 'hint' => 'Chercher...', ], 'adherent_type_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'AdherentTypes', ], 'ville_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'Villes', ], ], ], 'Equipements' => [ 'order' => [ 'Equipements.hostname' => 'ASC', ], 'orderHook' => [ 'Equipements.ip_management' => 'INET_ATON(Equipements.ip_management)', ], 'title' => [ 'pieces' => ['hostname', 'ip_management'], ], 'filters' => [ 'q' => [ 'mode' => 'like', 'before' => true, 'after' => true, 'field' => ['hostname', 'mac_boite', 'ip_management'], 'colspan' => 3, 'hint' => 'Hostname, IP, MAC...', ], 'equipement_modele_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'Equipement Modeles', ], 'relais_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'Relais', ], ], ], 'EquipementModeles' => [ 'order' => [ 'EquipementModeles.constructeur' => 'ASC', 'EquipementModeles.modele' => 'ASC', ], 'title' => [ 'glue' => ' - ', 'pieces' => ['constructeur', 'modele'], ], ], 'Interesses' => [ 'filters' => [ 'q' => [ 'mode' => 'like', 'before' => true, 'after' => true, 'field' => ['nom', 'prenom', 'date_demande', 'raison'], 'colspan' => 5, 'hint' => 'Chercher...', ], 'interesse_statut_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'Interesse Statut', ], ], ], 'IpPubliques' => [ 'order' => [ 'IpPubliques.ip4' => 'ASC', ], 'orderHook' => [ 'IpPubliques.ip4' => 'INET_ATON(IpPubliques.ip4)', 'IpPubliques.ip6' => 'INET6_ATON(IpPubliques.ip6)', ], 'title' => [ 'pieces' => ['ip4', 'ip6'], ], 'filters' => [ 'q' => [ 'mode' => 'like', 'before' => true, 'after' => false, 'field' => ['ip4','ip6'], 'colspan' => 2, 'hint' => 'Derniers chiffres...', ], 'secteur_id' => [ 'mode' => 'value', 'colspan' => 1, 'hint' => 'Secteurs', ], ], ], 'LienRadios' => [ 'order' => [ 'LienRadios.ssid' => 'ASC', ], 'title' => [ 'pieces' => ['ssid'], ], ], 'Services' => [ 'title' => [ 'prefix' => 'SER', 'pieces' => ['id'], ], 'filters' => [ 'service_type_id' => [ 'mode' => 'value', 'colspan' => 3, 'hint' => 'Service Type', ], 'service_statut_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'Service Statut', ], 'relais_id' => [ 'mode' => 'value', 'colspan' => 2, 'hint' => 'Relais', ], ], ], ]; return compact('skipTables', 'taskParams', 'controllerActions', 'templateExtra');