Index: trunk/core/units/general/cat_dbitem.php =================================================================== diff -u -r3543 -r3568 --- trunk/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 3543) +++ trunk/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 3568) @@ -10,7 +10,14 @@ * @var Array */ var $CategoryPath = Array(); - + + /** + * Use automatic filename generation + * + * @var bool + */ + var $useFilenames = true; + function Init($prefix, $special, $event_params = null) { parent::Init($prefix, $special, $event_params); @@ -24,13 +31,16 @@ { if (!$this->Validate()) return false; - $this->checkFilename(); $this->SetDBField('ResourceId', $this->Application->NextResourceId()); $this->SetDBField('Modified', adodb_mktime() ); $this->SetDBField('CreatedById', $this->Application->GetVar('u_id')); + + if ($this->useFilenames) { + $this->checkFilename(); $this->generateFilename(); + } - $ret = parent::Create($force_id, $system_create); + $ret = parent::Create(); if($ret) { if ( kTempTablesHandler::IsTempTable($this->TableName) ) { @@ -49,11 +59,14 @@ function Update($id=null, $system_update=false) { - $this->checkFilename(); $this->VirtualFields['ResourceId'] = true; $this->SetDBField('Modified', adodb_mktime() ); $this->SetDBField('ModifiedById', $this->Application->GetVar('u_id')); + + if ($this->useFilenames) { + $this->checkFilename(); $this->generateFilename(); + } return parent::Update($id, $system_update); }