Index: branches/5.2.x/core/kernel/db/cat_dbitem.php =================================================================== diff -u -N -r14596 -r14699 --- branches/5.2.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 14596) +++ branches/5.2.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 14699) @@ -1,6 +1,6 @@ VirtualFields['ResourceId']); - + return $ret; } @@ -163,6 +163,15 @@ return $this->Create($cat_id); } + /** + * Sets new name for item in case if it is being copied in same table + * + * @param array $master Table data from TempHandler + * @param int $foreign_key ForeignKey value to filter name check query by + * @param string $title_field FieldName to alter, by default - TitleField of the prefix + * @param string $format sprintf-style format of renaming pattern, by default Copy %1$s of %2$s which makes it Copy [Number] of Original Name + * @access public + */ public function NameCopy($master=null, $foreign_key=null, $title_field=null, $format='Copy %1$s of %2$s') { $title_field = $this->Application->getUnitOption($this->Prefix, 'TitleField'); @@ -322,14 +331,14 @@ /** * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result * - * @param string $string + * @param string $filename * @return string */ function stripDisallowed($filename) { $filenames_helper =& $this->Application->recallObject('FilenamesHelper'); /* @var $filenames_helper kFilenamesHelper */ - + $table = $this->IsTempTable() ? $this->Application->GetTempName(TABLE_PREFIX.'CategoryItems', 'prefix:'.$this->Prefix) : TABLE_PREFIX.'CategoryItems'; return $filenames_helper->stripDisallowed($table, 'ItemResourceId', $this->GetDBField('ResourceId'), $filename); @@ -558,7 +567,7 @@ // delete this item, because changes made in pending copy (this item) will be declined in this method $temp_handler =& $this->Application->recallObject($this->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler'); /* @var $temp_handler kTempTablesHandler */ - + $temp_handler->DeleteItems($this->Prefix, $this->Special, Array ($this->GetID())); $this->sendEmailEvents(STATUS_DISABLED, true);