Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

be_manager_relation - "Ziel Tabellenfeld(er) zur Anzeige [...]" durch EP flexibler machen #1433

Open
bitshiftersgmbh opened this issue Jun 14, 2023 · 2 comments

Comments

@bitshiftersgmbh
Copy link
Contributor

Ich habe immer wieder das Problem, dass ich Listen-Anzeige und Dropdown-Texte bei be_manager_relation-Feldern zu wenig customizen kann. Öfter brauchte ich schon ein IF(bla, blubb, else) an dieser Stelle.

Es braucht dort einen kleinen EP, der genau das zulässt. PR und Bsp.-Implementierung folgen.

/cc @christophboecker

@bitshiftersgmbh
Copy link
Contributor Author

Beispiel-Implementierung:

rex_extension::register('YFORM_BE_MANAGER_RELATION_QUERY_FIELDS', function(rex_extension_point $ep) {
    $fields = $ep->getSubject();
    /** @var rex_yform_manager_table $table */
    $table = $ep->getParam('table');

    if($table->getTableName() == 'rex_apartments' && count($fields)) {
        $type = array_search('t0.`type`', $fields);

        if(gettype($type) == 'integer') {
            $fields[$type] = 'IF(t0.`type` = \'VA\', \'GW\', \'AW\') AS `type`';
        }
    }

    return $fields;
});

@bitshiftersgmbh
Copy link
Contributor Author

Altes Teil, aber ich woltle das nochmal ins Gespräch bringen. Ich brauch das öfter und vielleicht mag der ein oder andere ja auch etwas mehr Flexibilität bei dem DB-Part bei der be_manager_relation (die ja inzwischen scheinbar viele schn gut verstanden haben und einsetzen). :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant