';
-
- /*
- * Ajouter une ligne de contact
- * Non affiche en mode modification de ligne
- */
- if ($action != 'editline' && $user->rights->propale->creer)
- {
- print '
';
}
}
}
-$db->close();
+
llxFooter();
+$db->close();
?>
diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php
index 1c573e7c294..3a363b41997 100644
--- a/htdocs/core/ajax/extraparams.php
+++ b/htdocs/core/ajax/extraparams.php
@@ -61,12 +61,14 @@ if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type))
dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php');
- $classname = ucfirst($subelement);
- $object = new $classname($db);
- $object->id = $id;
+ $classname = ucfirst($subelement);
+ $object = new $classname($db);
+ $object->fetch($id);
$params[$htmlelement] = array($type => $value);
- $result=$object->setExtraParameters($params);
+ $object->extraparams = array_merge($object->extraparams, $params);
+
+ $result=$object->setExtraParameters();
}
?>
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index c89fe9aba22..c6c1fdfa79b 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2131,13 +2131,11 @@ abstract class CommonObject
/**
* Set extra parameters
*
- * @param array $params Extra parameters
+ * @return void
*/
- function setExtraParameters($params)
+ function setExtraParameters()
{
$this->db->begin();
-
- $this->extraparams = array_merge($this->extraparams, (array) $params);
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql.= ' SET extraparams = "'.$this->db->escape(dol_json_encode($this->extraparams)).'"';
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index 9b86b373925..3ef03979045 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2005-2010 Regis Houssin
+ * 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
@@ -62,11 +62,14 @@ function propal_prepare_head($object)
$head[$h][2] = 'preview';
$h++;
}
-
- $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id;
- $head[$h][1] = $langs->trans('ContactsAddresses');
- $head[$h][2] = 'contact';
- $h++;
+
+ if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
+ {
+ $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id;
+ $head[$h][1] = $langs->trans('ContactsAddresses');
+ $head[$h][2] = 'contact';
+ $h++;
+ }
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php
new file mode 100644
index 00000000000..ff902336521
--- /dev/null
+++ b/htdocs/core/tpl/bloc_showhide.tpl.php
@@ -0,0 +1,62 @@
+
+ *
+ * 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, see .
+ *
+ */
+
+// Hide by default
+$hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
new file mode 100644
index 00000000000..16a3e1a40d7
--- /dev/null
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -0,0 +1,168 @@
+
+ *
+ * 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, see .
+ *
+ */
+
+$module = $object->element;
+if ($module == 'propal') $module = 'propale';
+else if ($module == 'fichinter') { $module = 'ficheinter'; }
+
+$companystatic=new Societe($db);
+$contactstatic=new Contact($db);
+$userstatic=new User($db);
+
+?>
+
+
+