mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Can now add documents to events in agenda
This commit is contained in:
parent
1907891b14
commit
a804999d92
|
|
@ -666,6 +666,10 @@ class Documents extends DolibarrApi
|
|||
$modulepart = 'propale';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
$object = new Propal($this->db);
|
||||
} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') {
|
||||
$modulepart = 'agenda';
|
||||
require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
|
||||
$object = new ActionComm($this->db);
|
||||
} else {
|
||||
// TODO Implement additional moduleparts
|
||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||
|
|
@ -742,6 +746,11 @@ class Documents extends DolibarrApi
|
|||
throw new RestException(500, "File with name '".$original_file."' already exists.");
|
||||
}
|
||||
|
||||
// in case temporary directory doesn't exist
|
||||
if (!dol_is_dir(dirname(DOL_DATA_ROOT . '/admin/temp/'))) {
|
||||
dol_mkdir(DOL_DATA_ROOT . '/admin/temp/');
|
||||
}
|
||||
|
||||
$fhandle = @fopen($destfiletmp, 'w');
|
||||
if ($fhandle) {
|
||||
$nbofbyteswrote = fwrite($fhandle, $newfilecontent);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user