Browse Source

#1016: record the displayed value of the database_table_name field in the database.
This happens:
- when creating a new Synchro Data Source
- when modifying an "old" Synchro Data Source for which the field was empty.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3439 a333f486-631f-4898-b8df-5754b55c2be0

dflaven 10 năm trước cách đây
mục cha
commit
0271e09150
1 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 16 0
      synchro/synchrodatasource.class.inc.php

+ 16 - 0
synchro/synchrodatasource.class.inc.php

@@ -640,6 +640,14 @@ EOF
 				$this->Set('attribute_list', $oAttributeSet);
 			}
 		}
+		else
+		{
+			$sDataTable = $this->Get('database_table_name');
+			if (empty($sDataTable))
+			{
+				$this->Set('database_table_name', $this->ComputeDataTableName());
+			}
+		}
 	}
 	public function DoCheckToWrite()
 	{
@@ -761,6 +769,14 @@ EOF
 		{
 			CMDBSource::Query($sTriggerSQL);
 		}
+		
+		$sDataTable = $this->Get('database_table_name');
+		if (empty($sDataTable))
+		{
+			$this->Set('database_table_name', $this->ComputeDataTableName());
+			$this->DBUpdate();
+		}
+		
 	}
 
 	/**