浏览代码

[Administration] Documents > PDF : hauteur du logo paramétrable #1365

feature/souke
Guillaume Bourgeois 1年前
父节点
当前提交
9721c1aafa
共有 5 个文件被更改,包括 42 次插入4 次删除
  1. +2
    -1
      backend/views/document/download.php
  2. +1
    -1
      backend/views/layouts/header.php
  3. +9
    -0
      backend/views/producer/update.php
  4. +4
    -2
      common/logic/Producer/Producer/Model/Producer.php
  5. +26
    -0
      console/migrations/m231024_092428_add_column_producer_option_document_height_logo.php

+ 2
- 1
backend/views/document/download.php 查看文件

@@ -21,7 +21,8 @@ $documentPriceDecimals = (int) $producerModule->getConfig('option_document_price
<div class="producer">
<?php if (strlen($producer->logo)) : ?>
<div class="logo">
<img style="max-height: 80px;" src="<?= $producerModule->getUrlLogo($producer) ?>"/>
<?php $optionDocumentHeightLogo = $producerModule->getSolver()->getConfig('option_document_height_logo'); ?>
<img style="height: <?= $optionDocumentHeightLogo ?: 100; ?>px;" src="<?= $producerModule->getUrlLogo($producer) ?>"/>
</div>
<?php endif; ?>
<div class="address">

+ 1
- 1
backend/views/layouts/header.php 查看文件

@@ -66,7 +66,7 @@ $userCurrent = GlobalParam::getCurrentUser();
<?php if($producer->logo): ?>
<span class="logo">
<img class="img-logo"
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>uploads/<?= $producer->logo; ?>"
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>/uploads/<?= $producer->logo; ?>"
alt="Logo <?= Html::encode($producer->name) ?>" />
</span>
<?php endif; ?>

+ 9
- 0
backend/views/producer/update.php 查看文件

@@ -467,6 +467,15 @@ $this->addBreadcrumb($this->getTitle());
0 => 'Non',
1 => 'Oui'
]); ?>
<?= $form->field($model, 'option_document_height_logo')
->dropDownList([
null => '--',
50 => '50px',
100 => '100px',
150 => '150px',
200 => '200px',
250 => '250px',
]); ?>
<?= $form->field($model, 'document_display_orders_invoice')->dropDownList([
0 => 'Non',
1 => 'Oui'

+ 4
- 2
common/logic/Producer/Producer/Model/Producer.php 查看文件

@@ -164,7 +164,8 @@ class Producer extends ActiveRecordCommon
'option_billing_reduction_percentage',
'dolibarr_socid',
'dolibarr_product_id',
'option_weeks_distributions_activated_in_advance'
'option_weeks_distributions_activated_in_advance',
'option_document_height_logo',
],
'integer'
],
@@ -446,7 +447,8 @@ class Producer extends ActiveRecordCommon
'dolibarr_socid' => 'Dolibarr : id user',
'dolibarr_product_id' => 'Dolibarr : id produit',
'option_weeks_distributions_activated_in_advance' => "Semaines de distributions à activer à l'avance",
'option_invoice_only_based_on_delivery_notes' => 'Facturer uniquement sur la base des bons de livraison'
'option_invoice_only_based_on_delivery_notes' => 'Facturer uniquement sur la base des bons de livraison',
'option_document_height_logo' => 'Hauteur du logo dans les documents'
];
}


+ 26
- 0
console/migrations/m231024_092428_add_column_producer_option_document_height_logo.php 查看文件

@@ -0,0 +1,26 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m231024_092428_add_column_producer_option_document_height_logo
*/
class m231024_092428_add_column_producer_option_document_height_logo extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('producer', 'option_document_height_logo', Schema::TYPE_INTEGER);
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('producer', 'option_document_height_logo');
}
}

正在加载...
取消
保存