get('net15.form.forge.reasons.manager')->getByPublicKey($request->request->get('reason')); $type = $request->request->get('customFieldType'); $order = 1; $label = $request->request->get('customFieldName');; $locale = $request->getLocale(); $required = $request->get('customFieldRequire'); $formForgeField = $this->get('net15.form.forge.fields.manager')->create($reason, $label,$locale, $type, $required, $order); $formForgeField->getValues(); $this->get('net15.form.forge.reasons.manager')->addFormForgeField($reason, $formForgeField); return $this->render('@FormForge/FormForgeField/create.html.twig',array( 'customField' => $formForgeField, 'lang' => $locale )) ; } /** * @param string $publicKey * @param Request $request * @return Response */ public function editAction(string $publicKey, Request $request) { $field = $this->get('net15.form.forge.fields.manager')->getByPublicKey($publicKey); $locale = $request->getLocale(); return $this->render('@FormForge/FormForgeField/form.field.html.twig',array( 'customField' => $field, 'lang' => $locale )); } /** * @param Request $request * @return Response */ public function updateAction(Request $request){ $publicKey = $request->request->get('publicKey'); $type = $request->request->get('customFieldType'); $label = $request->request->get('customFieldName'); $locale = $request->getLocale(); $field = $this->get('net15.form.forge.fields.manager')->updateFormForgeField($publicKey, $label, $locale, $type); return $this->render('@FormForge/FormForgeField/create.html.twig',array( 'customField' => $field, 'lang' => $locale )) ; } public function deleteFieldAction(Request $request){ $formFieldDeleted = $this->get('net15.form.forge.fields.manager')->deleteField($request->get('formFieldPK')); return $this->render('@FormForge/FormForgeField/create.html.twig',array( 'customField' => $formFieldDeleted, 'lang' => $request->getLocale() )) ; } /** * @param Request $request * @return Response */ public function addValueAction(Request $request){ $publicKey = $request->request->get('publicKey'); $value = $request->request->get('customFieldValue'); $locale = $request->getLocale(); $formForgeField= $this->get('net15.form.forge.fields.manager')->addCustomFiedValue($publicKey,$value,$locale); return $this->render('@FormForge/FormForgeField/form.field.value.html.twig',array( 'customField' => $formForgeField, 'lang' => $locale )); } /** * @param Request $request * @return Response */ public function editValueAction(Request $request){ $customFieldValue = $this->get('net15.form.forge.fields.manager')->getCustomFieldValueByPublicKey($request->get('customFieldValuePK')); $locale = $request->getLocale(); return $this->render('@FormForge/FormForgeField/edit.field.value.html.twig',array( 'customFieldValue' => $customFieldValue, 'lang' => $locale )); } /** * @param Request $request * @return Response */ public function updateValueAction(Request $request) { $locale = $request->getLocale(); $publicKey = $request->request->get('customFieldValuePK'); $label = $request->request->get('customFieldValuelabel'); $formForgeField= $this->get('net15.form.forge.fields.manager')->updateCustomFieldValue($publicKey, $label, $locale); return $this->render('@FormForge/FormForgeField/form.field.value.html.twig',array( 'customField' => $formForgeField, 'lang' => $locale )); } /** * @param Request $request * @return Response */ public function removeValueAction(Request $request) { $locale = $request->getLocale(); $publicKey = $request->request->get('customFieldValue'); $formForgeField= $this->get('net15.form.forge.fields.manager')->removeCustomFieldValue($publicKey); return $this->render('@FormForge/FormForgeField/form.field.value.html.twig',array( 'customField' => $formForgeField, 'lang' => $locale )); } }