- $sql = "SELECT l.PhraseId AS pid FROM ".GetTablePrefix()."Phrase AS l LEFT JOIN $edit_table AS e ON e.PhraseId = l.PhraseId WHERE e.PhraseId IS NULL ORDER BY l.PhraseId";
- $rs = $this->adodbConnection->Execute($sql);
-
- $ids = '';
- while ($rs && !$rs->EOF) {
- $ids .= $rs->fields['pid'].',';
- $rs->MoveNext();
- }
-
- $ids = substr($ids, 0, strlen($ids) - 1);
-
- if (strlen($ids) > 0) {
- $sql = "DELETE FROM ".GetTablePrefix()."Phrase WHERE PhraseId IN (".$ids.")";
- $this->adodbConnection->Execute($sql);
- }
-
//$idlist = array();
$sql = "SELECT * FROM $edit_table";
$this->Clear();
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$c = $this->AddItemFromArray($data);
- $c->Dirty();
+ $c->Dirty();
if($data["PhraseId"]>0)
{
$c->Update();
}
else
{
$c->debuglevel=0;
$c->UnsetIdField();
$c->Create();
}
$rs->MoveNext();
- }
+ }
+
+ // Phrases deleted from temporary table are marked with LanguageId = 0, when saving we need to actually delete them all
+ // The idea was taken from Images edit by Kostja
+ $sql = "DELETE FROM ".$this->SourceTable." WHERE LanguageId = 0";
$inst_error = "Your license must be updated before you can upgrade. Please don't use 'Existing License' option, instead either Download from Intechnic or Upload a new license file!";
}
else {
$sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules";
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$sitepath' WHERE VariableName='Site_Path'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$g_Domain' WHERE VariableName='Server_Name'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '".$_SERVER['DOCUMENT_ROOT'].$sitepath."admin/backupdata' WHERE VariableName='Backup_Path'";