Skip to content

Commit

Permalink
Merge pull request #996 from Evarisk/develop
Browse files Browse the repository at this point in the history
1.5.1
  • Loading branch information
nicolas-eoxia authored Jun 24, 2024
2 parents c9a97a5 + 6ab1b5f commit 09fd9d3
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 73 deletions.
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 : 03/06/2024
- Dernière mise à jour : 24/06/2024
- Éditeur : [Evarisk](https://evarisk.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

### Version

- Version : 1.5.0
- Version : 1.5.1
- PHP : 7.4.33
- Compatibilité : Dolibarr 16.0.0 - 19.0.2
- Compatibilité : Dolibarr 16.0.0 - 20.0.0

## Liens

Expand Down
44 changes: 22 additions & 22 deletions class/actions_saturne.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class ActionsSaturne
public array $results = [];

/**
* @var string String displayed by executeHook() immediately after return
* @var string|null String displayed by executeHook() immediately after return
*/
public string $resprints;
public ?string $resprints;

/**
* Constructor
Expand All @@ -75,7 +75,7 @@ public function printMainArea(array $parameters): int
global $conf, $mysoc;

// Do something only for the current context
if ($parameters['currentcontext'] == 'saturnepublicinterface') {
if (strpos($parameters['context'], 'saturnepublicinterface') !== false) {
if (!empty($conf->global->SATURNE_SHOW_COMPANY_LOGO)) {
// Define logo and logosmall
$logosmall = $mysoc->logo_small;
Expand Down Expand Up @@ -110,7 +110,7 @@ public function emailElementlist(array $parameters): int
global $user, $langs;

// do something only for the context 'somecontext1' or 'somecontext2'
if ($parameters['currentcontext'] == 'emailtemplates') {
if (strpos($parameters['context'], 'emailtemplates') !== false) {
if (isModEnabled('saturne') && $user->hasRight('saturne', 'adminpage', 'read')) {
$pictopath = dol_buildpath('/custom/saturne/img/saturne_color.png', 1);
$picto = img_picto('', $pictopath, '', 1, 0, 0, '', 'pictoModule');
Expand Down Expand Up @@ -257,7 +257,7 @@ public function doActions(array $parameters, $object, string $action): int
} else {
setEventMessages($signatory->error, [], 'errors');
}
} elseif (preg_match('/categorycard/', $parameters['context'])) {
} elseif (strpos($parameters['context'], 'categorycard') !== false) {
global $langs;

$elementId = GETPOST('element_id');
Expand All @@ -268,26 +268,26 @@ public function doActions(array $parameters, $object, string $action): int
return 0;
}

$objects = saturne_fetch_all_object_type($type);
$newObject = $objects[$elementId];

if (GETPOST('action') == 'addintocategory') {
$result = $object->add_type($newObject, $type);
if ($result >= 0) {
setEventMessages($langs->trans("WasAddedSuccessfully", $newObject->ref), array());
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), array(), 'warnings');
$objects = saturne_fetch_all_object_type($type);
if (is_array($objects) && !empty($objects)) {
$newObject = $objects[$elementId];
if (GETPOST('action') == 'addintocategory') {
$result = $object->add_type($newObject, $type);
if ($result >= 0) {
setEventMessages($langs->trans("WasAddedSuccessfully", $newObject->ref), array());
} else {
setEventMessages($object->error, $object->errors, 'errors');
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), array(), 'warnings');
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
} elseif (GETPOST('action') == 'delintocategory') {
$result = $object->del_type($newObject, $type);
if ($result < 0) {
dol_print_error('', $object->error);
}
}
} elseif (GETPOST('action') == 'delintocategory') {
$result = $object->del_type($newObject, $type);
if ($result < 0) {
dol_print_error('', $object->error);
}
$action = '';
}
}

Expand Down
2 changes: 1 addition & 1 deletion class/saturnecertificate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SaturneCertificate extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string Last output from end job execution.
Expand Down
2 changes: 1 addition & 1 deletion class/saturnedocuments.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SaturneDocuments extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
Expand Down
2 changes: 1 addition & 1 deletion class/saturnemail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SaturneMail extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes
*/
public int $isextrafieldmanaged = 0;
public $isextrafieldmanaged = 0;

/**
* 'type' field format:
Expand Down
2 changes: 1 addition & 1 deletion class/saturneobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class SaturneObject extends CommonObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* Constructor.
Expand Down
2 changes: 1 addition & 1 deletion class/saturneschedules.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SaturneSchedules extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
Expand Down
2 changes: 1 addition & 1 deletion class/saturnesignature.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SaturneSignature extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 0;
public $isextrafieldmanaged = 0;

/**
* @var string String with name of icon for signature. Must be the part after the 'object_' into object_signature.png
Expand Down
2 changes: 1 addition & 1 deletion core/modules/modSaturne.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function __construct($db)
$this->editor_url = 'https://evarisk.com/';

// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = '1.5.0';
$this->version = '1.5.1';

// Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
Expand Down
2 changes: 1 addition & 1 deletion core/modules/saturne/modules_saturne.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public function info(Translate $langs): string
$info .= '<div class="file-generation">';
foreach ($listOfFiles as $file) {
// Show list of found files
$path = DOL_MAIN_URL_ROOT . '/custom/' . GETPOST('module_name') . '/documents/temp/';
$path = DOL_MAIN_URL_ROOT . '/custom/' . $this->module . '/documents/temp/';
$info .= '<input type="hidden" class="template-name" value="'. $file['name'] .'">';
$info .= '<input type="hidden" class="template-type" value="' . $file['level1name'] . '">';
$info .= '<input type="hidden" class="template-path" value="' . $path . '">';
Expand Down
3 changes: 2 additions & 1 deletion core/tpl/documents/documents_action.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@
foreach ($modelLists as $key => $modelList) {
$confName = dol_strtoupper($moduleNameLowerCase . '_' . $document->element) . '_DEFAULT_MODEL';
if (strpos($key, getDolGlobalString($confName)) !== false) {
$model = str_replace($object->element . 'document_custom_odt', $object->element . 'document_odt', $key);
$model = $key;
}
}
}
} else {
$model = GETPOST('model', 'alpha');
}
$model = str_replace($object->element . 'document_custom_odt', $object->element . 'document_odt', $model);

$moreParams['object'] = $object;
$moreParams['user'] = $user;
Expand Down
2 changes: 1 addition & 1 deletion core/tpl/signature/public_signature_view.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div class="public-card__content signature">
<div class="signature-element">
<?php if (empty($signatory->signature) && $object->status == $object::STATUS_VALIDATED && $signatory->attendance != SaturneSignature::ATTENDANCE_ABSENT) : ?>
<canvas class="canvas-container canvas-signature"></canvas>
<canvas class="canvas-container editable canvas-signature"></canvas>
<div class="signature-erase wpeo-button button-square-40 button-rounded button-grey"><span><i class="fas fa-eraser"></i></span></div>
<?php else : ?>
<div class="canvas-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(DoliDB $db)
$this->name = preg_replace('/^Interface/i', '', get_class($this));
$this->family = 'demo';
$this->description = 'Saturne triggers.';
$this->version = '1.5.0';
$this->version = '1.5.1';
$this->picto = 'saturne@saturne';
}

Expand Down
2 changes: 1 addition & 1 deletion css/saturne.min.css

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions css/scss/page/_signature.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
height: 220px;
border: 1px solid rgba(0,0,0,0.2);
border-radius: 6px;
cursor: url('../img/assets/pencil-alt-solid.svg') 0 32, auto;


img {
width: 100%;
}
}
.editable {
cursor: url('../img/assets/pencil-alt-solid.svg') 0 32, auto;
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions js/modules/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ window.saturne.menu.event = function() {
*/
window.saturne.menu.toggleMenu = function() {

var menu = $(this).closest('#id-left').find('a.vmenu, font.vmenudisabled, span.vmenu, a.vsmenu');
var menu = $(this).closest('#id-left').find('a.vmenu, span.vmenudisabled, span.vmenu, a.vsmenu');
var elementParent = $(this).closest('#id-left').find('div.vmenu')
var text = '';

Expand Down Expand Up @@ -124,7 +124,7 @@ window.saturne.menu.setMenu = function() {

if (localStorage.maximized == 'false') {
var text = '';
var menu = $('#id-left').find('a.vmenu, font.vmenudisabled, span.vmenu, a.vsmenu');
var menu = $('#id-left').find('a.vmenu, span.vmenudisabled, span.vmenu, a.vsmenu');
var elementParent = $(document).find('div.vmenu')

menu.each(function () {
Expand Down
2 changes: 1 addition & 1 deletion js/saturne.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions langs/en_US/medias.lang
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ MediaDimensionSetWithSuccess = Successfully modified media dimensions
MediaDimensionNegativeError = The values of the dimensions cannot be negative
MediaDimensionEmptyError = The values of the dimensions cannot be empty
ConfirmUnlinkMedia = Are you sure you want to detach the selected media ?
AddPhotoFromComputer = Add a photo from device gallery
AddPhotoFromMediaGallery = Add a photo from media gallery

# Config page
MediaMaxWidthMini = Minimum media width
Expand Down
2 changes: 2 additions & 0 deletions langs/fr_FR/medias.lang
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ MediaDimensionNegativeError = Les valeurs des dimensions ne peuvent être néga
MediaDimensionEmptyError = Les valeurs des dimensions ne peuvent pas être vides
MediaData = Configuration des médias
ConfirmUnlinkMedia = Êtes vous sur de vouloir détacher le media sélectionné ?
AddPhotoFromComputer = Ajouter une photo depuis la galerie de l'appareil
AddPhotoFromMediaGallery = Ajouter une photo depuis la galerie des médias

# Config page - Page d'administration
MediaMaxWidthMini = Largeur du média mini
Expand Down
2 changes: 1 addition & 1 deletion lib/documents.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function saturne_show_documents(string $modulepart, $modulesubdir, $filedir, str
// Show title of array if not already shown
if ((!empty($fileList) || !empty($link_list) || preg_match('/^massfilesarea/', $modulepart)) && !$headershown) {
$headershown = 1;
$out .= '<div class="titre">' . $titletoshow . '</div>' . "\n";
$out .= load_fiche_titre($titletoshow, '', '', 0, 'builddoc');
$out .= '<div class="div-table-responsive-no-min">';
$out .= '<table class="noborder centpercent" id="' . $modulepart . '_table">' . "\n";
}
Expand Down
9 changes: 7 additions & 2 deletions lib/object.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@
* @param bool $categoryManagement Option for manage categories with LEFT JOIN SQL
* @param string $joinManagement Option for manage JOIN SQL
* @return int|array 0 < if KO, array of pages if OK
* @throws Exception
* @throws Exception|Error
*/
function saturne_fetch_all_object_type(string $className = '', string $sortorder = '', string $sortfield = '', int $limit = 0, int $offset = 0, array $filter = [], string $filtermode = 'AND', bool $extraFieldManagement = false, bool $multiEntityManagement = true, bool $categoryManagement = false, string $joinManagement = '')
{
dol_syslog(__METHOD__, LOG_DEBUG);

global $db;

$object = new $className($db);
try {
$object = new $className($db);
} catch (Error $error) {
dol_syslog(__METHOD__ . ' ' . $error->getMessage(), LOG_ERR);
return -1;
}

$records = [];
$optionsArray = [];
Expand Down
Loading

0 comments on commit 09fd9d3

Please sign in to comment.