|
|
@ -132,6 +132,7 @@ class ExtraFieldValue extends Model |
|
|
|
|
|
|
|
|
|
|
|
$commentVariable = 'extra_'.$field_variable.'_comment'; |
|
|
|
$commentVariable = 'extra_'.$field_variable.'_comment'; |
|
|
|
$comment = isset($params[$commentVariable]) ? $params[$commentVariable] : null; |
|
|
|
$comment = isset($params[$commentVariable]) ? $params[$commentVariable] : null; |
|
|
|
|
|
|
|
$dirPermissions = api_get_permissions_for_new_directories(); |
|
|
|
|
|
|
|
|
|
|
|
switch ($extraFieldInfo['field_type']) { |
|
|
|
switch ($extraFieldInfo['field_type']) { |
|
|
|
case ExtraField::FIELD_TYPE_TAG: |
|
|
|
case ExtraField::FIELD_TYPE_TAG: |
|
|
@ -214,7 +215,6 @@ class ExtraFieldValue extends Model |
|
|
|
$em->flush(); |
|
|
|
$em->flush(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case ExtraField::FIELD_TYPE_FILE_IMAGE: |
|
|
|
case ExtraField::FIELD_TYPE_FILE_IMAGE: |
|
|
|
$dirPermissions = api_get_permissions_for_new_directories(); |
|
|
|
|
|
|
|
switch ($this->type) { |
|
|
|
switch ($this->type) { |
|
|
|
case 'course': |
|
|
|
case 'course': |
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/"; |
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/"; |
|
|
@ -228,6 +228,10 @@ class ExtraFieldValue extends Model |
|
|
|
$fileDir = UserManager::getUserPathById($params['item_id'], 'system'); |
|
|
|
$fileDir = UserManager::getUserPathById($params['item_id'], 'system'); |
|
|
|
$fileDirStored = UserManager::getUserPathById($params['item_id'], 'last'); |
|
|
|
$fileDirStored = UserManager::getUserPathById($params['item_id'], 'last'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'work': |
|
|
|
|
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH).'work/'; |
|
|
|
|
|
|
|
$fileDirStored = 'work/'; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png"; |
|
|
|
$fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png"; |
|
|
@ -254,21 +258,23 @@ class ExtraFieldValue extends Model |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case ExtraField::FIELD_TYPE_FILE: |
|
|
|
case ExtraField::FIELD_TYPE_FILE: |
|
|
|
$dirPermissions = api_get_permissions_for_new_directories(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch ($this->type) { |
|
|
|
switch ($this->type) { |
|
|
|
case 'course': |
|
|
|
case 'course': |
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/"; |
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH).'courses/'; |
|
|
|
$fileDirStored = "courses/"; |
|
|
|
$fileDirStored = "courses/"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'session': |
|
|
|
case 'session': |
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH)."sessions/"; |
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH).'sessions/'; |
|
|
|
$fileDirStored = "sessions/"; |
|
|
|
$fileDirStored = "sessions/"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'user': |
|
|
|
case 'user': |
|
|
|
$fileDir = UserManager::getUserPathById($params['item_id'], 'system'); |
|
|
|
$fileDir = UserManager::getUserPathById($params['item_id'], 'system'); |
|
|
|
$fileDirStored = UserManager::getUserPathById($params['item_id'], 'last'); |
|
|
|
$fileDirStored = UserManager::getUserPathById($params['item_id'], 'last'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'work': |
|
|
|
|
|
|
|
$fileDir = api_get_path(SYS_UPLOAD_PATH).'work/'; |
|
|
|
|
|
|
|
$fileDirStored = "work/"; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$cleanedName = api_replace_dangerous_char($value['name']); |
|
|
|
$cleanedName = api_replace_dangerous_char($value['name']); |
|
|
|