diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index d3ba746ff1b..51eb547e123 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -662,7 +662,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
$facture->remise_absolue = $_POST['remise_absolue'];
$facture->remise_percent = $_POST['remise_percent'];
- // If creation from proposal
+ // If creation from other modules
if ($_POST['origin'] && $_POST['originid'])
{
// Parse element/subelement (ex: project_task)
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index 846f8fb53b4..1cee222732c 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -1329,6 +1329,27 @@ else
print "";
print '
';
}
+
+ /*
+ * Linked object block
+ */
+ $contrat->load_object_linked($contrat->id,$contrat->element);
+
+ if (! empty($contrat->linked_object))
+ {
+ print '
| ';
+
+ foreach($contrat->linked_object as $object => $objectid)
+ {
+ if($conf->$object->enabled && $object != $contrat->element)
+ {
+ $somethingshown=$contrat->showLinkedObjectBlock($object,$objectid,$somethingshown);
+ }
+ }
+
+ print ' | ';
+ print ' |
';
+ }
}
}
diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
new file mode 100644
index 00000000000..30cdf91d194
--- /dev/null
+++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
@@ -0,0 +1,60 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ */
+?>
+
+
+
+'; }
+print_titre($langs->trans('RelatedContract'));
+?>
+
+
+
\ No newline at end of file
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7b5afc2d400..d2d8f354663 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1029,8 +1029,8 @@ class CommonObject
// TODO uniformiser emplacement classe
$classpath = $object.'/class';
$tplpath = $object;
- if ($object == 'facture') $tplpath = $classpath = 'compta/'.$object;
- if ($object == 'propal') $tplpath = $classpath = 'comm/'.$object;
+ if ($object == 'facture') $tplpath = 'compta/'.$object; $classpath = $tplpath.'/class';
+ if ($object == 'propal') $tplpath = 'comm/'.$object; $classpath = $tplpath.'/class';
$classname = ucfirst($object);
if(!class_exists($classname)) require(DOL_DOCUMENT_ROOT."/".$classpath."/".$object.".class.php");