Commit 3f33a775 authored by Théo GUILLON's avatar Théo GUILLON
Browse files

Correction : enregistrement valeur

parent c51e4c97
......@@ -106,6 +106,7 @@ ALTER TABLE fiches
DROP CONSTRAINT fiches_form_id_fkey,
ADD CONSTRAINT fiches_form_id_fkey FOREIGN KEY (form_id) REFERENCES formulaires (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE fiches ADD COLUMN soustraitance NOT NULL BOOLEAN DEFAULT FALSE;
ALTER TABLE fiches ADD COLUMN obligation_pia BOOL DEFAULT NULL;
ALTER TABLE fiches ADD COLUMN realisation_pia BOOL DEFAULT NULL;
ALTER TABLE fiches ADD COLUMN depot_pia BOOL DEFAULT NULL;
......
......@@ -473,6 +473,8 @@ class FormulairesController extends AppController {
$success = true;
$this->Formulaire->begin();
// debug($this->request->data);die;
$data = $this->request->data;
unset($data['Fiche']);
......@@ -580,20 +582,14 @@ class FormulairesController extends AppController {
}
break;
// case 'conditions':
// debug($val);
//
case 'conditions':
$sortie[$clef] = $val;
// $conditions = (array)json_decode($val);
// debug($conditions);
// foreach ($conditions as $key => $condition) {
// debug($condition);
//
// $conditionValues = (array)json_decode($condition);
// debug($conditionValues);
// foreach ($conditions as $key => $condition) {
// $sortie[$clef][$key] = $condition;
// }
// die;
//
// break;
break;
default:
$sortie[$clef] = $val;
......
......@@ -35,17 +35,19 @@ foreach ($champs as $key => $value) {
switch ($value['Champ']['type']) {
// Petit champ texte
case 'input':
echo '<div class="draggable form-group col-md-6 small-text" style="top:' . $line . 'px; ' . $colonne . '" data-virtual-required="'.$champObligatoire.'" virtual-data-repeat="'.$fieldRepeat.'">'
echo '<div class="draggable form-group col-md-6 small-text" style="top: '.$line.'px; '.$colonne.'" '
.'data-virtual-required="'.$champObligatoire.'" virtual-data-repeat="'.$fieldRepeat.'" '
.'data-virtual-conditions="'.$details['conditions'].'">'
. '<div class="col-md-4">'
. '<label>'
. '<span class="labeler">' . $details['label'] . '</span>'
. ($details['obligatoire'] ? '<span class="obligatoire"> *</span>' : '')
. '</label>'
. '<label>'
. '<span class="labeler">' . $details['label'] . '</span>'
. ($details['obligatoire'] ? '<span class="obligatoire"> *</span>' : '')
. '</label>'
. '</div>'
. '<div class="col-md-8">'
. '<input type="text" value="'.$details['default'].'" name="' . $details['name'] . '" checked="' . $details['obligatoire'] . '" placeholder="' . $details['placeholder'] . '" class="form-control champNomVariableReadonly"/>'
. '<input type="text" value="'.$details['default'].'" name="' . $details['name'] . '" checked="' . $details['obligatoire'] . '" placeholder="' . $details['placeholder'] . '" class="form-control champNomVariableReadonly"/>'
. '</div>'
. '</div>';
. '</div>';
break;
// Grand champ texte
......
......@@ -443,6 +443,7 @@ var createForm = function(typeCreateForm) {
if (object.is('.small-text, .long-text, .date, .checkboxes, .radios, .deroulant, .multi-select')) {
// Ecriture des conditions dans les options du champs
conditions = $(idContainer).find('.ui-selected').attr('data-virtual-conditions');
console.log(conditions);
if (conditions) {
displayConditions = writeConditionsInOption(conditions);
}
......
......@@ -99,7 +99,7 @@ $(document).ready(function () {
objFieldDetails['label'] = $(draggable).find('.labeler').html();
options = [];
$(draggable).find('input').each(function () {
$(draggable).find('input[type="checkbox"]').each(function () {
options.push($(this).attr('value'));
});
objFieldDetails['options'] = options;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment