Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0

This commit is contained in:
Laurent Destailleur 2023-02-22 14:38:25 +01:00
commit 610ab03f0d
6 changed files with 12 additions and 6 deletions

View File

@ -513,7 +513,7 @@ $tabcond[25] = isModEnabled('website');
$tabcond[27] = isModEnabled("societe");
$tabcond[28] = isModEnabled('holiday');
$tabcond[29] = isModEnabled('project');
$tabcond[30] = isModEnabled('label');
$tabcond[30] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('adherent')); // stickers format dictionary
//$tabcond[31]= isModEnabled('accounting');
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = isModEnabled('hrm');

View File

@ -179,6 +179,7 @@ class FormTicket
print '<form method="POST" '.($withdolfichehead ? '' : 'style="margin-bottom: 30px;" ').'name="ticket" id="form_create_ticket" enctype="multipart/form-data" action="'.(!empty($this->param["returnurl"]) ? $this->param["returnurl"] : $_SERVER['PHP_SELF']).'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="'.$this->action.'">';
print '<input type="hidden" name="trackid" value="'.$this->trackid.'">';
foreach ($this->param as $key => $value) {
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
}

View File

@ -2471,10 +2471,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
if (!empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / ';
$linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_value'] = dol_print_date(empty($elementobject->date_shipping) ? $elementobject->date_delivery : $elementobject->date_shipping, 'day', '', $outputlangs);
} else {
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending");
if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_value'] = dol_print_date(empty($elementobject->date_shipping) ? $elementobject->date_delivery : $elementobject->date_shipping, 'day', '', $outputlangs);
}
}
}

View File

@ -187,10 +187,11 @@ if (($line->info_bits & 2) == 2) {
if ($line->date_start || $line->date_end) {
print '<div class="clearboth nowraponall opacitymedium daterangeofline">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
}
if (!$line->date_start || !$line->date_end) {
// show warning under line
// we need to fetch product associated to line for some test
if ($object->element == 'propal' || $object->element == 'order' || $object->element == 'propal_supplier' || $object->element == 'supplier_proposal' || $object->element == 'commande') {
if ($object->element == 'propal' || $object->element == 'order' || $object->element == 'facture' || $object->element == 'propal_supplier' || $object->element == 'supplier_proposal' || $object->element == 'commande') {
$res = $line->fetch_product();
if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod()) {

View File

@ -276,7 +276,7 @@ if (empty($reshook)) {
if (!$error) {
// File transfer
$object->copyFilesForTicket();
$object->copyFilesForTicket(''); // trackid is forced to '' because files were uploaded when no id for ticket exists yet and trackid was ''
}
if (!$error) {
@ -726,6 +726,7 @@ if ($action == 'create' || $action == 'presend') {
print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket');
$formticket->trackid = ''; // TODO Use a unique key to avoid conflict in upload file feature
$formticket->withfromsocid = $socid ? $socid : $user->socid;
$formticket->withfromcontactid = $contactid ? $contactid : '';
$formticket->withtitletopic = 1;

View File

@ -2248,9 +2248,10 @@ class Ticket extends CommonObject
* Used for files linked into messages.
* Files may be renamed during copy to avoid overwriting existing files.
*
* @return array Array with final path/name/mime of files.
* @param string $forcetrackid Force trackid
* @return array Array with final path/name/mime of files.
*/
public function copyFilesForTicket()
public function copyFilesForTicket($forcetrackid = null)
{
global $conf;
@ -2265,7 +2266,7 @@ class Ticket extends CommonObject
$maxheightmini = 72;
$formmail = new FormMail($this->db);
$formmail->trackid = 'tic'.$this->id;
$formmail->trackid = (is_null($forcetrackid) ? 'tic'.$this->id : '');
$attachedfiles = $formmail->get_attached_files();
$filepath = $attachedfiles['paths'];