Hello,
Thanks Robert for the recommendation. Just wanted to reply because we found a good solution and this might help someone else in the future. The constant in the example is the name of our outbound sales team.
We did the following:
- added our custom constants into the config table, for example:
PHP Code:
INSERT INTO config (category, name, value) VALUES ('AppSettings', 'outbound_team_name', 'DEFAULT TEAM NAME');
- created the file: custom/includes/get_constants.php to grab the info from the DB (there might be a more "proper" way to do this). For example:
PHP Code:
function get_sales_outbound_team_name() {
$administration = new Administration();
$administration->retrieveSettings('AppSettings');
if(empty($administration->settings['AppSettings_sales_outbound'])) {
$GLOBALS['log']->error("get_sales_outbound_team_name: sales_outbound constant not found .. you need to run custom/scripts/sql/install_constants.sql");
}
else {
$outbound_team = $administration->settings['AppSettings_sales_outbound'];
return $outbound_team;
}
}
- we also created custom/scripts/sql/install_constants.php ... which inserts the default constants into the DB.
Thanks,
Ben
Bookmarks