getTableDefaults('sccpdevice'); $def_val['netlang'] = array("keyword" => 'netlang', "data" => $this->sccpvalues['netlang']['data'], "seq" => "99"); $def_val['devlang'] = array("keyword" => 'devlang', "data" => $this->sccpvalues['devlang']['data'], "seq" => "99"); $def_val['directed_pickup_context'] = array("keyword" => 'directed_pickup_context', "data" => $this->sccpvalues['directed_pickup_context']['data'], "seq" => "99"); if (!empty($_REQUEST['new_id'])) { // Adding device that is connected but not in database $dev_id = $_REQUEST['new_id']; // Overwrite some specific defaults based on $_REQUEST $def_val['type'] = array("keyword" => 'type', "data" => $_REQUEST['type'], "seq" => "99"); if (!empty($_REQUEST['addon'])) { $def_val['addon'] = array("keyword" => 'type', "data" => $_REQUEST['addon'], "seq" => "99"); } } if (!empty($_REQUEST['id'])) { // Editing an existing Device. Overwrite any defaults that are already set for this device. $dev_id = $_REQUEST['id']; $db_res = $this->dbinterface->getSccpDeviceTableData('get_sccpdevice_byid', array("id" => $dev_id)); foreach ($db_res as $key => $val) { if (!empty($val)) { switch ($key) { case 'phonepersonalization': $def_val['phonepersonalization'] = array("keyword" => 'phonepersonalization', "data" => $val, "seq" => "99"); break; default: // Overwrite existing defaults after checking that data is still valid after schema updates // Do not strip underscores as these fields are new in the schema and so should be valid. $enumFields = $this->getTableEnums('sccpdevice', false); if (array_key_exists($key, $enumFields)){ // This field is (now) an enum. Check the current value is acceptable. // Quote value as enum values are quoted. if (in_array("'{$val}'", $enumFields[$key])) { // The value is valid so will keep $def_val[$key] = array('keyword' => $key, 'data' => $val, 'seq' => 99); } // Do not store value and let defaults apply break; } $def_val[$key] = array("keyword" => $key, "data" => $val, "seq" => "99"); // Need to assign defaultLine as not set in the db. $def_val['defaultLine'] = $this->dbinterface->getSccpDeviceTableData('getDefaultLine', array('id' => $dev_id))['name']; break; } } } } if (!empty($def_val['type'])) { $tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$def_val['type'])); if (!empty($tmp_raw[0])) { $tmp_raw = $tmp_raw[0]; } if (!empty($tmp_raw['validate'])) { $tmpar = explode(";", $tmp_raw['validate']); if ($tmpar[0] != 'yes') { $device_warning['Image'] = array('Device firmware not found : '.$tmp_raw['loadimage']); } if ($tmpar[1] != 'yes') { $device_warning['Template'] = array('Missing device configuration template : '. $tmp_raw['nametemplate']); } if (!empty($device_warning)) { ?>

Warning in the SCCP Device

                                 $value) {
                                    echo '

'.$key.'

'; if (is_array($value)) { echo '
  • '._(implode('
  • ', $value)).'
  • '; } else { echo '
  • '. _($value).'
  • '; } } ?>

    '; } else { $val = str_replace(array('SEP','ATA','VG'), '', $dev_id); $val = implode(':', sscanf($val, '%2s%2s%2s%2s%2s%2s')); // Convert to Cisco display Format $def_val['mac'] = array("keyword" => 'mac', "data" => $val, "seq" => "99"); echo ''; } if ($_REQUEST['tech_hardware'] == 'cisco') { echo ''; if (empty($dev_id)) { echo $this->showGroup('sccp_hw_dev', 1, 'sccp_hw', $def_val); } else { echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val); } echo $this->showGroup('sccp_hw_dev2', 1, 'sccp_hw', $def_val); echo $this->showGroup('sccp_hw_dev_advance', 1, 'sccp_hw', $def_val); echo $this->showGroup('sccp_hw_dev_softkey', 1, 'sccp_hw', $def_val); // echo $this->showGroup('sccp_hw_dev_pickup', 1, 'sccp_hw', $def_val); This are line properties and does not exist! echo $this->showGroup('sccp_hw_dev_conference', 1, 'sccp_hw', $def_val); echo $this->showGroup('sccp_dev_vendor_conf', 1, 'vendorconfig', $def_val); echo $this->showGroup('sccp_hw_dev_network', 1, 'sccp_hw', $def_val); } else if ($_REQUEST['tech_hardware'] == 'cisco-sip') { echo ''; /* if (empty($dev_new)) { echo ''; } else { echo ''; } */ if (empty($dev_id)) { echo $this->showGroup('sccp_hw_sip_dev', 1, 'sccp_hw', $def_val); } else { echo $this->showGroup('sccp_hw_dev_edit', 1, 'sccp_hw', $def_val); } echo $this->showGroup('sccp_hw_sip_dev2', 1, 'sccp_hw', $def_val); echo $this->showGroup('sccp_hw_sip_conf', 1, 'sccp_hw', $def_val); } ?>