]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ссылка на документацию в плане
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 14 Feb 2025 10:29:37 +0000 (13:29 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 14 Feb 2025 10:29:37 +0000 (13:29 +0300)
erp24/helpers/PrintBlockHelper.php
erp24/views/sales-write-offs-plan/index.php

index 9d933e05d225565dda913f2b1eafe5a2eca59ed1..5339a7064ae133cc7b862fb1b349353fffdc204c 100644 (file)
@@ -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 {
         </div>
         <?php
     }
-}
\ No newline at end of file
+
+    public static function printDocAnchor($url = ['wiki/show-doc', 'returnUrl' => 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 = '<svg fill="#000000" version="1.1"  id="Capa_1" width="20px" height="20px" 
+             xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
+             viewBox="0 0 416.979 416.979" xml:space="preserve"><g id="SVGRepo_bgCarrier" 
+             stroke-width="0"></g><g id="SVGRepo_tracerCarrier" 
+             stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> 
+             <path d="M356.004,61.156c-81.37-81.47-213.377-81.551-294.848-0.182c-81.47,81.371-81.552,213.379-0.181,
+             294.85 c81.369,81.47,213.378,81.551,294.849,0.181C437.293,274.636,437.375,142.626,356.004,61.156z M237.6,
+             340.786 c0,3.217-2.607,5.822-5.822,5.822h-46.576c-3.215,0-5.822-2.605-5.822-5.822V167.885c0-3.217,
+             2.607-5.822,5.822-5.822h46.576 c3.215,0,5.822,2.604,5.822,5.822V340.786z M208.49,137.901c-18.618,
+             0-33.766-15.146-33.766-33.765 c0-18.617,15.147-33.766,33.766-33.766c18.619,0,33.766,15.148,33.766,
+             33.766C242.256,122.755,227.107,137.901,208.49,137.901z">                         
+              </path> </g> </g></svg>';
+
+        return Html::a($svgIcon, $linkUrl, $options);
+    }
+
+}
index f315dc5f30bd6e287e219e641763b958a26b7406..cdbb83c0ce65944b85e3b9b8ef9bd9c1833c17d0 100644 (file)
@@ -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) {
 ?>
 
 <div class="salesWriteOffsPlanIndex m-5">
-
-    <h1>План продаж и списания</h1>
+    <div class="row my-4">
+        <div class="col-8">
+            <h1>План продаж и списания
+                <?= PrintBlockHelper::printDocAnchor() ?>
+            </h1>
+            <?= Html::a(
+            '📖 Документация',
+                 Url::to(
+                ['wiki/show-doc', 'returnUrl' => Yii::$app->request->url]
+                ),
+             ['class' => 'ms-3', 'target' => '_blank', 'title' => 'Открыть документацию']
+            ) ?>
+        </div>
+    </div>
 
     <?php $form = ActiveForm::begin([
         'method' => 'GET',