5 * Functions for the interface to the help page
14 * rank (for prioritizing modules)
29 * Adds menu item to nav menu
34 function navMenu($args) {
36 $ret .= "<p><small><small><a href='" . $_SESSION['ARI_ROOT'] . "?m=featurecodes&f=display'>" . _("Feature Codes") . "</a></small></small></p><br>";
47 function display($args) {
49 global $ARI_HELP_FEATURE_CODES;
51 $display = new Display();
54 $m = getArgument($args,'m');
55 $q = getArgument($args,'q');
57 $displayname = $_SESSION['ari_user']['displayname'];
58 $extension = $_SESSION['ari_user']['extension'];
61 $ret .= checkErrorMessage();
63 $header_text = _("Feature Codes");
64 if (!$_SESSION['ari_user']['admin_help']) {
65 $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension);
68 // handset feature code header
69 $handset_feature_codes_header =
71 <th class='feature_codes'>
72 " . _("Handset Feature Code") . "
79 // handset feature code body
80 if (isset($_SESSION['dbh_asterisk'])) {
83 SELECT keycode, description
85 SELECT modulename, description, defaultcode keycode
87 WHERE customcode IS NULL
89 UNION ALL SELECT modulename, description, customcode keycode
91 WHERE customcode IS NOT NULL
95 IN ( 'core', 'recordings', 'infoservices', 'polycomreassign')
96 ORDER BY modulename, keycode
99 $results = $_SESSION['dbh_asterisk']->getAll($sql, DB_FETCHMODE_ASSOC);
100 if(DB::IsError($results)) {
101 $_SESSION['ari_error'] = $results->getMessage();
104 foreach ($results as $item ) {
105 $handset_feature_codes_body .=
107 <td class='feature_codes'>
108 " . $item['keycode'] . "
111 " . $item['description'] . "
119 // handset feature code body
120 foreach($ARI_HELP_FEATURE_CODES as $key => $feature_code) {
122 $handset_feature_codes_body .=
124 <td class='feature_codes'>
128 " . $feature_code . "
134 // build page content
135 $ret .= checkErrorMessage();
137 $ret .= $display->displayHeaderText($header_text);
138 $ret .= $display->displayLine();
143 " . $handset_feature_codes_header . "
144 " . $handset_feature_codes_body . "