Skip to content
Snippets Groups Projects
Commit d5e0bcfa authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

parents 8de6748b f25bb79d
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
......@@ -109,6 +110,63 @@ else if ($action == 'del')
}
}
// Option
if ($action == 'set_DONATION_MESSAGE')
{
$freemessage = GETPOST('DONATION_MESSAGE'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "DONATION_MESSAGE",$freemessage,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate an article
else if ($action == 'setart200') {
$setart200 = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "DONATION_ART200", $setart200, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'mesgs');
}
}
else if ($action == 'setart238') {
$setart238 = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "DONATION_ART238", $setart238, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'mesgs');
}
}
else if ($action == 'setart885') {
$setart885 = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "DONATION_ART885", $setart885, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
} else {
setEventMessage($langs->trans("Error"), 'mesgs');
}
}
/*
* View
*/
......@@ -121,6 +179,88 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup');
/*
* Params
*/
print_titre($langs->trans("Options"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=true;
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="set_DONATION_MESSAGE" />';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("FreeTextOnDonations").'<br>';
print '<textarea name="DONATION_MESSAGE" class="flat" cols="120">'.$conf->global->DONATION_MESSAGE.'</textarea>';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n";
print "</table>\n";
print '</form>';
/*
* French params
*/
if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR")
{
print '<br>';
print_titre($langs->trans("FrenchOptions"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('Parameters') . '</td>';
print "</tr>\n";
$var=!$var;
print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("DONATION_ART200") . '</td>';
if (! empty($conf->global->DONATION_ART200)) {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setart200&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setart200&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
$var=!$var;
print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("DONATION_ART238") . '</td>';
if (! empty($conf->global->DONATION_ART238)) {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setart238&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setart238&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
$var=!$var;
print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("DONATION_ART885") . '</td>';
if (! empty($conf->global->DONATION_ART885)) {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setart885&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setart885&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print "</table>\n";
}
// Document templates
print '<br>';
print_titre($langs->trans("DonationsModels"));
......
......@@ -24,7 +24,6 @@
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
/**
* Class to manage the box to show last invoices
*/
......@@ -159,4 +158,4 @@ class box_factures extends ModeleBoxes
}
}
?>
\ No newline at end of file
<?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* 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 htdocs/core/boxes/box_activite.php
* \ingroup projet
* \brief Module to show Projet activity of the current Year
*/
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
/**
* Class to manage the box to show last projet
*/
class box_project extends ModeleBoxes
{
var $boxcode="project";
var $boximg="object_projectpub";
var $boxlabel;
//var $depends = array("projet");
var $db;
var $param;
var $info_box_head = array();
var $info_box_contents = array();
/**
* \brief Constructeur de la classe
*/
function box_project()
{
global $langs;
$langs->load("boxes");
$langs->load("projects");
$this->boxlabel="Projet";
}
/**
* Load data for box to show them later
*
* @param int $max Maximum number of records to load
* @return void
*/
function loadBox($max=5)
{
global $conf, $user, $langs, $db;
$this->max=$max;
$totalMnt = 0;
$totalnb = 0;
$totalnbTask=0;
include_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
$projectstatic=new Project($db);
$textHead = $langs->trans("Projet");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the orders
if ($user->rights->projet->lire)
{
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."projet as p";
$sql.= ")";
$sql.= " WHERE p.fk_soc = s.rowid";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
$sql.= " ORDER BY p.datec DESC";
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projectpub');
$objp = $db->fetch_object($result);
$projectstatic->fetch($objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' =>$projectstatic->getNomUrl(1)
);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
'text' => $objp->title
);
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
$sql.=" FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p";
$sql.=" WHERE pt.fk_projet = p.rowid";
$sql.=" AND p.entity = ".$conf->entity;
$resultTask = $db->query($sql);
if ($resultTask)
{
$objTask = $db->fetch_object($resultTask);
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
if ($objTask->nb > 0 )
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')." %&nbsp;".$langs->trans("Progress"));
else
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A&nbsp;");
$totalnbTask += $objTask->nb;
}
else
{
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0, 0, ',', ' '));
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A&nbsp;");
}
$i++;
}
}
}
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')."&nbsp;".$langs->trans("Projects"));
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => "");
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
}
}
?>
<?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* 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 htdocs/core/boxes/box_task.php
* \ingroup Projet
* \brief Module to Task activity of the current year
* \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE
*/
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
/**
* Class to manage the box to show last task
*/
class box_task extends ModeleBoxes
{
var $boxcode="projet";
var $boximg="object_projecttask";
var $boxlabel;
//var $depends = array("projet");
var $db;
var $param;
var $info_box_head = array();
var $info_box_contents = array();
/**
* \brief Constructeur de la classe
*
* @return void
*/
function box_task()
{
global $langs;
$langs->load("boxes");
$langs->load("projects");
$this->boxlabel="Tasks";
}
/**
* Load data for box to show them later
*
* @param int $max Maximum number of records to load
* @return void
*/
function loadBox($max=5)
{
global $conf, $user, $langs, $db;
$this->max=$max;
$totalMnt = 0;
$totalnb = 0;
$totalDuree=0;
include_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
$taskstatic=new Task($db);
$textHead = $langs->trans("Tasks")."&nbsp;".date("Y");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the orders
if ($user->rights->projet->lire)
{
$sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt";
$sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = ".date("Y")." ";
$sql.= " AND pt.rowid = ptt.fk_task";
$sql.= " GROUP BY pt.fk_statut ";
$sql.= " ORDER BY pt.fk_statut DESC";
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' =>$langs->trans("Task")."&nbsp;".$taskstatic->LibStatut($objp->fk_statut,0)
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $objp->nb."&nbsp;".$langs->trans("Tasks"),
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut
);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));
$totalplannedtot += $objp->plannedtot;
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5));
$totaldurationtot += $objp->durationtot;
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3));
$i++;
}
}
}
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
$this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => "");
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
}
}
?>
......@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>__DonationReceipt__</title>
<title>__DonationTitle__</title>
</head>
<body topmargin="10" marginheight="10" marginwidth="10">
......@@ -11,10 +11,10 @@
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#ffffff">
<tr>
<td width="15%" class="nowrap" valign="middle">Cerfa No 11580 01</td>
<td width="15%" class="nowrap" valign="middle">Cerfa N° 11580*03</td>
<td class="nowrap" align="center" valign="middle">
<font size="+2">__DonationReceipt__</font><br>
<font size="+2"><b>__DonationReceipt__</b></font><br>
__FrenchArticle__
</td>
......@@ -25,7 +25,6 @@
<td class="nowrap">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="40" class="nowrap">No:</td>
<td align="center">__REF__ </td>
</tr>
</table>
......@@ -37,9 +36,6 @@
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
......@@ -74,6 +70,10 @@
</td>
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
......@@ -93,25 +93,29 @@
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
<b>__Name__ :</b><br>
__DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__<br>
<b>__Address__ :</b><br>
__DONATOR_ADDRESS__<br>
<b>__Zip__ :</b> __DONATOR_ZIP__<br>
<b>__Town__ :</b> __DONATOR_TOWN__<br>
</td>
</tr>
</table>
</td>
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
<b>__Name__ :</b><br>
__DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__<br>
<b>__Address__ :</b><br>
__DONATOR_ADDRESS__<br>
<b>__Zip__ :</b> __DONATOR_ZIP__<br>
<b>__Town__ :</b> __DONATOR_TOWN__<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">
<tr>
<td valign="bottom">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td>
......@@ -119,20 +123,31 @@
<table width="100%">
<tr align="center">
<td>
__AMOUNT__ __CURRENCY__
<font size="+1">
<b>__AMOUNT__ __CURRENCY__<b/>
</font>
</td>
</tr>
</table>
<b>__DatePayment__</b> : __DATE__ <br>
<b>__DonationDatePayment__</b> : __DATE__ <br>
<b>__PaymentMode__</b> : __PAYMENTMODE_LIB__ <br>
<table width="100%">
<table width="100%" border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td valign="top">
<br>
<b>__Message__ :</b>
__DonationMessage__<br>
</td>
</tr>
</table>
<table width="100%">
<tr align="center">
<td valign="top">
<br><br>
__ThankYou__
<td align="left">
__FrenchEligibility__<br>
__ARTICLE200__ __ARTICLE238__ __ARTICLE885__
</td>
<td align="right">
......@@ -142,8 +157,8 @@
<table border="0" bgcolor="#ffffff" cellspacing="0" cellpadding="3">
<tr>
<td width="160" height="100" valign="top">
<center>__Date__ __Signature__</center>
__NOW__
<center>__Date__ & __Signature__</center>
<center>__NOW__</center>
</td>
</tr>
</table>
......
......@@ -3,6 +3,7 @@
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
......@@ -19,9 +20,9 @@
*/
/**
* \file htdocs/core/modules/dons/html_cerfafr.modules.php
* \ingroup don
* \brief Formulaire de don
* \file htdocs/core/modules/dons/html_cerfafr.modules.php
* \ingroup don
* \brief Form of donation
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
......@@ -44,9 +45,9 @@ class html_cerfafr extends ModeleDon
$this->db = $db;
$this->name = "cerfafr";
$this->description = $langs->trans('DonationsReceiptModel');
$this->description = $langs->trans('DonationsReceiptModel').' - fr_FR - Cerfa 11580*03';
// Dimension page pour format A4
// Dimension page for size A4
$this->type = 'html';
}
......@@ -87,7 +88,7 @@ class html_cerfafr extends ModeleDon
if (! empty($conf->don->dir_output))
{
// Definition de l'objet $don (pour compatibilite ascendante)
// Definition of the object don (for upward compatibility)
if (! is_object($don))
{
$don = new Don($this->db);
......@@ -95,7 +96,7 @@ class html_cerfafr extends ModeleDon
$id=$don->id;
}
// Definition de $dir et $file
// Definition of $dir and $file
if (! empty($don->specimen))
{
$dir = $conf->don->dir_output;
......@@ -121,8 +122,8 @@ class html_cerfafr extends ModeleDon
{
$formclass = new Form($this->db);
//This is not the proper way to do it but $formclass->form_modes_reglement
//prints the translation instead of returning it
// This is not the proper way to do it but $formclass->form_modes_reglement
// prints the translation instead of returning it
if ($don->modepaiementid)
{
$formclass->load_cache_types_paiements();
......@@ -130,7 +131,7 @@ class html_cerfafr extends ModeleDon
}
else $paymentmode = '';
// Defini contenu
// Define contents
$donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html";
$form = implode('', file($donmodel));
$form = str_replace('__REF__',$don->id,$form);
......@@ -143,32 +144,79 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_ZIP__',$mysoc->zip,$form);
$form = str_replace('__MAIN_INFO_SOCIETE_TOWN__',$mysoc->town,$form);
$form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form);
$form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form);
$form = str_replace('__DONATOR_LASTNAME__',$don->lastname,$form);
$form = str_replace('__DONATOR_ADDRESS__',$don->address,$form);
$form = str_replace('__DONATOR_ZIP__',$don->zip,$form);
$form = str_replace('__DONATOR_TOWN__',$don->town,$form);
$form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form);
$form = str_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$form);
$form = str_replace('__NOW__',dol_print_date($now,'day',false,$outputlangs),$form);
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
$form = str_replace('__DonationTitle__',$outputlangs->trans("DonationTitle"),$form);
$form = str_replace('__DonationReceipt__',$outputlangs->trans("DonationReceipt"),$form);
$form = str_replace('__DonationRecipient__',$outputlangs->trans("DonationRecipient"),$form);
$form = str_replace('__DatePayment__',$outputlangs->trans("DatePayment"),$form);
$form = str_replace('__PaymentMode__',$outputlangs->trans("PaymentMode"),$form);
$form = str_replace('__DonationDatePayment__',$outputlangs->trans("DonationDatePayment"),$form);
$form = str_replace('__PaymentMode__',$outputlangs->trans("PaymentMode"),$form);
$form = str_replace('__Name__',$outputlangs->trans("Name"),$form);
$form = str_replace('__Address__',$outputlangs->trans("Address"),$form);
$form = str_replace('__Zip__',$outputlangs->trans("Zip"),$form);
$form = str_replace('__Town__',$outputlangs->trans("Town"),$form);
$form = str_replace('__Object__',$outputlangs->trans("Object"),$form);
$form = str_replace('__Donor__',$outputlangs->trans("Donor"),$form);
$form = str_replace('__Date__',$outputlangs->trans("Date"),$form);
$form = str_replace('__Signature__',$outputlangs->trans("Signature"),$form);
$form = str_replace('__ThankYou__',$outputlangs->trans("ThankYou"),$form);
$form = str_replace('__Message__',$outputlangs->trans("Message"),$form);
$form = str_replace('__IConfirmDonationReception__',$outputlangs->trans("IConfirmDonationReception"),$form);
$frencharticle='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='<font size="+1"><b>(Article 200-5 du Code Général des Impôts)</b></font><br>+ article 238 bis';
$form = str_replace('__DonationMessage__',$conf->global->DONATION_MESSAGE,$form);
$frencharticle='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='<font size="+1">Article 200, 238 bis et 885-0 V bis A du code général des impôts (CGI)</font>';
$form = str_replace('__FrenchArticle__',$frencharticle,$form);
// Sauve fichier sur disque
$frencheligibility='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencheligibility='Le bénéficiaire certifie sur l\'honneur que les dons et versements qu\'il reçoit ouvrent droit à la réduction d\'impôt prévue à l\'article :';
$form = str_replace('__FrenchEligibility__',$frencheligibility,$form);
$art200='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART200 >= 1)
{
$art200='<input type="checkbox" checked="checked">200 du CGI';
}
else
{
$art200='<input type="checkbox">200 du CGI';
}
}
$form = str_replace('__ARTICLE200__',$art200,$form);
$art238='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART238 >= 1)
{
$art238='<input type="checkbox" checked="checked">238 bis du CGI';
}
else
{
$art238='<input type="checkbox">238 bis du CGI';
}
}
$form = str_replace('__ARTICLE238__',$art238,$form);
$art885='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART885 >= 1)
{
$art885='<input type="checkbox" checked="checked">885-0 V bis du CGI';
}
else
{
$art885='<input type="checkbox">885-0 V bis du CGI';
}
}
$form = str_replace('__ARTICLE885__',$art885,$form);
// Save file on disk
dol_syslog("html_cerfafr::write_file $file");
$handle=fopen($file,"w");
fwrite($handle,$form);
......@@ -190,7 +238,7 @@ class html_cerfafr extends ModeleDon
return 0;
}
$this->error=$langs->trans("ErrorUnknown");
return 0; // Erreur par defaut
return 0; // Error by default
}
}
<?php
/* Copyright (C) 2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.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
......@@ -19,17 +20,17 @@
/**
* \defgroup don Module donation
* \brief Module pour gerer le suivi des dons
* \brief Module to manage the follow-up of the donations
* \file htdocs/core/modules/modDon.class.php
* \ingroup don
* \brief Fichier de description et activation du module Don
* \brief Description and activation file for module Donation
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* Classe de description et activation du module Don
* Class to describe and enable module Donation
*/
class modDon extends DolibarrModules
{
......@@ -66,15 +67,43 @@ class modDon extends DolibarrModules
$this->config_page_url = array("dons.php");
// Constants
$this->const = array();
$r=0;
$this->const[$r][0] = "DON_ADDON_MODEL";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "html_cerfafr";
$this->const[$r][3] = 'Nom du gestionnaire de generation de recu de dons';
$this->const[$r][4] = 0;
$r++;
$this->const = array ();
$this->const[1] = array (
"DON_ADDON_MODEL",
"chaine",
"html_cerfafr",
"Nom du gestionnaire de generation de recu de dons",
"0"
);
$this->const[2] = array (
"DONATION_ART200",
"yesno",
"0",
"Option Française - Eligibilité Art200 du CGI",
"0"
);
$this->const[3] = array (
"DONATION_ART238",
"yesno",
"0",
"Option Française - Eligibilité Art238 bis du CGI",
"0"
);
$this->const[4] = array (
"DONATION_ART885",
"yesno",
"0",
"Option Française - Eligibilité Art885-0 V bis du CGI",
"0"
);
$this->const[5] = array (
"DONATION_MESSAGE",
"chaine",
"Thank you",
"Message affiché sur le récépissé de versements ou dons",
"0"
);
// Boxes
$this->boxes = array();
......
......@@ -5,6 +5,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
*
* 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
......@@ -116,6 +117,11 @@ class modProjet extends DolibarrModules
// Boxes
$this->boxes = array();
$r=0;
$this->boxes[$r][1] = "box_project.php";
$r++;
$this->boxes[$r][1] = "box_task.php";
$r++;
// Permissions
$this->rights = array();
......
......@@ -320,9 +320,9 @@ class modSociete extends DolibarrModules
$this->export_label[$r]='ExportDataset_company_2';
$this->export_icon[$r]='contact';
$this->export_permission[$r]=array(array("societe","contact","export"));
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
$this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company"); // We define here only fields that use another picto
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1');
$this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto
if (empty($conf->fournisseur->enabled))
{
unset($this->export_fields_array[$r]['s.code_fournisseur']);
......
# Dolibarr language file - Source file is en_US - donations
Donation=Don
Donations=Dons
DonationRef=Réf. donation
DonationRef=Numéro d'ordre du reçu
Donor=Donateur
Donors=Donateurs
AddDonation=Ajouter don
......@@ -22,11 +22,19 @@ DonationStatusPromiseNotValidatedShort=Non validée
DonationStatusPromiseValidatedShort=Validée
DonationStatusPaidShort=Payé
ValidPromess=Valider promesse
DonationReceipt=Reçu de dons
DonationTitle=Reçu au titre des dons
DonationReceipt=Reçu au titre des dons<br>à certains organismes d'intéret général
DonationDatePayment=Date de versement ou du don
BuildDonationReceipt=Créer reçu
DonationsModels=Modèles de documents de bon de réception de dons
LastModifiedDonations=Les %s derniers dons modifiés
SearchADonation=Rechercher un don
DonationRecipient=Bénéficiaire des versements
ThankYou=Merci
IConfirmDonationReception=Le bénéficiaire reconnait avoir reçu au titre des versements ouvrant droit à réduction d'impôt, la somme de
FreeTextOnDonations=Message affiché sur le récépissé de versements ou dons
IConfirmDonationReception=Le bénéficiaire reconnait avoir reçu au titre des dons et versements ouvrant droit à réduction d'impôt, la somme de
# French Options
FrenchOptions=Options éligibles en France
DONATION_ART200=Les dons ou versements reçus sont éligibles à l'article 200 du CGI
DONATION_ART238=Les dons ou versements reçus sont éligibles à l'article 238bis du CGI
DONATION_ART885=Les dons ou versements reçus sont éligibles à l'article 885-0 V bis A du CGI
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment