diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue
index d56fe3c48..027b79965 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue
@@ -18,7 +18,8 @@
@close="modal.showModal = false">
- {{ $t(titleModal) }}
+ {{ $t(titleModal, {q: parent.text}) }}
+ {{ $t(titleModal) }}
@@ -44,7 +45,7 @@
:parent="parent"
:action="action"
type="thirdparty"
- ref="castNew">
+ ref="castThirdparty">
@@ -160,8 +161,8 @@ export default {
},
methods: {
openModal() {
- console.log('## OPEN ON THE FLY MODAL');
- console.log('## type:', this.type, ', action:', this.action);
+ // console.log('## OPEN ON THE FLY MODAL');
+ // console.log('## type:', this.type, ', action:', this.action);
this.modal.showModal = true;
this.$nextTick(function() {
//this.$refs.search.focus();
@@ -171,7 +172,7 @@ export default {
this.$data.action = action;
},
saveAction() {
- console.log('saveAction button: create/edit action with', this.type);
+ // console.log('saveAction button: create/edit action with', this.type);
let
type = this.type,
data = {} ;
@@ -186,14 +187,20 @@ export default {
break;
default:
- if (typeof this.type === 'undefined') { // action=create
- type = this.$refs.castNew.radioType;
- data = this.$refs.castNew.castDataByType();
+ if (typeof this.type === 'undefined') { // action=create or addContact
+ if (this.action === 'addContact') {
+ type = 'thirdparty'
+ data = this.$refs.castThirdparty.$data.thirdparty;
+ // console.log(data)
+ } else {
+ type = this.$refs.castNew.radioType;
+ data = this.$refs.castNew.castDataByType();
+ }
} else {
throw 'error with object type';
}
}
-
+ console.log('type', type, 'data', data)
// pass datas to parent
this.$emit('saveFormOnTheFly', { type: type, data: data });
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js
index 2400f8e80..00ab79845 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js
@@ -18,7 +18,7 @@ const ontheflyMessages = {
thirdparty: "un nouveau tiers professionnel"
},
addContact: {
- title: "Créer un contact pour ..."
+ title: "Créer un contact pour {q}"
}
}
}
diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
index 7c3e9f60a..97d18ae62 100644
--- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
+++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
@@ -126,14 +126,14 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
* @var Civility
* @ORM\ManyToOne(targetEntity=Civility::class)
* ORM\JoinColumn(name="civility", referencedColumnName="id", nullable=true)
- * @Groups({"docgen:read", "read", "docgen:read:3party:parent"})
+ * @Groups({"docgen:read", "read", "write", "docgen:read:3party:parent"})
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
private ?Civility $civility = null;
/**
* @ORM\Column(name="comment", type="text", nullable=true)
- * @Groups({"read"})
+ * @Groups({"read", "write"})
*/
private ?string $comment = null;
@@ -199,7 +199,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
*
* @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
- * @Groups({"read", "docgen:read"})
+ * @Groups({"read", "write", "docgen:read"})
* @Context(normalizationContext={"groups": "docgen:read:3party:parent"}, groups={"docgen:read"})
*/
private ?ThirdParty $parent = null;
diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue
index 789eaa5cf..75fdffb7c 100644
--- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue
+++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue
@@ -66,20 +66,27 @@
}">
-