Skip to content

Commit

Permalink
first commit from 1.4.0 doliproject
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry committed Oct 6, 2022
0 parents commit 979d14b
Show file tree
Hide file tree
Showing 159 changed files with 37,984 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Generate Auto Changelog'
on:
push:
branches:
- master
jobs:
master:
name: 'build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Generate Auto Changelog
uses: Evarisk/action-auto-changelog@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
npm-debug.log
.idea
vendor
.editorconfig
.gitattributes
621 changes: 621 additions & 0 deletions COPYING

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG DOLISIRH FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)

## 1.0

Initial version
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# DOLISIRH POUR [DOLIBARR ERP CRM](https://www.dolibarr.org)

## Informations

Version du module: 1.3.0

Dernière mise à jour: 18/08/2022

Prérequis:
* Dolibarr min version 14.0.0
* Dolibarr min version 15.0.3

Thème: Eldy Menu

Editeur/Licence: [Eoxia](https://www.eoxia.com) / GPL-v3

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

Demo: [Demo DoliSIRH](https://www.dolisirh.projetm.com) - ID: demo - Password: demo

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

## Fonctionnalités

- Module ajoutant la possibilité de simplifier la création de tâche liée à un projet à partir d'une facture.
- Module ajoutant la possibilité de simplifier la création d'un temps consommé lié à une tâche à partir d'un ticket.

## Installation

# 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"
- Activer le module dans la liste des Modules/Applications installés

# Méthode 2 :

- Dans le dossier "dolibarr/htdocs/custom" copier la ligne suivante :
```
git clone https://github.com/Eoxia/dolisirh.git
```
80 changes: 80 additions & 0 deletions admin/about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
/* Copyright (C) 2022 EOXIA <dev@eoxia.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/>.
*/

/**
* \file admin/about.php
* \ingroup dolisirh
* \brief About page of module DoliSIRH.
*/

// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
// Try main.inc.php using relative path
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
if (!$res) die("Include of main fails");

// Libraries
require_once '../lib/dolisirh.lib.php';
require_once '../core/modules/modDolisirh.class.php';

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

// Translations
$langs->loadLangs(array("errors", "admin", "dolisirh@dolisirh"));

// Initialize objects
// Technical objets
$modDolisirh = new modDolisirh($db);

// Access control
if (!$user->admin) accessforbidden();

/*
* View
*/

$help_url = 'FR:Module_DoliSIRH';
$title = $langs->trans("DoliSIRHAbout");
$morejs = array("/dolisirh/js/dolisirh.js.php");
$morecss = array("/dolisirh/css/dolisirh.css");

llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss);

// Subheader
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1'.'">'.$langs->trans("BackToModuleList").'</a>';

print load_fiche_titre($title, $linkback, 'object_dolisirh@dolisirh');

// Configuration header
$head = dolisirhAdminPrepareHead();
print dol_get_fiche_head($head, 'about', '', 0, 'dolisirh@dolisirh');

print $modDolisirh->getDescLong();

// Page end
print dol_get_fiche_end();
llxFooter();
$db->close();
2 changes: 2 additions & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
//Silence is golden apple
218 changes: 218 additions & 0 deletions admin/project.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
<?php
/* Copyright (C) 2022 EOXIA <dev@eoxia.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/>.
*/

/**
* \file admin/project.php
* \ingroup dolisirh
* \brief DoliSIRH project/task config page.
*/

// Load Dolibarr environment
$res = 0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
// Try main.inc.php using relative path
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
if (!$res) die("Include of main fails");

// Libraries
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . "/core/class/html.formother.class.php";
require_once DOL_DOCUMENT_ROOT . "/core/class/html.formprojet.class.php";

require_once '../lib/dolisirh.lib.php';

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

// Translations
$langs->loadLangs(array("errors", "admin", "dolisirh@dolisirh"));

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

// Initialize objects
// View objets
$form = new Form($db);
$formother = new FormOther($db);
$formproject = new FormProjets($db);

// Access control
if (!$user->admin) accessforbidden();

/*
* Actions
*/

if ($action == 'update') {
$HRProject = GETPOST('HRProject', 'none');
$HRProject = explode('_', $HRProject);

dolibarr_set_const($db, "DOLISIRH_HR_PROJECT", $HRProject[0], 'integer', 0, '', $conf->entity);
setEventMessages($langs->transnoentities('TicketProjectUpdated'), array());
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}

if ($action == 'updateThemeColor') {
$val = (implode(',', (colorStringToArray(GETPOST('DOLISIRH_EXCEEDED_TIME_SPENT_COLOR'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'DOLISIRH_EXCEEDED_TIME_SPENT_COLOR', $conf->entity);
} else {
dolibarr_set_const($db, 'DOLISIRH_EXCEEDED_TIME_SPENT_COLOR', $val, 'chaine', 0, '', $conf->entity);
}

$val = (implode(',', (colorStringToArray(GETPOST('DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR', $conf->entity);
} else {
dolibarr_set_const($db, 'DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR', $val, 'chaine', 0, '', $conf->entity);
}

$val = (implode(',', (colorStringToArray(GETPOST('DOLISIRH_PERFECT_TIME_SPENT_COLOR'), array()))));
if ($val == '') {
dolibarr_del_const($db, 'DOLISIRH_PERFECT_TIME_SPENT_COLOR', $conf->entity);
} else {
dolibarr_set_const($db, 'DOLISIRH_PERFECT_TIME_SPENT_COLOR', $val, 'chaine', 0, '', $conf->entity);
}
}

/*
* View
*/

$help_url = 'FR:Module_DoliSIRH';
$title = $langs->trans("ProjectsAndTasks");
$morejs = array("/dolisirh/js/dolisirh.js.php");
$morecss = array("/dolisirh/css/dolisirh.css");

llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss);

// Subheader
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1'.'">'.$langs->trans("BackToModuleList").'</a>';

print load_fiche_titre($title, $linkback, 'object_dolisirh@dolisirh');

// Configuration header
$head = dolisirhAdminPrepareHead();
print dol_get_fiche_head($head, 'projecttasks', '', -1, 'dolisirh@dolisirh');

// Project
print load_fiche_titre($langs->transnoentities("HRProject"), '', 'project');

print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '" name="project_form">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>' . $langs->transnoentities("Name") . '</td>';
print '<td>' . $langs->transnoentities("SelectProject") . '</td>';
print '<td>' . $langs->transnoentities("Action") . '</td>';
print '</tr>';

if ( ! empty($conf->projet->enabled)) {
$langs->load("projects");
print '<tr class="oddeven"><td><label for="HRProject">' . $langs->transnoentities("HRProject") . '</label></td><td>';
$formproject->select_projects(-1, (GETPOST('projectid')) ? GETPOST('projectid') : $conf->global->DOLISIRH_HR_PROJECT, 'HRProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->transnoentities("AddProject") . '"></span></a>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->transnoentities("Save") . '">';
print '</td></tr>';
}

print '</table>';
print '</form>';

//Time spent
print load_fiche_titre($langs->transnoentities("TimeSpent"), '', 'clock');

print '<table class="noborder centpercent">';

print '<tr class="liste_titre">';
print '<td>' . $langs->transnoentities("Parameters") . '</td>';
print '<td>' . $langs->transnoentities("Description") . '</td>';
print '<td class="center">' . $langs->transnoentities("Status") . '</td>';
print '</tr>';

print '<tr class="oddeven"><td>';
print $langs->transnoentities("SpendMoreTimeThanPlanned");
print '</td><td>';
print $langs->transnoentities("SpendMoreTimeThanPlannedDescription");
print '</td>';
print '<td class="center">';
print ajax_constantonoff('DOLISIRH_SPEND_MORE_TIME_THAN_PLANNED');
print '</td>';
print '</tr>';

print '</table>';

//Theme dashboard time spent
print load_fiche_titre($langs->transnoentities("ThemeDashboardTimeSpent"), '', 'clock');

print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '" name="color_form">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="updateThemeColor">';
print '<table class="noborder centpercent">';

print '<tr class="liste_titre">';
print '<td>' . $langs->transnoentities("Parameters") . '</td>';
print '<td>' . $langs->transnoentities("Value") . '</td>';
print '</tr>';

print '<tr class="oddeven">';
print '<td>'.$langs->trans("ExceededTimeSpentColor").'</td>';
print '<td>';
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->DOLISIRH_EXCEEDED_TIME_SPENT_COLOR) ? $conf->global->DOLISIRH_EXCEEDED_TIME_SPENT_COLOR : ''), array()), ''), 'DOLISIRH_EXCEEDED_TIME_SPENT_COLOR', '', 1, '', '', 'dolisirhexceededtimespentcolor');
print '<span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong>#FF0000</strong>';
print '</td>';
print '</tr>';

print '<tr class="oddeven">';
print '<td>'.$langs->trans("NotExceededTimeSpentColor").'</td>';
print '<td>';
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR) ? $conf->global->DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR : ''), array()), ''), 'DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR', '', 1, '', '', 'dolisirhnotexceededtimespentcolor');
print '<span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong>#FFA500</strong>';
print '</td>';
print '</tr>';

print '<tr class="oddeven">';
print '<td>'.$langs->trans("PerfectTimeSpentColor").'</td>';
print '<td>';
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->DOLISIRH_PERFECT_TIME_SPENT_COLOR) ? $conf->global->DOLISIRH_PERFECT_TIME_SPENT_COLOR : ''), array()), ''), 'DOLISIRH_PERFECT_TIME_SPENT_COLOR', '', 1, '', '', 'dolisirhperfecttimespentcolor');
print '<span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong>#008000</strong>';
print '</td>';
print '</tr>';

print '</table>';

print '<div class="center">';
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
print '</div>';

print '</form>';

// Page end
print dol_get_fiche_end();
llxFooter();
$db->close();
Loading

0 comments on commit 979d14b

Please sign in to comment.