Skip to content

Commit

Permalink
Merge pull request #118 from Eoxia/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nicolas-eoxia authored Jul 21, 2023
2 parents 472b71d + b940ca8 commit edb1fd8
Show file tree
Hide file tree
Showing 34 changed files with 2,494 additions and 93 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.php]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
/.editorconfig
/.gitattributes
node_modules
package-lock.json
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# EasyCRM sur [DOLIBARR ERP CRM](https://www.dolibarr.org)
# EasyCRM sur [DOLIBARR ERP CRM](https://dolibarr.org)

## Informations

- Numéro du module : 436351
- Version : 1.0.0
- Dernière mise à jour : 12/04/2023
- Éditeur : [Eoxia](https://www.eoxia.com)
- Compatibilité : Dolibarr 15.0.0 - 16.0.5
- Thème : eldy
- Dernière mise à jour : 21/07/2023
- Éditeur : [Eoxia](https://eoxia.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux
-
### Version

- Version : 1.1.0
- Compatibilité : Dolibarr 16.0.0 - 17.0.2
- Saturne Framework : 1.1.1

## Liens

- Support & Assistance : [Forum www.dolibarr.fr](https://www.dolibarr.fr) / Par mail à contact@eoxia.com
- Demo : [Demo EasyCRM](https://www.demodoli.digirisk.com) - ID: demo - Password: demo
- Support & Assistance : [Forum dolibarr.fr](https://dolibarr.fr) / Par mail à technique@eoxia.com
- Demo : [Demo EasyCRM](https://demodoli.digirisk.com) - ID: demo - Password: demo
- Documentation : [Wiki EasyCRM](https://wiki.dolibarr.org/index.php/Module_EasyCRM)
- Projet GitHub : [Projet EasyCRM](https://github.com/Eoxia/easycrm/projects?query=is%3Aopen)
- D'autres modules développés par Eoxia disponibles sur [DoliStore.com](https://www.dolistore.com)
- Saturne Framework : [Télécharger Saturne](https://dolistore.com/fr/modules/1906-Saturne.html)
- D'autres modules développés par Eoxia disponibles sur [DoliStore.com](https://dolistore.com)

## Fonctionnalités

Expand All @@ -34,11 +39,13 @@

- Depuis le menu "Déployer/Installer un module externe" de Dolibarr :
- Glisser l'archive ZIP 'module_easycrm-X.Y.Z' et cliquer sur "ENVOYER FICHIER"
- Glisser l'archive ZIP 'module_saturne-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/Eoxia/easycrm.git
git clone https://github.com/Evarisk/saturne.git
```
106 changes: 106 additions & 0 deletions admin/address.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?php
/* Copyright (C) 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/>.
*/

/**
* \file admin/address.php
* \ingroup easycrm
* \brief EasyCRM address config page.
*/

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

// Libraries
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';

require_once __DIR__ . '/../class/address.class.php';
require_once __DIR__ . '/../lib/easycrm.lib.php';

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

// Load translation files required by the page
saturne_load_langs(['admin', 'categories']);

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

// Initialize technical objects.
$object = new Address($db);

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

/*
* Actions
*/

//Set numering modele for address object
if ($action == 'setmod') {
dolibarr_set_const($db, 'EASYCRM_ADDRESS_ADDON', $value, 'chaine', 0, '', $conf->entity);
}

/*
* View
*/

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

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, 'easycrm_color@easycrm');

// Configuration header
$head = easycrm_admin_prepare_head();
print dol_get_fiche_head($head, 'object', $title, -1, 'easycrm_color@easycrm');

require_once __DIR__ . '/../../saturne/core/tpl/admin/object/object_numbering_module_view.tpl.php';

print load_fiche_titre($langs->trans('Configs', $langs->trans('Addresses')), '', '');

print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans('Name') . '</td>';
print '<td>' . $langs->trans('Description') . '</td>';
print '<td class="center">' . $langs->trans('Status') . '</td>';
print '</tr>';

// Display single/multi address on map
print '<tr class="oddeven"><td>';
print $langs->trans('DisplayAllAddress');
print '</td><td>';
print $langs->trans('DisplayAllAddressDescription');
print '</td><td class="center">';
print ajax_constantonoff('EASYCRM_DISPLAY_MAIN_ADDRESS');
print '</td></tr>';
print '</table>';

$db->close();
llxFooter();
13 changes: 12 additions & 1 deletion admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,17 @@
print ajax_constantonoff('EASYCRM_PROJECT_DATE_START_VISIBLE');
print '</td></td><td></td></tr>';

// Extrafields
print '<tr class="oddeven"><td>';
print $langs->trans('Extrafields');
print '</td><td>';
print $langs->trans('ObjectVisibleDescription', $langs->transnoentities('Extrafields'));
print '</td>';

print '<td class="center">';
print ajax_constantonoff('EASYCRM_PROJECT_CATEGORIES_VISIBLE');
print '</td></td><td></td></tr>';

// Categories
print '<tr class="oddeven"><td>';
print $langs->trans('Categories');
Expand Down Expand Up @@ -501,4 +512,4 @@
print '</form>';

$db->close();
llxFooter();
llxFooter();
25 changes: 22 additions & 3 deletions class/actions_easycrm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(DoliDB $db)
public function addMoreBoxStatsCustomer(array $parameters, CommonObject $object, string $action): int
{
global $conf, $langs, $user;

// Do something only for the current context
if ($parameters['currentcontext'] == 'thirdpartycomm') {
if (isModEnabled('project') && $user->hasRight('projet', 'lire') && isModEnabled('saturne')) {
Expand Down Expand Up @@ -328,7 +328,7 @@ public function printFieldListValue(array $parameters): int
$picto = img_picto('', $pictopath, '', 1, 0, 0, '', 'pictoModule');

$actiomcomm = new ActionComm($db);

$filter = ' AND a.id IN (SELECT c.fk_actioncomm FROM ' . MAIN_DB_PREFIX . 'categorie_actioncomm as c WHERE c.fk_categorie = ' . $conf->global->EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG . ')';
if (is_object($parameters['obj']) && !empty($parameters['obj'])) {
if (!empty($parameters['obj']->id)) {
Expand Down Expand Up @@ -365,4 +365,23 @@ public function printFieldListValue(array $parameters): int
return 0; // or return 1 to replace standard code
}

}
/**
* Overloading the formConfirm hook
*
* @param array $parameters Hook metadatas (context, etc...)
* @param CommonObject $object
* @return int 0 < on error, 0 on success, 1 to replace standard code
* @throws Exception
*/
public function formConfirm(array $parameters, CommonObject $object): int
{
if ($parameters['currentcontext'] == 'propalcard') {
if (empty($object->thirdparty->id)) {
$object->fetch_thirdparty();
}
}

return 0; // or return 1 to replace standard code
}

}
Loading

0 comments on commit edb1fd8

Please sign in to comment.