static function networkport_addLog($port_id, $value_new, $field)
 {
     $pfNetworkPort = new PluginFusioninventoryNetworkPort();
     $pfNetworkPortLog = new PluginFusioninventoryNetworkPortLog();
     $pfConfigLogField = new PluginFusioninventoryConfigLogField();
     $pfMapping = new PluginFusioninventoryMapping();
     $db_field = $field;
     switch ($field) {
         case 'ifname':
             $db_field = 'name';
             $field = 'ifName';
             break;
         case 'mac':
             $db_field = 'mac';
             $field = 'macaddr';
             break;
         case 'ifnumber':
             $db_field = 'logical_number';
             $field = 'ifIndex';
             break;
         case 'trunk':
             $field = 'vlanTrunkPortDynamicStatus';
             break;
         case 'iftype':
             $field = 'ifType';
             break;
         case 'duplex':
             $field = 'portDuplex';
             break;
     }
     $pfNetworkPort->loadNetworkport($port_id);
     //echo $ptp->getValue($db_field);
     if ($pfNetworkPort->getValue($db_field) != $value_new) {
         $a_mapping = $pfMapping->get('NetworkEquipment', $field);
         $days = $pfConfigLogField->getValue($a_mapping['id']);
         if (isset($days) and $days != '-1') {
             $array = array();
             $array["networkports_id"] = $port_id;
             $array["plugin_fusioninventory_mappings_id"] = $a_mapping['id'];
             $array["value_old"] = $pfNetworkPort->getValue($db_field);
             $array["value_new"] = $value_new;
             $pfNetworkPortLog->insert_connection("field", $array);
         }
     }
 }