Index: trunk/kernel/include/parseditem.php =================================================================== diff -u -r3736 -r3907 --- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 3736) +++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 3907) @@ -666,6 +666,21 @@ var $QueryDone = false; var $LastQuerySQL = ''; + + /** + * Application object + * + * @var kApplication + */ + var $Application = null; + + /** + * Connection to database + * + * @var kDBConnection + */ + var $Conn = null; + function SetTable($action, $table_name = null) // new by Alex { // $action = {'live', 'restore','edit'} @@ -695,11 +710,16 @@ function clsItemCollection() { - - $this->adodbConnection = &GetADODBConnection(); - - $this->Clear(); - $this->BasePermission=""; + if (class_exists('kApplication')) { + // just in case when aplication is not found + $this->Application =& kApplication::Instance(); + $this->Conn =& $this->Application->GetADODBConnection(); + } + + $this->adodbConnection =& GetADODBConnection(); + + $this->Clear(); + $this->BasePermission = ''; } function GetIDField() // new by Alex