Index: trunk/kernel/include/parseditem.php
===================================================================
diff -u -N -r676 -r701
--- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 676)
+++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 701)
@@ -1173,6 +1173,7 @@
function CopyFromEditTable($idfield = null)
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$dropRelTableFlag = false;
if($idfield == null) $idfield = $this->GetIDField();
@@ -1269,6 +1270,7 @@
if($edit_table) @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$objSession->GetEditTable("CategoryItems"));
+ unset($GLOBALS['_CopyFromEditTable']);
}
function GetNextTempID()
Index: trunk/admin/category/addcategory_custom.php
===================================================================
diff -u -N -r672 -r701
--- trunk/admin/category/addcategory_custom.php (.../addcategory_custom.php) (revision 672)
+++ trunk/admin/category/addcategory_custom.php (.../addcategory_custom.php) (revision 701)
@@ -187,9 +187,8 @@
$fieldname = "CustomData[$fieldid]";
if(is_object($f))
{
- $val_field = "Get("Value"))."\" name=\"$fieldname\">";
+ $val_field = "Get("Value"))."\" name=\"$fieldname\">";
$field->Set("Value", $val_field);
-
if ($field->Get('Prompt') != '') {
$field->Set("FieldLabel", admin_language($field->Get('Prompt')));
}
Index: trunk/kernel/include/portalgroup.php
===================================================================
diff -u -N -r585 -r701
--- trunk/kernel/include/portalgroup.php (.../portalgroup.php) (revision 585)
+++ trunk/kernel/include/portalgroup.php (.../portalgroup.php) (revision 701)
@@ -438,6 +438,7 @@
function CopyFromEditTable($idfield)
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$sql = "SELECT * FROM $edit_table";
@@ -469,6 +470,7 @@
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
+ unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable($idfield)
Index: trunk/kernel/include/itemreview.php
===================================================================
diff -u -N -r676 -r701
--- trunk/kernel/include/itemreview.php (.../itemreview.php) (revision 676)
+++ trunk/kernel/include/itemreview.php (.../itemreview.php) (revision 701)
@@ -508,6 +508,7 @@
function CopyFromEditTable($ResourceId)
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
//echo "ToLive [Reviews]
";
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
@@ -539,6 +540,7 @@
//echo "DEL REVIEW SQL: $sql
";
$this->adodbConnection->Execute($sql);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$edit_table);
+ unset($GLOBALS['_CopyFromEditTable']);
}
Index: trunk/kernel/include/emailmessage.php
===================================================================
diff -u -N -r561 -r701
--- trunk/kernel/include/emailmessage.php (.../emailmessage.php) (revision 561)
+++ trunk/kernel/include/emailmessage.php (.../emailmessage.php) (revision 701)
@@ -501,7 +501,7 @@
if (!$use_parent) {
$edit_table = $objSession->GetEditTable($this->SourceTable);
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
- $query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield = -1";
+ $query = "SELECT * FROM ".$this->SourceTable." WHERE 0";
$insert = "CREATE TABLE ".$edit_table." ".$query;
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($insert,ENT_NOQUOTES)."
\n";
@@ -519,7 +519,7 @@
$e->UnsetIdField();
$e->Set("EmailMessageId",$idvalue--);
$e->Set("LanguageId",$id);
- $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$id));
+// $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$id));
$e->Create();
}
}
@@ -528,7 +528,7 @@
$e->UnsetIdField();
$e->Set("EmailMessageId",$idvalue--);
$e->Set("LanguageId",$IdList);
- $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$LangId));
+// $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$LangId));
$e->Create();
}
}
@@ -542,6 +542,7 @@
function CopyFromEditTable()
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$idfield = "EmailMessageId";
$edit_table = $objSession->GetEditTable($this->SourceTable);
@@ -568,6 +569,7 @@
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
+ unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable()
Index: trunk/kernel/include/itemdb.php
===================================================================
diff -u -N -r568 -r701
--- trunk/kernel/include/itemdb.php (.../itemdb.php) (revision 568)
+++ trunk/kernel/include/itemdb.php (.../itemdb.php) (revision 701)
@@ -276,12 +276,18 @@
{
if($first)
{
- $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
+ if(isset($GLOBALS['_CopyFromEditTable']))
+ $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(($value)));
+ else
+ $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
$first = 0;
}
else
{
- $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
+ if(isset($GLOBALS['_CopyFromEditTable']))
+ $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(($value)));
+ else
+ $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
}
}
if (!(($value == '' || $value == 0) && ($this->Data[$key] == 'NULL' || $this->Data[$key] == '0' || $this->Data[$key] == ''))) {
@@ -352,12 +358,18 @@
}
if($first)
{
- $sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
+ if(isset($GLOBALS['_CopyFromEditTable']))
+ $sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(($value)));
+ else
+ $sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
$first = 0;
}
else
{
- $sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
+ if(isset($GLOBALS['_CopyFromEditTable']))
+ $sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr(($value)));
+ else
+ $sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr(stripslashes($value)));
}
}
$sql = sprintf('%s)',$sql);
Index: trunk/kernel/include/image.php
===================================================================
diff -u -N -r686 -r701
--- trunk/kernel/include/image.php (.../image.php) (revision 686)
+++ trunk/kernel/include/image.php (.../image.php) (revision 701)
@@ -1069,6 +1069,7 @@
function CopyFromEditTable($idfield)
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$dummy =& $this->GetDummy();
@@ -1093,6 +1094,7 @@
$this->adodbConnection->Execute("DELETE FROM $edit_table WHERE ResourceId=0");
$this->CopyFromPendingFiles($edit_table);
parent::CopyFromEditTable($idfield);
+ unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable($idfield)
Index: trunk/kernel/include/portaluser.php
===================================================================
diff -u -N -r568 -r701
--- trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 568)
+++ trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 701)
@@ -979,6 +979,7 @@
function CopyFromEditTable($idfield)
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$sql = "SELECT * FROM $edit_table";
@@ -1008,6 +1009,7 @@
$rs->MoveNext();
}
@$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
+ unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable()
Index: trunk/kernel/include/relationship.php
===================================================================
diff -u -N -r271 -r701
--- trunk/kernel/include/relationship.php (.../relationship.php) (revision 271)
+++ trunk/kernel/include/relationship.php (.../relationship.php) (revision 701)
@@ -387,6 +387,7 @@
function CopyFromEditTable($ResourceId)
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
@@ -427,6 +428,7 @@
$this->adodbConnection->Execute($sql);
// $this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
+ unset($GLOBALS['_CopyFromEditTable']);
}
}
Index: trunk/kernel/include/language.php
===================================================================
diff -u -N -r651 -r701
--- trunk/kernel/include/language.php (.../language.php) (revision 651)
+++ trunk/kernel/include/language.php (.../language.php) (revision 701)
@@ -117,6 +117,7 @@
function CopyFromEditTable()
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
@@ -152,6 +153,7 @@
if( $GLOBALS['debuglevel'] ) echo $sql."
\n";
$this->adodbConnection->Execute($sql);
+ unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable()
@@ -397,6 +399,7 @@
function CopyFromEditTable()
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
@@ -428,6 +431,7 @@
}
$rs->MoveNext();
}
+ unset($GLOBALS['_CopyFromEditTable']);
}
function ExportPhrases($file,$LangIds=NULL,$PhraseTypes=null)
Index: trunk/kernel/include/events.php
===================================================================
diff -u -N -r271 -r701
--- trunk/kernel/include/events.php (.../events.php) (revision 271)
+++ trunk/kernel/include/events.php (.../events.php) (revision 701)
@@ -48,6 +48,7 @@
function CopyFromEditTable()
{
global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
@@ -64,6 +65,7 @@
}
$rs->MoveNext();
}
+ unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable()
Index: trunk/kernel/startup.php
===================================================================
diff -u -N -r659 -r701
--- trunk/kernel/startup.php (.../startup.php) (revision 659)
+++ trunk/kernel/startup.php (.../startup.php) (revision 701)
@@ -23,8 +23,8 @@
return $a;
}
foreach(Array(
- 'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS','$HTTP_POST_FILES',
- '_POST','_GET','_COOKIE','_SESSION','_SERVER','_FILES','_REQUEST') as $_)
+ 'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS',
+ '_POST','_GET','_COOKIE','_SESSION','_SERVER','_REQUEST') as $_)
if(isset($GLOBALS[$_]))
$GLOBALS[$_]=addSlashesA($GLOBALS[$_]);
}
Index: trunk/admin/config/importlang_progress.php
===================================================================
diff -u -N -r640 -r701
--- trunk/admin/config/importlang_progress.php (.../importlang_progress.php) (revision 640)
+++ trunk/admin/config/importlang_progress.php (.../importlang_progress.php) (revision 701)
@@ -108,10 +108,10 @@
{
if((int)$file["size"]>0)
{
- move_uploaded_file($file["tmp_name"],$pathtoroot.$admin."/export/".$file["name"]);
- @chmod($pathtoroot.$admin."/export/".$file["name"], 0666);
-
$filename = $pathtoroot.$admin."/export/".$file["name"];
+ move_uploaded_file($file["tmp_name"],$filename)?1:0;
+ @chmod($filename, 0666);
+
if(file_exists($filename))
{
/* parse xml file */
@@ -121,6 +121,8 @@
$objInXML = new xml_doc($xml);
$objInXML->parse();
+ $ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
+ $ado->Execute("DROP TABLE IF EXISTS $EventTable");
$sql = "CREATE TABLE $PhraseTable SELECT Phrase,Translation,PhraseType,LanguageId FROM ".GetTablePrefix()."Phrase WHERE PhraseId=-1";
$ado->Execute($sql);
@@ -215,7 +217,7 @@
$Types = implode(",",$_POST["langtypes"]);
$objSession->SetVariable("lang_types",$Types);
$objSession->SetVariable("lang_overwrite",(int)$_POST["overwrite"]);
- $Total = TableCount($PhraseTable,"PhraseType IN ($Types)",0);
+ $Total = $Types?TableCount($PhraseTable,"PhraseType IN ($Types)",0):0;
$objSession->SetVariable("phrase_total",$Total);
$Total = TableCount($EventTable,"",0);
$objSession->SetVariable("event_total",$Total);
@@ -272,7 +274,11 @@
$url = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&Offset=0&Status=1";
}
else
+ {
+ $ado->Execute("DROP TABLE IF EXISTS $PhraseTable");
+ $ado->Execute("DROP TABLE IF EXISTS $EventTable");
$url = $adminURL."/config/config_lang.php?env=".BuildEnv();
+ }
}
reload($url);
Index: trunk/kernel/include/adodb/drivers/adodb-mysql.inc.php
===================================================================
diff -u -N -r642 -r701
--- trunk/kernel/include/adodb/drivers/adodb-mysql.inc.php (.../adodb-mysql.inc.php) (revision 642)
+++ trunk/kernel/include/adodb/drivers/adodb-mysql.inc.php (.../adodb-mysql.inc.php) (revision 701)
@@ -343,30 +343,6 @@
{
//global $ADODB_COUNTRECS;
//if($ADODB_COUNTRECS)
- if(defined('EDD'))
- {
- $explain='';
-// if($result=mysql_query('EXPLAIN '.$sql,$this->_connectionID))
-// {
-// $dd=Array();
-// while($d=mysql_fetch_assoc($result))$dd[]=$d;
-// mysql_free_result($result);
-// $h='';$r='';
-// foreach($dd as $i=>$d)
-// {
-// foreach($d as $th=>$td)
-// {
-// if(!$i)$h.='