2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' into new-duplicate-pdf-configuration-for-order-in-sepcific-page

This commit is contained in:
Lucas Marcouiller
2025-02-13 11:42:52 +01:00
committed by GitHub
64 changed files with 728 additions and 405 deletions

View File

@@ -704,7 +704,7 @@ abstract class CommonObject
public $user_creation;
/**
* @var int User id author/creation
* @var int|null User id author/creation
*/
public $user_creation_id;

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -99,8 +99,8 @@ trait CommonPeople
* Return full name (civility+' '+name+' '+lastname)
*
* @param Translate $langs Language object for translation of civility (used only if option is 1)
* @param int $option 0=No option, 1=Add civility
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
* @param int<0,1> $option 0=No option, 1=Add civility
* @param int<-1,5> $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
* @param int $maxlen Maximum length
* @return string String with full name
*/

View File

@@ -1554,6 +1554,16 @@ class FormMail extends Form
}),
success: function(response) {
console.log('Received image URL: '+response);
// make substitutions
let substit = ". json_encode($this->substit).";
for (let key in substit) {
if (substit.hasOwnProperty(key)) {
// Replace the placeholder with its corresponding value
response = response.replace(key, substit[key]);
}
}
// Assuming response is the URL of the generated image
var imageUrl = response;
$('#ai_image_result').html('<img src=\"' + imageUrl + '\" alt=\"Generated Image\" />');

View File

@@ -2683,9 +2683,54 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
}
/**
* Show header of company in HTML public pages
*
* @param Societe $mysoc Third party
* @param Translate $langs Output language
* @return void
*/
function htmlPrintOnlineHeader($mysoc, $langs)
{
global $conf;
// Define urllogo
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
}
print '<header class="center">';
// Output html code for logo
if ($urllogo) {
print '<div class="backgreypublicpayment">';
print '<div class="logopublicpayment">';
print '<img id="dolpaymentlogo" src="'.$urllogo.'">';
print '</div>';
if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
}
print '</div>';
}
if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) {
print '<div class="backimagepublicregistration">';
print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION').'">';
print '</div>';
}
print '</header>';
}
/**
* Show footer of company in HTML pages
* Show footer of company in HTML public pages
*
* @param Societe $fromcompany Third party
* @param Translate $langs Output language

View File

@@ -47,7 +47,7 @@ class pdf_proforma extends pdf_eratosthene
*/
public function __construct($db)
{
global $conf, $langs, $mysoc;
global $langs;
parent::__construct($db);

View File

@@ -195,8 +195,8 @@ class doc_generic_project_odt extends ModelePDFProjects
'task_label' => $task->label,
'task_description' => $task->description,
'task_fk_parent' => $task->fk_task_parent,
'task_duration' => $task->duration,
'task_duration_hour' => convertSecondToTime($task->duration, 'all'),
'task_duration' => $task->duration_effective,
'task_duration_hour' => convertSecondToTime($task->duration_effective, 'all'),
'task_planned_workload' => $task->planned_workload,
'task_planned_workload_hour' => convertSecondToTime($task->planned_workload, 'all'),
'task_progress' => $task->progress,

View File

@@ -307,7 +307,7 @@ class pdf_timespent extends ModelePDFProjects
//$progress=($object->lines[$i]->progress?$object->lines[$i]->progress.'%':'');
$datestart = dol_print_date($object->lines[$i]->date_start, 'day');
$dateend = dol_print_date($object->lines[$i]->date_end, 'day');
$duration = convertSecondToTime((int) $object->lines[$i]->duration, 'allhourmin');
$duration = convertSecondToTime((int) $object->lines[$i]->duration_effective, 'allhourmin');
$showpricebeforepagebreak = 1;

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Benjamin Falière <benjamin@faliere.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,11 +70,13 @@ foreach ($object->fields as $key => $val) {
}
print '"';
print '>';
print '<label for="'.$key.'" class="block">';
if (!empty($val['help'])) {
print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
} else {
print $langs->trans($val['label']);
}
print '</label>';
print '</td>';
print '<td class="valuefieldcreate">';
if (!empty($val['picto'])) {