Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 22.0
This commit is contained in:
commit
d0aa0df4f6
5 changed files with 12 additions and 11 deletions
|
|
@ -94,6 +94,7 @@ if (GETPOST('sendit', 'alpha') && getDolGlobalString('MAIN_UPLOAD_DOC') && !empt
|
|||
$generatethumbs = 0;
|
||||
}
|
||||
$allowoverwrite = (GETPOSTINT('overwritefile') ? 1 : 0);
|
||||
$forceFullTextIndexation = (!empty($forceFullTextIndexation) ? $forceFullTextIndexation : '');
|
||||
|
||||
if (!empty($upload_dirold) && getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
|
||||
$result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs, $object, empty($forceFullTextIndexation) ? 0 : $forceFullTextIndexation);
|
||||
|
|
|
|||
|
|
@ -1318,10 +1318,11 @@ class FormFile
|
|||
// Define relative path used to store the file
|
||||
if (empty($relativepath)) {
|
||||
$relativepath = (!empty($object->ref) ? dol_sanitizeFileName($object->ref) : '').'/';
|
||||
if (!empty($object->element) && $object->element == 'invoice_supplier') {
|
||||
if (!empty($object->element) && $object->element == "societe" && !empty($object->id)) {
|
||||
$relativepath = ($object->id).'/';
|
||||
} elseif (!empty($object->element) && $object->element == 'invoice_supplier') {
|
||||
$relativepath = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
|
||||
}
|
||||
if (!empty($object->element) && $object->element == 'project_task') {
|
||||
} elseif (!empty($object->element) && $object->element == 'project_task') {
|
||||
$relativepath = 'Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
||||
}
|
||||
}
|
||||
|
|
@ -1600,7 +1601,6 @@ class FormFile
|
|||
}
|
||||
//print $file['path'].'/'.$smallfile.'<br>';
|
||||
|
||||
|
||||
$urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(empty($object->entity) ? $conf->entity : $object->entity));
|
||||
if (empty($urlforhref)) {
|
||||
$urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.urlencode($modulepart).'&entity='.(empty($object->entity) ? $conf->entity : $object->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
|
||||
|
|
|
|||
|
|
@ -1998,12 +1998,12 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
|
|||
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict, when $updatesessionordb is 0)
|
||||
* @param int<0,1> $generatethumbs 1=Generate also thumbs for uploaded image files
|
||||
* @param ?Object $object Object used to set the fields src_object_type and src_object_id.
|
||||
* @param string $forceFullTestIndexation '1'=Force full text storage in database even if global option not set (consume a high level of data)
|
||||
* @param string $forceFullTextIndexation '1'=Force full text storage in database even if global option not set (consume a high level of data)
|
||||
* @param int $mode 0=Default mode use to move a file from default system upload dir to $upload_dir. 1=Mode to move an uploaded file from $keyforsourcefile into $upload_dir.
|
||||
* @return int Return integer <=0 if KO, nb of success if OK (>0)
|
||||
* @see dol_remove_file_process(), FileUpload::handleFileUpload()
|
||||
*/
|
||||
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionordb = 0, $keyforsourcefile = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null, $forceFullTestIndexation = '', $mode = 0)
|
||||
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionordb = 0, $keyforsourcefile = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null, $forceFullTextIndexation = '', $mode = 0)
|
||||
{
|
||||
global $db, $user, $conf, $langs;
|
||||
|
||||
|
|
@ -2146,7 +2146,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionor
|
|||
deleteFilesIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), '');
|
||||
}
|
||||
|
||||
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object);
|
||||
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object, $forceFullTextIndexation);
|
||||
if ($result < 0) {
|
||||
if ($allowoverwrite) {
|
||||
// Do not show error message. We can have an error due to DB_ERROR_RECORD_ALREADY_EXISTS
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ function getInvoicesForThirdParty($authentication, $idthirdparty)
|
|||
* Create an invoice
|
||||
*
|
||||
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
|
||||
* @param array{id:string,ref:string,ref_ext:string,thirdparty_id:int,fk_user_author:string,fk_user_valid:string,date:string,date_due:string,date_creation:string,date_validation:string,date_modification:string,payment_mode_id:string,type:int,total_net:float,total_vat:float,total:float,note_private:string,note_public:string,status:int,close_code:string,close_note:string,project_id:string,lines?:array{id:string,type:int,desc:string,vat_rate:float,qty:float,unitprice:float,total_net:float,total_vat:float,total:float,date_start:string,date_end:string,product_id:int,product_ref:string,product_label:string,product_desc:string}} $invoice Invoice
|
||||
* @param array{id:string,ref:string,ref_ext:string,thirdparty_id:int,fk_user_author:string,fk_user_valid:string,date:string,date_due:string,date_creation:string,date_validation:string,date_modification:string,payment_mode_id:string,type:int,total_net:float,total_vat:float,total:float,note_private:string,note_public:string,status:int,close_code:string,close_note:string,project_id:string,lines?:array<array{id:string,type:int,desc:string,vat_rate:float,qty:float,unitprice:float,total_net:float,total_vat:float,total:float,date_start:string,date_end:string,product_id:int,product_ref:string,product_label:string,product_desc:string}>} $invoice Invoice
|
||||
* @return array{result:array{result_code:string,result_label:string}} Array result
|
||||
*/
|
||||
function createInvoice($authentication, $invoice)
|
||||
|
|
@ -617,9 +617,9 @@ function createInvoice($authentication, $invoice)
|
|||
foreach ($arrayoflines as $line) {
|
||||
// $key can be 'line' or '0','1',...
|
||||
$newline = new FactureLigne($db);
|
||||
$newline->product_type = $line['type'];
|
||||
$newline->product_type = (int) $line['type'];
|
||||
$newline->desc = $line['desc'];
|
||||
$newline->fk_product = $line['product_id'];
|
||||
$newline->fk_product = (int) $line['product_id'];
|
||||
$newline->tva_tx = isset($line['vat_rate']) ? $line['vat_rate'] : 0;
|
||||
$newline->qty = $line['qty'];
|
||||
$newline->subprice = isset($line['unitprice']) ? $line['unitprice'] : null;
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty)
|
|||
* Create order
|
||||
*
|
||||
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
|
||||
* @param array{id:string,ref:string,ref_client:string,ref_ext:string,thirdparty_id:int,status:int,billed:string,total_net:float,total_vat:float,total_localtax1:float,total_localtax2:float,total:float,date:string,date_creation:string,date_validation:string,date_modification:string,source:string,note_private:string,note_public:string,project_id:string,mode_reglement_id:string,mode_reglement_code:string,mode_reglement:string,cond_reglement_id:string,cond_reglement_code:string,cond_reglement:string,cond_reglement_doc:string,date_livraison:int,demand_reason_id:string,lines:array{lines:array<array{id:string,type:int,fk_commande:int,fk_parent_line:int,desc:string,qty:float,price:float,unitprice:float,vat_rate:float,remise:float,remise_percent:float,total_net:float,total_vat:float,total:float,date_start:int,date_end:int,product_id:int,product_ref:string,product_label:string,product_desc:string}>}} $order Order info
|
||||
* @param array{id:string,ref:string,ref_client:string,ref_ext:string,thirdparty_id:int,status:int,billed:string,total_net:float,total_vat:float,total_localtax1:float,total_localtax2:float,total:float,date:string,date_creation:string,date_validation:string,date_modification:string,source:string,note_private:string,note_public:string,project_id:string,mode_reglement_id:string,mode_reglement_code:string,mode_reglement:string,cond_reglement_id:string,cond_reglement_code:string,cond_reglement:string,cond_reglement_doc:string,date_livraison:int,demand_reason_id:string,lines:array<array{id:string,type:int,fk_commande:int,fk_parent_line:int,desc:string,qty:float,price:float,unitprice:float,vat_rate:float,remise:float,remise_percent:float,total_net:float,total_vat:float,total:float,date_start:int,date_end:int,product_id:int,product_ref:string,product_label:string,product_desc:string}>} $order Order info
|
||||
* @return array{result:array{result_code:string,result_label:string}} Array result
|
||||
*/
|
||||
function createOrder($authentication, $order)
|
||||
|
|
|
|||
Loading…
Reference in a new issue