From 19540b14b59bfc64d5db481a22e97dbdcb57864b Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 25 Mar 2015 16:38:18 +0100 Subject: [PATCH 1/5] Add last shipments to company card --- htdocs/comm/card.php | 70 ++++++++++++++++++++++++++++++++ htdocs/langs/en_US/sendings.lang | 1 + 2 files changed, 71 insertions(+) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3ea63caf256..14bf6e42fe8 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2015 Frederic 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 @@ -37,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; @@ -44,6 +46,7 @@ if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichin $langs->load("companies"); if (! empty($conf->contrat->enabled)) $langs->load("contracts"); if (! empty($conf->commande->enabled)) $langs->load("orders"); +if (! empty($conf->expedition->enabled)) $langs->load("sendings"); if (! empty($conf->facture->enabled)) $langs->load("bills"); if (! empty($conf->projet->enabled)) $langs->load("projects"); if (! empty($conf->ficheinter->enabled)) $langs->load("interventions"); @@ -661,6 +664,73 @@ if ($id > 0) } } + /* + * Last sendings + */ + if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) { + $sendingstatic = new Expedition($db); + + $sql = 'SELECT e.rowid as id'; + $sql.= ', e.ref'; + $sql.= ', e.date_creation'; + $sql.= ', e.fk_statut as statut'; + $sql.= ', s.nom'; + $sql.= ', s.rowid as socid'; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e"; + $sql.= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id; + $sql.= " AND e.entity = ".$conf->entity; + $sql.= ' GROUP BY e.rowid'; + $sql.= ', e.ref'; + $sql.= ', e.date_creation'; + $sql.= ', e.fk_statut'; + $sql.= ', s.nom'; + $sql.= ', s.rowid'; + $sql.= " ORDER BY e.date_creation DESC"; + + $resql = $db->query($sql); + if ($resql) { + $var = true; + $num = $db->num_rows($resql); + $i = 0; + if ($num > 0) { + print ''; + + $tableaushown=1; + print ''; + print ''; + print ''; + } + + while ($i < $num && $i < $MAXLIST) { + $objp = $db->fetch_object($resql); + $var = ! $var; + print ""; + print ''; + if ($objp->date_creation > 0) { + print ''; + } else { + print ''; + } + + print ''; + print "\n"; + $i++; + } + $db->free($resql); + + if ($num > 0) + print "
'; + print ''; + print '
'.$langs->trans("LastSendings",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSendings").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; + $sendingstatic->id = $objp->id; + $sendingstatic->ref = $objp->ref; + print $sendingstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->date_creation),'day').'!!!' . $sendingstatic->LibStatut($objp->statut, 5) . '
"; + } else { + dol_print_error($db); + } + } + /* * Last linked contracts */ diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index b1ff55f71c1..84088c3e023 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -2,6 +2,7 @@ RefSending=Ref. shipment Sending=Shipment Sendings=Shipments +AllSendings=All Shipments Shipment=Shipment Shipments=Shipments ShowSending=Show Sending From 50a3563f0320c9fcd46b4ea50cefb1646b71f897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 26 Mar 2015 10:57:13 +0100 Subject: [PATCH 2/5] Minor correction to the product list of a supplier --- htdocs/fourn/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 40d51c89b90..97004783ae6 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -351,7 +351,7 @@ if ($object->id > 0) print ''; print $productstatic->getNomUrl(1); print ''; - print ''; + print ''; print dol_trunc(dol_htmlentities($objp->label), 30); print ''; print ''.dol_print_date($objp->tms).''; From a39f81b1a627b779732b9e4f2a157c0e752cecff Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 26 Mar 2015 20:51:27 +0100 Subject: [PATCH 3/5] FIXED: Correct path of loan class --- htdocs/compta/bank/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 80fd211634e..c84909cb216 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/loan/class/loan.class.php'; +require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -611,7 +611,7 @@ if ($id > 0 || ! empty($ref)) } elseif ($links[$key]['type']=='payment_loan') { - print ''; + print ''; print ' '.img_object($langs->trans('ShowPayment'),'payment').' '; print ''; } From cb16e069dfc37285890b4423013d35358a19021d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2015 01:17:21 +0100 Subject: [PATCH 4/5] Better explanation --- htdocs/conf/conf.php.example | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 414b5c84ab7..c1a374ceec2 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -315,8 +315,10 @@ $dolibarr_main_db_prefix=''; // multicompany_transverse_mode // Prerequisite: Need external module "multicompany" -// Pyramidal (0): The rights and groups are managed in each entity. Each user belongs to the entity he was created into. -// Transversal (1): The user is created and managed only into master entity but can login to all entities. +// Pyramidal (0): The rights and groups are managed in each entity. Each user belongs to the entity he was created into. +// Transversal (1): The user is created and managed only into master entity but can login to all entities if he is admmin +// of entity or belongs to at least one user group created into entity. + // Default value: 0 (pyramidal) // Examples: // $multicompany_transverse_mode='1'; From f6df1d6380b9052f2ed940bf622fcdff5e562e05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Mar 2015 02:26:12 +0100 Subject: [PATCH 5/5] Update to match new issue tracker --- CONTRIBUTING.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef6dd3a834a..a872a4593ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,17 +40,30 @@ Please don't edit the ChangeLog file. A project manager will update it from your Use clear commit messages with the following structure:
-KEYWORD Short description
+KEYWORD Short description (may be the bug number #456)
 
 Long description (Can span accross multiple lines).
 
Where KEYWORD is one of: -- "FIXED:" for bug fixes. In upper case to appear into ChangeLog. (May be followed by the bug number i.e: #456) -- "NEW:" for new features. In upper case to appear into ChangeLog. (May be followed by the task number i.e: #123) +- "Fixed" for bug fixes (May be followed by the bug number i.e: #456) +- "Closed" for a commit to close a feature request issue (May be followed by the bug number i.e: #456) - void, don't put a keyword if the commit is not introducing feature or closing a bug. +### Pull Requests +When submitting a pull request, use following syntax: + +
+KEYWORD Short description (may be the bug number #456)
+
+ +Where KEYWORD is one of: + +- "FIXED" or "Fixed" for bug fixes. In upper case to appear into ChangeLog. (May be followed by the bug number i.e: #456) +- "NEW" or "New" for new features. In upper case to appear into ChangeLog. (May be followed by the task number i.e: #123) + + ### Resources [Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)