Commit 42c1d5e0 authored by Eric Windham's avatar Eric Windham

added personallty_identifiable to saves and updates

parent b12bed64
Pipeline #392 passed with stage
in 1 minute and 30 seconds
......@@ -15,7 +15,19 @@ final class NF_Database_FieldsController
*
* @var array
*/
private $update_fields = array( 'id' => '', 'key' => '', 'label' => '', 'type' => '', 'field_key' => '', 'field_label' => '', 'order' => '', 'default_value' => '', 'label_pos' => '', 'required' => '' );
private $update_fields = array(
'id' => '',
'key' => '',
'label' => '',
'type' => '',
'field_key' => '',
'field_label' => '',
'order' => '',
'default_value' => '',
'label_pos' => '',
'required' => '',
'personally_identifiable' => '',
);
private $update_field_meta = array();
private $update_field_meta_chunk = 0;
......@@ -33,6 +45,7 @@ final class NF_Database_FieldsController
'required',
'default_value',
'label_pos',
'personally_identifiable',
'parent_id',
);
......@@ -85,6 +98,7 @@ final class NF_Database_FieldsController
'order' => $field_data[ 'settings' ][ 'order' ],
'default_value' => $field_data[ 'settings' ][ 'default' ],
'label_pos' => $field_data[ 'settings' ][ 'label_pos' ],
'personally_identifiable' => absint( $field_data[ 'settings' ][ 'personally_identifiable' ] ),
);
/**
......@@ -262,7 +276,8 @@ final class NF_Database_FieldsController
empty( $this->update_fields[ 'order' ] ) ||
empty( $this->update_fields[ 'required' ] ) ||
empty( $this->update_fields[ 'default_value' ] ) ||
empty( $this->update_fields[ 'label_pos' ] )
empty( $this->update_fields[ 'label_pos' ] ) ||
empty( $this->update_fields[ 'personally_identifiable' ] )
) return "";
return "
......@@ -294,6 +309,9 @@ final class NF_Database_FieldsController
, `required` = CASE {$this->update_fields[ 'required' ]}
ELSE `required`
END
, `personally_identifiable` = CASE {$this->update_fields[ 'personally_identifiable' ]}
ELSE `personally_identifiable`
END
";
}
/*
......
......@@ -407,7 +407,7 @@ class NF_Updates_CacheCollateFields extends NF_Abstracts_RequiredUpdate
}
// Insert into the fields table.
$sql = "INSERT INTO `{$this->table}` ( `id`, label, `key`, `type`, parent_id, field_label, field_key, `order`, required, default_value, label_pos ) VALUES ( " .
$sql = "INSERT INTO `{$this->table}` ( `id`, label, `key`, `type`, parent_id, field_label, field_key, `order`, required, default_value, label_pos, personally_identifiable ) VALUES ( " .
$maybe_field_id . ", '" .
$this->prepare( $settings[ 'label' ] ) . "', '".
$this->prepare( $settings[ 'key' ] ) . "', '" .
......@@ -418,7 +418,8 @@ class NF_Updates_CacheCollateFields extends NF_Abstracts_RequiredUpdate
intval( $settings[ 'order' ] ) . ", " .
intval( $settings[ 'required' ] ) . ", '" .
$this->prepare( $settings[ 'default_value' ] ) . "', '" .
$this->prepare( $settings[ 'label_pos' ] ) . "' )";
$this->prepare( $settings[ 'label_pos' ] ) . "', " .
intval( $settings[ 'personally_identifiable' ] ) . " )";
$this->query( $sql );
......@@ -602,7 +603,8 @@ class NF_Updates_CacheCollateFields extends NF_Abstracts_RequiredUpdate
. ", required = " . intval( $settings[ 'required' ] )
. ", default_value = '" . $this->prepare( $settings[ 'default_value' ] )
. "', label_pos = '" . $this->prepare( $settings[ 'label_pos' ] )
. "' WHERE id = " . intval( $updating );
. "', personally_identifiable = " . intval( $settings[ 'personally_identifiable' ] )
. " WHERE id = " . intval( $updating );
$this->query( $sql );
// For each meta of the field...
foreach ( $settings as $meta => $value ) {
......
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