Skip to content

Commit

Permalink
#337 [Certificat] add: categorie
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Jul 21, 2023
1 parent d1e19bb commit 4f2b85a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 5 deletions.
14 changes: 10 additions & 4 deletions class/actions_dolisirh.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ function toggleTaskFavoriteWithId (taskId) {
*/
public function constructCategory(array $parameters)
{
if (in_array($parameters['currentcontext'], ['category', 'invoicecard', 'invoicereccard', 'timesheetcard', 'invoicelist', 'invoicereclist'])) {
if (in_array($parameters['currentcontext'], ['category', 'invoicecard', 'invoicereccard', 'timesheetcard', 'certificatecard', 'invoicelist', 'invoicereclist'])) {
$tags = [
'facture' => [
'id' => 436370001,
Expand All @@ -1018,12 +1018,18 @@ public function constructCategory(array $parameters)
'code' => 'timesheet',
'obj_class' => 'TimeSheet',
'obj_table' => 'dolisirh_timesheet',
],
'certificate' => [
'id' => 436370003,
'code' => 'certificate',
'obj_class' => 'Certificate',
'obj_table' => 'saturne_object_certificate',
]
];

$this->results = $tags;
}
}
$this->results = $tags;
}
}

/**
* Overloading the formObjectOptions function : replacing the parent's function with the one below
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
require_once __DIR__ . '/../../../../../../saturne/class/saturnesignature.class.php';
require_once __DIR__ . '/../../../../../../saturne/core/modules/saturne/modules_saturne.php';

// Load DoliSMQ libraries.
// Load DoliSIRH libraries.
require_once __DIR__ . '/mod_projectdocument_standard.php';

/**
Expand Down
20 changes: 20 additions & 0 deletions sql/certificate/llx_categorie_certificate.key.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Copyright (C) 2021-2023 EVARISK <technique@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_categorie_certificate ADD PRIMARY KEY pk_categorie_certificate (fk_categorie, fk_certificate);
ALTER TABLE llx_categorie_certificate ADD INDEX idx_categorie_certificate_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_certificate ADD INDEX idx_categorie_certificate_fk_certificate (fk_certificate);
ALTER TABLE llx_categorie_certificate ADD CONSTRAINT fk_categorie_certificate_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_certificate ADD CONSTRAINT fk_categorie_certificate_dolisirh_certificate_rowid FOREIGN KEY (fk_certificate) REFERENCES llx_dolisirh_certificate (rowid);
20 changes: 20 additions & 0 deletions sql/certificate/llx_categorie_certificate.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Copyright (C) 2021-2023 EVARISK <technique@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_categorie_certificate(
fk_categorie integer NOT NULL,
fk_certificate integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;

0 comments on commit 4f2b85a

Please sign in to comment.