Skip to content

Commit

Permalink
#7 [Core] add: create main file and information systems architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Apr 5, 2023
1 parent 9b33758 commit c19fd21
Show file tree
Hide file tree
Showing 30 changed files with 1,751 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
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 dolitmd FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)

## 1.0

Initial version
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# dolitmd
Audit et accompagnement TMD
# DoliTMD sur [DOLIBARR ERP CRM](https://www.dolibarr.org)

## Informations

- Numéro du module : 436303
- Version : 1.0.0
- Dernière mise à jour : 04/04/2023
- Éditeur : [Evarisk](https://www.evarisk.com)
- Compatibilité : Dolibarr 15.0.0 - 16.0.5
- Thème : eldy
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

## Liens

- Support & Assistance : [Forum www.dolibarr.fr](https://www.dolibarr.fr) / Par mail à [email protected]
- Demo : [Demo DoliTMD](https://www.demodoli.digirisk.com) - ID: demo - Password: demo
- Documentation : [Wiki DoliTMD](https://wiki.dolibarr.org/index.php/Module_DoliTMD)
- Projet GitHub : [Projet DoliTMD](https://github.com/Evarisk/DoliTMD/projects?query=is%3Aopen)
- D'autres modules développés par Evarisk disponibles sur [DoliStore.com](https://www.dolistore.com)

## Fonctionnalités

- Simplification de la CRM

## Traductions

- Français
- Anglais

## Installation

### Méthode 1 :

- Depuis le menu "Déployer/Installer un module externe" de Dolibarr :
- Glisser l'archive ZIP 'module_DoliTMD-X.Y.Z' et cliquer sur "ENVOYER FICHIER"
- 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/Evarisk/DoliTMD.git
```
73 changes: 73 additions & 0 deletions admin/about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
/* Copyright (C) 2023 EVARISK <[email protected]>
*
* 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 dolitmd
* \brief About page of module dolitmd.
*/

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

// Libraries
require_once __DIR__ . '/../lib/dolitmd.lib.php';
require_once __DIR__ . '/../core/modules/modDoliTMD.class.php';

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

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

// Initialize technical objects
$moddolitmd = new modDoliTMD($db);

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

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

/*
* View
*/

$title = $langs->trans('ModuleAbout', 'DoliTMD');
$help_url = 'FR:Module_DoliTMD';

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, 'dolitmd_color@dolitmd');

// Configuration header
$head = dolitmd_admin_prepare_head();
print dol_get_fiche_head($head, 'about', $title, -1, 'dolitmd_color@dolitmd');

print $moddolitmd->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
65 changes: 65 additions & 0 deletions admin/setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/* Copyright (C) 2023 EVARISK <[email protected]>
*
* 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 dolitmd
* \brief dolitmd setup page.
*/

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

// Libraries
require_once __DIR__ . '/../lib/dolitmd.lib.php';

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

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

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

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

/*
* View
*/

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

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, 'dolitmd_color@dolitmd');

// Configuration header
$head = dolitmd_admin_prepare_head();
print dol_get_fiche_head($head, 'settings', $title, -1, 'dolitmd_color@dolitmd');

$db->close();
llxFooter();
104 changes: 104 additions & 0 deletions class/actions_dolitmd.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php
/* Copyright (C) 2023 EVARISK <[email protected]>
*
* 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_dolitmd.class.php
* \ingroup dolitmd
* \brief dolitmd hook overload.
*/

/**
* Class ActionsDoliTMD
*/
class ActionsDolitmd
{
/**
* @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;
}

/**
* Overloading the printMainArea function : replacing the parent's function with the one below
*
* @param array $parameters Hook metadatas (context, etc...)
* @return int 0 < on error, 0 on success, 1 to replace standard code
*/
public function addMoreBoxStatsCustomer(array $parameters, $object, $action): int
{
global $user;

// Do something only for the current context
if ($parameters['currentcontext'] == 'thirdpartycomm') {
if (isModEnabled('project') && $user->rights->project->lire) {
$project = new Project($this->db);
$project->fetchAll('', '', 0, 0, []);

// Box factures
$tmp = $object->getOutstandingBills('customer', 0);
$outstandingOpened = $tmp['opened'];
$outstandingTotal = $tmp['total_ht'];
$outstandingTotalIncTax = $tmp['total_ttc'];

$text = $langs->trans("OverAllInvoices");
$link = DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id;
$icon = 'bill';
if ($link) {
$boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
}
$boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
$boxstat .= '<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat .= '</div>';
if ($link) {
$boxstat .= '</a>';
}
}
}

return 0; // or return 1 to replace standard code
}
}
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 c19fd21

Please sign in to comment.