mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00:00
Merge pull request #24 from ss23/master
FIX Don't show the upload field when inappropriate
This commit is contained in:
commit
c2639d86d1
@ -57,6 +57,15 @@ class DMSUploadField extends UploadField {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function isDisabled() {
|
||||||
|
return (parent::isDisabled() || !$this->isSaveable());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isSaveable() {
|
||||||
|
return (!empty($this->getRecord()->ID));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to handle upload of a single file
|
* Action to handle upload of a single file
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user