$logoFilenameOld = $model->logo; | $logoFilenameOld = $model->logo; | ||||
$photoFilenameOld = $model->photo; | $photoFilenameOld = $model->photo; | ||||
$documentImageBottomFilenameOld = $model->document_image_bottom; | |||||
$producerBuilder->initOptionDashboardDatesDisplay($model); | $producerBuilder->initOptionDashboardDatesDisplay($model); | ||||
if ($model->load(\Yii::$app->request->post())) { | if ($model->load(\Yii::$app->request->post())) { | ||||
$model->logoFile = UploadedFile::getInstance($model, 'logoFile'); | $model->logoFile = UploadedFile::getInstance($model, 'logoFile'); | ||||
$model->photoFile = UploadedFile::getInstance($model, 'photoFile'); | $model->photoFile = UploadedFile::getInstance($model, 'photoFile'); | ||||
$model->document_image_bottomFile = UploadedFile::getInstance($model, 'document_image_bottomFile'); | |||||
if($model->validate()) { | if($model->validate()) { | ||||
$producerBuilder->processUploadImage($model, 'logo', $logoFilenameOld, $request->post('delete_logo', 0)); | $producerBuilder->processUploadImage($model, 'logo', $logoFilenameOld, $request->post('delete_logo', 0)); | ||||
$producerBuilder->processUploadImage($model, 'photo', $photoFilenameOld, $request->post('delete_photo', 0)); | $producerBuilder->processUploadImage($model, 'photo', $photoFilenameOld, $request->post('delete_photo', 0)); | ||||
$producerBuilder->processUploadImage($model, 'document_image_bottom', $documentImageBottomFilenameOld, $request->post('delete_document_image_bottom', 0)); | |||||
$producerBuilder->initOptionDashboardDatesBeforeSave($model); | $producerBuilder->initOptionDashboardDatesBeforeSave($model); | ||||
$producerBuilder->savePrivateKeysStripe($model); | $producerBuilder->savePrivateKeysStripe($model); | ||||
$model->save(); | $model->save(); |
->hint("Affichées juste en dessous de l'adresse"); ?> | ->hint("Affichées juste en dessous de l'adresse"); ?> | ||||
<?= $form->field($model, 'document_infos_bottom') | <?= $form->field($model, 'document_infos_bottom') | ||||
->textarea(['rows' => 8]) ?> | ->textarea(['rows' => 8]) ?> | ||||
<?= $form->field($model, 'document_image_bottomFile')->fileInput()->hint('') ?> | |||||
<?php | |||||
if (strlen($model->document_image_bottom)) { | |||||
echo '<img src="' . Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl . '/uploads/' . $model->document_image_bottom . '" width="400px" /><br />'; | |||||
echo '<input type="checkbox" name="delete_document_image_bottom" id="delete_document_image_bottom" /> <label for="delete_document_image_bottom">Supprimer l\'image</label><br /><br />'; | |||||
} | |||||
?> | |||||
<?= $form->field($model, 'document_infos_quotation') | <?= $form->field($model, 'document_infos_quotation') | ||||
->textarea(['rows' => 8]) ?> | ->textarea(['rows' => 8]) ?> | ||||
<?= $form->field($model, 'document_infos_invoice') | <?= $form->field($model, 'document_infos_invoice') |
]); | ]); | ||||
$contentFooter = '<div id="footer">'; | $contentFooter = '<div id="footer">'; | ||||
$contentFooter .= '<div class="infos-bottom">' . Html::encode($producer->document_infos_bottom) . '</div>'; | |||||
if ($this->producerSolver->getConfig('document_image_bottom')) { | |||||
$urlDocumentImageBottom = \Yii::$app->urlManagerProducer->getHostInfo() . '/' . \Yii::$app->urlManagerProducer->baseUrl . '/uploads/' . $producer->document_image_bottom; | |||||
$contentFooter .= '<div class="image"><img src="'.$urlDocumentImageBottom.'" style="max-height:80px;" /></div>'; | |||||
} | |||||
if ($this->producerSolver->getConfig('document_infos_bottom')) { | |||||
$contentFooter .= '<div class="infos-bottom">'.nl2br($producer->document_infos_bottom).'</div>'; | |||||
} | |||||
$contentFooter .= '</div>'; | $contentFooter .= '</div>'; | ||||
$marginBottom = 10; | $marginBottom = 10; |
*/ | */ | ||||
public $photoFile; | public $photoFile; | ||||
/** | |||||
* @var UploadedFile | |||||
*/ | |||||
public $document_image_bottomFile; | |||||
/** | /** | ||||
* @inheritdoc | * @inheritdoc | ||||
*/ | */ | ||||
return $model->tiller == true; | return $model->tiller == true; | ||||
} | } | ||||
], | ], | ||||
[['logoFile', 'photoFile'], 'file', 'extensions' => 'png, jpg, jpeg', 'mimeTypes' => 'image/png, image/jpeg'], | |||||
[['logoFile', 'photoFile', 'document_image_bottomFile'], 'file', 'extensions' => 'png, jpg, jpeg', 'mimeTypes' => 'image/png, image/jpeg'], | |||||
[ | [ | ||||
[ | [ | ||||
'order_delay', | 'order_delay', | ||||
'contact_email', | 'contact_email', | ||||
'admin_comment', | 'admin_comment', | ||||
'export_shopping_cart_labels_format', | 'export_shopping_cart_labels_format', | ||||
'document_image_bottom', | |||||
], | ], | ||||
'string' | 'string' | ||||
], | ], | ||||
'siret', | 'siret', | ||||
'logo', | 'logo', | ||||
'photo', | 'photo', | ||||
'document_image_bottom', | |||||
'postcode', | 'postcode', | ||||
'city', | 'city', | ||||
'code', | 'code', | ||||
'id' => 'ID', | 'id' => 'ID', | ||||
'name' => 'Nom', | 'name' => 'Nom', | ||||
'siret' => 'Siret', | 'siret' => 'Siret', | ||||
'logo' => 'Logo', | |||||
'photo' => 'Photo', | |||||
'logoFile' => 'Logo', | |||||
'photoFile' => 'Photo', | |||||
'description' => 'Description', | 'description' => 'Description', | ||||
'postcode' => 'Code postal', | 'postcode' => 'Code postal', | ||||
'city' => 'Ville', | 'city' => 'Ville', | ||||
'document_delivery_note_first_reference' => 'Première référence des bons de livraison', | 'document_delivery_note_first_reference' => 'Première référence des bons de livraison', | ||||
'document_infos_top' => 'Informations affichées en haut des documents', | 'document_infos_top' => 'Informations affichées en haut des documents', | ||||
'document_infos_bottom' => 'Informations affichées en bas des documents', | 'document_infos_bottom' => 'Informations affichées en bas des documents', | ||||
'document_image_bottomFile' => "Image affichée en bas des documents", | |||||
'document_infos_quotation' => 'Informations affichées en bas des devis', | 'document_infos_quotation' => 'Informations affichées en bas des devis', | ||||
'document_infos_invoice' => 'Informations affichées en bas des factures', | 'document_infos_invoice' => 'Informations affichées en bas des factures', | ||||
'document_infos_delivery_note' => 'Informations affichées en bas des bons de livraison', | 'document_infos_delivery_note' => 'Informations affichées en bas des bons de livraison', | ||||
'export_shopping_cart_labels_format' => 'Étiquettes (PDF) : format', | 'export_shopping_cart_labels_format' => 'Étiquettes (PDF) : format', | ||||
'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme", | 'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme", | ||||
'id_user_group_default' => "Groupe utilisateur par défaut attribué à l'inscription", | 'id_user_group_default' => "Groupe utilisateur par défaut attribué à l'inscription", | ||||
'option_check_by_default_prevent_user_credit' => "Par défaut, prévenir l'utilisateur quand on crédite son compte" | |||||
'option_check_by_default_prevent_user_credit' => "Par défaut, prévenir l'utilisateur quand on crédite son compte", | |||||
]; | ]; | ||||
} | } | ||||
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
/** | |||||
* Class m231115_083420_add_column_producer_document_image_bottom | |||||
*/ | |||||
class m231115_083420_add_column_producer_document_image_bottom extends Migration | |||||
{ | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('producer', 'document_image_bottom', Schema::TYPE_STRING); | |||||
} | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('producer', 'document_image_bottom'); | |||||
} | |||||
} |