Fix some final bugs (#68)

This commit is contained in:
jekkos
2018-08-17 01:27:46 +02:00
committed by jekkos
parent 1a490cedf5
commit 8b212a8dd0
4 changed files with 7 additions and 12 deletions

View File

@@ -68,16 +68,10 @@ class Attributes extends Secure_Controller
$definition_data = array(
'definition_name' => $this->input->post('definition_name'),
'definition_flags' => $definition_flags,
'definition_type' => DEFINITION_TYPES[$this->input->post('definition_type')],
'definition_fk' => $this->input->post('definition_group') != '' ? $this->input->post('definition_group') : NULL
);
$definition_type = empty($this->input->post('definition_type')) ? NULL : $this->input->post('definition_type');
if ($definition_type)
{
$definition_data['definition_type'] = DEFINITION_TYPES[$definition_type];
}
$definition_name = $this->xss_clean($definition_data['definition_name']);
if($this->Attribute->save_definition($definition_data, $definition_id))

View File

@@ -160,6 +160,7 @@ class Attribute extends CI_Model
public function get_definition_names()
{
$this->db->from('attribute_definitions');
$this->db->where('deleted', 0);
$results = $this->db->get()->result_array();
$definition_name = array(-1 => $this->lang->line('common_none_selected_text'));

View File

@@ -147,7 +147,7 @@
{
$(form).ajaxSubmit({
beforeSerialize: function($form, options) {
$("select[disabled='disabled'").removeAttr("disabled");
is_new && $('<input>').attr({
id: 'definition_values',
type: 'hidden',

View File

@@ -45,7 +45,7 @@ foreach($definition_values as $definition_id => $definition_value)
echo form_input("attribute_links[$definition_id]", $value, "class='form-control' data-definition-id='$definition_id'");
}
?>
<span id="remove_attribute_link" class="input-group-addon input-sm btn btn-default"><span class="glyphicon glyphicon-trash"></span></span>
<span class="input-group-addon input-sm btn btn-default remove_attribute_btn"><span class="glyphicon glyphicon-trash"></span></span>
</div>
</div>
</div>
@@ -58,11 +58,11 @@ foreach($definition_values as $definition_id => $definition_value)
(function() {
<?php $this->load->view('partial/datepicker_locale'); ?>
$(".datetime").datetimepicker(pickerconfig);
$(".datetime").datetimepicker(pickerconfig());
var enable_delete = function() {
$("#remove_attribute_link").click(function() {
var parents = $(this).parents(".form-group").remove();
$(".remove_attribute_btn").click(function() {
$(this).parents(".form-group").remove();
});
};