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';
|
$modulepart = 'propale';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
$object = new Propal($this->db);
|
$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 {
|
} else {
|
||||||
// TODO Implement additional moduleparts
|
// TODO Implement additional moduleparts
|
||||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
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.");
|
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');
|
$fhandle = @fopen($destfiletmp, 'w');
|
||||||
if ($fhandle) {
|
if ($fhandle) {
|
||||||
$nbofbyteswrote = fwrite($fhandle, $newfilecontent);
|
$nbofbyteswrote = fwrite($fhandle, $newfilecontent);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user