-- adding scheduler permissions set
INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XSCHJEN','enable_scheduler','PADMSCH','enableSchedulerJob','','administration/scheduler','administration','Enable scheduler row','EXE','',1,false,false,NULL),
	 ('XSCHJDS','disable_scheduler','PADMSCH','disableSchedulerJob','','administration/scheduler','administration','Disable scheduler row','EXE','',1,false,false,NULL),
	 ('XADMSLS','get_scheduler_list','PADMSCH','getSchedulerList','','administration/scheduler','administration','Get scheduler list','EXE','',1,false,false,NULL),
	 ('BSCHNEW','administration_scheduler_new_row','PADMSCH','','','administration/scheduler','administration','New scheduler row button','BUT','fas fa-plus-square',1,false,false,NULL),
	 ('BSCHSAV','administration_scheduler_save','PADMSCH','','','administration/scheduler','administration','Scheduler save button','BUT','fas fa-save',1,false,false,NULL),
	 ('BSCHENA','administration_scheduler_enable','PADMSCH','','','administration/shceduler','administration','Button to enable scheduler','BUT','fas fa-toggle-on',1,false,false,NULL),
	 ('XSCHNEW','add_new_scheduler','PADMSCH','addSchedulerJob','','administration/scheduler','administration','Add scheduler row','EXE','',1,false,false,NULL),
	 ('XSCHDEL','delete_scheduler','PADMSCH','delSchedulerJob','','administration/scheduler','administration','Delete scheduler row','EXE','',1,false,false,NULL),
	 ('BSCHDIS','administration_scheduler_disable','PADMSCH','','','administration/scheduler','administration','Button to disable scheduler','BUT','fas fa-toggle-off',1,false,false,NULL),
	('XMSCSCJ','misc_get_scheduler_jobs','SADMMSC','getSchedulerJobs',NULL,'administration/scheduler','administration','Get installed scheduler jobs for all modules.','EXE',NULL,1,false,false,NULL),
	 ('PADMSCH','administration_scheduler','MADM','getObjects','','administration/scheduler','administration','Permission to access scheduler page','PAG','fas fa-tasks',1,false,false,NULL);


INSERT INTO public.core_assets (asset_type,asset_name,description,custom,asset_innerhtml,asset_parameters,asset_code,before_trigger,after_trigger,failure_rollback,exec_order,meta) VALUES
	 ('form','administration_scheduler_new_job_form','Form to add and edit scheduler jobs',false,'<form id="administration_scheduler_new_job_form"  autocomplete="off">
	
	<div class="row">
	
		<div class="form-group col-md-3">
            <label for="module">{form_new_scheduler_job_module}</label>
            <select id="module" class="form-control" name="module" data-list="/api/v1/misc/moduleslist" onchange="selectJobs(this)"></select>
        </div>
        
		<div class="form-group col-md-3">
            <label for="script">{form_new_scheduler_job_script}</label>
            <select id="script" class="form-control" name="script"></select>
        </div>
        
		<div class="form-group col-md-6">
			<label for="arguments">{form_new_scheduler_job_arguments}</label>
			<input type="text" class="form-control" id="arguments" name="arguments">
		</div>

	</div>
	<div class="row">
		<div class="form-group col-md-3">
			<label for="minutes">{form_new_scheduler_job_minutes}</label>
			<input type="text" class="form-control" id="minutes" name="minutes">
		</div>
		
		<div class="form-group col-md-3">
			<label for="hours">{form_new_scheduler_job_hours}</label>
			<input type="text" class="form-control" id="hours" name="hours">
		</div>

		<div class="form-group col-md-2">
			<label for="daymonth">{form_new_scheduler_job_daymonth}</label>
			<input type="text" class="form-control" id="daymonth" name="daymonth">
		</div>
		
		<div class="form-group col-md-2">
			<label for="months">{form_new_scheduler_job_months}</label>
			<input type="text" class="form-control" id="months" name="months">
		</div>
		
		<div class="form-group col-md-2">
			<label for="dayweek">{form_new_scheduler_job_dayweek}</label>
			<input type="text" class="form-control" id="dayweek" name="dayweek">
		</div>

	</div>
        
</form>','{}',NULL,NULL,NULL,NULL,NULL,NULL);