diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index 9838b3ed7e2..c2edbf940be 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -117,7 +117,7 @@ class ActionsContactCardCommon
if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
// State
- if ($this->object->fk_pays) $this->tpl['select_state'] = $formcompany->select_state($this->object->departement_id,$this->object->pays_code);
+ if ($this->object->fk_pays) $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement,$this->object->pays_code);
else $this->tpl['select_state'] = $countrynotdefined;
// Public or private
@@ -240,6 +240,7 @@ class ActionsContactCardCommon
$this->object->jabberid = $_POST["jabberid"];
$this->object->priv = $_POST["priv"];
$this->object->note = $_POST["note"];
+ $this->object->canvas = $_POST["canvas"];
// We set pays_id, and pays_code label of the chosen country
diff --git a/htdocs/contact/canvas/default/dao_contact_default.class.php b/htdocs/contact/canvas/default/dao_contact_default.class.php
index 85aaf4e3bf9..b438af0eb29 100644
--- a/htdocs/contact/canvas/default/dao_contact_default.class.php
+++ b/htdocs/contact/canvas/default/dao_contact_default.class.php
@@ -87,9 +87,9 @@ class DaoContactDefault extends Contact
* Delete third party in database
* @param id id de la societe a supprimer
*/
- function delete($id)
+ function delete()
{
- $result = parent::delete($id);
+ $result = parent::delete();
return $result;
}
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index d203271575e..a588596cf9e 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -104,7 +104,7 @@ class Contact extends CommonObject
$this->name=trim($this->name);
if (! $this->socid) $this->socid = 0;
if (! $this->priv) $this->priv = 0;
- if (! $this->canvas) $this->canvas = 'default@contact';
+ if (! $this->canvas) $this->canvas = 'default';
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user_creat, priv, canvas)";
$sql.= " VALUES ('".$this->db->idate($now)."',";
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index 76bbc228b01..53c8503cc59 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -54,7 +54,7 @@ if (! empty($canvas))
require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php");
$objcanvas = new Canvas($db);
- $objcanvas->getCanvas('thirdparty','contactcard',$canvas);
+ $objcanvas->getCanvas('contact','contactcard',$canvas);
// Security check
$result = $objcanvas->restrictedArea($user, 'contact', $id, 'socpeople');
diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php
index 6ac06991d55..ab2d412e342 100644
--- a/htdocs/core/class/canvas.class.php
+++ b/htdocs/core/class/canvas.class.php
@@ -111,23 +111,21 @@ class Canvas
$error='';
$this->card = $card;
$this->canvas = $canvas;
- $childmodule = $this->aliasmodule = $this->module = $module;
- $targetmodule = $this->aliastargetmodule = $this->targetmodule = $module;
+ $childmodule = $this->aliasmodule = $module;
+ $targetmodule = $this->targetmodule = $module;
if (preg_match('/^([^@]+)@([^@]+)$/i',$canvas,$regs))
{
- $childmodule = $this->aliasmodule = $this->module = $regs[2];
+ $childmodule = $this->aliasmodule = $regs[2];
$this->canvas = $regs[1];
}
// For compatibility
- if ($childmodule == 'thirdparty') $childmodule = $this->aliasmodule = 'societe';
- if ($targetmodule == 'thirdparty') $targetmodule = 'societe';
- if ($childmodule == 'contact')
- {
- $childmodule = 'societe';
- $this->targetmodule = 'contact';
- }
+ if ($childmodule == 'thirdparty') { $childmodule = $this->aliasmodule = 'societe'; }
+ if ($targetmodule == 'thirdparty') { $targetmodule = 'societe'; }
+ if ($childmodule == 'contact') { $childmodule = 'societe'; }
+ if ($targetmodule == 'contact') { $targetmodule = 'societe'; }
+
//print 'childmodule='.$childmodule.' targetmodule='.$targetmodule.'
';
//print 'this->aliasmodule='.$this->aliasmodule.' this->targetmodule='.$this->targetmodule.'
';
diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql
index b6dec476627..b009a9644ec 100644
--- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql
+++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql
@@ -97,6 +97,7 @@ ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_county (fk_county);
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid);
ALTER TABLE llx_socpeople ADD COLUMN canvas varchar(32) DEFAULT 'default' after default_lang;
+ALTER TABLE llx_socpeople MODIFY canvas varchar(32) DEFAULT 'default';
UPDATE llx_socpeople SET canvas = 'default' WHERE canvas = 'default@contact';
UPDATE llx_societe SET canvas = 'default' WHERE canvas = 'default@thirdparty';
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index 57eeaa6224a..3ab6165c927 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -77,6 +77,6 @@ create table llx_societe
gencod varchar(255), -- barcode
price_level integer NULL, -- level of price for multiprices
default_lang varchar(6), -- default language
- canvas varchar(32) DEFAULT 'default@thirdparty', -- type of canvas
+ canvas varchar(32) DEFAULT 'default', -- type of canvas
import_key varchar(14) -- import key
)type=innodb;
diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql
index f8fbd0ec9a9..eb39de0ce6d 100644
--- a/htdocs/install/mysql/tables/llx_socpeople.sql
+++ b/htdocs/install/mysql/tables/llx_socpeople.sql
@@ -48,6 +48,6 @@ create table llx_socpeople
fk_user_modif integer,
note text,
default_lang varchar(6),
- canvas varchar(32) DEFAULT 'default@contact', -- type of canvas
+ canvas varchar(32) DEFAULT 'default', -- type of canvas
import_key varchar(14)
)type=innodb;
diff --git a/htdocs/societe/canvas/default/tpl/card_create.tpl.php b/htdocs/societe/canvas/default/tpl/card_create.tpl.php
index 91d156bd59d..bbc33ed39ca 100644
--- a/htdocs/societe/canvas/default/tpl/card_create.tpl.php
+++ b/htdocs/societe/canvas/default/tpl/card_create.tpl.php
@@ -26,13 +26,13 @@
jQuery(document).ready(function () {
jQuery("#radiocompany").click(function() {
document.formsoc.action.value="create";
- document.formsoc.canvas.value="default@societe";
+ document.formsoc.canvas.value="default";
document.formsoc.private.value=0;
document.formsoc.submit();
});
jQuery("#radioprivate").click(function() {
document.formsoc.action.value="create";
- document.formsoc.canvas.value="individual@societe";
+ document.formsoc.canvas.value="individual";
document.formsoc.private.value=1;
document.formsoc.submit();
});
diff --git a/htdocs/societe/canvas/default/tpl/card_view.tpl.php b/htdocs/societe/canvas/default/tpl/card_view.tpl.php
index d9e7d3ccb34..f27e665f712 100644
--- a/htdocs/societe/canvas/default/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/default/tpl/card_view.tpl.php
@@ -247,7 +247,7 @@ function CheckVAT(a) {
rights->societe->contact->creer) { ?>
-trans("AddContact"); ?>
+trans("AddContact"); ?>
rights->societe->supprimer) { ?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
index e4562e5d08e..a6db140a9b6 100644
--- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php
@@ -26,13 +26,13 @@
jQuery(document).ready(function () {
jQuery("#radiocompany").click(function() {
document.formsoc.action.value="create";
- document.formsoc.canvas.value="default@societe";
+ document.formsoc.canvas.value="default";
document.formsoc.private.value=0;
document.formsoc.submit();
});
jQuery("#radioprivate").click(function() {
document.formsoc.action.value="create";
- document.formsoc.canvas.value="individual@societe";
+ document.formsoc.canvas.value="individual";
document.formsoc.private.value=1;
document.formsoc.submit();
});