diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index fbb89f4bfa20a..c81366bc5e91c 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2012-2013 Juanjo Menent * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2014 Alexandre Spangaro * * 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 @@ } } +// 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 @@ $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup'); +/* + * Params + */ +print_titre($langs->trans("Options")); + +print ''; +print ''; +print ''; +print ''; +print "\n"; +$var=true; + +$var=! $var; +print ''; +print ''; +print ''; +print '\n"; +print "
'.$langs->trans("Parameter").' 
'; +print $langs->trans("FreeTextOnDonations").'
'; +print ''; +print '
'; +print ''; +print "
\n"; +print ''; + +/* + * French params + */ +if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR") +{ + print '
'; + print_titre($langs->trans("FrenchOptions")); + + print ''; + print ''; + print ''; + print "\n"; + + $var=!$var; + print ""; + print ''; + if (! empty($conf->global->DONATION_ART200)) { + print ''; + } else { + print ''; + } + print ''; + + $var=!$var; + print ""; + print ''; + if (! empty($conf->global->DONATION_ART238)) { + print ''; + } else { + print ''; + } + print ''; + + $var=!$var; + print ""; + print ''; + if (! empty($conf->global->DONATION_ART885)) { + print ''; + } else { + print ''; + } + print ''; + print "
' . $langs->trans('Parameters') . '
' . $langs->trans("DONATION_ART200") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("DONATION_ART238") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("DONATION_ART885") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
\n"; +} + // Document templates print '
'; print_titre($langs->trans("DonationsModels")); diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 18d276b013057..23ab2df85569b 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -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 @@ function showBox($head = null, $contents = null) } } - +?> \ No newline at end of file diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php new file mode 100644 index 0000000000000..5155c92b2517a --- /dev/null +++ b/htdocs/core/boxes/box_project.php @@ -0,0 +1,156 @@ + + * 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 . + */ + +/** + * \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, ',', ' ')." ".$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, ',', ' ')." % ".$langs->trans("Progress")); + else + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); + $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 "); + } + + $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")." ".$textHead); + $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects")); + $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$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); + } +} +?> diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php new file mode 100644 index 0000000000000..20a0871bc7e42 --- /dev/null +++ b/htdocs/core/boxes/box_task.php @@ -0,0 +1,143 @@ + + * 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 . + */ + +/** + * \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")." ".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")." ".$taskstatic->LibStatut($objp->fk_statut,0) + ); + + $this->info_box_contents[$i][2] = array('td' => 'align="right"', + 'text' => $objp->nb." ".$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")." ".$textHead); + $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$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); + } +} +?> diff --git a/htdocs/core/modules/dons/html_cerfafr.html b/htdocs/core/modules/dons/html_cerfafr.html index cd4c06e763c00..2dc9c72968c4e 100644 --- a/htdocs/core/modules/dons/html_cerfafr.html +++ b/htdocs/core/modules/dons/html_cerfafr.html @@ -2,7 +2,7 @@ - __DonationReceipt__ + __DonationTitle__ @@ -11,10 +11,10 @@ - + @@ -25,7 +25,6 @@
Cerfa No 11580 01Cerfa N° 11580*03 - __DonationReceipt__
+ __DonationReceipt__
__FrenchArticle__
-
No: __REF__
@@ -37,9 +36,6 @@
-
-
-
@@ -74,6 +70,10 @@
+ +
+
+ +
@@ -93,25 +93,29 @@ +
- - - - - -
- __Name__ :
- __DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__
- __Address__ :
- __DONATOR_ADDRESS__
- __Zip__ : __DONATOR_ZIP__
- __Town__ : __DONATOR_TOWN__
-
- -
+ + + +
+ __Name__ :
+ __DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__
+ __Address__ :
+ __DONATOR_ADDRESS__
+ __Zip__ : __DONATOR_ZIP__
+ __Town__ : __DONATOR_TOWN__
+
+
+ +
+
+
+
@@ -119,20 +123,31 @@
- __AMOUNT__ __CURRENCY__ + + __AMOUNT__ __CURRENCY__ +
- __DatePayment__ : __DATE__
+ __DonationDatePayment__ : __DATE__
__PaymentMode__ : __PAYMENTMODE_LIB__
- +
+ + + +
+
+ __Message__ : + __DonationMessage__
+
+ + -
-

- __ThankYou__ - +
+ __FrenchEligibility__
+ __ARTICLE200__ __ARTICLE238__ __ARTICLE885__
@@ -142,8 +157,8 @@
-
__Date__ __Signature__
- __NOW__ +
__Date__ & __Signature__
+
__NOW__
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index e999124300eaa..b4cc2795c1a58 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2006 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Marcos García + * Copyright (C) 2014 Alexandre Spangaro * * 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 @@ function __construct($db) $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 @@ function write_file($don,$outputlangs) 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 @@ function write_file($don,$outputlangs) $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 @@ function write_file($don,$outputlangs) { $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 @@ function write_file($don,$outputlangs) } 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 @@ function write_file($don,$outputlangs) $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='(Article 200-5 du Code Général des Impôts)
+ article 238 bis'; + $form = str_replace('__DonationMessage__',$conf->global->DONATION_MESSAGE,$form); + + $frencharticle=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='Article 200, 238 bis et 885-0 V bis A du code général des impôts (CGI)'; $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='200 du CGI'; + } + else + { + $art200='200 du CGI'; + } + } + $form = str_replace('__ARTICLE200__',$art200,$form); + + $art238=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) { + if ($conf->global->DONATION_ART238 >= 1) + { + $art238='238 bis du CGI'; + } + else + { + $art238='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='885-0 V bis du CGI'; + } + else + { + $art885='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 @@ function write_file($don,$outputlangs) return 0; } $this->error=$langs->trans("ErrorUnknown"); - return 0; // Erreur par defaut + return 0; // Error by default } } diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 931aa2ec325c9..1e4dfd2c9140d 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2003-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2014 Alexandre Spangaro * * 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 @@ function __construct($db) $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(); diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 0d8a09aa7e5aa..d9d2817759fce 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Charles-Fr BENKE * * 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 @@ function __construct($db) // 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(); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 5284f5ef55b39..ee48e4d7ff727 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -320,9 +320,9 @@ function __construct($db) $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']); diff --git a/htdocs/langs/fr_FR/donations.lang b/htdocs/langs/fr_FR/donations.lang index f8a71165842d2..9af7a87a12d6d 100644 --- a/htdocs/langs/fr_FR/donations.lang +++ b/htdocs/langs/fr_FR/donations.lang @@ -1,7 +1,7 @@ # 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
à 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