Skip to content

Commit

Permalink
Merge pull request #6 from nicolas-eoxia/add_structure_projet
Browse files Browse the repository at this point in the history
#5 [Mod] add: initialize project GMAO structure
  • Loading branch information
nicolas-eoxia authored Jan 26, 2024
2 parents 62041b7 + 2ee081b commit 7f9311f
Show file tree
Hide file tree
Showing 25 changed files with 1,309 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:
- main
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 }}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated binaries
/build/*.zip
/bin/*.zip
# Doxygen generated documentation
/build/doxygen/doxygen_warnings.log
/doc/code/doxygen
# Composer managed dependencies
/vendor
/dev/bin
# PHPdocumentor generated files
/build/phpdoc
/doc/code/phpdoc
# Sphinx generated files
/doc/user/build
/.settings/
/.buildpath
/.project
# Other
*.back
/.editorconfig
/.gitattributes
node_modules
package-lock.json
621 changes: 621 additions & 0 deletions COPYING

Large diffs are not rendered by default.

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
71 changes: 71 additions & 0 deletions admin/setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php
/* Copyright (C) 2024 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/>.
*/

/**
* \file admin/setup.php
* \ingroup gmao
* \brief GMAO setup page
*/

// Load GMAO environment
if (file_exists('../gmao.main.inc.php')) {
require_once __DIR__ . '/../gmao.main.inc.php';
} elseif (file_exists('../../gmao.main.inc.php')) {
require_once __DIR__ . '/../../gmao.main.inc.php';
} else {
die('Include of gmao main fails');
}

// Load GMAO libraries
require_once __DIR__ . '/../lib/gmao.lib.php';

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

// Load translation files required by the page
saturne_load_langs();

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

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

// Security check - Protection if external user
$permissionToRead = $user->rights->gmao->adminpage->read;
saturne_check_access($permissionToRead);

/*
* View
*/

$title = $langs->trans('ModuleSetup', 'GMAO');
$help_url = 'FR:Module_GMAO';

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

// Subheader
$linkback = '<a href="' . ($backtopage ?: DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans('BackToModuleList') . '</a>';
print load_fiche_titre($title, $linkback, 'title_setup');

// Configuration header
$head = gmao_admin_prepare_head();
print dol_get_fiche_head($head, 'settings', $title, -1, 'gmao_color@gmao');

$db->close();
llxFooter();
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Changelog

66 changes: 66 additions & 0 deletions class/actions_gmao.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
/* Copyright (C) 2024 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/>.
*/

/**
* \file class/actions_gmao.class.php
* \ingroup gmao
* \brief GMAO hook overload
*/

// Load GMAO libraries
require_once __DIR__ . '/../lib/gmao_function.lib.php';

/**
* Class ActionsGmao
*/
class ActionsGmao
{
/**
* @var DoliDB Database handler
*/
public DoliDB $db;

/**
* @var string Error code (or message)
*/
public string $error = '';

/**
* @var array Errors.
*/
public array $errors = [];

/**
* @var array Hook results. Propagated to $hookmanager->resArray for later reuse
*/
public array $results = [];

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

/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
$this->db = $db;
}
}
2 changes: 2 additions & 0 deletions class/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
//Silence is golden
2 changes: 2 additions & 0 deletions core/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
//Silence is golden
2 changes: 2 additions & 0 deletions core/modules/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
//Silence is golden
Loading

0 comments on commit 7f9311f

Please sign in to comment.