mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-15 05:21:41 +00:00
create checkout filename from id, version and name
This commit is contained in:
parent
348d40ad22
commit
5351bd9596
|
@ -803,7 +803,14 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
|
|
||||||
$lc = self::getLatestContent();
|
$lc = self::getLatestContent();
|
||||||
|
|
||||||
$filename = $checkoutdir."/".$lc->getOriginalFileName();
|
$ext = pathinfo($this->getName(), PATHINFO_EXTENSION);
|
||||||
|
$oext = pathinfo($lc->getOriginalFileName(), PATHINFO_EXTENSION);
|
||||||
|
if($ext == $oext)
|
||||||
|
$filename = preg_replace('/[^A-Za-z0-9_.-]/', '_', $this->getName());
|
||||||
|
else {
|
||||||
|
$filename = preg_replace('/[^A-Za-z0-9_-]/', '_', $this->getName()).'.'.$oext;
|
||||||
|
}
|
||||||
|
$filename = $checkoutdir.$this->getID().'-'.$lc->getVersion().'-'.$filename; //$lc->getOriginalFileName();
|
||||||
$queryStr = "INSERT INTO tblDocumentCheckOuts (document, version, userID, date, filename) VALUES (".$this->_id.", ".$lc->getVersion().", ".$user->getID().", ".$db->getCurrentDatetime().", ".$db->qstr($filename).")";
|
$queryStr = "INSERT INTO tblDocumentCheckOuts (document, version, userID, date, filename) VALUES (".$this->_id.", ".$lc->getVersion().", ".$user->getID().", ".$db->getCurrentDatetime().", ".$db->qstr($filename).")";
|
||||||
if (!$db->getResult($queryStr))
|
if (!$db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user