From 67140dc188d83ecc560b15ccc81642ce2b596be5 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 16 Aug 2015 08:18:00 +0200 Subject: [PATCH 1/4] Fix: Missing "Gender" translation --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 250ba2304ae..70f8a980495 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -709,6 +709,7 @@ GoIntoSetupToChangeLogo=Go into Home - Setup - Company to change logo or go into Deny=Deny Denied=Denied ListOfTemplates=List of templates +Gender=Gender Genderman=Man Genderwoman=Woman ViewList=List view From 7d2eae2359d4098d848ff621946c1fbf72282503 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 23 Aug 2015 07:37:38 +0200 Subject: [PATCH 2/4] Fix: Better presentation for add form --- htdocs/product/card.php | 6 +++++- htdocs/product/fournisseurs.php | 10 ++++++++-- htdocs/product/price.php | 23 ++++++++++++++++++++--- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 704a0db9442..7ba7ecbdf1d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013-2014 Marcos García * Copyright (C) 2012-2013 Cédric Salvador - * Copyright (C) 2011-2014 Alexandre Spangaro + * Copyright (C) 2011-2015 Alexandre Spangaro * Copyright (C) 2014 Cédric Gross * Copyright (C) 2014-2015 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry @@ -1785,6 +1785,8 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status) print ''; print load_fiche_titre($langs->trans("Add"),'',''); + + dol_fiche_head(''); $html .= ''.$langs->trans("Quantity").' '; $html .= ''.$langs->trans("ReductionShort").'(%) '; @@ -1794,6 +1796,8 @@ if ($object->id && ($action == '' || $action == 'view') && $object->status) print ''; print $html; print '
'; + + dol_fiche_end(); print '
'; print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index fe715801f11..866abd856b1 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -6,6 +6,7 @@ * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2014 Ion Agorria + * Copyright (C) 2015 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 @@ -320,6 +321,8 @@ if ($id || $ref) print '
'; print ''; print ''; + + dol_fiche_head(); print ''; @@ -487,9 +490,11 @@ if ($id || $ref) print '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; - print '   '; + print '     '; print ''; print '
'; @@ -536,6 +541,7 @@ if ($id || $ref) print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DiscountQtyMin")); print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder); + // Charges ???? if ($conf->global->PRODUCT_CHARGES) { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 4114005ecdd..29f0c1bb455 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Philippe Grand * Copyright (C) 2014 Ion agorria + * Copyright (C) 2015 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 @@ -690,7 +691,11 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print ''; print ''; print ''; + + dol_fiche_head(''); + print ''; + print ''; // VAT print ''; print ''; - //Only show price mode and expression selector if module is enabled + // Only show price mode and expression selector if module is enabled if (! empty($conf->dynamicprices->enabled)) { // Price mode selector print ''; + print ''; print '
' . $langs->trans("VATRate") . ''; @@ -706,7 +711,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print '
'.$langs->trans("PriceMode").''; @@ -769,9 +774,12 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> } print '
'; - print '
'; + dol_fiche_end(); + + print '
'; print ''; print '     '; print ''; @@ -787,7 +795,11 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print ''; print ''; print ''; + + dol_fiche_head(''); + print ''; + print ''; // VAT if ($i == 1) { @@ -826,9 +838,14 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> } print ''; - print ''; + + print ''; print '
 '; + print '
   '; print '
'; + + dol_fiche_end(); + print ''; } } From 478947d630a3cc847e339bdf7663055bbfb5cd56 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 23 Aug 2015 07:46:37 +0200 Subject: [PATCH 3/4] Correct --- htdocs/product/price.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 29f0c1bb455..87534a6162f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -799,7 +799,6 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> dol_fiche_head(''); print ''; - print ''; // VAT if ($i == 1) { @@ -838,10 +837,10 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> } print ''; - print ''; - print ''; print '
   '; + print '
'; + print '   '; print '
'; dol_fiche_end(); From 73d8f20c6be0f1be3be50f677cdb86fd5115e754 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 25 Aug 2015 08:09:14 +0200 Subject: [PATCH 4/4] Fix: Correct directory where the donation is generated & add the action to remove_file who are generated --- .../modules/dons/html_cerfafr.modules.php | 2 +- htdocs/don/card.php | 31 ++++++++++++++----- htdocs/product/price.php | 2 -- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 1b3e9822106..ee8951864c0 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -105,7 +105,7 @@ class html_cerfafr extends ModeleDon else { $donref = dol_sanitizeFileName($don->ref); - $dir = $conf->don->dir_output . "/" . get_exdir($donref,2,0,1,$don,'donation') . "/" . dol_sanitizeFileName($don->ref); + $dir = $conf->don->dir_output . "/" . $donref; $file = $dir . "/" . $donref . ".html"; } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 323f36bd609..b56171b8796 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -229,6 +229,25 @@ if ($action == 'set_paid') setEventMessage($object->error, 'errors'); } } +// Remove file in doc form +if ($action == 'remove_file') +{ + $object = new Don($db, 0, $_GET['id']); + if ($object->fetch($id)) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $object->fetch_thirdparty(); + + $langs->load("other"); + $upload_dir = $conf->don->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file,0,0,0,$object); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + $action=''; + } +} /* * Build doc @@ -743,13 +762,11 @@ if (! empty($id) && $action != 'edit') /* * Documents generes */ - $filename=dol_sanitizeFileName($object->id); - $filedir=$conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref); - $urlsource=$_SERVER['PHP_SELF'].'?rowid='.$object->id; - // $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer); - // $delallowed=$user->rights->facture->supprimer; - $genallowed=1; - $delallowed=0; + $filename = dol_sanitizeFileName($object->id); + $filedir = $conf->don->dir_output . "/" . dol_sanitizeFileName($object->id); + $urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id; + $genallowed = ($object->statut == 2 && ($object->paid == 0 || $user->admin) && $user->rights->don->creer); + $delallowed = $user->rights->don->supprimer; $var=true; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 87534a6162f..b3b884cbd7e 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -695,7 +695,6 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> dol_fiche_head(''); print ''; - print ''; // VAT print ''; - print ''; print '
' . $langs->trans("VATRate") . ''; @@ -774,7 +773,6 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> } print '
'; dol_fiche_end();