From: fomichev Date: Fri, 14 Feb 2025 10:29:37 +0000 (+0300) Subject: ссылка на документацию в плане X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=71cfcada2b2030bc218a268a368de426ca4f0740;p=erp24_rep%2Fyii-erp24%2F.git ссылка на документацию в плане --- diff --git a/erp24/helpers/PrintBlockHelper.php b/erp24/helpers/PrintBlockHelper.php index 9d933e05..5339a706 100644 --- a/erp24/helpers/PrintBlockHelper.php +++ b/erp24/helpers/PrintBlockHelper.php @@ -2,6 +2,10 @@ namespace yii_app\helpers; +use Yii; +use yii\helpers\Html; +use yii\helpers\Url; + class PrintBlockHelper { public static function printBlock($title, $block, $reverse = false) { ?> @@ -44,4 +48,40 @@ class PrintBlockHelper { null], $htmlOptions = []) + { + if (is_array($url)) { + if (!isset($url['returnUrl']) || $url['returnUrl'] === null) { + $url['returnUrl'] = Yii::$app->request->url; + } + $linkUrl = Url::to($url); + } else { + $linkUrl = $url; + } + + $defaultOptions = [ + 'class' => '', + 'target' => '_blank', + 'title' => 'Открыть документацию', + ]; + + $options = array_merge($defaultOptions, $htmlOptions); + + $svgIcon = ' + + '; + + return Html::a($svgIcon, $linkUrl, $options); + } + +} diff --git a/erp24/views/sales-write-offs-plan/index.php b/erp24/views/sales-write-offs-plan/index.php index f315dc5f..cdbb83c0 100644 --- a/erp24/views/sales-write-offs-plan/index.php +++ b/erp24/views/sales-write-offs-plan/index.php @@ -2,12 +2,14 @@ use yii\helpers\Html; use yii\base\DynamicModel; +use yii\helpers\Url; use yii\widgets\ActiveForm; use yii\helpers\ArrayHelper; use kartik\select2\Select2; use dosamigos\datetimepicker\DateTimePicker; +use yii_app\helpers\PrintBlockHelper; use yii_app\records\Admin; use yii_app\records\AdminGroup; use yii_app\records\StoreType; @@ -50,8 +52,20 @@ function colorScheme2($p) { ?>
- -

План продаж и списания

+
+
+

План продаж и списания + +

+ Yii::$app->request->url] + ), + ['class' => 'ms-3', 'target' => '_blank', 'title' => 'Открыть документацию'] + ) ?> +
+
'GET',