Преглед на файлове

Merge branch 'master' of ssh://biuro.biall-net.pl:2222/plabudda/se

Piotr Labudda преди 9 години
родител
ревизия
32dba8a753
променени са 4 файла, в които са добавени 16 реда и са изтрити 3 реда
  1. 2 1
      SE/procesy5.php
  2. 3 1
      SE/se-lib/Core/Database/Mysql.php
  3. 7 1
      SE/se-lib/Core/Database/Pgsql.php
  4. 4 0
      SE/superedit-SYNC_DATABASES.php

+ 2 - 1
SE/procesy5.php

@@ -1990,7 +1990,8 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 		if ($tree->get_param('ProcesTblId') > 0) {
 			// rem@2016-08 sqix link do nowy edytor: 
 			if($r->TYPE == 'PROCES_INIT') {
-				echo App::link("E", "index.php?_route=UrlAction_ProcesEditor&id=".$r->ID, array('title'=>'Edytuj', 'class'=>'btn-p5'));
+				echo App::link("E", "index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=".$tree->get_param('ProcesTblId')."#EDIT/".$r->ID, array('title'=>'Edytuj', 'class'=>'btn-p5'));
+				echo App::link("e", "index.php?_route=UrlAction_ProcesEditor&id=".$r->ID, array('title'=>'Edytuj', 'class'=>'btn-p5'));
 			} else { 
 				echo App::link("E", "index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=".$tree->get_param('ProcesTblId')."#EDIT/".$r->ID, array('title'=>'Edytuj', 'class'=>'btn-p5'));
 			}

+ 3 - 1
SE/se-lib/Core/Database/Mysql.php

@@ -420,6 +420,7 @@ class Core_Database_Mysql extends Core_Database {
 						else if(strstr($Struct->Type,"multilinestring")) $col[]=' AsWKT(`'.$Field.'`) as "'.$Field.'"';
 						else if(strstr($Struct->Type,"polygon")) $col[]=' AsWKT(`'.$Field.'`) as "'.$Field.'"';
 						else if(strstr($Struct->Type,"multipolygon")) $col[]=' AsWKT(`'.$Field.'`) as "'.$Field.'"';
+						else if(strstr($Struct->Type,"point")) $col[]=' AsWKT(`'.$Field.'`) as "'.$Field.'"';
 
 						else $col[]='`'.$Field.'`';
 				}	
@@ -432,7 +433,7 @@ class Core_Database_Mysql extends Core_Database {
 	function MAKE_DB_OBJ($table,$obj,$dieonerror=null) {
 		$structure=self::describe_table_value($table); //todo to cache optimize
 		foreach(get_object_vars($obj) as $k=>$v) {
-			if(($structure[$k]->Type=='multipoint')||($structure[$k]->Type=='linestring')||($structure[$k]->Type=='polygon')||($structure[$k]->Type=='multipolygon')||($structure[$k]->Type=='multilinestring')) {
+			if(($structure[$k]->Type=='multipoint')||($structure[$k]->Type=='point')||($structure[$k]->Type=='linestring')||($structure[$k]->Type=='polygon')||($structure[$k]->Type=='multipolygon')||($structure[$k]->Type=='multilinestring')) {
 				if(empty($v)) {
 					unset($k);
 					unset($v);
@@ -1007,6 +1008,7 @@ class Core_Database_Mysql extends Core_Database {
 																	      			|| ( strstr($VAL->Type, 'decimal(42')  ) && strstr($ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type, 'decimal(41'  )
 																	      			|| ( strstr($VAL->Type, 'decimal(43')  ) && strstr($ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type, 'decimal(41'  )
 																	      			|| ( strstr($VAL->Type, 'multipoint')  ) && strstr($ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type, 'multipoint'  )
+																	      			|| ( strstr($VAL->Type, 'point')  ) && strstr($ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type, 'point'  )
 																		  			|| ( strstr($VAL->Type, 'date')  ) && strstr($ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type, 'char' ) 
 																		  			|| ( strstr($VAL->Type, 'date')  ) && strstr('varchar',$ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type ) 
 																		  			|| ( strstr($VAL->Type, 'datetime')  ) && strstr($ARR_TABLE['FIELDS'][$INDEX_OF_CONFIG_TABLE]->Type, 'char' ) 

+ 7 - 1
SE/se-lib/Core/Database/Pgsql.php

@@ -377,6 +377,9 @@ FROM information_schema.triggers
 		} else  if(strstr($type, "multipoint'")) {
 			$sql="SELECT UpdateGeometrySRID('".$table."','".$column."',4326);";
 			self::query($sql) or die1($sql);
+		} else  if(strstr($type, "point'")) {
+			$sql="SELECT UpdateGeometrySRID('".$table."','".$column."',4326);";
+			self::query($sql) or die1($sql);
 		}
 		
 	}
@@ -390,7 +393,7 @@ FROM information_schema.triggers
 				$structure=self::describe_table_value($table);
 				foreach($structure as $Field=>$Struct) {
 						//echo $Struct->Type;
-						if((strstr($Struct->Type,"multipoint") )||strstr($Struct->Type,"linestring") ||strstr($Struct->Type,"polygon"))
+						if((strstr($Struct->Type,"point") )|| strstr($Struct->Type,"multipoint") || strstr($Struct->Type,"linestring") ||strstr($Struct->Type,"polygon"))
 						 $col[]=' ST_AsText("'.$Field.'") as "'.$Field.'"';
 						else $col[]='"'.$Field.'"';
 				}	
@@ -481,6 +484,9 @@ FROM information_schema.triggers
 				if(empty($v)) $v='null';
 				else $v = "ST_GeomFromText('".$v."',4326)"; 
 			} else if(trim($structure[$k]->Type)=='multipolygon') {
+				if(empty($v)) $v='null';
+				else $v = "ST_GeomFromText('".$v."',4326)"; 
+			} else if(trim($structure[$k]->Type)=='point') {
 				if(empty($v)) $v='null';
 				else $v = "ST_GeomFromText('".$v."',4326)";
 			} else if(trim($structure[$k]->Type)=='datetime') {

+ 4 - 0
SE/superedit-SYNC_DATABASES.php

@@ -115,6 +115,7 @@ class SYNC_DATABASES {
 			  	self::get_current_time();
 			  	$loc_key=$this->db->show_index_value($table);
 			  	$rem_key=$this->gdb->show_index_value($table);
+			  	if($remote_key='') die('#118 Remote key not found ! ERROR ');
 			  	DEBUG_S(-3,'Last synced for (last_sync_loc,last_sync_rem,loc_key,rem_key) '.$table,array($LAST_SYNCED_loc,$LAST_SYNCED_rem,$loc_key,$rem_key),__FILE__,__FUNCTION__,__LINE__);
 			  	$ids_rem=$this->gdb->get_by_data_column($table,'A_RECORD_UPDATE_DATE',$LAST_SYNCED_rem,$this->currtime_rem,$loc_key);
 			  	while($h=$this->gdb->fetch($ids_rem)) {
@@ -255,6 +256,9 @@ $sd->set_table_to_sync('opt_przelacznice_mufy');
 $sd->set_table_to_sync('opt_wlokna');
 $sd->set_table_to_sync('opt_tuby');
 $sd->set_table_to_sync('opt_lokalizacje');
+$sd->set_table_to_sync('opt_porty');
+$sd->set_table_to_sync('opt_spawy');
+
 //$sd->set_table_to_sync('IN7_MK_BAZA_DYSTRYBUCJI');
 
 $sd->sync_struct();