Changeset 574
- Timestamp:
- Sep 29, 2013, 2:38:34 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Types/String.php
r548 r574 15 15 function OnEdit($Item) 16 16 { 17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>';17 $Output = '<input type="text" name="'.$Item['Name'].'" id="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 18 18 return($Output); 19 19 } -
trunk/Common/Form/Types/Type.php
r548 r574 86 86 87 87 $Type['Name'] = $Name; 88 $Type['Class'] = $Name; 88 89 if(array_key_exists('Parameters', $Type)) 89 90 $Type['Parameters'] = array_merge($Type['Parameters'], $Parameters); -
trunk/Common/Version.php
r573 r574 1 1 <?php 2 2 3 $Revision = 57 2; // Subversion revision4 $DatabaseRevision = 57 1; // SQL structure revision5 $ReleaseTime = '2013-09-2 6';3 $Revision = 574; // Subversion revision 4 $DatabaseRevision = 574; // SQL structure revision 5 $ReleaseTime = '2013-09-29'; -
trunk/Modules/IS/IS.php
r561 r574 27 27 if($Action == 'list') $Content = $this->ShowList($Table); 28 28 else if($Action == 'select') $Content = $this->ShowSelect($Table); 29 else if($Action == 'mapselect') $Content = $this->ShowMapSelect($Table); 29 30 else if($Action == 'edit') $Content = $this->ShowEdit($Table, $ItemId); 30 31 else if($Action == 'add') $Content = $this->ShowAdd($Table); … … 380 381 $this->BasicHTML = true; 381 382 $this->HideMenu = true; 382 $RowActions = '<a href="javascript:window.close();" onclick="set_return(#RowId,"'.$_GET['r'].'");"><img alt="Vybrat" title="Vybrat" src="'. 383 $RowActions = '<a href="javascript:window.close();" onclick="set_return(#RowId,"'. 384 $_GET['r'].'");"><img alt="Vybrat" title="Vybrat" src="'. 383 385 $this->System->Link('/images/select.png').'"/></a>'; 384 386 $Output = $this->ShowTable($Table, $Filter, $Title, $RowActions); 387 return($Output); 388 } 389 390 function ShowMapSelect($Table, $Filter = '', $Title = '') 391 { 392 $MapApi = new MapApiGoogle($this->System); 393 $MapApi->Position = array('Lat' => $this->System->Config['Map']['DefaultLatitude'], 394 'Lng' => $this->System->Config['Map']['DefaultLongitude']); 395 $MapApi->Zoom = $this->System->Config['Map']['DefaultZoom']; 396 $MapApi->Key = $this->System->Config['Map']['GoogleMapsApiKey']; 397 $MapApi->OnClickObject = $_GET['r']; 398 //$MapApi->ShowMarker = true; 399 $Output = $MapApi->ShowPage($this); 385 400 return($Output); 386 401 } -
trunk/Modules/Map/Map.php
r566 r574 1 1 <?php 2 2 3 include_once(dirname(__FILE__).'/ ../../Common/Global.php');3 include_once(dirname(__FILE__).'/MapAPI.php'); 4 4 5 5 class PageNetworkMap extends Page … … 15 15 if(count($this->System->PathItems) > 1) 16 16 { 17 if($this->System->PathItems[1] == 'show-position') 18 { 19 $DbResult = $this->Database->select('MapPosition', '*', 'Id='.$_GET['i']); 20 if($DbResult->num_rows > 0) 21 { 22 $DbRow = $DbResult->fetch_assoc(); 23 Header('Location: http://www.mapy.cz/#!x='.$DbRow['Longitude'].'&y='. 24 $DbRow['Latitude'].'&z=17&t=s&l=15&d=user_'.$DbRow['Longitude'].'%2C'. 25 $DbRow['Latitude'].'%2C'.$DbRow['Name'].'~%0A_1'); 26 return('Přesměrování na http://www.mapy.cz/'); 27 } else return('Položka nenalezena'); 28 return(''); 29 } 17 if($this->System->PathItems[1] == 'show-position') return($this->ShowPosition()); 30 18 else return(PAGE_NOT_FOUND); 31 19 } else return($this->ShowMain()); 32 20 } 33 21 22 function ShowPosition() 23 { 24 $DbResult = $this->Database->select('MapPosition', '*', 'Id='.$_GET['i']); 25 if($DbResult->num_rows > 0) 26 { 27 $DbRow = $DbResult->fetch_assoc(); 28 $Pos = explode(';', $DbRow['Pos']); 29 $MapApi = new MapApiGoogle($this->System); 30 $MapApi->Position = array('Lat' => $Pos[0], 'Lng' => $Pos[1]); 31 $MapApi->Zoom = 18; 32 $MapApi->Key = $this->System->Config['Map']['GoogleMapsApiKey']; 33 $MapApi->ShowMarker = true; 34 $MapApi->MarkerText = $DbRow['Name']; 35 $Output = $MapApi->ShowPage($this); 36 return($Output); 37 } else return('Položka nenalezena'); 38 } 39 34 40 function ShowMain() 35 41 { 36 $Output = '<script src="http://maps.google.com/maps?file=api&v=2&sensor=true&key='.$this->System->Config['Web']['GoogleMapsApiKey'].'" 42 $Output = '<script src="http://maps.google.com/maps?file=api&v=2&sensor=true&key='. 43 $this->System->Config['Map']['GoogleMapsApiKey'].'" 37 44 type="text/javascript"> 38 45 </script>'; … … 60 67 tinyIcon.shadowSize = new GSize(10, 10); 61 68 tinyIcon.iconAnchor = new GPoint(5, 5); 62 tinyIcon.infoWindowAnchor = new GPoint(5, 1);'; 63 64 $Output .= ' 69 tinyIcon.infoWindowAnchor = new GPoint(5, 1); 70 71 toggleLabel(\'NetworkLinks\'); 72 toggleLabel(\'NetworkDevices\');'; 73 74 $Output .= ' 65 75 } 66 76 } … … 81 91 while($Link = $DbResult->fetch_assoc()) 82 92 { 83 $DbResult2 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Latitude, MapPosition.Longitude FROM NetworkDevice JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface1'].')'); 84 $DbResult3 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Latitude, MapPosition.Longitude FROM NetworkDevice JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface2'].')'); 93 $DbResult2 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Pos FROM NetworkDevice '. 94 'JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition '. 95 'WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface1'].')'); 96 $DbResult3 = $this->Database->query('SELECT NetworkDevice.Used, MapPosition.Pos FROM NetworkDevice '. 97 'JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition '. 98 'WHERE NetworkDevice.Id = (SELECT NetworkInterface.Device FROM NetworkInterface WHERE NetworkInterface.Id = '.$Link['Interface2'].')'); 85 99 if(($DbResult2->num_rows > 0) and ($DbResult3->num_rows > 0)) 86 100 { 87 101 $Device1 = $DbResult2->fetch_assoc(); 102 $Pos1 = explode(';', $Device1['Pos']); 88 103 $Device2 = $DbResult3->fetch_assoc(); 104 $Pos2 = explode(';', $Device2['Pos']); 89 105 if(($Device1['Used'] == 1) and ($Device2['Used'] == 1)) 90 $Output .= 'new GPolyline([new GLatLng('.$Device1['Latitude'].', '.$Device1['Longitude'].'),new GLatLng('.$Device2['Latitude'].', '.$Device2['Longitude'].')], "#4F4FBF", 3, 0.8), '; 106 $Output .= 'new GPolyline([new GLatLng('.$Pos1[0].', '. 107 $Pos1[1].'),new GLatLng('.$Pos2[0].', '.$Pos2[1].')], "#4F4FBF", 3, 0.8), '; 91 108 } 92 109 } … … 120 137 121 138 $DbResult = $this->Database->query('SELECT GROUP_CONCAT(NetworkDevice.Name SEPARATOR ",") AS Name, '. 122 'MapPosition. Latitude AS Latitude, MapPosition.Longitude AS Longitude, MapPosition.Name AS NodeName '.139 'MapPosition.Pos AS Pos, MapPosition.Name AS NodeName '. 123 140 'FROM NetworkDevice LEFT JOIN MapPosition ON MapPosition.Id = NetworkDevice.MapPosition '. 124 141 'WHERE (NetworkDevice.Used=1) AND (NetworkDevice.MapPosition IS NOT NULL) '. … … 126 143 while($Device = $DbResult->fetch_assoc()) 127 144 { 128 $Output .= 'new GMarker(new GLatLng('.$Device['Latitude'].', '. 129 $Device['Longitude'].'), {title: "'.$Device['NodeName'].': '.$Device['Name'].'", icon:tinyIcon }), '; 145 $Pos = explode(';', $Device['Pos']); 146 $Output .= 'new GMarker(new GLatLng('.$Pos[0].', '. 147 $Pos[1].'), {title: "'.$Device['NodeName'].': '.$Device['Name'].'", icon:tinyIcon }), '; 130 148 } 131 149 $Output .= ']; … … 141 159 NetworkDevices[i] = null; 142 160 } 143 } 161 } 144 162 } 145 163 … … 151 169 <td style="width: 20%"> 152 170 <form> 153 <input type="checkbox" id="NetworkLinks" onClick="UpdateNetworkLinks();" 171 <input type="checkbox" id="NetworkLinks" onClick="UpdateNetworkLinks();"> 154 172 <a href="" onClick="toggleLabel(\'NetworkLinks\');return false;">Ukázat spoje</a> 155 173 </input><br /> 156 <input type="checkbox" id="NetworkDevices" onClick="UpdateNetworkDevices();" 174 <input type="checkbox" id="NetworkDevices" onClick="UpdateNetworkDevices();"> 157 175 <a href="" onClick="toggleLabel(\'NetworkDevices\');return false;">Ukázat zařízení</a> 158 176 </input> … … 160 178 </tr> 161 179 </table>'; 180 return($Output); 181 } 182 } 183 184 class TypeMapPosition extends TypeString 185 { 186 function OnEdit($Item) 187 { 188 $Output = parent::OnEdit($Item); 189 if($this->FormManager->ShowRelation) 190 $Output .= '<img src="'.$this->FormManager->Root.'/images/select.png" alf="Vybrat" language="javascript" '. 191 'onclick="return popupwindow("'.$this->FormManager->Root.'/is/?a=mapselect&r='. 192 $Item['Name'].'","test");" style="cursor:hand;cursor:pointer"/>'; 162 193 return($Output); 163 194 } … … 182 213 parent::Start(); 183 214 $this->System->Pages['map'] = 'PageNetworkMap'; 215 $this->System->FormManager->Type->RegisterType('MapPosition', 'String', array()); 184 216 $this->System->FormManager->RegisterClass('MapPosition', array( 185 217 'Title' => 'Pozice na mapě', … … 187 219 'Items' => array( 188 220 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 189 'Latitude' => array('Type' => 'Float', 'Caption' => 'Zeměpisná šířka', 'Default' => '0'), 190 'Longitude' => array('Type' => 'Float', 'Caption' => 'Zeměpisná výška', 'Default' => '0'), 221 'Pos' => array('Type' => 'MapPosition', 'Caption' => 'Poloha', 'Default' => '0;0'), 191 222 ), 192 223 'ItemActions' => array( -
trunk/admin/DefaultConfig.php
r548 r574 29 29 array('Name' => 'Web/News/Count', 'Type' => 'Integer', 'Default' => '5', 'Title' => 'Počet zobrazovaných aktualit na skupinu'), 30 30 array('Name' => 'Web/News/DirectoryId', 'Type' => 'Integer', 'Default' => '1', 'Title' => 'Id adresáře souborů příloh aktualit'), 31 array('Name' => 'Web/GoogleMapsApiKey', 'Type' => 'String', 'Default' => '', 'Title' => 'API google map'), 31 array('Name' => 'Map/GoogleMapsApiKey', 'Type' => 'String', 'Default' => '', 'Title' => 'API google map'), 32 array('Name' => 'Map/DefaultLatitude', 'Type' => 'Float', 'Default' => '49.260422', 'Title' => 'Výchozí pozice na mapě'), 33 array('Name' => 'Map/DefaultLongitude', 'Type' => 'Float', 'Default' => '18.081179', 'Title' => 'Výchozí pozice na mapě'), 34 array('Name' => 'Map/DefaultZoom', 'Type' => 'Float', 'Default' => '15', 'Title' => 'Výchozí přihlížení mapy'), 32 35 array('Name' => 'Web/ItemsPerPage', 'Type' => 'Integer', 'Default' => '50', 'Title' => 'Položek na stránku'), 33 36 array('Name' => 'Web/VisiblePagingItems', 'Type' => 'Integer', 'Default' => '20', 'Title' => 'Položek stránkování'), -
trunk/admin/Updates.php
r572 r574 375 375 } 376 376 377 function UpdateTo574($Manager) 378 { 379 $Manager->Execute('ALTER TABLE `MapPosition` ADD `Pos` VARCHAR( 255 ) NOT NULL ;'); 380 $Manager->Execute('UPDATE `MapPosition` SET `Pos`=CONCAT(`Latitude`, ";", `Longitude`)'); 381 $Manager->Execute('ALTER TABLE `MapPosition` DROP `Latitude`'); 382 $Manager->Execute('ALTER TABLE `MapPosition` DROP `Longitude`'); 383 } 377 384 378 385 $Updates = array( … … 397 404 551 => array('Revision' => 565, 'Function' => 'UpdateTo565'), 398 405 565 => array('Revision' => 571, 'Function' => 'UpdateTo571'), 406 571 => array('Revision' => 574, 'Function' => 'UpdateTo574'), 399 407 );
Note:
See TracChangeset
for help on using the changeset viewer.