|
|
|
@ -1285,6 +1285,25 @@ EOT; |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param string $name |
|
|
|
|
* @param string $label |
|
|
|
|
* @param array $attributes |
|
|
|
|
* @param bool $required |
|
|
|
|
* |
|
|
|
|
* @return HTML_QuickForm_element |
|
|
|
|
*/ |
|
|
|
|
public function addNumeric($name, $label, $attributes = [], $required = false) |
|
|
|
|
{ |
|
|
|
|
$element = $this->addElement('Number', $name, $label, $attributes); |
|
|
|
|
|
|
|
|
|
if ($required) { |
|
|
|
|
$this->addRule($name, get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $element; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Adds a text field for alphanumeric characters to the form. |
|
|
|
|
* A trim-filter is attached to the field. |
|
|
|
@ -1639,32 +1658,32 @@ EOT; |
|
|
|
|
); |
|
|
|
|
$this->addHtml('</div>'); |
|
|
|
|
|
|
|
|
|
$this->addHtml("<script> |
|
|
|
|
$this->addHtml("<script> |
|
|
|
|
$(function() { |
|
|
|
|
var defaultValue = '$defaultId'; |
|
|
|
|
$('#$typeNoDots').val(defaultValue); |
|
|
|
|
$('#$typeNoDots').selectpicker('render'); |
|
|
|
|
if (defaultValue != '') { |
|
|
|
|
var selected = $('#$typeNoDots option:selected').val(); |
|
|
|
|
$.ajax({ |
|
|
|
|
var selected = $('#$typeNoDots option:selected').val(); |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '$url' + '&id=' + selected+ '&template_name=$type', |
|
|
|
|
success: function (data) { |
|
|
|
|
$('#$templateNoDots').html(data); |
|
|
|
|
$('#$templateNoDotsBlock').show(); |
|
|
|
|
return; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$('#$typeNoDots').on('change', function(){ |
|
|
|
|
var selected = $('#$typeNoDots option:selected').val(); |
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
|
|
$('#$typeNoDots').on('change', function(){ |
|
|
|
|
var selected = $('#$typeNoDots option:selected').val(); |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '$url' + '&id=' + selected, |
|
|
|
|
success: function (data) { |
|
|
|
|
$('#$templateNoDots').html(data); |
|
|
|
|
$('#$templateNoDotsBlock').show(); |
|
|
|
|
return; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
@ -1714,8 +1733,8 @@ EOT; |
|
|
|
|
data.submit().always(function () { |
|
|
|
|
\$this.remove(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#".$inputName."').fileupload({ |
|
|
|
|
url: url, |
|
|
|
|
dataType: 'json', |
|
|
|
@ -1726,11 +1745,11 @@ EOT; |
|
|
|
|
previewMaxWidth: 300, |
|
|
|
|
previewMaxHeight: 169, |
|
|
|
|
previewCrop: true, |
|
|
|
|
dropzone: $('#dropzone'), |
|
|
|
|
}).on('fileuploadadd', function (e, data) { |
|
|
|
|
dropzone: $('#dropzone'), |
|
|
|
|
}).on('fileuploadadd', function (e, data) { |
|
|
|
|
data.context = $('<div class=\"row\" />').appendTo('#files'); |
|
|
|
|
$.each(data.files, function (index, file) { |
|
|
|
|
var node = $('<div class=\"col-sm-5 file_name\">').text(file.name); |
|
|
|
|
var node = $('<div class=\"col-sm-5 file_name\">').text(file.name); |
|
|
|
|
node.appendTo(data.context); |
|
|
|
|
}); |
|
|
|
|
}).on('fileuploadprocessalways', function (e, data) { |
|
|
|
@ -1780,8 +1799,8 @@ EOT; |
|
|
|
|
$('<span class=\"message-image-success\"/>').text('".addslashes(get_lang('UplUploadSucceeded'))."') |
|
|
|
|
); |
|
|
|
|
$(data.context.children()[index]).parent().append(message); |
|
|
|
|
}); |
|
|
|
|
$('#dropzone').removeClass('hover'); |
|
|
|
|
}); |
|
|
|
|
$('#dropzone').removeClass('hover'); |
|
|
|
|
".$redirectCondition." |
|
|
|
|
}).on('fileuploadfail', function (e, data) { |
|
|
|
|
$.each(data.files, function (index) { |
|
|
|
@ -1792,14 +1811,14 @@ EOT; |
|
|
|
|
$(data.context.children()[index]).parent().append(error); |
|
|
|
|
}); |
|
|
|
|
$('#dropzone').removeClass('hover'); |
|
|
|
|
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled'); |
|
|
|
|
|
|
|
|
|
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled'); |
|
|
|
|
|
|
|
|
|
$('#dropzone').on('dragover', function (e) { |
|
|
|
|
// dragleave callback implementation |
|
|
|
|
// dragleave callback implementation |
|
|
|
|
$('#dropzone').addClass('hover'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#dropzone').on('dragleave', function (e) { |
|
|
|
|
|
|
|
|
|
$('#dropzone').on('dragleave', function (e) { |
|
|
|
|
$('#dropzone').removeClass('hover'); |
|
|
|
|
}); |
|
|
|
|
$('.fileinput-button').hide(); |
|
|
|
|