'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'])) { $dev_id = $_REQUEST['new_id']; $val = str_replace(array('SEP','ATA','VG'), '', $dev_id); $val = implode('.', sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format $def_val['mac'] = array("keyword" => 'mac', "data" => $val, "seq" => "99"); $val = $_REQUEST['type']; $def_val['type'] = array("keyword" => 'type', "data" => $val, "seq" => "99"); if (!empty($_REQUEST['addon'])) { $def_val['addon'] = array("keyword" => 'type', "data" => $_REQUEST['addon'], "seq" => "99"); } } // Editing an existing Device if (!empty($_REQUEST['id'])) { $dev_id = $_REQUEST['id']; $dev_new = $dev_id; $db_res = $this->dbinterface->HWextension_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id)); dbug('db_res', $db_res); foreach ($db_res as $key => $val) { if (!empty($val)) { switch ($key) { case 'type': $tmp_raw = $this->getSccpModelInformation('byid', true, 'all', array('model'=>$val)); 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']); } } break; case 'name': $key = 'mac'; $val = str_replace(array('SEP','ATA','VG'), '', $val); $val = implode('.', sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format break; case '_hwlang': $tmpar = explode(":", $val); $def_val['netlang'] = array("keyword" => 'netlang', "data" => $tmpar[0], "seq" => "99"); $def_val['devlang'] = array("keyword" => 'devlang', "data" => $tmpar[1], "seq" => "99"); break; // case 'permit': // case 'deny': // $def_val[$key . '_net'] = array("keyword" => $key, "data" => before('/', $val), "seq" => "99"); // $key = $key . '_mask'; // $val = after('/', $val); // break; } $translateFieldArray = array('_logserver' => 'vendorconfig_logserver', '_daysdisplaynotactive' => 'vendorconfig_daysdisplaynotactive', '_displayontime' => 'vendorconfig_displayontime', '_displayonduration' => 'vendorconfig_displayonduration', '_displayidletimeout' => 'vendorconfig_displayidletimeout', '_settingsaccess' => 'vendorconfig_settingsaccess', '_videocapability' => 'vendorconfig_videocapability', '_webaccess' => 'vendorconfig_webaccess', '_webadmin' => 'vendorconfig_webadmin', '_pcport' => 'vendorconfig_pcport', '_spantopcport' => 'vendorconfig_spantopcport', '_voicevlanaccess' => 'vendorconfig_voicevlanaccess', '_enablecdpswport' => 'vendorconfig_enablecdpswport', '_enablecdppcport' => 'vendorconfig_enablecdppcport', '_enablelldpswport' => 'vendorconfig_enablelldpswport', '_enablelldppcport' => 'vendorconfig_enablelldppcport' ); if (array_key_exists($key,$translateFieldArray)) { $def_val[$translateFieldArray[$key]] = array("keyword" => $translateFieldArray[$key], "data" => $val, "seq" => "99"); continue; } $def_val[$key] = array("keyword" => $key, "data" => $val, "seq" => "99"); } } dbug('def_value', $def_val); } //print_r($db_res); if (!empty($device_warning)) { ?>