Merge pull request #2942 from aspangaro/develop-donation

Fix: Donation error on admin tab & Fix: Input disabled by default
This commit is contained in:
Laurent Destailleur 2015-06-05 15:57:35 +02:00
commit 7e3a457f85
2 changed files with 12 additions and 13 deletions

View File

@ -24,15 +24,14 @@
/**
* Prepare array with list of admin tabs
*
* @param Donation $object Donation
* @return array Array of tabs to show
*/
function donation_admin_prepare_head($object)
function donation_admin_prepare_head()
{
global $langs, $conf;
$h = 0;
$head = array ();
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/don/admin/donation.php';
$head[$h][1] = $langs->trans("Miscellaneous");
@ -43,14 +42,14 @@ function donation_admin_prepare_head($object)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin');
$head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin', 'remove');
return $head;
}
@ -66,7 +65,7 @@ function donation_prepare_head($object)
global $langs, $conf;
$h = 0;
$head = array ();
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");

View File

@ -3,7 +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>
* Copyright (C) 2014-2015 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
@ -181,11 +181,11 @@ class html_cerfafr extends ModeleDon
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART200 >= 1)
{
$art200='<input type="checkbox" checked>200 du CGI';
$art200='<input type="checkbox" disabled="true" checked>200 du CGI';
}
else
{
$art200='<input type="checkbox">200 du CGI';
$art200='<input type="checkbox" disabled="true">200 du CGI';
}
}
$form = str_replace('__ARTICLE200__',$art200,$form);
@ -194,11 +194,11 @@ class html_cerfafr extends ModeleDon
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART238 >= 1)
{
$art238='<input type="checkbox" checked>238 bis du CGI';
$art238='<input type="checkbox" disabled="true" checked>238 bis du CGI';
}
else
{
$art238='<input type="checkbox">238 bis du CGI';
$art238='<input type="checkbox" disabled="true">238 bis du CGI';
}
}
$form = str_replace('__ARTICLE238__',$art238,$form);
@ -207,11 +207,11 @@ class html_cerfafr extends ModeleDon
if (preg_match('/fr/i',$outputlangs->defaultlang)) {
if ($conf->global->DONATION_ART885 >= 1)
{
$art885='<input type="checkbox" checked>885-0 V bis du CGI';
$art885='<input type="checkbox" disabled="true" checked>885-0 V bis du CGI';
}
else
{
$art885='<input type="checkbox">885-0 V bis du CGI';
$art885='<input type="checkbox" disabled="true">885-0 V bis du CGI';
}
}
$form = str_replace('__ARTICLE885__',$art885,$form);