Ejemplo n.º 1
0
<?php

// Delete the old code if still there
//
$fcc = new featurecode('daynight', 'toggle-mode');
$fcc->delete();
unset($fcc);
$list = daynight_list();
foreach ($list as $item) {
    $id = $item['ext'];
    $fcc = new featurecode('daynight', 'toggle-mode-' . $id);
    $fcc->delete();
    unset($fcc);
}
sql('DROP TABLE IF EXISTS daynight');
Ejemplo n.º 2
0
 /**
  * @verb GET
  * @returns - a list of daynight settings
  * @uri /daynight
  */
 function get_daynight($params)
 {
     $daynights = daynight_list();
     return $daynights ? $daynights : false;
 }
Ejemplo n.º 3
0
function daynight_hook_timeconditions($viewing_itemid, $target_menuid)
{
    global $tabindex;
    global $amp_conf;
    switch ($target_menuid) {
        // only provide display for timeconditions
        case 'timeconditions':
            $current = daynight_get_timecondition($viewing_itemid);
            if (!$amp_conf['DAYNIGHTTCHOOK'] && $current['ext'] == '') {
                break;
            }
            $daynightcodes = daynight_list();
            $dnopts = sprintf('<option value="" %s>%s</option>', $current['ext'] == '' ? 'selected' : '', _("No Association"));
            foreach ($daynightcodes as $dn_item) {
                $dnopts .= sprintf('<option value="%d,timeday" %s>%s</option>', $dn_item['ext'], $current['ext'] . ',' . $current['dmode'] == $dn_item['ext'] . ',timeday' ? 'selected' : '', $dn_item['dest'] . _(" - Force Time Condition True Destination"));
                $dnopts .= "\n";
                $dnopts .= sprintf('<option value="%d,timenight" %s>%s</option>', $dn_item['ext'], $current['ext'] . ',' . $current['dmode'] == $dn_item['ext'] . ',timenight' ? 'selected' : '', $dn_item['dest'] . _(" - Force Time Condition False Destination"));
                $dnopts .= "\n";
            }
            $html = '
				<!--Call Flow Toggle Mode Association-->
				<div class="element-container">
					<div class="row">
						<div class="col-md-12">
							<div class="row">
								<div class="form-group">
									<div class="col-md-3">
										<label class="control-label" for="daynight_ref">' . _("Call Flow Toggle Associate with") . '</label>
										<i class="fa fa-question-circle fpbx-help-icon" data-for="daynight_ref"></i>
									</div>
									<div class="col-md-9">
										<select class="form-control" id="daynight_ref" name="daynight_ref">
											' . $dnopts . '
										</select>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<span id="daynight_ref-help" class="help-block fpbx-help-block">' . _("If a selection is made, this timecondition will be associated with the specified call flow toggle  featurecode. This means that if the Call Flow Feature code is set to override (Red/BLF on) then this time condition will always go to its True destination if the chosen association is to 'Force Time Condition True Destination' and it will always go to its False destination if the association is with the 'Force Time Condition False Destination'. When the associated Call Flow Control Feature code is in its Normal mode (Green/BLF off), then then this Time Condition will operate as normal based on the current time. The Destinations that are part of any Associated Call Flow Control Feature Code will have no affect on where a call will go if passing through this time condition. The only thing that is done when making an association is allowing the override state of a Call Flow Toggle to force this time condition to always follow one of its two destinations when that associated Call Flow Toggle is in its override (Red/BLF on) state.") . '</span>
						</div>
					</div>
				</div>
				<!--END Call Flow Toggle Mode Association-->
			';
            return $html;
            break;
        default:
            return false;
            break;
    }
}
Ejemplo n.º 4
0
//of the License, or (at your option) any later version.
//
//This program 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.
$dispnum = "daynight";
//used for switch on config.php
$tabindex = 0;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$password = isset($_REQUEST['password']) ? $_REQUEST['password'] : '';
$fc_description = isset($_REQUEST['fc_description']) ? $_REQUEST['fc_description'] : '';
$day_recording_id = isset($_POST['day_recording_id']) ? $_POST['day_recording_id'] : '';
$night_recording_id = isset($_POST['night_recording_id']) ? $_POST['night_recording_id'] : '';
isset($_REQUEST['itemid']) ? $itemid = mysql_real_escape_string($_REQUEST['itemid']) : ($itemid = '');
$daynightcodes = daynight_list();
?>

</div> <!-- end content div so we can display rnav properly-->

<!-- right side menu -->
<div class="rnav"><ul>
    <li><a id="<?php 
echo $itemid == '' ? 'current' : '';
?>
" href="config.php?display=<?php 
echo urlencode($dispnum);
?>
&action=add"><?php 
echo _("Add Day/Night Code");
?>
Ejemplo n.º 5
0
function daynight_hook_timeconditions($viewing_itemid, $target_menuid)
{
    global $tabindex;
    switch ($target_menuid) {
        // only provide display for timeconditions
        case 'timeconditions':
            $html = '';
            $html = '<tr><td colspan="2"><h5>';
            $html .= _("Day/Night Mode Association");
            $html .= '<hr></h5></td></tr>';
            $html .= '<tr>';
            $html .= '<td><a href="#" class="info">';
            $html .= _("Associate with") . '<span>' . _("If a selection is made, this timecondition will be associated with that featurecode and will allow this timecondition to be direct overridden by that daynight mode featurecode") . '.</span></a>:</td>';
            $html .= '<td><select tabindex="' . ++$tabindex . '" name="daynight_ref">';
            $daynightcodes = daynight_list();
            $current = daynight_get_timecondition($viewing_itemid);
            $html .= "\n";
            $html .= sprintf('<option value="" %s>%s</option>', $current['ext'] == '' ? 'selected' : '', _("No Association"));
            $html .= "\n";
            foreach ($daynightcodes as $dn_item) {
                $html .= sprintf('<option value="%d,timeday" %s>%s</option>', $dn_item['ext'], $current['ext'] . ',' . $current['dmode'] == $dn_item['ext'] . ',timeday' ? 'selected' : '', $dn_item['dest'] . _(" - Force Day"));
                $html .= "\n";
                $html .= sprintf('<option value="%d,timenight" %s>%s</option>', $dn_item['ext'], $current['ext'] . ',' . $current['dmode'] == $dn_item['ext'] . ',timenight' ? 'selected' : '', $dn_item['dest'] . _(" - Force Night"));
                $html .= "\n";
            }
            $html .= '</select></td></tr>';
            return $html;
            break;
        default:
            return false;
            break;
    }
}