Commit b3b52a9f359cdc6ae862c5b290c2289585dcf3ed

Authored by Megan Watson
1 parent a871a97f

KTS-3190

""Import from server location" should also remove the file extension from the document name"
Fixed. Document add now drops the extension from the filename if it is used for the document title.

Committed by: Megan Watson
Reviewed by: Jonathan Byrne



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8305 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/documentutil.inc.php
... ... @@ -237,7 +237,13 @@ class KTDocumentUtil {
237 237 //$oContents = KTUtil::arrayGet($aOptions, 'contents');
238 238 $aMetadata = KTUtil::arrayGet($aOptions, 'metadata', null, false);
239 239 $oDocumentType = KTUtil::arrayGet($aOptions, 'documenttype');
240   - $sDescription = KTUtil::arrayGet($aOptions, 'description', $sFilename);
  240 + $sDescription = KTUtil::arrayGet($aOptions, 'description', '');
  241 +
  242 + if(empty($sDescription)){
  243 + // If no document name is provided use the filename minus the extension
  244 + $aFile = pathinfo($sFilename);
  245 + $sDescription = (isset($aFile['filename']) && !empty($aFile['filename'])) ? $aFile['filename'] : $sFilename;
  246 + }
241 247  
242 248 $oUploadChannel =& KTUploadChannel::getSingleton();
243 249  
... ...