Projet

Général

Profil

« Précédent | Suivant » 

Révision 8e2a4091

Ajouté par Renato Botelho il y a plus de 9 ans

Use GPS type presets only to pre-set values then user can change it. After user changes, save type always as Custom to avoid overwriting values when user attempt to edit. It fixes #3782

Voir les différences:

usr/local/www/services_ntpd_gps.php
70 70
	else unset($config['ntpd']['gps']);
71 71

  
72 72
	if (!empty($_POST['gpstype']))
73
		$config['ntpd']['gps']['type'] = $_POST['gpstype'];
73
		$config['ntpd']['gps']['type'] = 'Custom';
74 74
	elseif (isset($config['ntpd']['gps']['type']))
75 75
		unset($config['ntpd']['gps']['type']);
76 76

  
......
314 314
				gpsdef['fudge2'] = "0.407";
315 315
				gpsdef['inittxt'] = "JFBNVEsyMjUsMCoyQg0KJFBNVEszMTQsMSwxLDAsMSwwLDUsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDEsMCoyRA0KJFBNVEszMDEsMioyRQ0KJFBNVEszOTcsMCoyMw0KJFBNVEsxMDIqMzENCiRQTVRLMzEzLDEqMkUNCiRQTVRLNTEzLDEqMjgNCiRQTVRLMzE5LDAqMjUNCiRQTVRLNTI3LDAuMDAqMDANCiRQTVRLMjUxLDk2MDAqMTcNCg==";
316 316
				break;
317

  
318
			}
317
			default:
318
				return;
319
		}
319 320

  
320 321
		//then update the html and set the common stuff
321 322
		document.getElementById("gpsnmea").selectedIndex = gpsdef['nmea'];
......
386 387
			<td width="78%" valign="top" class="vtable">
387 388
				<!-- Start with the original "Default", list a "Generic" and then specific configs alphabetically -->
388 389
				<select id="gpstype" name="gpstype" class="formselect" onchange="set_gps_default(this.form)">
390
					<option value="Custom"<?php if($pconfig['type'] == 'Custom') echo " selected=\"selected\""; ?>>Custom</option>
389 391
					<option value="Default"<?php if($pconfig['type'] == 'Default') echo " selected=\"selected\""; ?>>Default</option>
390 392
					<option value="Generic" title="Generic"<?php if($pconfig['type'] == 'Generic') echo " selected=\"selected\"";?>>Generic</option>
391 393
					<option value="Garmin" title="$PGRM... Most Garmin"<?php if($pconfig['type'] == 'Garmin') echo " selected=\"selected\"";?>>Garmin</option>

Formats disponibles : Unified diff