Skip to content

Commit

Permalink
Merge pull request #1066 from Evarisk/develop
Browse files Browse the repository at this point in the history
1.6.0
  • Loading branch information
nicolas-eoxia authored Aug 29, 2024
2 parents de5efdf + 7ad6317 commit e99feb9
Show file tree
Hide file tree
Showing 31 changed files with 2,853 additions and 1,573 deletions.
25 changes: 25 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"esversion": 6,
"forin": true,
"freeze": true,
"latedef": "nofunc",
"maxcomplexity": 10,
"noarg": true,
"nonbsp": true,
"nonew": true,
"undef": true,
"unused": true,
"node": true,
"browser": true,
"jquery": true,
"devel": true,
"strict": "global",
"globals": {
"angular": false,
"module": false,
"require": false
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
## Informations

- Numéro du module : 436318
- Dernière mise à jour : 24/06/2024
- Dernière mise à jour : 29/08/2024
- Éditeur : [Evarisk](https://evarisk.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

### Version

- Version : 1.5.1
- Version : 1.6.0
- PHP : 7.4.33
- Compatibilité : Dolibarr 16.0.0 - 20.0.0
- Compatibilité : Dolibarr 17.0.2 - 20.0.0

## Liens

Expand Down
13 changes: 11 additions & 2 deletions admin/documents.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2021-2023 EVARISK <[email protected]>
/* Copyright (C) 2021-2024 EVARISK <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,7 +31,10 @@
}

// Get module parameters
$moduleName = GETPOST('module_name', 'alpha');
$moduleName = GETPOST('module_name');
if (dol_strlen($moduleName) > 0 && strpos($moduleName, '#') !== false) {
$moduleName = explode('#', $moduleName)[0];
}
$moduleNameLowerCase = strtolower($moduleName);

// Load Dolibarr libraries
Expand Down Expand Up @@ -234,6 +237,12 @@

saturne_header(0, '', $title, $help_url);

?>
<script>
history.replaceState(null, '', window.saturne.toolbox.replaceUrlAnchor());
</script>
<?php

$parameters = [];
$reshook = $hookmanager->executeHooks('saturneAdminDocumentData', $parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
Expand Down
20 changes: 20 additions & 0 deletions admin/object.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@
$moduleName = GETPOST('module_name', 'alpha');
$objectType = GETPOST('object_type', 'alpha');

// If the previous action is from extrafields, the return value is PHP_SELF without querys
// So we need to fill moduleName and objectType using the previous url (HTTP_REFERER)
if (empty($moduleName) && empty($objectType)) {
$lastUrl = $_SERVER['HTTP_REFERER'];
$lastUrlArray = parse_url($lastUrl);

if (is_array($lastUrlArray) && isset($lastUrlArray['query'])) {
parse_str($lastUrlArray['query'], $lastUrlQuerys);

if (isset($lastUrlQuerys['module_name']) && isset($lastUrlQuerys['object_type'])) {
$moduleName = $lastUrlQuerys['module_name'];
$objectType = $lastUrlQuerys['object_type'];
}
}
}

$moduleNameLowerCase = strtolower($moduleName);

// Libraries
Expand Down Expand Up @@ -87,6 +103,10 @@

require_once __DIR__ . '/../core/tpl/admin/object/object_const_view.tpl.php';

if ($object->isextrafieldmanaged > 0) {
require_once __DIR__ . '/../core/tpl/admin/object/object_extrafields_view.tpl.php';
}

// Page end
print dol_get_fiche_end();
llxFooter();
Expand Down
16 changes: 11 additions & 5 deletions admin/pwa.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2022-2023 EVARISK <[email protected]>
/* Copyright (C) 2022-2024 EVARISK <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -42,18 +42,20 @@
require_once __DIR__ . '/../../' . $moduleNameLowerCase . '/lib/' . $moduleNameLowerCase . '.lib.php';

// Global variables definitions
global $conf, $db, $langs, $user;
global $conf, $db, $hookmanager, $langs, $user;

// Load translation files required by the page
saturne_load_langs(['admin']);

// Initialize view objects
$form = new Form($db);

// Get parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');

// Initialize view objects
$form = new Form($db);

$hookmanager->initHooks(['pwaadmin', 'globalcard']); // Note that conf->hooks_modules contains array

// Security check - Protection if external user
$permissiontoread = $user->rights->$moduleNameLowerCase->adminpage->read;
saturne_check_access($permissiontoread);
Expand Down Expand Up @@ -120,6 +122,10 @@
print $form->buttonsSaveCancel('Generate', '');
print '</form>';

$parameters = [];
$hookmanager->executeHooks('saturneAdminPWAAdditionalConfig', $parameters);
print $hookmanager->resPrint;

// Page end
print dol_get_fiche_end();
llxFooter();
Expand Down
7 changes: 5 additions & 2 deletions class/saturnedashboard.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2021-2023 EVARISK <[email protected]>
/* Copyright (C) 2021-2024 EVARISK <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -148,9 +148,12 @@ public function show_dashboard(?array $moreParams = [])
for ($i = 0; $i < count($dashboardWidget['label']); $i++) {
if (!empty($dashboardWidget['label'][$i])) {
$widget .= '<span class=""><strong>' . $dashboardWidget['label'][$i] . ' : ' . '</strong>';
if (!empty($dashboardWidget['content'][$i])) {
if (isset($dashboardWidget['content'][$i]) && $dashboardWidget['content'][$i] !== '') {
$widget .= '<span class="classfortooltip badge badge-info">' . $dashboardWidget['content'][$i] . '</span>';
$widget .= (!empty($dashboardWidget['tooltip'][$i]) ? $form->textwithpicto('', $langs->transnoentities($dashboardWidget['tooltip'][$i])) : '') . '</span>';
if (isset($dashboardWidget['moreContent'][$i]) && $dashboardWidget['moreContent'][$i] !== '') {
$widget .= $dashboardWidget['moreContent'][$i];
}
} else {
$widget .= $dashboardWidget['customContent'][$i];
}
Expand Down
Loading

0 comments on commit e99feb9

Please sign in to comment.