mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-12 17:55:28 -04:00
Fix some final bugs (#68)
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
{
|
||||
$(form).ajaxSubmit({
|
||||
beforeSerialize: function($form, options) {
|
||||
|
||||
$("select[disabled='disabled'").removeAttr("disabled");
|
||||
is_new && $('<input>').attr({
|
||||
id: 'definition_values',
|
||||
type: 'hidden',
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user