diff --git a/.github/workflows/add-issue-to-project.yml b/.github/workflows/add-issue-to-project.yml new file mode 100644 index 0000000..cfa4ba3 --- /dev/null +++ b/.github/workflows/add-issue-to-project.yml @@ -0,0 +1,13 @@ +name: Add Issue to Project + +on: + issues: + types: [ opened ] + +jobs: + add-to-project: + uses: PrestaShop/.github/.github/workflows/reusable-add-to-project.yml@master + with: + project-number: 47 + secrets: + TOKEN: ${{ secrets.JARVIS_TOKEN }} diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f57b6a5..80364fd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -45,7 +45,7 @@ jobs: uses: actions/checkout@v2.0.0 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: vendor key: php-${{ hashFiles('composer.lock') }} @@ -74,14 +74,14 @@ jobs: # Add vendor folder in cache to make next builds faster - name: Cache vendor folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: vendor key: php-${{ hashFiles('composer.lock') }} # Add composer local folder in cache to make next builds faster - name: Cache composer folder - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache key: php-composer-cache diff --git a/config.xml b/config.xml index 4bcaae8..1e5e281 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ dashactivity - + diff --git a/dashactivity.php b/dashactivity.php index 4bb4d96..c9746a1 100755 --- a/dashactivity.php +++ b/dashactivity.php @@ -35,7 +35,7 @@ public function __construct() { $this->name = 'dashactivity'; $this->tab = 'administration'; - $this->version = '2.1.1'; + $this->version = '2.1.2'; $this->author = 'PrestaShop'; parent::__construct(); @@ -430,4 +430,24 @@ public function getConfigFieldsValues() 'DASHACTIVITY_VISITOR_ONLINE' => Tools::getValue('DASHACTIVITY_VISITOR_ONLINE', Configuration::get('DASHACTIVITY_VISITOR_ONLINE')), ]; } + + /** + * Save dashboard configuration + * + * @param array $config + * + * @return bool determines if there are errors or not + */ + public function saveDashConfig(array $config) + { + if (!$this->getPermission('configure')) { + return true; + } + + foreach (array_keys($this->getConfigFieldsValues()) as $fieldName) { + Configuration::updateValue($fieldName, (int) $config[$fieldName]); + } + + return false; + } } diff --git a/tests/phpstan/phpstan-1.7.7.neon b/tests/phpstan/phpstan-1.7.7.neon index b5f0783..6d53937 100644 --- a/tests/phpstan/phpstan-1.7.7.neon +++ b/tests/phpstan/phpstan-1.7.7.neon @@ -5,3 +5,4 @@ parameters: ignoreErrors: - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' + - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#' diff --git a/tests/phpstan/phpstan-1.7.8.neon b/tests/phpstan/phpstan-1.7.8.neon index b5f0783..6d53937 100644 --- a/tests/phpstan/phpstan-1.7.8.neon +++ b/tests/phpstan/phpstan-1.7.8.neon @@ -5,3 +5,4 @@ parameters: ignoreErrors: - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' + - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#'