mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
some fix
This commit is contained in:
@@ -33,6 +33,8 @@ class PDFRecords extends PDF
|
||||
$this->pdfTitle = $pdfTitle;
|
||||
$this->pdfDescription = $pdfDescription;
|
||||
|
||||
$this->pdf->setPrintOwnerUser($app->getAuthenticatedUser());
|
||||
|
||||
$records = $printer->get_elements();
|
||||
|
||||
$list = [];
|
||||
@@ -507,7 +509,7 @@ class PDFRecords extends PDF
|
||||
$this->pdf->Cell(95, $h, $RIGHT_TEXT, "TBR", 1, "R", 1);
|
||||
|
||||
$this->pdf->SetY($y);
|
||||
$this->pdf->write(7, "record " . $rec->getNumber(), '', false, 'C');
|
||||
$this->pdf->write(7, $rec->getNumber(), '', false, 'C');
|
||||
$this->pdf->SetY($y2);
|
||||
|
||||
if($basket) {
|
||||
|
@@ -11,10 +11,15 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Out\Tool;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\User;
|
||||
|
||||
class PhraseaPDF extends \TCPDF
|
||||
{
|
||||
const FONT = 'freesans';
|
||||
|
||||
/** @var User */
|
||||
private $printOwnerUser;
|
||||
|
||||
public function Header()
|
||||
{
|
||||
|
||||
@@ -22,6 +27,13 @@ class PhraseaPDF extends \TCPDF
|
||||
|
||||
public function Footer()
|
||||
{
|
||||
$owner = ' Phraseanet';
|
||||
$unNeededTextLength = '';
|
||||
if (!empty($this->printOwnerUser)) {
|
||||
$owner = sprintf('Printed with Phraseanet by <a href="mailto:%s">%s</a> on %s', $this->printOwnerUser->getEmail(), $this->printOwnerUser->getDisplayName(), (new \DateTime())->format("Y/m/d"));
|
||||
$unNeededTextLength = sprintf('<a href="%s"></a>', $this->printOwnerUser->getEmail());
|
||||
}
|
||||
|
||||
$this->SetLeftMargin(0);
|
||||
$mr = $this->SetRightMargin(0);
|
||||
|
||||
@@ -30,18 +42,33 @@ class PhraseaPDF extends \TCPDF
|
||||
$this->SetFont(self::FONT, 'I', 8);
|
||||
$this->Cell(0, 10, 'Page ' . $this->PageNo(), 0, 0, 'C');
|
||||
|
||||
$this->SetFont(self::FONT, '', 8);
|
||||
$w = $this->GetStringWidth('Printed by');
|
||||
if (empty($this->printOwnerUser)) {
|
||||
$this->SetFont(self::FONT, '', 8);
|
||||
$w = $this->GetStringWidth('Printed by');
|
||||
|
||||
$this->SetFont(self::FONT, 'B', 8);
|
||||
$w += $this->GetStringWidth(' Phraseanet');
|
||||
$this->SetFont(self::FONT, 'B', 8);
|
||||
$w += $this->GetStringWidth($owner);
|
||||
|
||||
$this->SetXY(-$w - $mr - 5, -15);
|
||||
$this->SetXY(-$w - $mr - 5, -15);
|
||||
|
||||
$this->SetFont(self::FONT, '', 8);
|
||||
$this->Write(8, 'Printed by');
|
||||
$this->SetFont(self::FONT, '', 8);
|
||||
$this->Write(8, 'Printed by');
|
||||
|
||||
$this->SetFont(self::FONT, 'B', 8);
|
||||
$this->Write(8, ' Phraseanet');
|
||||
$this->SetFont(self::FONT, 'B', 8);
|
||||
$this->Write(8, ' Phraseanet');
|
||||
} else {
|
||||
$this->SetFont(self::FONT, '', 8);
|
||||
$w = $this->GetStringWidth($owner) - $this->GetStringWidth($unNeededTextLength);
|
||||
|
||||
$this->SetXY(-$w - $mr -5, -15);
|
||||
|
||||
$this->SetFont(self::FONT, '', 8);
|
||||
$this->writeHTMLCell($w,8, '', '', $owner);
|
||||
}
|
||||
}
|
||||
|
||||
public function setPrintOwnerUser($user)
|
||||
{
|
||||
$this->printOwnerUser = $user;
|
||||
}
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<div style="padding:10px;">
|
||||
<div style="margin: 20px 5px;">
|
||||
<h4 style="margin-left: 0px;">{{ 'print:: pdf title' | trans }}</h4>
|
||||
<input type="text" value="" name="print-pdf-title" class="print-pdf-title" style="margin-left: 0px"/>
|
||||
<input type="text" value="" name="print-pdf-title" class="print-pdf-title" style="margin-left: 0px;width: 530px;padding-left: 0px;padding-right: 0px;margin-right: 0px;"/>
|
||||
</div>
|
||||
<div style="margin: 20px 5px;">
|
||||
<h4 style="margin-left: 0px;">{{ 'print:: pdf description' | trans }}</h4>
|
||||
@@ -27,6 +27,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if printer.get_count_actionable() > 0 %}
|
||||
<h3>{{ 'print:: choose model' | trans }}</h3>
|
||||
{% if printer.get_count_preview() > 0 %}
|
||||
<h4>{{ 'phraseanet:: preview' | trans }}</h4>
|
||||
<div style="margin: 10px 0 20px 0; padding: 0 10px;">
|
||||
|
Reference in New Issue
Block a user