diff --git a/ChangeLog b/ChangeLog
index aed7dd1ca92..40d6e9ff31b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,7 @@ For users:
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count.
- Fix: [ bug #1022 ] correct margin calculation for credit notes.
- Fix: Better management of using ajax for upload form (to solve problem when enabling ajax jquery multifile upload in some cases).
+- Fix: Lost stats filters into year selection.
New experimental module:
- New: [ task #157 ] Add a Skype button (adherents / third parties / contacts)
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 280da52f6c5..262ccbfe91e 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -422,14 +422,14 @@ if ($result)
{
if($num<$limit){
$var=!$var;
- print '
| '.$langs->trans("Total HT").' | ';
+ print '
| '.$langs->trans("TotalHT").' | ';
print ''.price($total).' | ';
print ' |
';
}
else
{
$var=!$var;
- print '| '.$langs->trans("Total HT for this page").' | ';
+ print '
| '.$langs->trans("TotalHTforthispage").' | ';
print ''.price($total).' | ';
print ' |
';
}
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index b3b8379afc3..e0805d385e6 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -267,14 +267,14 @@ foreach ($data as $val)
{ // If we have empty year
$oldyear--;
print '';
- print '| '.$oldyear.' | ';
+ print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' | ';
print '0 | ';
print '0 | ';
print '0 | ';
print '
';
}
print '';
- print '| '.$year.' | ';
+ print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.' | ';
print ''.$val['nb'].' | ';
print ''.price(price2num($val['total'],'MT'),1).' | ';
print ''.price(price2num($val['avg'],'MT'),1).' | ';
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index 31cb0566934..a7b51fb5fb0 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -288,7 +288,7 @@ foreach ($data as $val)
{ // If we have empty year
$oldyear--;
print '
';
- print '| '.$oldyear.' | ';
+ print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' | ';
print '0 | ';
print '0 | ';
@@ -297,7 +297,7 @@ foreach ($data as $val)
}
print '
';
- print '| '.$year.' | ';
+ print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.' | ';
print ''.$val['nb'].' | ';
print ''.price(price2num($val['total'],'MT'),1).' | ';
print ''.price(price2num($val['avg'],'MT'),1).' | ';
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 211bc355cc6..51747fe04d2 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville
* Copyright (c) 2004-2012 Laurent Destailleur
* Copyright (C) 2012 Marcos García
+ * Copyright (C) 2013 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
@@ -266,14 +267,14 @@ foreach ($data as $val)
{ // If we have empty year
$oldyear--;
print '';
- print '| '.$oldyear.' | ';
+ print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.' | ';
print '0 | ';
print '0 | ';
print '0 | ';
print '
';
}
print '';
- print '| '.$year.' | ';
+ print '0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.' | ';
print ''.$val['nb'].' | ';
print ''.price(price2num($val['total'],'MT'),1).' | ';
print ''.price(price2num($val['avg'],'MT'),1).' | ';
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 8c87e754bc4..5ac8438f2ad 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -75,6 +75,10 @@ $result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
$hookmanager->initHooks(array('ordersuppliercard'));
$object = new CommandeFournisseur($db);
+$extrafields = new ExtraFields($db);
+
+// fetch optionals attributes and labels
+$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Load object
if ($id > 0 || ! empty($ref))
@@ -692,6 +696,46 @@ else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisse
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
}
+elseif ($action == 'update_extras')
+{
+ // Fill array 'array_options' with data from add form
+ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
+
+ if($ret < 0)
+ $error++;
+
+ if(!$error) {
+
+ // Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
+ $hookmanager->initHooks(array('supplierorderdao'));
+ $parameters=array('id'=>$object->id);
+
+ $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+
+ if (empty($reshook))
+ {
+ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ {
+
+ $result=$object->insertExtraFields();
+
+ if ($result < 0)
+ {
+ $error++;
+ }
+
+ }
+ }
+ else if ($reshook < 0) $error++;
+ }
+ else
+ {
+ $action = 'edit_extras';
+ }
+}
+
/*
* Create an order
*/
@@ -718,6 +762,9 @@ else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');
+ // Fill array 'array_options' with data from add form
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
+
$id = $object->create($user);
if ($id < 0)
{
@@ -1072,7 +1119,12 @@ if ($action=="create")
// Other options
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
-
+
+ if (empty($reshook) && ! empty($extrafields->attribute_label))
+ {
+ print $object->showOptionals($extrafields,'edit');
+ }
+
// Bouton "Create Draft"
print "\n";
@@ -1089,7 +1141,9 @@ elseif (! empty($object->id))
$title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'card', $title, 0, 'order');
-
+
+ $res=$object->fetch_optionals($object->id,$extralabels);
+
/*
* Confirmation de la suppression de la commande
*/
@@ -1355,6 +1409,69 @@ elseif (! empty($object->id))
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ if (empty($reshook) && ! empty($extrafields->attribute_label))
+ {
+ if ($action == 'edit_extras')
+ {
+ print '