|
Feature Codes
How are we to handle feature codes going forward?
Goals
- There should be default settings for modules, which should be set by the Module install script (Ryan currently working on allowing .php file's as install script for modules)
- Modules should be able to amend the defaults by providing a 'custom' version of the code if the user wants to override the default, but still retain the default
- Each module should have a standard way to create a Feature Code for every feature
- Feature codes to be held in one place (e.g. table called 'featurecodes')
- Should be stored with...
- ModuleName? (e.g. 'callwaiting')
- FeatureName? (e.g. 'app-callwaiting-enable')
- Enabled/Disabled (feature not module)
- Module's '_config' function would read the feature code as needed (see below)
- Nothing would be returned to the '_config' script if disabled, thus don't generate the config !
Strategy
Reading Feature Codes
$fcc = new FeatureCode('callwaiting', 'app-callwaiting-enable');
$featurecode = $fcc->getCodeActive(); <--- will only return one if available AND enabled
Reading Feature Codes (even if not enabled)
$fcc = new FeatureCode('callwaiting', 'app-callwaiting-enable');
$featurecode = $fcc->getCode();}}}
Assigning Default Feature Codes
$fcc = new FeatureCode('callwaiting', 'app-callwaiting-enable');
$fcc->setDefault('*43'); <---- which would set one if wasn't set already
$fcc->update();
Assigning a Description to a Feature Code
$fcc = new FeatureCode('callwaiting', 'app-callwaiting-enable');
$fcc->setDescription('Call Waiting -- Activate'); <---- this will appear in the Feature Code Admin module
$fcc->update();
Assigning Custom Code
$fcc = new FeatureCode('callwaiting', 'app-callwaiting-enable');
$fcc->setCode('*72');
$fcc->update();
Discussion
RC: can Feature Codes be optional? I think not, they should be built into core.
RC: The strategy above looks good to me Mark. Would we have a way to apply predefined codes for a certain locale?
MH: I would see that as being part of a 'Feature Code Admin' module I think to be honest, with some kind of way to download a set of codes for a specific country maybe?
RC: I'm happy with your proposed implemention above. Yes, localization could probably be in a separate module, and would not only set feature codes, but also prompt languages, ring tones, etc.
MH: OK, I've finished writing the class for this, will put toghet an example of it in use PLUS a simple Feature Code Admin page by tomorrow (hopefully)....will help to see the idea in action
MH: Prelim work now complete in SVN-HEAD. Waiting on changes to allow modules to run install.php files as well as the current install.sql, this is to allow creation of the default feature code(s) while installing the module. Also need to write a 'Feature Code Admin' module to allow users to change all feature codes using one interface, hopefully will have a simple version of this available over the weekend. This can be built on in the future to allow for localisation etc.
