Removed default types
This commit is contained in:
parent
848c4aad96
commit
f8b9fa560a
|
@ -422,8 +422,7 @@ CREATE TABLE `".$prefix."_bot_telegram` (
|
|||
PRIMARY KEY (`id`),
|
||||
KEY `Id` (`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `".$prefix."_dbversion` (`version`, `timestamp`) VALUES('1', current_timestamp());
|
||||
INSERT INTO `".$prefix."_type` (`id`, `name`) VALUES (NULL, 'type1'), (NULL, 'type2');"
|
||||
INSERT INTO `".$prefix."_dbversion` (`version`, `timestamp`) VALUES('1', current_timestamp());"
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
if(is_cli()) {
|
||||
|
|
|
@ -104,6 +104,9 @@
|
|||
{% for type in service.types %}
|
||||
<option value='{{ type.name }}'>{{ type.name }}</option>
|
||||
{% endfor %}
|
||||
{% if service.types is empty %}
|
||||
<option id="empty_option" value=''></option>
|
||||
{% endif %}
|
||||
<option value='add_new'>{{ 'Add type...'|t }}</option>
|
||||
</select>
|
||||
<br>
|
||||
|
@ -115,6 +118,7 @@
|
|||
</form>
|
||||
<script>
|
||||
$( ".types" ).change(function() {
|
||||
$('#empty_option').remove();
|
||||
var type = "";
|
||||
$( ".types option:selected" ).each(function() {
|
||||
type = $( this ).val();
|
||||
|
@ -155,7 +159,7 @@
|
|||
$( ".types option:selected" ).each(function() {
|
||||
type = $( this ).val();
|
||||
});
|
||||
if(type == "add_new"){
|
||||
if(type == "add_new" || type == ""){
|
||||
toastr.error("{{ 'You must select a valid service type!'|t }}");
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue