From 43aacbd55aee8b71f57f509b57074630b6f28301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 10 Mar 2019 09:00:59 +0100 Subject: [PATCH] replace html by html5 in donation --- htdocs/don/admin/donation.php | 40 +++++++++++------------ htdocs/don/admin/donation_extrafields.php | 10 +++--- htdocs/don/card.php | 12 +++---- htdocs/don/class/api_donations.class.php | 24 +++++++------- htdocs/don/index.php | 32 +++++++++--------- htdocs/don/list.php | 38 ++++++++++----------- htdocs/don/payment/card.php | 19 ++++++----- htdocs/don/payment/payment.php | 29 ++++++++-------- htdocs/don/stats/index.php | 34 +++++++++---------- htdocs/don/tpl/linkedobjectblock.tpl.php | 21 ++++++------ 10 files changed, 129 insertions(+), 130 deletions(-) diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index db0633c8e9d..0662c367a40 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -232,10 +232,10 @@ print ''; print ''; print ''; print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; clearstatcache(); @@ -272,20 +272,20 @@ if (is_resource($handle)) { if ($conf->global->DON_ADDON_MODEL == $name) { - print "'; } else { - print "'; } } else { - print ""; } @@ -293,13 +293,13 @@ if (is_resource($handle)) // Default if ($conf->global->DON_ADDON_MODEL == "$name") { - print "'; } else { - print "'; } @@ -314,12 +314,12 @@ if (is_resource($handle)) $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - print ''; // Preview - print ''; @@ -340,7 +340,7 @@ print load_fiche_titre($langs->trans("Options"), '', ''); print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Activated").''.$langs->trans("Default").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").''.$langs->trans("Activated").''.$langs->trans("Default").''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
\n"; + print "\n"; print img_picto($langs->trans("Enabled"), 'switch_on'); print '\n"; + print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; print '\n"; + print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; + print ""; print img_picto($langs->trans("Default"), 'on'); print '"; + print ""; print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; print ''; + print ''; print $form->textwithpicto('', $htmltooltip, -1, 0); print ''; + print ''; print ''.img_object($langs->trans("Preview"), 'generic').''; print '
'; print ''; print ''; -print '\n"; +print '\n"; print ''; print "\n"; @@ -352,7 +352,7 @@ print ''; print ''; -print ''; print ''; -print '\n"; print ''; @@ -387,7 +387,7 @@ print ''; print '\n"; @@ -405,12 +405,12 @@ if (preg_match('/fr/i', $conf->global->MAIN_INFO_SOCIETE_COUNTRY)) print '
'.$langs->trans("Parameters").''.$langs->trans("Value")."'.$langs->trans("Value")."
'; print $form->textwithpicto($langs->trans("DonationUserThirdparties"), $langs->trans("DonationUserThirdpartiesDesc")); print ''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('DONATION_USE_THIRDPARTIES'); } else { @@ -366,7 +366,7 @@ print '
'; $label = $langs->trans("AccountAccounting"); print ''; +print ''; if (! empty($conf->accounting->enabled)) { print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); @@ -375,7 +375,7 @@ else { print ''; } -print ''; +print ''; print ''; print "
'; print $langs->trans("FreeTextOnDonations").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; print ''; -print '
'; +print ''; print ''; print "
'; print ''; print ''."\n"; - print ''."\n"; + print ''."\n"; print "\n"; print ''; print ''; - print ''; print ''; - print ''; print ''; - print ''; print ''; print ''; - print ''; + print ''; print ''; while ($i < $num) @@ -758,7 +758,7 @@ if ($object->socid) { print '\n"; $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; print "\n"; - print '\n"; + print '\n"; print ""; $totalpaid += $objp->amount; $i++; @@ -766,13 +766,13 @@ if ($object->socid) { if ($object->paid == 0) { - print "\n"; - print "\n"; + print "\n"; + print "\n"; $remaintopay = $object->amount - $totalpaid; - print ""; - print '\n"; + print ""; + print '\n"; } print "
'.$langs->trans("Parameters").''.$langs->trans("Status").''.$langs->trans("Status").'
' . $langs->trans("DONATION_ART200") . ''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('DONATION_ART200'); } else { @@ -421,7 +421,7 @@ if ($conf->use_javascript_ajax) { print '
' . $langs->trans("DONATION_ART238") . ''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('DONATION_ART238'); } else { @@ -432,7 +432,7 @@ if ($conf->use_javascript_ajax) { print '
' . $langs->trans("DONATION_ART885") . ''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('DONATION_ART885'); } else { diff --git a/htdocs/don/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php index 1bfc12f2758..b01fc176eae 100644 --- a/htdocs/don/admin/donation_extrafields.php +++ b/htdocs/don/admin/donation_extrafields.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Juanjo Menent +/* Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Juanjo Menent * * 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 @@ -17,9 +17,9 @@ */ /** - * \file htdocs/don/admin/donation_extrafields.php - * \ingroup donations - * \brief Page to setup extra fields of donations + * \file htdocs/don/admin/donation_extrafields.php + * \ingroup donations + * \brief Page to setup extra fields of donations */ require '../../main.inc.php'; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 02a35deb70d..d88017e52ea 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -746,7 +746,7 @@ if ($object->socid) { print ''.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").''.$langs->trans("Amount").'
'.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'.price($objp->amount)."'.price($objp->amount)."
".$langs->trans("AlreadyPaid")." :".price($totalpaid)."
".$langs->trans("AmountExpected")." :".price($object->amount)."
".$langs->trans("AlreadyPaid")." :".price($totalpaid)."
".$langs->trans("AmountExpected")." :".price($object->amount)."
".$langs->trans("RemainderToPay")." :'.price($remaintopay)."
".$langs->trans("RemainderToPay")." :'.price($remaintopay)."
"; $db->free($resql); diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 8762f763da7..efcd418cbc1 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Laurent Destailleur +/* Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2019 Laurent Destailleur * * 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 @@ -58,7 +58,7 @@ class Donations extends DolibarrApi * * @param int $id ID of order * @return array|mixed data without useless information - * + * * @throws RestException */ public function get($id) @@ -89,13 +89,13 @@ class Donations extends DolibarrApi * * Get a list of donations * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit for list - * @param int $page Page number - * @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @return array Array of order objects + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @return array Array of order objects * * @throws RestException */ @@ -177,8 +177,8 @@ class Donations extends DolibarrApi public function post($request_data = null) { if (! DolibarrApiAccess::$user->rights->don->creer) { - throw new RestException(401, "Insuffisant rights"); - } + throw new RestException(401, "Insuffisant rights"); + } // Check mandatory fields $result = $this->_validate($request_data); diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 6f238c97d1b..d632f316a25 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin * * 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 @@ -126,7 +126,7 @@ foreach ($listofstatus as $status) if ($conf->use_javascript_ajax) { - print ''; + print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); @@ -143,9 +143,9 @@ if ($conf->use_javascript_ajax) print ''; print ''.$langs->trans("Status").''; -print ''.$langs->trans("Number").''; -print ''.$langs->trans("Total").''; -print ''.$langs->trans("Average").''; +print ''.$langs->trans("Number").''; +print ''.$langs->trans("Total").''; +print ''.$langs->trans("Average").''; print ''; $total=0; @@ -155,9 +155,9 @@ foreach ($listofstatus as $status) print ''; print ''.$donstatic->LibStatut($status, 4).''; - print ''.(! empty($nb[$status])?$nb[$status]:' ').''; - print ''.(! empty($nb[$status])?price($somme[$status], 'MT'):' ').''; - print ''.(! empty($nb[$status])?price(price2num($somme[$status]/$nb[$status], 'MT')):' ').''; + print ''.(! empty($nb[$status])?$nb[$status]:' ').''; + print ''.(! empty($nb[$status])?price($somme[$status], 'MT'):' ').''; + print ''.(! empty($nb[$status])?price(price2num($somme[$status]/$nb[$status], 'MT')):' ').''; $totalnb += (! empty($nb[$status])?$nb[$status]:0); $total += (! empty($somme[$status])?$somme[$status]:0); print ""; @@ -165,9 +165,9 @@ foreach ($listofstatus as $status) print ''; print ''.$langs->trans("Total").''; -print ''.$totalnb.''; -print ''.price($total, 'MT').''; -print ''.($totalnb?price(price2num($total/$totalnb, 'MT')):' ').''; +print ''.$totalnb.''; +print ''.price($total, 'MT').''; +print ''.($totalnb?price(price2num($total/$totalnb, 'MT')):' ').''; print ''; print ""; @@ -218,14 +218,14 @@ if ($resql) print dolGetFirstLastname($obj->lastname, $obj->firstname); print ''; - print ''; + print ''; print price($obj->amount, 1); print ''; // Date - print ''.dol_print_date($db->jdate($obj->datem), 'day').''; + print ''.dol_print_date($db->jdate($obj->datem), 'day').''; - print ''.$donation_static->LibStatut($obj->fk_statut, 5).''; + print ''.$donation_static->LibStatut($obj->fk_statut, 5).''; print ''; $i++; diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 3a0ec6d189a..70e3b38da39 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2019 Thibault FOUCART +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2019 Thibault FOUCART * * 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 @@ -20,9 +20,9 @@ */ /** - * \file htdocs/don/list.php - * \ingroup donations - * \brief List of donations + * \file htdocs/don/list.php + * \ingroup donations + * \brief List of donations */ require '../main.inc.php'; @@ -178,18 +178,18 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ' '; print ''; if (! empty($conf->projet->enabled)) { - print ''; + print ''; print ' '; print ''; } - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -222,7 +222,7 @@ if ($resql) print "".$donationstatic->getNomUrl(1)."\n"; print "".$objp->societe."\n"; print "".$donationstatic->getFullName($langs)."\n"; - print ''.dol_print_date($db->jdate($objp->datedon), 'day').''; + print ''.dol_print_date($db->jdate($objp->datedon), 'day').''; if (! empty($conf->projet->enabled)) { print ""; @@ -238,20 +238,20 @@ if ($resql) else print ' '; print "\n"; } - print ''.price($objp->amount).''; - print ''.$donationstatic->LibStatut($objp->statut, 5).''; + print ''.price($objp->amount).''; + print ''.$donationstatic->LibStatut($objp->statut, 5).''; print ''; print ""; $i++; } - print ""; - print ''; + print ""; + print ''; print "\n"; $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } llxFooter(); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 43e329f3d08..bbf2163b9af 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2019 Frédéric France * * 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 @@ -216,9 +217,9 @@ if ($resql) print '
'; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print "\n"; if ($num > 0) @@ -234,14 +235,14 @@ if ($resql) print $don->getNomUrl(1); print "\n"; // Expected to pay - print ''; + print ''; // Status - print ''; + print ''; // Amount payed - print ''; + print ''; print "\n"; - if ($objp->paid == 1) // If at least one invoice is paid, disable delete - { + if ($objp->paid == 1) { + // If at least one invoice is paid, disable delete $disable_delete = 1; } $total = $total + $objp->amount; diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 640a94ff729..0172765b19c 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -35,8 +35,7 @@ $amounts = array(); // Security check $socid=0; -if ($user->societe_id > 0) -{ +if ($user->societe_id > 0) { $socid = $user->societe_id; } @@ -244,10 +243,10 @@ if (GETPOST('action', 'aZ09') == 'create') print '
'.$langs->trans('Donation').''.$langs->trans('ExpectedToPay').''.$langs->trans('Status').''.$langs->trans('PayedByThisPayment').''.$langs->trans('ExpectedToPay').''.$langs->trans('Status').''.$langs->trans('PayedByThisPayment').'
'.price($objp->d_amount).''.price($objp->d_amount).''.$don->getLibStatut(4, $objp->amount).''.$don->getLibStatut(4, $objp->amount).''.price($objp->amount).''.price($objp->amount).'
'; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; $total=0; @@ -259,13 +258,13 @@ if (GETPOST('action', 'aZ09') == 'create') print ''; - print '"; + print '"; - print '"; + print '"; - print '"; + print '"; - print ''; - print ''; - print ""; - print ""; - print ""; - print ''; + print ''; + print ""; + print ""; + print ""; + print ''; print "\n"; } diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 4c360786425..cc25ea8ae7b 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -253,7 +253,7 @@ print '
'; arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; - print '
'; + print ''; print '
'.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").'
'.price($objp->amount)."'.price($objp->amount)."'.price($sumpaid)."'.price($sumpaid)."'.price($objp->amount - $sumpaid)."'.price($objp->amount - $sumpaid)."'; + print ''; if ($sumpaid < $objp->amount) { $namef = "amount_".$objp->id; @@ -287,11 +286,11 @@ if (GETPOST('action', 'aZ09') == 'create') { // Print total print '
'.$langs->trans("Total").':".price($total_ttc)."".price($totalrecu)."".price($total_ttc - $totalrecu)." '.$langs->trans("Total").':".price($total_ttc)."".price($totalrecu)."".price($total_ttc - $totalrecu)." 
'; print ''; print '

'; @@ -262,10 +262,10 @@ print '
'; print '
'; print ''; print ''; -print ''; -print ''; -/*print ''; -print '';*/ +print ''; +print ''; +/*print ''; +print '';*/ print ''; $oldyear=0; @@ -276,19 +276,19 @@ foreach ($data as $val) { // If we have empty year $oldyear--; print ''; - print ''; + print ''; - print ''; - /*print ''; - print '';*/ + print ''; + /*print ''; + print '';*/ print ''; } print ''; - print ''; - print ''; - /*print ''; - print '';*/ + print ''; + print ''; + /*print ''; + print '';*/ print ''; $oldyear=$year; } @@ -301,7 +301,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("NbOfSendings").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''.$langs->trans("Year").''.$langs->trans("NbOfSendings").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'
'.$oldyear.''.$oldyear.'000000
'.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).''.$year.''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
'; +print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); @@ -323,8 +323,8 @@ dol_fiche_end(); // TODO USe code similar to commande/stats/index.php instead of this one. /* print ''; -print ''; -print ''; +print ''; +print ''; $sql = "SELECT count(*) as nb, date_format(date_expedition,'%Y') as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition"; @@ -343,7 +343,7 @@ if ($resql) $nbproduct = $row[0]; $year = $row[1]; print ""; - print ''; + print ''; $i++; } } diff --git a/htdocs/don/tpl/linkedobjectblock.tpl.php b/htdocs/don/tpl/linkedobjectblock.tpl.php index 0191fd89ee4..70373c58b28 100644 --- a/htdocs/don/tpl/linkedobjectblock.tpl.php +++ b/htdocs/don/tpl/linkedobjectblock.tpl.php @@ -33,8 +33,7 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; $langs->load("donations"); $total=0; $ilink=0; -foreach($linkedObjectBlock as $key => $objectlink) -{ +foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; $trclass='oddeven'; @@ -43,14 +42,14 @@ foreach($linkedObjectBlock as $key => $objectlink) - - - + + - + 1) - - - - - + + + + +
'.$langs->trans("Year").''.$langs->trans("NbOfSendings").'
'.$langs->trans("Year").''.$langs->trans("NbOfSendings").'
'.$year.''.$nbproduct.'
'.$year.''.$nbproduct.'
trans("Donation"); ?> getNomUrl(1); ?>ref_client; ?>date, 'day'); ?>ref_client; ?>date, 'day'); ?>total_ht; echo price($objectlink->total_ht); } ?> getLibStatut(3); ?>getLibStatut(3); ?>
trans("Total"); ?>