Skip to content

Commit

Permalink
#1 [Certificate] fix: change sql file name for use framework name
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Nov 9, 2022
1 parent c258b40 commit 9d9cc8b
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 34 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@

## Informations

Version du module: 1.1.0
Version du module : 1.1.0

Dernière mise à jour: 02/11/2022
Dernière mise à jour : 02/11/2022

Prérequis:
* Dolibarr min version 15.0.0
* Dolibarr min version 15.0.4
Prérequis :
- Dolibarr min version 15.0.0
- Dolibarr min version 15.0.4

Thème: Eldy Menu
Thème : Eldy Menu

Editeur/Licence: [Evarisk](https://www.evarisk.com) / GPL-v3
Editeur/Licence : [Evarisk](https://www.evarisk.com) / GPLv3

Assitance: [Forum www.dolibarr.fr](https://www.dolibarr.fr) / Par mail à contact@evarisk.com
Assitance : [Forum www.dolibarr.fr](https://www.dolibarr.fr) / Par mail à technique@evarisk.com

à venir :
Documentation: [Wiki DoliSIRH](https://wiki.dolibarr.org/index.php/Module_DoliSIRH)
Documentation : [Wiki DoliSIRH](https://wiki.dolibarr.org/index.php/Module_DoliSIRH)

## Fonctionnalités

- Simplification de la gestion du temps
- Génération des navettes de préparation de la fiche de paye

à venir :
[Voir les projets](https://github.com/Evarisk/DoliSIRH/projects?query=is%3Aopen)
[Projet DoliSIRH](https://github.com/Evarisk/DoliSIRH/projects?query=is%3Aopen)

## Installation

# Méthode 1 :
### Méthode 1 :

- Depuis le menu "Déployer/Installer un module externe" de Dolibarr :
- Glisser l'archive ZIP 'module_dolisirh-1.2.0' et cliquer sur "SEND"
- Glisser l'archive ZIP 'module_dolisirh-X.Y.Z' et cliquer sur "ENVOYER FICHIER"
- Activer le module dans la liste des Modules/Applications installés

# Méthode 2 :
### Méthode 2 :

- Dans le dossier "dolibarr/htdocs/custom" copier la ligne suivante :
```
Expand Down
2 changes: 1 addition & 1 deletion class/certificate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Certificate extends CommonObject
/**
* @var string Name of table without prefix where object is stored. This is also the key used for extrafields management.
*/
public $table_element = 'dolisirh_certificate';
public $table_element = 'saturne_certificate';

/**
* @var int Does this object support multicompany module ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function canBeActivated(object $object): bool

$posindice = strlen($this->prefix) + 6;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql .= " FROM ".MAIN_DB_PREFIX."dolisirh_certificate";
$sql .= " FROM ".MAIN_DB_PREFIX."saturne_certificate";
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
Expand Down Expand Up @@ -122,7 +122,7 @@ public function getNextValue(object $object)
// first we get the max value
$posindice = strlen($this->prefix) + 6;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql .= " FROM ".MAIN_DB_PREFIX."dolisirh_certificate";
$sql .= " FROM ".MAIN_DB_PREFIX."saturne_certificate";
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
Expand Down
30 changes: 15 additions & 15 deletions core/modules/modDolisirh.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,21 +342,21 @@ public function __construct($db)
'user' => 0,
);

// $this->menu[$r++] = array(
// 'fk_menu' => 'fk_mainmenu=dolisirh',
// 'type' => 'left',
// 'titre' => $langs->trans('Certificate'),
// 'prefix' => '<i class="fas fa-user-graduate pictofixedwidth"></i>',
// 'mainmenu' => 'dolisirh',
// 'leftmenu' => 'certificate',
// 'url' => '/dolisirh/view/certificate/certificate_list.php',
// 'langs' => 'dolisirh@dolisirh',
// 'position' => 1000 + $r,
// 'enabled' => '$conf->dolisirh->enabled',
// 'perms' => '$user->rights->dolisirh->certificate->read',
// 'target' => '',
// 'user' => 0,
// );
$this->menu[$r++] = array(
'fk_menu' => 'fk_mainmenu=dolisirh',
'type' => 'left',
'titre' => $langs->trans('Certificate'),
'prefix' => '<i class="fas fa-user-graduate pictofixedwidth"></i>',
'mainmenu' => 'dolisirh',
'leftmenu' => 'certificate',
'url' => '/dolisirh/view/certificate/certificate_list.php',
'langs' => 'dolisirh@dolisirh',
'position' => 1000 + $r,
'enabled' => '$conf->dolisirh->enabled',
'perms' => '$user->rights->dolisirh->certificate->read',
'target' => '',
'user' => 0,
);

$this->menu[$r++] = array(
'fk_menu' => 'fk_mainmenu=dolisirh', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
Expand Down
2 changes: 2 additions & 0 deletions sql/certificate/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
//Silence is golden apple
24 changes: 24 additions & 0 deletions sql/certificate/llx_saturne_certificate.key.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- Copyright (C) 2023 EVARISK <dev@evarisk.com>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.

ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_rowid (rowid);
ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_ref (ref);
ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_status (status);
ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_fk_element (fk_element);
ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_fk_product (fk_product);
ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_fk_soc (fk_soc);
ALTER TABLE llx_saturne_certificate ADD INDEX idx_saturne_certificate_fk_project (fk_project);
ALTER TABLE llx_saturne_certificate ADD UNIQUE INDEX uk_saturne_certificate_ref (ref, entity);
ALTER TABLE llx_saturne_certificate ADD CONSTRAINT llx_saturne_certificate_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
42 changes: 42 additions & 0 deletions sql/certificate/llx_saturne_certificate.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
-- Copyright (C) 2023 EVARISK <dev@evarisk.com>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.

CREATE TABLE llx_saturne_certificate(
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
ref_ext varchar(128),
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
description text,
note_public text,
note_private text,
date_creation datetime NOT NULL,
date_start datetime,
date_end datetime,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14),
last_main_doc varchar(255),
model_pdf varchar(255),
status integer NOT NULL,
json text,
sha256 text,
element_type text,
fk_element integer,
fk_product integer,
fk_soc integer,
fk_project integer,
fk_user_creat integer NOT NULL,
fk_user_modif integer
) ENGINE=innodb;
16 changes: 16 additions & 0 deletions sql/certificate/llx_saturne_certificate_extrafields.key.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Copyright (C) 2023 EVARISK <dev@evarisk.com>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.

ALTER TABLE llx_saturne_certificate_extrafields ADD INDEX idx_certificate_fk_object(fk_object);
21 changes: 21 additions & 0 deletions sql/certificate/llx_saturne_certificate_extrafields.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Copyright (C) 2023 EVARISK <dev@evarisk.com>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.

create table llx_saturne_certificate_extrafields(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
6 changes: 3 additions & 3 deletions sql/signature/llx_dolisirh_object_signature.key.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
-- along with this program. If not, see https://www.gnu.org/licenses/.

ALTER TABLE llx_dolisirh_object_signature ADD INDEX idx_dolisirh_object_signature_rowid (rowid);
ALTER TABLE llx_dolisirh_certificate_extrafields ADD INDEX idx_dolisirh_object_signature_status (status);
ALTER TABLE llx_dolisirh_certificate_extrafields ADD INDEX idx_dolisirh_object_signature_element_id (element_id);
ALTER TABLE llx_dolisirh_certificate_extrafields ADD INDEX idx_dolisirh_object_signature_fk_object (fk_object);
ALTER TABLE llx_dolisirh_object_signature ADD INDEX idx_dolisirh_object_signature_status (status);
ALTER TABLE llx_dolisirh_object_signature ADD INDEX idx_dolisirh_object_signature_element_id (element_id);
ALTER TABLE llx_dolisirh_object_signature ADD INDEX idx_dolisirh_object_signature_fk_object (fk_object);

0 comments on commit 9d9cc8b

Please sign in to comment.