Nettoyage

This commit is contained in:
Chl 2018-12-02 01:21:54 +01:00
parent 59bc09e99f
commit bb2b2dba40
10 changed files with 4 additions and 2879 deletions

View file

@ -1,5 +1,4 @@
# CHANGELOG SENDFACRECMAIL FOR <a href="https://www.dolibarr.org">DOLIBARR ERP CRM</a>
## 0.1
Initial version
## 0.1.2
Première version fonctionnelle.

View file

@ -1,7 +1,7 @@
# SENDFACRECMAIL FOR <a href="https://www.dolibarr.org">DOLIBARR ERP CRM</a>
## Features
Description...
This module send the PDF generated with recurring invoices by email to the client.
<!--
![Screenshot sendfacrecmail](img/screenshot_sendfacrecmail.png?raw=true "sendfacrecmail"){imgmd}

View file

@ -1,87 +0,0 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 SuperAdmin
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \file sendfacrecmail/admin/about.php
* \ingroup sendfacrecmail
* \brief About page of module sendfacrecmail.
*/
// 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 '../lib/sendfacrecmail.lib.php';
// Translations
$langs->loadLangs(array("errors","admin","sendfacrecmail@sendfacrecmail"));
// Access control
if (! $user->admin) accessforbidden();
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
/*
* Actions
*/
// None
/*
* View
*/
$form = new Form($db);
$page_name = "sendfacrecmailAbout";
llxHeader('', $langs->trans($page_name));
// Subheader
$linkback = '<a href="'.($backtopage?$backtopage:DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_sendfacrecmail@sendfacrecmail');
// Configuration header
$head = sendfacrecmailAdminPrepareHead();
dol_fiche_head($head, 'about', '', 0, 'sendfacrecmail@sendfacrecmail');
dol_include_once('/sendfacrecmail/core/modules/modsendfacrecmail.class.php');
$tmpmodule = new modsendfacrecmail($db);
print $tmpmodule->getDescLong();
// Page end
dol_fiche_end();
llxFooter();
$db->close();

View file

@ -1,147 +0,0 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 SuperAdmin
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \file sendfacrecmail/admin/setup.php
* \ingroup sendfacrecmail
* \brief sendfacrecmail setup 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");
global $langs, $user;
// Libraries
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once '../lib/sendfacrecmail.lib.php';
//require_once "../class/myclass.class.php";
// Translations
$langs->loadLangs(array("admin", "sendfacrecmail@sendfacrecmail"));
// Access control
if (! $user->admin) accessforbidden();
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$arrayofparameters=array(
'SENDFACRECMAIL_MYPARAM1'=>array('css'=>'minwidth200','enabled'=>1),
'SENDFACRECMAIL_MYPARAM2'=>array('css'=>'minwidth500','enabled'=>1)
);
/*
* Actions
*/
if ((float) DOL_VERSION >= 6)
{
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
}
/*
* View
*/
$page_name = "sendfacrecmailSetup";
llxHeader('', $langs->trans($page_name));
// Subheader
$linkback = '<a href="'.($backtopage?$backtopage:DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_sendfacrecmail@sendfacrecmail');
// Configuration header
$head = sendfacrecmailAdminPrepareHead();
dol_fiche_head($head, 'settings', '', -1, "sendfacrecmail@sendfacrecmail");
// Setup page goes here
echo $langs->trans("sendfacrecmailSetupPage").'<br><br>';
if ($action == 'edit')
{
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach($arrayofparameters as $key => $val)
{
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
}
print '</table>';
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
print '<br>';
}
else
{
if (! empty($arrayofparameters))
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach($arrayofparameters as $key => $val)
{
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
print '</td><td>' . $conf->global->$key . '</td></tr>';
}
print '</table>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
}
else
{
print '<br>'.$langs->trans("NothingToSetup");
}
}
// Page end
dol_fiche_end();
llxFooter();
$db->close();

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
# Your module name here
#
# Goal: Goal of module
# Version: <version>
# Author: Copyright <year> - <name of author>
# License: GPLv3
# Install: Just unpack content of module package in Dolibarr directory.
# Setup: Go on Dolibarr setup - modules to enable module.
#
# Files in module
mymodule/

View file

@ -69,7 +69,7 @@ class modsendfacrecmail extends DolibarrModules
$this->editor_url = 'https://www.bugness.org';
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = '0.1.1';
$this->version = '0.1.2';
//Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';

View file

@ -1,26 +0,0 @@
= MYMODULE =
:subtitle: MYMODULE SPECIFICATIONS
== TOPIC OF DOCUMENT
This document describe specifications of module MyModule
*Log of versions*
[options="header",format="csv"]
|===
Author, Date, Version
---Put here your own copyright and developer email---, Date YYY-MM-DD, Version 1.0
|===
[NOTE]
==============
This document was generated using Dolibarr ERP CRM process
==============
<<<

View file

@ -1,126 +0,0 @@
= MYMODULE =
:subtitle: MYMODULE SPECIFICATIONS
== TOPIC OF DOCUMENT
This document was build from following input:
* Date 1
...
* Date 2
...
The document includes an introductory chapter of functional specifications, presenting the different actors involved in the rebuild of the definitions
of business terms that will be used (some of which may be new or different).
The main following chapter will present the entire process, also known as *uses cases*, according to a principle of a description, in chronological sequence if possible,
to present the actor and the action performed, as in the following example:
* *X* Actor realizes Action A.
* *Y* Actor communicates Info B to Actor *Z*
* *Automaton* performs update of data for...
* Etc ...
Functional requirements are complemented by a chapter of technical requirements.
The chapter on data lists key information specific to Presto that were identified at the time of writing specification. It will be enriched as
iterations occurs.
Finally, in the Appendix, the documents known when writing this document are centralized to illustrate the existing document or inspire the new expected one.
These documents have their content directly integrated in this specification or have a reference to
external documents stored in the *Appendices* directory accompanying this document.
*Log of versions*
[options="header",format="csv"]
|===
Author, Date, Version
John Doe, Date YYY-MM-DD, Version 1.0
|===
<<<
== BUSINESS SPECIFICATIONS - INTRODUCTION
=== List of actors [[actors]]
Actors are physical people or moral entities working on at least one process.
The following chart prensts list of actors or partners identified by the project for the defined scope of project. We will use then the name defined into first column to speak about roles in the rest of documents.
[options="header",format="csv"]
|===
Actor/profil/role, Description of role, Access to system or not, Example of actor
Customer Service, Receive and create Sales orders (SO), Yes, Mr Smith
Purchase, Make puchase order (PO), Yes, 5 people
Administrator - IT, Administration of users/groups and IT services, Yes, John Doe
Automaton, Execute automatic data processing, Yes, NA
|===
=== Definitions [[definitions]]
To understand the descriptions of the target process, it was necessary to define or redefine some vocabulary concepts. We must see these definitions as defined in the
new system. Indeed, some terms are already being used but have either not a definition in line with standards, or even differs between services. To bring everyone,
and to consolidate the process, these terms are redefined here, and with their definition in the target objective.
*Definition ABC*
...
*Definition DEF*
...
[NOTE]
==============
Important information will be noticed with a notice like this one.
* Main information 1
* Main information 2
==============
== BUSINESS SPECIFICATION - PROCESS
Specifications were cut into different business process. We call a business process a workflow with a starting situation and ending situation. Between start and end, we will find actions
done by actors to bring the value of the company. This actions are described using the syntax rule:
*Actor X* do action Y, *Actor Z* do action W.
_Each process/use case is described into a separate chapter._
=== Use case / Process 1 [[process_1]]
==== Title and goals
...
==== Actors or roles
* Members of group *...*
==== Standard flow
* Members of Groupe *...*: Do ...
* Members of Groupe *...*: Do ...
* Members of Groupe *...*: Do ...
==== Alternative flow
* A user without role *...*: Can't do ...
==== Business rules
* Business rule 1
* Business rule 2

View file

@ -1,58 +0,0 @@
<?php
/* Copyright (C) 2018 SuperAdmin
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \file sendfacrecmail/lib/sendfacrecmail.lib.php
* \ingroup sendfacrecmail
* \brief Library files with common functions for sendfacrecmail
*/
/**
* Prepare admin pages header
*
* @return array
*/
function sendfacrecmailAdminPrepareHead()
{
global $langs, $conf;
$langs->load("sendfacrecmail@sendfacrecmail");
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath("/sendfacrecmail/admin/setup.php", 1);
$head[$h][1] = $langs->trans("Settings");
$head[$h][2] = 'settings';
$h++;
$head[$h][0] = dol_buildpath("/sendfacrecmail/admin/about.php", 1);
$head[$h][1] = $langs->trans("About");
$head[$h][2] = 'about';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
//$this->tabs = array(
// 'entity:+tabname:Title:@sendfacrecmail:/sendfacrecmail/mypage.php?id=__ID__'
//); // to add new tab
//$this->tabs = array(
// 'entity:-tabname:Title:@sendfacrecmail:/sendfacrecmail/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'sendfacrecmail');
return $head;
}