Browse Source

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

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
9721c1aafa
5 changed files with 42 additions and 4 deletions
  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 View File

<div class="producer"> <div class="producer">
<?php if (strlen($producer->logo)) : ?> <?php if (strlen($producer->logo)) : ?>
<div class="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> </div>
<?php endif; ?> <?php endif; ?>
<div class="address"> <div class="address">

+ 1
- 1
backend/views/layouts/header.php View File

<?php if($producer->logo): ?> <?php if($producer->logo): ?>
<span class="logo"> <span class="logo">
<img class="img-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) ?>" /> alt="Logo <?= Html::encode($producer->name) ?>" />
</span> </span>
<?php endif; ?> <?php endif; ?>

+ 9
- 0
backend/views/producer/update.php View File

0 => 'Non', 0 => 'Non',
1 => 'Oui' 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([ <?= $form->field($model, 'document_display_orders_invoice')->dropDownList([
0 => 'Non', 0 => 'Non',
1 => 'Oui' 1 => 'Oui'

+ 4
- 2
common/logic/Producer/Producer/Model/Producer.php View File

'option_billing_reduction_percentage', 'option_billing_reduction_percentage',
'dolibarr_socid', 'dolibarr_socid',
'dolibarr_product_id', 'dolibarr_product_id',
'option_weeks_distributions_activated_in_advance'
'option_weeks_distributions_activated_in_advance',
'option_document_height_logo',
], ],
'integer' 'integer'
], ],
'dolibarr_socid' => 'Dolibarr : id user', 'dolibarr_socid' => 'Dolibarr : id user',
'dolibarr_product_id' => 'Dolibarr : id produit', 'dolibarr_product_id' => 'Dolibarr : id produit',
'option_weeks_distributions_activated_in_advance' => "Semaines de distributions à activer à l'avance", '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 View File

<?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');
}
}

Loading…
Cancel
Save