Iniit
Этот коммит содержится в:
+402
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+13
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+48
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+900
@@ -0,0 +1,900 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class AppBuilder extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.installedappid = 0;
|
||||
this.parameters = "";
|
||||
this.recordid = 0;
|
||||
this.appmanager = Apps.Managers.AppManager.Instance();
|
||||
this.reportmanager = Unibase.Platform.Analytics.Managers.ReportManager.Instance();
|
||||
this.permissionmanager = Unibase.Platform.Permissions.Managers.PermissionManager.Instance();
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
init(containerid) {
|
||||
this.Dependentapp(containerid);
|
||||
}
|
||||
jsFiles() {
|
||||
return ["bundle/index.appbuilder.js"];
|
||||
}
|
||||
html(id, containerid) {
|
||||
return `<form id="frmUnibase_CreateApp" data-validate="parsley" data-isdynamic="false"><div class="card bg-light"><div class="b-b bg-white card-header header"><strong class="text-dark title" id="lbl_title">Create App</strong></div>
|
||||
<div data-simplebar class="card-body simple-scroll-bar scrollable" id="divCreateApp"><div id="div_appmessage"></div><div class="bg-white card"><div id="unibase_ValidationSummary" class="clear"></div><div class="card-body">
|
||||
<div class="row"><div class="col-sm-6"><div class="floating-label-form-group"><label for="txt_FriendlyName" class="font-bold">App Title<span class="text-danger"> *</span></label><input type="text" id="txt_FriendlyName" class="form-control floating-label-control required" data-isdynamic="false" placeholder="App Title *" data-placeholder="Enter App Title" data-label="App Title *" autocomplete="off"/></div></div>
|
||||
<div class="col-sm-6"><div class="floating-label-form-group div_IconGroupName" id="div_IconMargin"><label for="txt_IconName" class="font-bold">Icon Name<span class="text-danger"> *</span></label><input type="text" id="txt_IconName" class="form-control floating-label-control required tokenable" data-isdynamic="false" placeholder="Icon Name *" data-placeholder="Enter Icon Name" data-label="Icon Name *" autocomplete="off"><input type='hidden' id='txtfafaIcon'/><div class='div_GroupIcon'></div></div></div></div>
|
||||
<div class='col-sm-12 hidden div_Icons' id='icons'><div id='appicons' class='panel panel-default'>
|
||||
<ul class='list-group no-radius m-b-none list-group-item no-border icon-list'></ul></div></div>
|
||||
<div class="row"><div class="col-sm-6"><div class="input-group"><label for="companyname" class="font-bold">Company Name<span class="text-danger">*</span></label><select id="txtAutoComplete_Company" class="form-control text-control required" style="width:100%;" placeholder = "Company Name" data-placeholder="Company Name" data-label="" data-istagselect="true" onchange="Unibase.Platform.Apps.Components.AppBuilder.Instance().Company();" ></select>
|
||||
<input type="hidden" id="hfAutoComplete_Company" class="hfAutoCompleteId_Company' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
<div class="col-sm-6"><div class="input-group"><label for="" class="font-bold">Module Type <span class="text-danger">*</span></label><select id="txtAutoComplete_ModuleType" class="form-control text-control required" style="width:100%;" placeholder = "Module Type" data-placeholder="Module Type" data-label="" data-istagselect="true" disabled="true" onchange="Unibase.Platform.Apps.Components.AppBuilder.Instance().ModuleType();"></select>
|
||||
<input type="hidden" id="hfAutoComplete_ModuleType" class="hfAutoComplete_ModuleType' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6"><div class="input-group"><label for="" class="font-bold">Module <span class="text-danger">*</span></label><select id="txtAutoComplete_Module" class="form-control text-control required" style="width:100%;" placeholder = "Module" data-placeholder="Module" data-label="" data-istagselect="true" disabled="true" onchange="Unibase.Platform.Apps.Components.AppBuilder.Instance().Module();"></select>
|
||||
<input type="hidden" id="hfAutoComplete_Module" class="hfAutoComplete_Module' form-control value-control" data-isdynamic="true"/></div></div>
|
||||
<div class="col-sm-6 div_Enabledefault" style="margin-top:50px"><strong>Enable Defaults</strong><label class="switch pull-right"><input id="chkEnableDefaults" data-group="" style="margin-top:50px" type="checkbox" checked><span></span> </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row div_table">
|
||||
<div class="col-sm-6"><div class="floating-label-form-group"><label for="txt_TableName" class="font-bold">Table Name<span class="text-danger"> *</span></label>
|
||||
<input type="text" id="txt_TableName" class="form-control floating-label-control required" data-isdynamic="false" placeholder="TableName *" data-placeholder="Enter TableName" data-label="TableName *" autocomplete="off"/></div></div>
|
||||
<div class="col-sm-6"><div class="floating-label-form-group" ><label for="" class="font-bold">Primary Key<span class="text-danger"> *</span>
|
||||
</label><input type="text" id="txt_PrimaryKey" class="form-control floating-label-control required" data-isdynamic="false" placeholder="Primary Key *" data-placeholder="Enter Primary Key" data-label="Primary Key *" autocomplete="off">
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6"><div class="floating-label-form-group"><label for="" class="font-bold">App Color<span class="text-danger"> *</span>
|
||||
</label><input type="text" id="txt_AppColor" class="form-control floating-label-control required" data-isdynamic="false" placeholder="App Color *" data-placeholder="Enter App Color" data-label="App Color *" autocomplete="off">
|
||||
</div></div>
|
||||
<div class="col-sm-6 div_appdoctypes hidden"><div class="input-group"><label for="lblType" class="font-bold">Default DocType </label> <select id="Autocomplete_AppDocTypes" class="form-control value-control" style="width:100%;" placeholder = "App DocTypes" data-placeholder="App DocTypes" data-label="" data-istagselect="true"></select>
|
||||
<input type="hidden" id="hfAutoComplete_appdoctypes" class="hfAutoComplete_appdoctypes' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
|
||||
<div class="col-sm-4 div_appimage"><div class="floating-label-form-group"><label for="lblType" class="font-bold">App Image </label>
|
||||
<input type="file" id="txt_AppImage" class="form-control" data-isdynamic="false" placeholder="App Image" data-placeholder="Choose Image" data-label="App Image" autocomplete="off" onchange = "Unibase.Platform.Apps.Components.AppBuilder.Instance().loadImage(event)">
|
||||
</div></div>
|
||||
<div class="div_image col-sm-2"></div></div>
|
||||
|
||||
<div class="card-body"><div class="row"><div class="col-sm-12"><div class="floating-label-form-group divSvgimage">
|
||||
<label for="" class="font-bold">Svg Image<span class="text-danger"></span>
|
||||
</label><input type="text" id="txt_SvgImage" class="form-control floating-label-control " data-isdynamic="false" placeholder="Svg Img" data-placeholder="Svg Image " data-label=" Svg Image" autocomplete="off">
|
||||
</div></div></div></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row hidden div_dispname_revname " >
|
||||
<div class="col-sm-6 "><div class="floating-label-form-group"><label for="" class="font-bold">Display Name<span class="text-danger"></span>
|
||||
</label><input type="text" id="txt_DisplayName" class="form-control floating-label-control " data-isdynamic="false" placeholder="Display Name" data-placeholder="Enter Display Name" data-label=" Display Name" autocomplete="off">
|
||||
</div></div>
|
||||
<div class="col-sm-6 "><div class="floating-label-form-group"><label for="" class="font-bold">Reverse Name<span class="text-danger"></span>
|
||||
</label><input type="text" id="txt_ReverseName" class="form-control floating-label-control " data-isdynamic="false" placeholder="Reverse Name" data-placeholder="Enter Reverse Name" data-label=" Reverse Name" autocomplete="off">
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="row hidden div_roles"><div class="col-sm-6"><div class="input-group"><label for="lblRoles"
|
||||
class="font-bold">Roles</label> <select id="Select2_Roles" class="form-control value-control" style="width:100%;
|
||||
" placeholder = "Roles" data-placeholder="Roles" data-label="" data-istagselect="true" multiple="multiple"/></select>
|
||||
<input type="hidden" id="hfSelect2_Roles" class="hfSelect2_Roles' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div></div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 div_stages" style="margin-top:50px"><strong>Enable Stage</strong><label class="switch pull-right"><input id="chkStageEnable" data-group="" style="margin-top:50px" type="checkbox"><span></span> </label></div>
|
||||
|
||||
<div class="col-sm-6 div_isSyncEnabled d-none" style="margin-top:50px"><strong>Enable Sync</strong><label class="switch pull-right"><input id="chkSyncEnabled" data-group="" style="margin-top:50px" type="checkbox"><span></span> </label></div>
|
||||
|
||||
<div class="col-sm-6 div_issystemlock d-none" style="margin-top:50px"><strong>Enable System Lock</strong><label class="switch pull-right"><input id="chkSystemlock" data-group="" style="margin-top:50px" type="checkbox"><span></span> </label></div>
|
||||
|
||||
<div class="col-sm-6 hidden" id="div_LockAppliedOn"><div class="input-group"><label for="lblLockappliedon" class="font-bold">LockAppiedOn</label> <select id="Autocomplete_LockAppliedOn" class="form-control value-control" style="width:100%;" placeholder = "LockAppliedOn" data-placeholder="LockAppliedOn" data-istagselect="true" onchange=""/></select>
|
||||
<input type="hidden" id="hfAutoComplete_LockAppliedOn" class="hfAutoComplete_LockAppliedOn' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
|
||||
<div class="col-sm-6 div_isSeriesExport d-none" style="margin-top:50px"><strong>Enable Series Export</strong><label class="switch pull-right"><input id="chkSeriesExport" data-group="" style="margin-top:50px" type="checkbox"><span></span> </label></div>
|
||||
|
||||
<div class="col-sm-6 div_isPermissionsExport d-none" style="margin-top:50px"><strong>Enable Permissions Export</strong><label class="switch pull-right"><input id="chkPermissionsExport" data-group="" style="margin-top:50px" type="checkbox"><span></span> </label></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12" style="margin-top:50px"><a href="javascript:;" id="link_MoreOptions" class="pull-right">More Options</a><a href="javascript:;" id="link_LessOptions" class="pull-right hidden">Less Options</a></div></div>
|
||||
<div class="row hidden div_moreoptions"><div class="col-sm-6"><div class="input-group"><label for="lblAppproviderType" class="font-bold">AppProvider Type </label> <select id="Autocomplete_AppproviderType" class="form-control value-control" style="width:100%;" placeholder = "AppProvider Type" data-placeholder="AppProvider Type" data-label="" data-istagselect="true" onchange="Unibase.Platform.Apps.Components.AppBuilder.Instance().AppProviderType();"/></select>
|
||||
<input type="hidden" id="hfAutoComplete_Appprovidertype" class="hfAutoComplete_Appprovidertype' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
|
||||
<div class="col-sm-6"><div class="input-group"><label for="lblParentApp" class="font-bold">ParentApp </label> <select id="Autocomplete_ParentApp" class="form-control value-control" style="width:100%;" placeholder = "ParentApp" data-placeholder="ParentApp" data-istagselect="true" onchange=""/></select>
|
||||
<input type="hidden" id="hfAutoComplete_ParentApp" class="hfAutoComplete_ParentApp' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
<div class="col-sm-6 mt-3"><div class="input-group"><label for="lblAppType" class="font-bold">AppType
|
||||
</label> <select id="Autocomplete_AppType" class="form-control value-control" style="width:100%;" placeholder = "AppType" data-placeholder="AppType" data-istagselect="true" onchange=""/></select>
|
||||
<input type="hidden" id="hfAutoComplete_AppType" class="hfAutoComplete_AppType' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="row hidden div_dependentapps"><div class="col-sm-6"><div class="input-group"><label for="lblAppproviderType" class="font-bold">Dependent Apps </label> <select id="Select2_DependentApps" class="form-control value-control" style="width:100%;" placeholder = "Dependent App" data-placeholder="Dependent Apps" data-label="" data-istagselect="true" multiple="multiple"/></select>
|
||||
<input type="hidden" id="hfSelect2_Dependentapps" class="hfSelect2_Dependentapps' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div></div>
|
||||
</div></div>
|
||||
<div class="bg-white card div_moreoptions1 hidden" id=" div_moreoptions1"><div class="card-header">
|
||||
<div class="row col-sm-12 mt-2">
|
||||
<div class="TemplateText_Section card"><div class="card-header"> Template Text </div><div class="card-body"><div id="div_TemplateText" class="">
|
||||
<textarea class="" id="txt_DefaultWidgetTemplateText" placeholder="Template Text" rows="3" cols="112"></textarea>
|
||||
</div></div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6"><div class="input-group"><label for="lblReports" class="font-bold">Reports </label> <select id="Autocomplete_Report" class="form-control value-control" style="width:100%;" placeholder = "Reports" data-placeholder="Reports" data-istagselect="true" onchange=""/></select>
|
||||
<input type="hidden" id="hfAutoComplete_Report" class="hfAutoComplete_Report' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
<div class="col-sm-6"><div class="input-group" ><label for="lblParameter" class="font-bold">DefaultWidget Parameter</label> <select id="Sel_Dwparameter" class="form-control value-control" style="width:100%;" placeholder = "DefaultWidget Parameter data-placeholder="DefaultWidget Parameter" data-istagselect="true" data-isdynamic="true"></select>
|
||||
<input type="hidden" id="hfAutoComplete_Dwparam" class="hfAutoComplete_Dwparam' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
</div><br>
|
||||
<div class="row">
|
||||
<div class="col-sm-4"><div class="input-group" ><label for="lblReport" class="font-bold">Report Column1<span class="text-danger"> </span></label> <select id="Sel_Column1" class="form-control value-control" style="width:100%;" placeholder = "Reports Column1" data-placeholder="Reports Column1" data-istagselect="true" data-isdynamic="true"></select>
|
||||
<input type="hidden" id="hfAutoComplete_ReportColumn1" class="hfAutoComplete_ReportColumn1' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
<div class="col-sm-4"><div class="input-group" ><label for="lblReport" class="font-bold">Report Column2<span class="text-danger"> </span></label> <select id="Sel_Column2" class="form-control value-control" data-isdynamic="true" style="width:100%;" placeholder = "Reports Column2" data-placeholder="Reports Column2" data-istagselect="true" disabled="true"></select>
|
||||
<input type="hidden" id="hfAutoComplete_ReportColumn2" class="hfAutoComplete_ReportColumn2' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
<div class="col-sm-4"><div class="input-group" ><label for="lblReport" class="font-bold">Report Column3<span class="text-danger"> </span></label> <select id="Sel_Column3" class="form-control value-control" data-isdynamic="true" style="width:100%;" placeholder = "Reports Column3" data-placeholder="Reports Column3" data-istagselect="true" disabled="true"></select>
|
||||
<input type="hidden" id="hfAutoComplete_ReportColumn3" class="hfAutoComplete_ReportColumn3' form-control value-control" data-isdynamic="true"/>
|
||||
</div></div>
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="bg-white card"><div class="card-header">Unique Key</div><div class="card-body"><div class="row"><div class="col-sm-11"><div class="alert alert-primary" id="txt_UniqueId"></div></div><div class="col-sm-1"><button id="Edit_UniqueKey" class="btn btn-secondary btn-sm mr-auto hidden">Edit</button>
|
||||
</div></div></div></div>
|
||||
<div class="bg-white card"><div class="card-header">Description</div><div class="card-body"><div class="row"><div class="col-sm-12"><div class="floating-label-form-group divDiscription"><textarea class="summernote form-control value-control floating-label-control required" id="txt_Description" name="" rows=""></textarea></div></div>
|
||||
</div></div></div></div>
|
||||
<div class="bg-white card-footer footer" id="CreateAppFooter"><button id="btn_CloseApp" class="btn btn-secondary btn-sm mr-auto">Close</button><button id="btn_SaveApp" class="btn btn-primary btn-sm pull-right">Save</button></div></div></form>`;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().addCacheFiles([
|
||||
"platform/apps/components/appbuilder.js", "platform/apps/enums/dependenttype.js", "platform/datasources/managers/doctypemanager.js", "platform/datasources/managers/interfaces/idoctypemanager.js", "platform/apps/enums/apptype.js"
|
||||
]);
|
||||
var instance = this;
|
||||
instance.recordid = id;
|
||||
$("#btn_CloseApp").click(function () {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
});
|
||||
$("#txt_FriendlyName").keyup(function () {
|
||||
if (id == 0) {
|
||||
AppBuilder.Instance().AppTitle(id);
|
||||
}
|
||||
});
|
||||
$("#btn_SaveApp").click(function () {
|
||||
let appcontrolid = "frmUnibase_CreateApp";
|
||||
let result = Unibase.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation(appcontrolid);
|
||||
if (result == false) {
|
||||
if ($($(".summernote").summernote("code")).text() == "") {
|
||||
$('.divDiscription').css('border-color', 'red');
|
||||
MessageHelper.Instance().showError("Mandatory Fields are missing", "div_appmessage");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$('.divDiscription').css('border-color', '');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
AppBuilder.Instance().SaveApp(id, containerid);
|
||||
}
|
||||
});
|
||||
$("#chkEnableDefaults").on("change", function () {
|
||||
if (!($("#chkEnableDefaults").prop('checked'))) {
|
||||
$(".div_table").addClass('hidden');
|
||||
$("#txt_PrimaryKey").removeClass('required');
|
||||
$("#txt_TableName").removeClass('required');
|
||||
$(".div_stages").addClass('hidden');
|
||||
}
|
||||
else {
|
||||
$(".div_table").removeClass('hidden');
|
||||
$(".div_stages").removeClass('hidden');
|
||||
}
|
||||
});
|
||||
$("#txt_IconName").focus(function () {
|
||||
$(".div_Icons").fadeIn();
|
||||
$("#icons").toggleClass("hidden");
|
||||
$(".div_Icons").removeClass('hidden');
|
||||
});
|
||||
$("#txt_IconName").focusout(function () {
|
||||
$(".div_Icons").fadeOut();
|
||||
});
|
||||
$('.summernote').summernote({
|
||||
toolbar: [],
|
||||
placeholder: "Enter Description *"
|
||||
});
|
||||
$('.summernote1').summernote({
|
||||
toolbar: [],
|
||||
placeholder: "Svg Image "
|
||||
});
|
||||
$(".divDiscription").keypress(function () {
|
||||
$('.divDiscription').css('border-color', '');
|
||||
});
|
||||
$(".divDiscription").keydown(function () {
|
||||
var contents = $('.summernote').summernote('code');
|
||||
var plainText = $("<p>" + contents + "</p>").text();
|
||||
if (plainText != "" && plainText.length == 1) {
|
||||
$('.divDiscription').css('border-color', 'red');
|
||||
}
|
||||
});
|
||||
$("#chkStageEnable").on("change", function () {
|
||||
if ($("#chkStageEnable").prop('checked')) {
|
||||
if (id != 0) {
|
||||
$("#Autocomplete_AppDocTypes").addClass('required');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#Autocomplete_AppDocTypes").removeClass('required');
|
||||
}
|
||||
});
|
||||
instance.appdata(id);
|
||||
instance.loadIcons();
|
||||
$("#chkSystemlock").change(function () {
|
||||
if ($("#chkSystemlock").prop("checked"))
|
||||
$("#div_LockAppliedOn").removeClass("hidden");
|
||||
else
|
||||
$("#div_LockAppliedOn").addClass("hidden");
|
||||
});
|
||||
}
|
||||
loadImage(event) {
|
||||
Unibase.Platform.Helpers.FileHelper.Instance().getBase64(event).then(function (response) {
|
||||
Unibase.Platform.Apps.Components.AppBuilder.FileInfo = response;
|
||||
});
|
||||
$(".div_image").empty();
|
||||
var url = URL.createObjectURL(event.target.files[0]);
|
||||
var imagetag = '<img class="img-fluid" src = "' + url + '"width="60" height="50" style="margin-top:10px" ></img>';
|
||||
$(".div_image").append(imagetag);
|
||||
}
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
|
||||
this.addprovider(Pk_Value);
|
||||
}
|
||||
addprovider(Pk_Value) {
|
||||
this.navigationHelper.popup(Pk_Value, '', Unibase.Platform.Apps.Components.AppBuilder.Instance(), null, Platform.Helpers.Size.Large);
|
||||
}
|
||||
loadAppForm(iscreate) {
|
||||
var Pk_Value = 0;
|
||||
if (!iscreate)
|
||||
Pk_Value = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
this.navigationHelper.popup(Pk_Value, '', Unibase.Platform.Apps.Components.AppBuilder.Instance(), null, Platform.Helpers.Size.Large);
|
||||
}
|
||||
appdata(Pk_Value) {
|
||||
if (Pk_Value != 0) {
|
||||
var instance = this;
|
||||
var defaultdoctypeid = 0;
|
||||
this.appmanager.getInstallApp(Pk_Value).then(function (response) {
|
||||
if (response.result.ReportId != 0) {
|
||||
instance.getreportcolumns(response.result.ReportId);
|
||||
}
|
||||
instance.appmanager.getdependentApps(Pk_Value).then(function (response) {
|
||||
if (response.result.length > 0) {
|
||||
var ids = [];
|
||||
var options = "";
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
ids.push(response.result[i].DependentId);
|
||||
options += '<option value="' + response.result[i].DependentId + '">' + response.result[i].AppTitle + '</option>';
|
||||
}
|
||||
$("#Select2_DependentApps").append(options).val(ids).trigger("change");
|
||||
}
|
||||
});
|
||||
$("#lbl_title").text("Edit App");
|
||||
$(".div_Enabledefault").remove();
|
||||
$(".div_dispname_revname").removeClass('hidden');
|
||||
$(".div_isSeriesExport").removeClass('d-none');
|
||||
$(".div_isPermissionsExport").removeClass('d-none');
|
||||
$(".div_issystemlock").removeClass('d-none');
|
||||
$(".div_isSyncEnabled").removeClass('d-none');
|
||||
$("#txt_DisplayName,#txt_ReverseName").keypress(function () {
|
||||
$(".div_roles").removeClass('hidden');
|
||||
});
|
||||
if (response.result.EnableStage) {
|
||||
$("#chkStageEnable").prop('checked', true);
|
||||
$("#chkStageEnable").attr('disabled', 'true');
|
||||
$("#Autocomplete_AppDocTypes").attr('required', 'true');
|
||||
}
|
||||
if (response.result.IsSystemLock) {
|
||||
$("#chkSystemlock").prop('checked', true).trigger("change");
|
||||
$("#chkSystemlock").attr('disabled', 'true');
|
||||
$("#Autocomplete_AppDocTypes").attr('required', 'true');
|
||||
}
|
||||
if (response.result.EnableSeriesExport) {
|
||||
$("#chkSeriesExport").prop('checked', true);
|
||||
}
|
||||
if (response.result.EnablePermissionsExport) {
|
||||
$("#chkPermissionsExport").prop('checked', true);
|
||||
}
|
||||
$("#chkSyncEnabled").prop('checked', response.result.IsSyncEnabled).trigger("change");
|
||||
if (response.result.ImageUrl != "") {
|
||||
var imagetag = '<img class="rounded-circle img-fluid" src = "' + response.result.ImageUrl + '" width="60" height="50" style="margin-top:10px" ></img>';
|
||||
$(".div_image").append(imagetag);
|
||||
}
|
||||
if (response.result.DefaultDocTypeId != 0) {
|
||||
var appdoctypeoptions = new Option(response.result.DocTypeTableName, response.result.DefaultDocTypeId.toString(), true);
|
||||
$("#Autocomplete_AppDocTypes").append(appdoctypeoptions);
|
||||
$("#Autocomplete_AppDocTypes").attr("disabled", "true");
|
||||
defaultdoctypeid = response.result.DefaultDocTypeId;
|
||||
var defaultdoctypeid = defaultdoctypeid;
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/doctypes/docpropertiesautocomplete/doctypeid/' + defaultdoctypeid;
|
||||
AutoCompleteHelper.getHelper().Create("#Autocomplete_LockAppliedOn", "#hfAutoComplete_LockAppliedOn", url, function (response) {
|
||||
});
|
||||
if (response.result.LockAppliedOnName != null) {
|
||||
var lockappliedoptions = new Option(response.result.LockAppliedOnName, response.result.LockAppliedOn.toString(), true);
|
||||
$("#Autocomplete_LockAppliedOn").append(lockappliedoptions);
|
||||
$("#Autocomplete_LockAppliedOn").attr("disabled", "true");
|
||||
}
|
||||
}
|
||||
$(".div_appdoctypes").removeClass('hidden');
|
||||
$(".div_table").remove();
|
||||
$("#txt_FriendlyName").val(response.result.AppTitle);
|
||||
$("#txt_FriendlyName").attr("disabled", "true");
|
||||
$("#txt_IconName").val(response.result.IconName);
|
||||
$("#txt_DisplayName").val(response.result.DisplayText);
|
||||
$("#txt_ReverseName").val(response.result.ReverseText);
|
||||
$("#txt_AppColor").val(response.result.AppColor);
|
||||
$("#txt_SvgImage").val(response.result.SvgIconUrl);
|
||||
$('.summernote').summernote("code", response.result.Description);
|
||||
var appprovidertypeoption = new Option(Apps.Enums.AppProviderType[Number(response.result.AppProviderTypeId)], response.result.AppProviderTypeId.toString(), true);
|
||||
$("#Autocomplete_AppproviderType").append(appprovidertypeoption);
|
||||
var apptypeoption = new Option(Apps.Enums.AppType[Number(response.result.AppTypeId)], response.result.AppTypeId.toString(), true);
|
||||
$("#Autocomplete_AppType").append(apptypeoption);
|
||||
$("#txt_UniqueId").text(response.result.UniqueId);
|
||||
$("#txt_DefaultWidgetTemplateText").val(response.result.DefaultWidgetTemplateText);
|
||||
if (response.result.ReportId == 0) {
|
||||
$("#chkEnableDefaults").prop("checked", false);
|
||||
}
|
||||
if (response.result.RoleIds != "" && response.result.RoleIds != null) {
|
||||
$(".div_roles").removeClass('hidden');
|
||||
var roleids = response.result.RoleIds.split('|');
|
||||
var ids = [];
|
||||
for (var i = 0; i < roleids.length; i++) {
|
||||
let roleid = Number(roleids[i]);
|
||||
ids.push(roleid);
|
||||
if (roleid == 0) {
|
||||
$("#Select2_Roles").append(`<option value="${roleid}">All</option>`).val(ids).trigger('change');
|
||||
continue;
|
||||
}
|
||||
instance.permissionmanager.getRole(roleid).then(function (roleresponse) {
|
||||
var options = `<option value="${roleid}">${roleresponse.result.RoleName}</option>`;
|
||||
$("#Select2_Roles").append(options).val(ids).trigger('change');
|
||||
});
|
||||
}
|
||||
}
|
||||
var option1 = new Option(response.result.DevOrgName, response.result.DevOrgId.toString(), true);
|
||||
$("#txtAutoComplete_Company").append(option1);
|
||||
$("#txtAutoComplete_Company").attr("disabled", "true");
|
||||
var option2 = new Option(response.result.ModuleTypeName, response.result.ModuleTypeId.toString(), true);
|
||||
$("#txtAutoComplete_ModuleType").append(option2);
|
||||
var option3 = new Option(response.result.ModuleName, response.result.ModuleId.toString(), true);
|
||||
$("#txtAutoComplete_Module").append(option3);
|
||||
if (response.result.ParentAppId != 0) {
|
||||
instance.appmanager.getInstallApp(Number(response.result.ParentAppId)).then(function (parentappresponse) {
|
||||
var parentappoption = new Option(parentappresponse.result.AppTitle, parentappresponse.result.InstalledAppId.toString(), true);
|
||||
$("#Autocomplete_ParentApp").append(parentappoption);
|
||||
});
|
||||
}
|
||||
if (response.result.ReportId != 0) {
|
||||
instance.reportmanager.getReportById(Number(response.result.ReportId)).then(function (reportresponse) {
|
||||
var reportoption = new Option(reportresponse.result.ReportName, reportresponse.result.ReportId.toString(), true);
|
||||
$("#Autocomplete_Report").append(reportoption);
|
||||
});
|
||||
}
|
||||
$("#Autocomplete_Report").on("change", function () {
|
||||
$("#Sel_Column1").removeAttr("disabled");
|
||||
$("#Sel_Column2").attr("disabled", "true");
|
||||
$("#Sel_Column3").attr("disabled", "true");
|
||||
var repportvalue = Number($("#Autocomplete_Report").val());
|
||||
var reporttext = $("#Autocomplete_Report").text();
|
||||
if (repportvalue != 0) {
|
||||
instance.getreportcolumns(repportvalue);
|
||||
}
|
||||
});
|
||||
$("#Sel_Column1").on("change", function () {
|
||||
var value = $("#Sel_Column1").val();
|
||||
var text = $("#Sel_Column1 option:selected").text();
|
||||
if (text != "") {
|
||||
$("#Sel_Column2").removeAttr("disabled");
|
||||
$("#Sel_Column1").attr("disabled", "true");
|
||||
var htmlString = $($("#txt_DefaultWidgetTemplateText").val());
|
||||
var htmltext = htmlString;
|
||||
htmltext.find("#Column1").text("{{" + text + "}}");
|
||||
var template = htmltext.html().toString();
|
||||
$("#txt_DefaultWidgetTemplateText").val("<div class='app_defaultwidget'>" + template + "</div>");
|
||||
}
|
||||
});
|
||||
$("#Sel_Column2").on("change", function () {
|
||||
var value = $("#Sel_Column2").val();
|
||||
var text = $("#Sel_Column2 option:selected").text();
|
||||
if (text != "") {
|
||||
$("#Sel_Column3").removeAttr("disabled");
|
||||
$("#Sel_Column2").attr("disabled", "true");
|
||||
var html2 = $($("#txt_DefaultWidgetTemplateText").val());
|
||||
var htmltext2 = html2;
|
||||
htmltext2.find("#Column2").text("{{" + text + "}}");
|
||||
var template2 = htmltext2.html().toString();
|
||||
$("#txt_DefaultWidgetTemplateText").val("<div class='app_defaultwidget'>" + template2 + "</div>");
|
||||
}
|
||||
else {
|
||||
}
|
||||
});
|
||||
$("#Sel_Column3").on("change", function () {
|
||||
var text = $("#Sel_Column3 option:selected").text();
|
||||
if (text != "") {
|
||||
$("#Sel_Column3").attr("disabled", "true");
|
||||
var templte3 = $("#txt_DefaultWidgetTemplateText").val();
|
||||
var htmlObject3 = $($("#txt_DefaultWidgetTemplateText").val());
|
||||
var temp3 = htmlObject3.find("#Column3").text();
|
||||
if (temp3 == "") {
|
||||
MessageHelper.Instance().showError("Please add third column in templatetext", "div_appmessage");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
var html3 = $($("#txt_DefaultWidgetTemplateText").val());
|
||||
var htmltext3 = html3;
|
||||
htmltext3.find("#Column3").text("{{" + text + "}}");
|
||||
var template3 = htmltext3.html().toString();
|
||||
$("#txt_DefaultWidgetTemplateText").val("<div class='app_defaultwidget'>" + template3 + "</div>");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
$("#link_MoreOptions").click(function () {
|
||||
$(".div_moreoptions").removeClass('hidden');
|
||||
$("#link_MoreOptions").addClass('hidden');
|
||||
$("#link_LessOptions").removeClass('hidden');
|
||||
if (Pk_Value != 0) {
|
||||
$(".div_moreoptions1").removeClass('hidden');
|
||||
if (Number($("#Autocomplete_AppproviderType").val()) == Apps.Enums.AppProviderType.Dependent) {
|
||||
$(".div_dependentapps").removeClass('hidden');
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#link_LessOptions").click(function () {
|
||||
$(".div_moreoptions").addClass('hidden');
|
||||
$("#link_MoreOptions").removeClass('hidden');
|
||||
$("#link_LessOptions").addClass('hidden');
|
||||
$(".div_dependentapps").addClass('hidden');
|
||||
if (Pk_Value != 0) {
|
||||
$(".div_moreoptions1").addClass('hidden');
|
||||
$(".div_dependentapps").addClass('hidden');
|
||||
}
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getcompanynames';
|
||||
AutoCompleteHelper.getHelper().Create("#txtAutoComplete_Company", "#hfAutoCompleteId_Company", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getappprovidertype';
|
||||
AutoCompleteHelper.getHelper().Create("#Autocomplete_AppproviderType", "#hfAutoComplete_Appprovidertype", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getmoduletypes';
|
||||
AutoCompleteHelper.getHelper().Create("#txtAutoComplete_ModuleType", "#hfAutoComplete_ModuleType", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getmodulenames/devorgid/0/moduletypeid/0';
|
||||
AutoCompleteHelper.getHelper().Create("#txtAutoComplete_Module", "#hfAutoComplete_Module", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getdependentapps';
|
||||
AutoCompleteHelper.getHelper().Create("#Select2_DependentApps", "#hfSelect2_Dependentapps", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/parentapps';
|
||||
AutoCompleteHelper.getHelper().Create("#Autocomplete_ParentApp", "#hfAutoComplete_ParentApp", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/analytics/reports';
|
||||
AutoCompleteHelper.getHelper().Create("#Autocomplete_Report", "#hfAutoComplete_Report", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/doctypes/appdoctypesautocomplete/installedappid/' + Pk_Value;
|
||||
AutoCompleteHelper.getHelper().Create("#Autocomplete_AppDocTypes", "#hfAutoComplete_appdoctypes", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/roles/getroles';
|
||||
AutoCompleteHelper.getHelper().Create("#Select2_Roles", "#hfSelect2_Roles", url, function (response) {
|
||||
});
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getapptype';
|
||||
AutoCompleteHelper.getHelper().Create("#Autocomplete_AppType", "#hfAutoComplete_AppType", url, function (response) {
|
||||
});
|
||||
if (Pk_Value == 0) {
|
||||
var appTypeoption = new Option(Apps.Enums.AppType[Apps.Enums.AppType.App], Apps.Enums.AppType.App.toString(), true);
|
||||
$("#Autocomplete_AppType").append(appTypeoption);
|
||||
}
|
||||
}
|
||||
getreportcolumns(ReportId) {
|
||||
$("#Sel_Column1 option").remove();
|
||||
$("#Sel_Column2 option").remove();
|
||||
$("#Sel_Column3 option").remove();
|
||||
$("#Sel_Dwparameter option").remove();
|
||||
var primarykey = 0;
|
||||
var primarykeyname = "";
|
||||
var options;
|
||||
if (ReportId != 0) {
|
||||
this.reportmanager.getColumns(ReportId).then(function (response) {
|
||||
var Data = [];
|
||||
Data.push({ id: 0, text: "select" });
|
||||
for (let i = 0; i < response.result.length; i++) {
|
||||
var columns = response.result[i];
|
||||
if (columns.IsPrimaryKey) {
|
||||
primarykey = columns.ReportColumnId;
|
||||
primarykeyname = columns.ReportColumnName;
|
||||
options = new Option(primarykeyname, primarykey.toString());
|
||||
$("#Sel_Dwparameter").append(options);
|
||||
}
|
||||
Data.push({ id: columns.ReportColumnId, text: columns.ReportColumnName });
|
||||
}
|
||||
$('#Sel_Dwparameter,#Sel_Column1,#Sel_Column2,#Sel_Column3').select2({
|
||||
placeholder: 'Select Column',
|
||||
data: Data,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
loadIcons() {
|
||||
var html = "";
|
||||
var Icons = [
|
||||
{ Name: 'APP Store', Icon: ' fa fa-flask' },
|
||||
{ Name: 'List', Icon: 'fa fa-list' },
|
||||
{ Name: 'Arrow', Icon: 'fa fa-arrow-right' },
|
||||
{ Name: 'Bank', Icon: 'fa fa-bank' },
|
||||
{ Name: 'Invoice', Icon: 'fa fa-files-o' },
|
||||
{ Name: 'CRM', Icon: 'fa fa-users' },
|
||||
{ Name: 'Shopping', Icon: 'fa fa-shopping-cart' },
|
||||
{ Name: 'Overflow', Icon: 'fa fa-stack-overflow' },
|
||||
{ Name: 'Money', Icon: 'fa fa-money' },
|
||||
{ Name: 'Car', Icon: 'fa fa-car' },
|
||||
{ Name: 'Building', Icon: 'fa fa-building' },
|
||||
{ Name: 'Chart', Icon: 'fa fa-bar-chart' },
|
||||
{ Name: 'Image', Icon: 'fa fa-image' },
|
||||
{ Name: 'Settings', Icon: 'fa fa-cog' },
|
||||
];
|
||||
$(".icon-list").html('<li class="icon-item hidden"></li>');
|
||||
html += '<li class="list-group-item icon-item"><div class="row"><div class="col-sm-12">';
|
||||
for (var i = 0; i < Icons.length; i++) {
|
||||
html += ' <span class="fa-stack fa-2-5x m-t-sm">' +
|
||||
'<a href="javascript:;" class="list-group-anchor" onclick="Unibase.Platform.Apps.Components.AppBuilder.Instance().AssginIcon(\'' + Icons[i].Name + '\',\'' + Icons[i].Icon + '\');">' +
|
||||
'<i class="fa fa-circle fa-stack-2x text-success dker"></i>' +
|
||||
'<i class="' + Icons[i].Icon + ' fa-stack-1x text-white"></i></a></span>';
|
||||
}
|
||||
html += '</div></div></li>';
|
||||
$(".icon-item:last").after(html);
|
||||
}
|
||||
AssginIcon(Name, Icon) {
|
||||
$(".div_GroupIcon").html('');
|
||||
$("#txtfafaIcon").val(Icon);
|
||||
$("#txt_IconName").val(Icon);
|
||||
var html = '<span class="fa-stack fa-2-5x m-t-sm"><i class="fa fa-circle fa-stack-2x text-success dker"></i><i class=" fa ' + Icon + ' fa-stack-1x text-white"></i></span><a class="pull-right" onclick="Unibase.Platform.Apps.Components.AppBuilder.Instance().RemoveImage();"><i class="m-r fa fa-close text-danger fa-lg" id="close" onclick=""></i></a>';
|
||||
$(".iconname").addClass('hidden');
|
||||
$(".div_GroupIcon").append(html);
|
||||
$("#icons").toggleClass("hidden");
|
||||
if ($("#txtfafaIcon").val() != "") {
|
||||
$(".tokenable").addClass('hidden');
|
||||
$('.div_IconGroupName').addClass('floating-label-form-group-with-value');
|
||||
}
|
||||
else {
|
||||
$('.div_IconGroupName').removeClass('floating-label-form-group-with-value');
|
||||
}
|
||||
}
|
||||
RemoveImage() {
|
||||
$(".div_GroupIcon").html('');
|
||||
$(".iconname").removeClass('hidden');
|
||||
$(".tokenable").removeClass('hidden');
|
||||
$("#txt_IconName").val('');
|
||||
$('.div_IconGroupName').removeClass('floating-label-form-group-with-value');
|
||||
$('#div_IconMargin').css('margin-top', '0px');
|
||||
}
|
||||
AppTitle(id) {
|
||||
let apptitle = $("#txt_FriendlyName").val().toString().replace(/ /g, '');
|
||||
var uniqueid = $("#txt_UniqueId").text();
|
||||
var companynametext = $("#txtAutoComplete_Company option:selected").text();
|
||||
var ModuleText = $("#txtAutoComplete_ModuleType option:selected").text();
|
||||
var Module = $("#txtAutoComplete_Module option:selected").text();
|
||||
if ((companynametext != "" && companynametext != "null") && (ModuleText != "" && ModuleText != "null") && (Module != "" && Module != "null")) {
|
||||
$("#txt_UniqueId").text(companynametext + "_" + ModuleText + "_" + Module + "_" + apptitle + "_App_" + apptitle);
|
||||
}
|
||||
else {
|
||||
if (id != 0) {
|
||||
MessageHelper.Instance().showError("Please Arrange CompanyName,ModuleType and Module", "div_appmessage");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Company() {
|
||||
var companyname = Number($("#txtAutoComplete_Company").val());
|
||||
var companynametext = $("#txtAutoComplete_Company option:selected").text();
|
||||
$("#txtAutoComplete_ModuleType").val(0);
|
||||
$("#txtAutoComplete_Module").val(0);
|
||||
$("#txt_UniqueId").text('');
|
||||
if (companyname != 0) {
|
||||
$("#txtAutoComplete_ModuleType").removeAttr("disabled");
|
||||
$("#txt_UniqueId").text(companynametext + "_");
|
||||
}
|
||||
$("#txt_UniqueId").attr('readonly', 'readonly');
|
||||
}
|
||||
ModuleType() {
|
||||
var companyname = Number($("#txtAutoComplete_Company").val());
|
||||
var Module = Number($("#txtAutoComplete_ModuleType").val());
|
||||
var ModuleText = $("#txtAutoComplete_ModuleType option:selected").text();
|
||||
var uniqueid = $("#txt_UniqueId").text();
|
||||
if (Module != 0) {
|
||||
$("#txtAutoComplete_Module").removeAttr("disabled");
|
||||
$("#txt_UniqueId").text(uniqueid + ModuleText + "_");
|
||||
}
|
||||
$("#txtAutoComplete_ModuleType").attr("disabled", "true");
|
||||
var url = _appsettings.server_url() + '/apis/v4/unibase/platform/apps/getmodulenames/devorgid/' + companyname + '/moduletypeid/' + Module;
|
||||
AutoCompleteHelper.getHelper().Create("#txtAutoComplete_Module", "#hfAutoComplete_Module", url, function (response) {
|
||||
});
|
||||
}
|
||||
Module() {
|
||||
var Module = $("#txtAutoComplete_Module option:selected").text();
|
||||
var Modulevalue = Number($("#txtAutoComplete_Module option:selected").val());
|
||||
var uniqueid = $("#txt_UniqueId").text();
|
||||
if (Modulevalue != 0) {
|
||||
if ($("#txt_FriendlyName").val() != "") {
|
||||
var apptitle = $("#txt_FriendlyName").val().toString().replace(/ /g, '');
|
||||
$("#txt_UniqueId").text(uniqueid + Module + "_" + apptitle + "_App_" + apptitle);
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError("Please Enter AppTitle", "div_appmessage");
|
||||
$("#txtAutoComplete_Company").empty();
|
||||
$("#txt_UniqueId").text('');
|
||||
$("#txtAutoComplete_ModuleType").empty();
|
||||
$("#txtAutoComplete_Module").empty();
|
||||
}
|
||||
}
|
||||
$("#txtAutoComplete_Module").attr("disabled", "true");
|
||||
}
|
||||
AppProviderType() {
|
||||
var providertype = $("#Autocomplete_AppproviderType option:selected").text();
|
||||
var providertypevalue = $("#Autocomplete_AppproviderType option:selected").val();
|
||||
if (providertype == "Dependent") {
|
||||
$(".div_dependentapps").removeClass('hidden');
|
||||
}
|
||||
else {
|
||||
$(".div_dependentapps").addClass('hidden');
|
||||
}
|
||||
}
|
||||
Dependentapp(containerid) {
|
||||
var instance = this;
|
||||
if (Unibase.Themes.Providers.DetailHelper.recordId != 0) {
|
||||
instance.appmanager.getAllApps(Unibase.Themes.Providers.DetailHelper.recordId).then(function (response) {
|
||||
$("." + containerid).empty();
|
||||
var html = '<ul class="list-group gutter list-group list-group-sp sortable ul_dependentapps">';
|
||||
for (let i = 0; i < response.result.length; i++) {
|
||||
var data = response.result[i];
|
||||
html += '<li class="list-group-item box-shadow status-item group-item li_' + data.InstalledAppId + '">' +
|
||||
'<input type="hidden" id="hfAppdependentid" value=' + data.InstalledAppId + '>' +
|
||||
'<span class="pull-left media-xs mr-30"><i class="fa fa-sort text-muted fa mr-10"></i>' + data.AppIndex + '</span>' +
|
||||
'<div class="clear">' +
|
||||
'<div class="header">' +
|
||||
' <label class="">' + data.AppTitle + '</label>' +
|
||||
'</div></div>' +
|
||||
'</div></li>';
|
||||
}
|
||||
html += '</ul>';
|
||||
$("." + containerid).append(html);
|
||||
if ($.fn.sortable) {
|
||||
$('.sortable').sortable();
|
||||
$('.sortable').on("sortupdate", function (event, ui) {
|
||||
instance.UpdateAppIndex(containerid);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
UpdateAppIndex(containerid) {
|
||||
var instance = this;
|
||||
var ids = "";
|
||||
$("." + containerid).find(".list-group-item").each(function () {
|
||||
var id = $(this).find("#hfAppdependentid").val();
|
||||
if (id != 0) {
|
||||
ids += id + ",";
|
||||
}
|
||||
});
|
||||
if (ids != "") {
|
||||
var postData = {
|
||||
id: ids
|
||||
};
|
||||
instance.appmanager.updateAppIndex(postData).then(function (response) {
|
||||
if (response.status != Unibase.Data.Status.Error) {
|
||||
instance.Dependentapp(containerid);
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_message");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
fileEvent($event) {
|
||||
const fileSelected = $event.target.files[0];
|
||||
Unibase.Platform.Apps.Components.AppBuilder.fileData = new FormData();
|
||||
Unibase.Platform.Apps.Components.AppBuilder.fileData.append(fileSelected.name, fileSelected);
|
||||
}
|
||||
exportApp() {
|
||||
var instance = this;
|
||||
var recordid = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
instance.navigationHelper.showLoading();
|
||||
instance.appmanager.getInstallApp(recordid).then(function (appresponse) {
|
||||
instance.appmanager.exportApp(recordid).then(function (response) {
|
||||
if (response.status == Unibase.Data.Status.Error) {
|
||||
instance.navigationHelper.hideLoading();
|
||||
MessageHelper.Instance().showError(response.message, "div_message");
|
||||
return false;
|
||||
}
|
||||
var filename = appresponse.result.AppTitle + ".xml";
|
||||
var xmltext = response.result;
|
||||
var pom = document.createElement('a');
|
||||
var bb = new Blob([xmltext], { type: 'text/plain' });
|
||||
pom.setAttribute('href', window.URL.createObjectURL(bb));
|
||||
pom.setAttribute('download', filename);
|
||||
pom.dataset.downloadurl = ['text/plain', pom.download, pom.href].join(':');
|
||||
pom.draggable = true;
|
||||
pom.classList.add('dragout');
|
||||
pom.click();
|
||||
instance.navigationHelper.hideLoading();
|
||||
});
|
||||
});
|
||||
}
|
||||
SaveApp(Pk_Value, containerid) {
|
||||
var instance = this;
|
||||
var appdependentlist = [];
|
||||
var dependentid = $("#Select2_DependentApps").val() != null ? $("#Select2_DependentApps").val().toString().replace(/,/g, '|') : "0";
|
||||
let dependenttype;
|
||||
if (dependentid != "") {
|
||||
dependenttype = Unibase.Platform.Apps.Enums.DependentType.Apps;
|
||||
var apparray = [];
|
||||
apparray = dependentid.split("|");
|
||||
$.each(apparray, function (index, value) {
|
||||
var appdependentObj = {
|
||||
AppDependentId: 0,
|
||||
InstalledAppId: Pk_Value,
|
||||
DependentId: Number(value),
|
||||
DependentType: Number(dependenttype)
|
||||
};
|
||||
appdependentlist.push(appdependentObj);
|
||||
});
|
||||
}
|
||||
var defaultwidgetparameter = "";
|
||||
var imagepath = $("#txt_AppImage").val();
|
||||
var svgiconpath = $("#txt_SvgImage").val();
|
||||
var imageurl = imagepath.split(/(\\|\/)/g).pop();
|
||||
var svgicon = svgiconpath.split(/(\\|\/)/g).pop();
|
||||
if (Pk_Value != 0) {
|
||||
if (Number($("#Sel_Dwparameter option:selected").val()) == 0) {
|
||||
MessageHelper.Instance().showError("Please Select Defaultwidget parameter", "div_appmessage");
|
||||
return false;
|
||||
}
|
||||
if (Number($("#Sel_Dwparameter option:selected").val()) != 0) {
|
||||
defaultwidgetparameter = $("#Sel_Dwparameter option:selected").text() + ":=:recordid";
|
||||
}
|
||||
}
|
||||
var roleids = "";
|
||||
if ($("#Select2_Roles").val() != null && ($("#Select2_Roles").val() != "")) {
|
||||
var roleids = $("#Select2_Roles").val().toString();
|
||||
roleids = roleids.replace(/\,/g, '|');
|
||||
}
|
||||
var contents = $('.summernote').summernote('code');
|
||||
var plainText = $("<p>" + contents + "</p>").text();
|
||||
var content = $('.summernote1').summernote('code');
|
||||
var plaintext = $("<p>" + content + "</p>").text();
|
||||
let postData = {
|
||||
InstalledAppId: Pk_Value,
|
||||
AppTitle: $("#txt_FriendlyName").val(),
|
||||
IconName: $("#txt_IconName").val(),
|
||||
AppImage: $("#txt_ImageFile").val(),
|
||||
AppColor: $("#txt_AppColor").val(),
|
||||
Description: plainText,
|
||||
UniqueId: $("#txt_UniqueId").text(),
|
||||
DevOrgId: Number($("#txtAutoComplete_Company").val()),
|
||||
DevOrgName: $("#txtAutoComplete_Company option:selected").text(),
|
||||
ModuleTypeName: $("#txtAutoComplete_ModuleType option:selected").text(),
|
||||
ModuleTypeId: Number($("#txtAutoComplete_ModuleType").val()),
|
||||
ModuleName: $("#txtAutoComplete_Module option:selected").text(),
|
||||
ModuleId: Number($("#txtAutoComplete_Module").val()),
|
||||
AppProviderTypeId: Number($("#Autocomplete_AppproviderType").val()),
|
||||
ParentAppId: Number($("#Autocomplete_ParentApp").val()),
|
||||
ReportId: Number($("#Autocomplete_Report").val()),
|
||||
AppKeyId: 0,
|
||||
SvgIconUrl: $("#txt_SvgImage").val(),
|
||||
DefaultWidgetTemplateText: $("#txt_DefaultWidgetTemplateText").val(),
|
||||
DefaultWidgetParameters: defaultwidgetparameter,
|
||||
EnableStage: $("#chkStageEnable").prop('checked'),
|
||||
AppDependent: appdependentlist,
|
||||
EnableDefaults: $("#chkEnableDefaults").prop('checked'),
|
||||
TableName: $("#txt_TableName").val(),
|
||||
PrimaryKeyName: $("#txt_PrimaryKey").val(),
|
||||
IsDynamic: true,
|
||||
DefaultDocTypeId: Pk_Value != 0 ? Number($("#Autocomplete_AppDocTypes").val()) : 0,
|
||||
ImageUrl: imageurl,
|
||||
DisplayText: $("#txt_DisplayName").val(),
|
||||
ReverseText: $("#txt_ReverseName").val(),
|
||||
RoleIds: roleids,
|
||||
FileData: Unibase.Platform.Apps.Components.AppBuilder.FileInfo,
|
||||
IsSystemLock: $("#chkSystemlock").prop('checked'),
|
||||
IsSyncEnabled: $("#chkSyncEnabled").prop('checked'),
|
||||
LockAppliedOn: Number($("#Autocomplete_LockAppliedOn").val()),
|
||||
EnableSeriesExport: $("#chkSeriesExport").prop('checked'),
|
||||
EnablePermissionsExport: $("#chkPermissionsExport").prop('checked'),
|
||||
AppTypeId: Number($("#Autocomplete_AppType").val()),
|
||||
ReportColumnId: Number($("#Sel_Dwparameter").val())
|
||||
};
|
||||
var nav = Unibase.Platform.Helpers.NavigationHelper.Instance();
|
||||
if (Pk_Value != 0) {
|
||||
instance.navigationHelper.showLoading();
|
||||
instance.appmanager.updateDynamicApp(postData).then(function (response) {
|
||||
if (response.status == Unibase.Data.Status.Error) {
|
||||
MessageHelper.Instance().showError(response.message, "div_appmessage");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_appmessage");
|
||||
instance.appmanager.getMyApps();
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
}
|
||||
instance.navigationHelper.hideLoading();
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.navigationHelper.showLoading();
|
||||
instance.appmanager.saveDynamicApp(postData).then(function (response) {
|
||||
if (response.status == Unibase.Data.Status.Error) {
|
||||
MessageHelper.Instance().showError(response.message, "div_appmessage");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, "div_appmessage");
|
||||
instance.appmanager.getMyApps();
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
}
|
||||
instance.navigationHelper.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new AppBuilder();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
AppBuilder.fileData = new FormData();
|
||||
Components.AppBuilder = AppBuilder;
|
||||
})(Components = Apps.Components || (Apps.Components = {}));
|
||||
})(Apps = Platform.Apps || (Platform.Apps = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Enums;
|
||||
(function (Enums) {
|
||||
let DependentType;
|
||||
(function (DependentType) {
|
||||
DependentType[DependentType["Apps"] = 1] = "Apps";
|
||||
DependentType[DependentType["Reports"] = 2] = "Reports";
|
||||
})(DependentType = Enums.DependentType || (Enums.DependentType = {}));
|
||||
})(Enums = Apps.Enums || (Apps.Enums = {}));
|
||||
})(Apps = Platform.Apps || (Platform.Apps = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
|
||||
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Enums;
|
||||
(function (Enums) {
|
||||
let AppType;
|
||||
(function (AppType) {
|
||||
AppType[AppType["App"] = 1] = "App";
|
||||
AppType[AppType["Setting"] = 2] = "Setting";
|
||||
AppType[AppType["Configuration"] = 3] = "Configuration";
|
||||
})(AppType = Enums.AppType || (Enums.AppType = {}));
|
||||
})(Enums = Apps.Enums || (Apps.Enums = {}));
|
||||
})(Apps = Platform.Apps || (Platform.Apps = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+126
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+20
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+35
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+3404
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
+21
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+466
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+6679
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+2493
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
Исполняемый файл
+10821
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
+31
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+843
@@ -0,0 +1,843 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Series;
|
||||
(function (Series) {
|
||||
let Managers;
|
||||
(function (Managers) {
|
||||
class SeriesManager extends Platform.Core.BaseManager {
|
||||
getseries(appkeyid, installedappid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/seriesautocomplete/appkeyid/' + appkeyid + '/installedappid/' + installedappid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
var result = "";
|
||||
result = JSON.parse(response.result);
|
||||
return result;
|
||||
});
|
||||
});
|
||||
}
|
||||
createSeries(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/createseries';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSeries(AppKeyId, InstalledAppId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/getserieslist/appKeyid/' + AppKeyId + '/installedappid/' + InstalledAppId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getActiveSeries(appkeyid, installedappId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/getactiveseries/appkeyid/' + appkeyid + '/installedappid/' + installedappId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
changeSeriesStatus(SeriesId, Status) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/changeseriesformatstatus/seriesid/' + SeriesId + '/status/' + Status;
|
||||
return yield this.dataHelper().postAsync(url, null);
|
||||
});
|
||||
}
|
||||
getSeriesById(seriesid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/getseries/seriesid/' + seriesid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
updateSeries(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/updateseries';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
saveSeriesFormat(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/saveseriesformat';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSeriesFormats(SeriesId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/getseriesformatlist/seriesid/' + SeriesId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSeriesFormatBySeriesId(SeriesId, SeriesFormatId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/getseriesformatbyseriesandformatid/seriesid/' + SeriesId + '/seriesformatid/' + SeriesFormatId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSeriesFormat(SeriesFormatId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/apps/getseriesformat/seriesformatid/' + SeriesFormatId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new SeriesManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Managers.SeriesManager = SeriesManager;
|
||||
})(Managers = Series.Managers || (Series.Managers = {}));
|
||||
})(Series = Platform.Series || (Platform.Series = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Managers;
|
||||
(function (Managers) {
|
||||
class InvoiceManager extends Unibase.Platform.Core.BaseManager {
|
||||
getItemById(itemid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/transact/items/getitem/itemid/' + itemid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getLatestMrpByItemId(itemid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/pricelists/getlatestmrp/itemid/' + itemid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getMrpById(mrpid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/pricelists/getmrp/mrpid/' + mrpid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getlobsummary() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/loboutstandingsummary';
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetMrpandBatchQty(url) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getItemDetails(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getItemDetails';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getItemDetailsList(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getItemDetailsList/List';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
gettaxpercentages(taxgroupid, branchid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/tax/gettaxpercentages/taxgroupid/' + taxgroupid + '/branchid/' + branchid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getPendingSalesInvoicesByContactId(ContactId, IsOverDue) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getpendingsalesinvoicesbycontactid/contactid/' + ContactId + '/isoverdue/' + IsOverDue;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getCreditNotesByContactId(ContactId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getcreditnotesbycontactid/contactid/' + ContactId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getRecentFiveInvoicesBySpocId(OrgContactId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getrecentfiveinvoicesbyspocid/orgcontactid/' + OrgContactId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getLastFiveClearedInvoices(OrgContactId, OrgId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getlastfiveclearedinvoices/orgcontactid/' + OrgContactId + '/orgid/' + OrgId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getorganization(OrgId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/crm/organization/getorganization/organizationid/' + OrgId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result != "")
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getorgcontact(orgcontactid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/crm/orgcontacts/getorgcontact/orgcontactid/' + orgcontactid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result != "")
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getbranche(branchid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/crm/companies/getbranchbybranchid/branchid/' + branchid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getInvoiceDetails(invoiceid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoice/invoiceid/' + invoiceid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getInvoiceItems(url) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getMrps(itemid, dctypeid, branchid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/pricelist/getmrpslistbyitemid/itemid/' + itemid + '/dctype/' + dctypeid + "/branchid/" + branchid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getBatches(itemid, dctypeid, branchid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/pricelist/getbatchlistbyitemid/itemid/' + itemid + '/dctype/' + dctypeid + "/branchid/" + branchid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getPendingDiscountsForInvoice(dcid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getpendingdiscountsforinvoice/dcid/' + dcid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getOrderDcDetails(url) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getorderbranchsettings(OrderId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/orders/getordersettings/orderid/' + OrderId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getItemSetting(itemid, branchid, typeid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/items/getitemsetting/itemid/' + itemid + '/branchid/' + branchid + '/type/' + typeid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetSampleInvoiceNo(invoiceNo, invidate, seriesid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getsampleinvoiceno/invoiceno/' + invoiceNo + "/invoicedate/" + invidate + "/seriesid/" + seriesid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
gettemplates(installedappid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/unibase/platform/templates/gettemplatesbyapp/installedappid/' + installedappid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetTemplateSetting(installedappid, branchid, lobid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/automationrules/gettemplatesetting/installedappid/' + installedappid + '/branchid/' + branchid + '/lobid/' + lobid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getTempNextNumber(SeriesId, date) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoicenextnumber/seriesid/' + SeriesId + '/invoicedate/' + date;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== "" && response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getprintinvoice(invoiceid, isprintpreview, ispos) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getprintinvoice/invoiceid/' + invoiceid + '/isprintpreview/' + isprintpreview + '/ispos/' + ispos;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
updateinvoiceseries(invoiceid, seriesid, invoiceno, templateid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/updateinvoiceseries/invoiceid/' + invoiceid + '/seriesid/' + seriesid + '/invoiceno/' + invoiceno + '/templateid/' + templateid;
|
||||
return yield this.dataHelper().postAsync(url, null).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
Updateconnecteddc(dcid, invoiceid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/Updateconnecteddc/dcid/' + dcid + '/invoiceid/' + invoiceid;
|
||||
return yield this.dataHelper().postAsync(url, null).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
UpdateInvoice(InvoiceId, salespersonid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/updateinvoicesalesperson/invoiceid/' + InvoiceId + '/salespersonid/' + salespersonid;
|
||||
return yield this.dataHelper().postAsync(url, null).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
UpdateInvoiceItemTaxAllocs(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/updateinvoiceitemtaxallocs';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getinvoiceitems(invoiceid, itemid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoiceitemsbyinvoiceid/invoiceid/' + invoiceid + '/isreturn/false/itemid' + itemid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getBatchByBatchId(BatchId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/pricelists/getbatch/batchid/' + BatchId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getPlanVolume(ItemId, OrganizationId, InvoiceApplyType) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/offers/getplanvolumebyitem/itemid/' + ItemId + '/organizationid/' + OrganizationId + '/type/' + InvoiceApplyType;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getJournalWallets(invoicedate, invoiceid, contactid, invoicetype, lobId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getjournalwallets/invoicedate/' + invoicedate + '/invoiceid/' + invoiceid + '/contactid/' + contactid + '/invoicetype/' + invoicetype + '/lobid/' + lobId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result !== "") {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getJournalAllocs(invoiceid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getjournalallocs/invoiceid/' + invoiceid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getSeries(installedappid, branchid, lobid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/seriessettings/getseriessettings/lobid/' + lobid + '/branchid/' + branchid + '/installedappid/' + installedappid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getInvoiceItemDetails(invoiceitemid, taxgroupid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoiceitemdetails/invoiceitemid/' + invoiceitemid + '/taxgroupid/' + taxgroupid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getCustomerTurnOver(organizationid, excludeinvoiceid, invoicedate, applytype) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getcustomerturnover/organizationid/' + organizationid + '/excludeinvoiceid/' + excludeinvoiceid + "/invoicedate/" + invoicedate + "/applytype/" + applytype;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getTcsDeclaration(partitionid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/gettcsdeclarationbypartitionid/partitionid/' + partitionid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result !== "") {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
saveTcsDeclaration(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/savetcsdeclaration';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetInvoicePermissions(invoicetypeid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoicepermissions/invoicetypeid/' + invoicetypeid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetTenants(tenantid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/gettenant/tenantid/' + tenantid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
refreshInvoiceTypes() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/refreshinvoicetypes/np';
|
||||
return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetTCSTaxgroupforReturn(invoiceid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/gettcstaxgroupforreturn/invoiceid/' + invoiceid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
GetFirstPendingInvoicesBySalesPerson(salespersonid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getfirstpendinginvoices/salespersionid/' + salespersonid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
changeManagers(postdata) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/changemanagers';
|
||||
return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
changeManager(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/updatemanagerdetails';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getdcbydcno(dcno) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/dc/getdcbydcno/dcno/' + dcno;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result !== '')
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getproductsbyLobid(lobid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/items/getproductsbylobid/lobid/' + lobid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getItemsUnitPriceByProductId(productId, contactId, term) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/items/getitemsunitpricebyproductid/productid/' + productId + '/contactid/' + contactId + '/term/' + term;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getpricebyProductId(itemid, lobid, productId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/pricelists/getlatestprices/itemids/' + itemid + '/lobid/' + lobid + '/productid/' + productId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getitemname(searchtext) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/items/getitemsbyterm/term/' + searchtext;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getOffersByItemIdWithPrice(postdata) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/items/getrelatedofferwithprice';
|
||||
return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getInvoiceByDc(DcId) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoicebydc/dcid/' + DcId;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result !== "") {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
loadEbs(url1) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = url1;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getIsEnableSalesPipeline(url) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getPendingInvoicesByOrganizationName(OrganizationName) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getpendinginvoicesbyorganizationname/organizationname/' + OrganizationName;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result != "" && response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getGSTRReport(gstno) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var fromdate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate;
|
||||
var todate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;
|
||||
var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD");
|
||||
var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD");
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/exportgstr1returndetails/gstno/' + gstno + '/fromdate/' + fromdatestring + '/todate/' + todatestring;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
refreshTaxclassifications() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var fromdate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate;
|
||||
var todate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;
|
||||
var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD");
|
||||
var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD");
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/refreshtaxclassificaions/fromdate/' + fromdatestring + '/todate/' + todatestring;
|
||||
return yield this.dataHelper().postAsync(url, null).then(function (response) {
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
RefreshEInvoice(irn) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transactintegrations/einvoice/refresheinvoices/irn/' + irn;
|
||||
return yield this.dataHelper().postAsync(url, null).then(function (response) {
|
||||
if (response.result !== null)
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getInvoiceByorder(orderid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getinvoicesbyorderid/orderid/' + orderid;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
if (response.result !== null && response.result !== "") {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
getbulkprint(fromdate, todate, salespersonid, organizationid, invoicetype) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
debugger;
|
||||
var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD");
|
||||
var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD");
|
||||
const url = 'apis/v4/bizgaze/transact/invoices/getbulkinvoiceprint/organizationid/' + organizationid + '/salespersonid/' + salespersonid + '/fromdate/' + fromdatestring + '/todate/' + todatestring + '/invoicetype/' + invoicetype;
|
||||
return yield this.dataHelper().getAsync(url).then(function (response) {
|
||||
debugger;
|
||||
if (response.result !== null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new InvoiceManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Managers.InvoiceManager = InvoiceManager;
|
||||
})(Managers = Transact.Managers || (Transact.Managers = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+1810
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
+220
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+18108
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+2650
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+149
@@ -0,0 +1,149 @@
|
||||
var Bizgaze;(function(Bizgaze){let Apps;(function(Apps){let Transact;(function(Transact){let Controls;(function(Controls){let Subscriptions;(function(Subscriptions){class Addons extends Unibase.Platform.Core.BaseComponent{cssFiles(){return[]}jsFiles(){return[]}html(){}init(){}loadControl(containerid){var html=`<div class="orderdiv"></div>`;$("#"+containerid).html(html)}getAddons(itemid,id,tenureid){let instance=this;this.fileCacheHelper.loadJsFile("apps/transact/managers/subscriptions/subscriptionmanager.js",function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().getAddonsItems(itemid,tenureid).then(function(response){for(var res=response.result,html=``,i=0;i<res.length;i++)html=`
|
||||
<div class="product-card adoonsItems AddonValue-row" id="li_AddOnsItems_Details" data-search-term="${res[i].ItemName.toLowerCase()}">
|
||||
<div class="product-card-body">
|
||||
<div class="product-img-wrap">
|
||||
<img src="https://res.cloudinary.com/redq-inc/image/upload/v1600351534/pickbazar/bakery/Cookies_ggshwp.png"
|
||||
alt="" class="product-img">
|
||||
</div>
|
||||
<div class="product-title-desc-wrap addItemname">
|
||||
<span class="product-title">${res[i].ItemName}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card-footer ">
|
||||
<span class="product-price "><i class="fa fa-inr"></i>${res[i].SalesPrice}</span>
|
||||
<input type="hidden" class="addPrice" id="hf_addPrice" value=${res[i].SalesPrice} />
|
||||
<input href="javascript:;" type="checkbox" id="addonchk" class="addonchk_${res[i].ItemId} btn addonchk add-cart-btn" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.Addons.Instance().addOrderAddonItems();">
|
||||
</div>
|
||||
<div class="offer-percentage">0%</div>
|
||||
<input type="hidden" id="hf_addonQuantity" value=${res[i].SubscriptionAddonsQuantity} /> <input type="hidden" id="hf_addonSku" value=${res[i].Sku} /> <input type="hidden" id="hf_addonItemId" value=${res[i].ItemId} />
|
||||
</div>
|
||||
</div>
|
||||
</div>`,$(".addonslist:first").append(html)})});$(".loader-pendulums").removeClass("loader-pendulums")}addOrderAddonItems(){this.fileCacheHelper.loadJsFile("apps/transact/controls/subscriptions/orderdetails.component.js",function(){var addonsList=[];$(".Uaddonitems").find(".AddonValue-row").each(function(){var addonItemName=$(this).find(".addItemname").text(),addonPrice=Number($(this).find(".addPrice").val()),addcheck=$(this).find("#addonchk").is(":checked"),addonQuantity=$(this).find("#hf_addonQuantity").val(),addonSku=$(this).find("#hf_addonSku").val(),addonItemId=$(this).find("#hf_addonItemId").val();addcheck==!0&&addonsList.push({AddonItemName:addonItemName,AddonPrice:addonPrice,AddonQuantity:addonQuantity,AddonSku:addonSku,addonItemId:addonItemId})});Bizgaze.Apps.Transact.Controls.Subscriptions.OrderDetails.Instance().Orderaddonitems(addonsList)})}ShowOfferItems(OrganizationId,ItemId,ItemName,OrderType,element){Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/components/subscriptions/subscriptionitemofferselection.js","apps/transact/controls/invoices/invoiceitem.component.js"],function(){Unibase.Platform.Helpers.NavigationHelper.Instance().popup(0,"",Bizgaze.Apps.Transact.Components.Subscriptions.SubscriptionItemOfferSelection.Instance(),function(){Bizgaze.Apps.Transact.Components.Subscriptions.SubscriptionItemOfferSelection.Instance().LoadOfferItems(OrganizationId,ItemId,ItemName,OrderType,$(element),"Order")},Unibase.Platform.Helpers.Size.Large)})}loadControlSettings(){}loadPropertySettings(){}bindEditFormDetails(){}static Instance(){return this.instance===undefined&&(this.instance=new Addons),this.instance}}Subscriptions.Addons=Addons})(Subscriptions=Controls.Subscriptions||(Controls.Subscriptions={}))})(Controls=Transact.Controls||(Transact.Controls={}))})(Transact=Apps.Transact||(Apps.Transact={}))})(Apps=Bizgaze.Apps||(Bizgaze.Apps={}))})(Bizgaze||(Bizgaze={})),function(Bizgaze){let Apps;(function(Apps){let Transact;(function(Transact){let Controls;(function(Controls){let Subscriptions;(function(Subscriptions){class RegisterEmail extends Unibase.Platform.Core.BaseComponent{init(){this.fileCacheHelper.loadCssFiles(["libs/owl.carousel/assets/owl.carousel.min.css","libs/simplebar/simplebar.min.css","apps/transact/controls/subscriptions/style.subscription.css"],null);$(".planSelectRadio").click(function(){});$(".login-btn").click(function(){var url=_appsettings.server_url()+"/#/login";window.open(url,"_blank")})}loadControl(containerid){var html=`<div class="pricing-details-wrap subs-bg-pattern"><div id="pricingFormErrMsg" class="princing-form-err-msg"></div><div class="plan-details-bg-img-wrap"><img src="./imgs/plan-detail-top-left.png" class="plan-detail-top-left-img"><img src="./imgs/plan-detail-top-right-1.png" class="plan-detail-top-right-1-img"><img src="./imgs/plan-detail-top-right-2.png" class="plan-detail-top-right-2-img"><img src="./imgs/plan-detail-left-bottom.png" class="plan-detail-left-bottom-img"><img src="./imgs/plan-detail-bottom-right.png" class="plan-detail-bottom-right-img"></div>
|
||||
<div class="pricing-details-header-wrap py-15 px-15 pl-lg-130 px-xl-150 pr-lg-100">
|
||||
<div class="logo-wrap">
|
||||
<img src="./imgs/biz-logo.svg" class="img-fluid biz-logo h-50p" alt="logo">
|
||||
</div>
|
||||
<h5 class="pricing-body-heading text-dark-100 mt-20 font-weight-bold">Pricing Details</h5>
|
||||
</div>
|
||||
<div data-simplebar class="pricing-details-body-wrap simple-scroll-bar px-15 pb-15 pb-md-20">
|
||||
<div class="row mx-0 List_cartItems">
|
||||
<div class="col-12 px-0 pricing-detail-col plan-details-wrap">
|
||||
<h6 class="form-heading heading-underline ml-lg-120 ml-xl-135 mb-md-20">Select Plan</h6>
|
||||
<div class="plans-carousel-wrap biz-custom-scrollbar px-xl-100 px-lg-80 px-md-50">
|
||||
<div class="owl-carousel owl-theme biz-plans-carousel listitems" id="biz-plans-carousel">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;$("#"+containerid).html(html)}planItemsList(){var SubscriptionItemType=1;this.fileCacheHelper.loadJsFiles(["apps/transact/managers/subscriptions/subscriptionmanager.js","apps/transact/components/subscriptions/userregistration.component.js"],function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().getItemsList(Number(SubscriptionItemType)).then(function(response){for(var res=response.result,i=0;i<res.length;i++){let html=`<div class="item card plan-card-item CartItems" id="planCard_${res[i].ItemId}">
|
||||
<div class="card-header">`;html+=` <h5 class="plan-title text-truncate">${res[i].ItemName}</h5>`;html+=`</div>
|
||||
<div class="card-body px-10 py-0">
|
||||
<div class="dropdown plan-price-wrap">
|
||||
<h6 class="plan-price inr-sign mr-1">${res[i].SalesPrice}</h6><span class="text-dark-100">/</span>
|
||||
<a href="javascript:;" data-toggle="dropdown"
|
||||
class="plans-dp-link dropdown-toggle ml-1"></a>
|
||||
<div role="menu" class="dropdown-menu TenureDropdown_${res[i].ItemId}">`;html+=` </div>
|
||||
</div>
|
||||
<ul class="plan-list-group biz-custom-scrollbar PlanList_${res[i].ItemId}">`;html+=` <input type="hidden" id="hf_Sku" value=`+res[i].SKU+` /><input type="hidden" id="hf_CartItemId" value=`+res[i].ItemId+` /><input type="hidden" id="hf_Quantity" value=1 /><input type="hidden" class="itemprice" value=`+res[i].SalesPrice+` id="hf_itemprice" /><input type="hidden" class="price hf_itemprice" value=`+res[i].SalesPrice+` id="hf_price" /><input type="hidden" class="hf_discountPercent" value=0 id="hf_discountPercent" /><input type="hidden" class="hf_dropitemtenure_${res[i].ItemId}" value=0 id="hf_dropitemtenure_${res[i].ItemId}" />
|
||||
</ul>
|
||||
<div class="card-footer d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<a class="btn btn-sm btn-outline-dark plan-subscribe-btn addonchk planSelectBox_${res[i].ItemId}" href="javascript:;" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().userRegistration('${res[i].ItemId}')">Subscribe</a>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-sm btn-outline-dark plan-subscribe-btn addonchk planSelectBox_${res[i].ItemId}" id="Sub_try_now" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().TryUser();">Try Now</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<img src="./imgs/plan-item-bg.png" class="plan-item-bg-img img-fluid">
|
||||
</div>`;$("#biz-plans-carousel").append(html)}for(Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().loadCustomUiJs(),Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().initiatePlansCarousel(),$(".planSelectBox_"+res[0].ItemId).addClass("checked"),i=0;i<res.length;i++)Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().getBoMItems(res[i].ItemId);for(i=0;i<res.length;i++)Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().getTenures(res[i].ItemId)})})}OpenModal(){const html=`<div class="modal fade open-try-modal" id="Opentrynowmodal" style="width: auto;background-color: rgba(0, 0, 0, 0.5) !important;">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content p-4">
|
||||
<div class="modal-body">
|
||||
<div class="otp-err-msg" id="trynowotpErrMsg"></div>
|
||||
<div class="form-heading-col pt-10"><h5 class="form-heading heading-underline">Try Now</h5></div>
|
||||
<div class="otp-header hidden"><p>Enter 6 Digit Verification Code sent</p></div>
|
||||
<div class="trynow_contact pt-3">
|
||||
<input type="text" class="form-control trynow_register" Placeholder="Enter Email / Contact Number">
|
||||
<div class="otp-input-group hidden">
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(1);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(2);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(3);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(4);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(5);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(6);" maxlength=1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right close_trynow mt-30">
|
||||
<a href="javascript:;" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().sendOtp();" class="otp-trynowresend-link hidden">Resend Code</a>
|
||||
<a href="javascript:;" class="btn subs-btn-outline-primary trynow-submit-btn" id="trynow_submit">Submit</a>
|
||||
<a href="javascript:;" class="btn subs-btn-outline-primary trynow-otp-submit-btn hidden" id="trynow_otpSubmitBtn" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().tryNowSubmitHandler();">Proceed</a>
|
||||
</div>
|
||||
<a href="javascript:;" class="modal-close-btn btn btn-icon btn-flush-danger btn-rounded flush-soft-hover w-30p h-30p" id="otpModalCloseBtn" style="position:absolute;right:10px;top:5px;"><span class="btn-icon-wrap"><i class="las la-times"></i></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`,containerId=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1];$(".open-try-modal").remove();$(`#${containerId}`).append(html);const trynowotpModalEl=$("#Opentrynowmodal");$("#trynow_submit").click(function(){function isNumeric(val){return/^-?\d+$/.test(val)}let input_val=$(".trynow_register").val().toString();let values=isNumeric(input_val);var email=input_val;if(email=="")MessageHelper.Instance().showError("Please Enter a Eamil or Phone Number!","trynowotpErrMsg");else if(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})|([0-9]{10})+$/.test(email))$("#trynowotpErrMsg").addClass("hidden"),$(this).addClass("hidden"),$("#Opentrynowmodal").find(".modal-body").addClass("p-3"),$(".close_trynow").addClass("otp-modal-footer"),$(".trynow_register").addClass("hidden"),$(".trynow-otp-submit-btn").removeClass("hidden"),$(".otp-trynowresend-link").removeClass("hidden"),$(".otp-header").removeClass("hidden"),$(".otp-input-group").removeClass("hidden");else return MessageHelper.Instance().showError("Vaild eamil or phone number must be!","trynowotpErrMsg"),!1});trynowotpModalEl.addClass("show d-block");$(".otp-input").first().focus();$("#otpModalCloseBtn").click(function(){trynowotpModalEl.removeClass("show d-block")});$(".otp-input-group .otp-input").on("input",function(){const inputEl=this;inputEl.value=inputEl.value.replace(/[^0-9]/g,"")})}trynow(){Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().OpenModal()}tryNowSubmitHandler(){let enteredtrynowOtp="";$("#Opentrynowmodal").find(".otp-input").each(function(){enteredtrynowOtp+=$(this).val()});let otp=RegisterEmail.instance.registertoken;"123456"===enteredtrynowOtp?$("#Opentrynowmodal").removeClass("show d-block"):MessageHelper.Instance().showError("Invalid OTP!","trynowotpErrMsg")}planItemsListByorgId(orgid){var SubscriptionItemType=1;this.fileCacheHelper.loadJsFiles(["apps/transact/managers/subscriptions/subscriptionmanager.js","apps/transact/components/subscriptions/userregistration.component.js"],function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().getItemsList(SubscriptionItemType).then(function(response){for(var res=response.result,i=0;i<res.length;i++){let html=`<div class="item card plan-card-item CartItems" id="planCard_${res[i].ItemId}">
|
||||
<div class="card-header">`;html+=` <h5 class="plan-title text-truncate">${res[i].ItemName}</h5>`;html+=`</div>
|
||||
<div class="card-body px-10 py-0">
|
||||
<div class="dropdown plan-price-wrap">
|
||||
<h6 class="plan-price inr-sign mr-1">${res[i].SalesPrice}</h6><span class="text-dark-100">/</span>
|
||||
<a href="javascript:;" data-toggle="dropdown"
|
||||
class="plans-dp-link dropdown-toggle ml-1"></a>
|
||||
<div role="menu" class="dropdown-menu TenureDropdown_${res[i].ItemId}">`;html+=` </div>
|
||||
</div>
|
||||
<ul class="plan-list-group biz-custom-scrollbar PlanList_${res[i].ItemId}">`;html+=` <input type="hidden" id="hf_Sku" value=`+res[i].SKU+` /><input type="hidden" id="hf_CartItemId" value=`+res[i].ItemId+` /><input type="hidden" id="hf_Quantity" value=1 /><input type="hidden" class="itemprice" value=`+res[i].SalesPrice+` id="hf_itemprice" /><input type="hidden" class="price hf_itemprice" value=`+res[i].SalesPrice+` id="hf_price" /><input type="hidden" class="hf_discountPercent" value=0 id="hf_discountPercent" /><input type="hidden" class="hf_dropitemtenure_${res[i].ItemId}" value=0 id="hf_dropitemtenure_${res[i].ItemId}" />
|
||||
</ul>
|
||||
<div class="card-footer"><a class="btn btn-sm btn-outline-dark plan-subscribe-btn addonchk planSelectBox_${res[i].ItemId}" href="javascript:;" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().UpgradePlan('${res[i].ItemId}','${orgid}')">Subscribe</a></div>
|
||||
</div>
|
||||
<img src="./imgs/plan-item-bg.png" class="plan-item-bg-img img-fluid">
|
||||
</div>`;$("#biz-plans-carousel").append(html)}for(Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().loadCustomUiJs(),Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().initiatePlansCarousel(),$(".planSelectBox_"+res[0].ItemId).addClass("checked"),i=0;i<res.length;i++)Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().getBoMItems(res[i].ItemId);for(i=0;i<res.length;i++)Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().getTenures(res[i].ItemId)})})}UpgradePlan(itemid,orgid){var tenureid=$(`.hf_dropitemtenure_${itemid}`).val();Bizgaze.Apps.Transact.Components.Subscriptions.Userregistration.Instance().managePayments(orgid,itemid,tenureid,null)}userRegistration(itemid){var tenureid=$(`.hf_dropitemtenure_${itemid}`).val();Bizgaze.Apps.Transact.Components.Subscriptions.Userregistration.Instance().openUserRegistration(itemid,tenureid)}getTenures(itemId){this.fileCacheHelper.loadJsFile("apps/transact/managers/subscriptions/subscriptionmanager.js",function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().getTenures(itemId).then(function(response){var tenures=response.result,i,tenure,price,html;if(tenures.length!=0){for(i=0;i<tenures.length;i++)tenure="",price=tenures[i].Price,tenures[i].Tenure==1?tenure="Daily":tenures[i].Tenure==2?tenure="Monthly":tenures[i].Tenure==3&&(tenure="Yearly"),html=`<a class="dropdown-item tenure-item dropitemtenure_${itemId}_${tenures[i].Tenure}" href="javascript:;" data-price="${price}">${tenure}</a>`,$(`.TenureDropdown_`+itemId+`:first`).append(html),i==0&&($(`#planCard_${itemId}`).find(".plans-dp-link").text(tenure),$(`#planCard_${itemId}`).find(".plan-price").text(price),$(`.hf_dropitemtenure_${itemId}`).val(tenures[0].Tenure));$(".tenure-item").click(function(){const parentEl=$(this).parents(".plan-card-item");$(this).text()=="Monthly"?(parentEl.find(".plans-dp-link").text("Monthly"),$(`.hf_dropitemtenure_${itemId}`).val(2)):$(this).text()=="Yearly"?(parentEl.find(".plans-dp-link").text("Yearly"),$(`.hf_dropitemtenure_${itemId}`).val(3)):$(this).text()=="Daily"&&(parentEl.find(".plans-dp-link").text("Daily"),$(`.hf_dropitemtenure_${itemId}`).val(1));parentEl.find(".plan-price").text($(this).attr("data-price"))})}})})}getBoMItems(itemId){this.fileCacheHelper.loadJsFile("apps/transact/managers/subscriptions/subscriptionmanager.js",function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().getbomitems(itemId).then(function(BoMresponse){var BoMres=BoMresponse.result,i,html;if(BoMres.length!=0)for(i=0;i<BoMres.length;i++)html=`<li class="plan-list-item">
|
||||
${BoMres[i].ChildItemName}
|
||||
</li>`,$(`.PlanList_`+BoMres[i].ParentItemId+`:first`).append(html)})})}getAddonsList(itemid,tenureid){$(".plan-select-box").removeClass("checked");$(`.planSelectBox_${itemid}`).addClass("checked");this.fileCacheHelper.loadJsFile("apps/transact/managers/subscriptions/subscriptionmanager.js",function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().getAddonsItems(itemid,tenureid).then(function(response){for(var res=response.result,html=``,i=0;i<res.length;i++)html+=`<div class="product-card CartItems">
|
||||
<div class="product-card-body">
|
||||
<div class="product-img-wrap">
|
||||
<img src="https://www.pteinc.com/wp-content/uploads/2021/04/Process-Automation-Icon-Redn.png" alt="" class="product-img">
|
||||
</div>
|
||||
<div class="product-title-desc-wrap">
|
||||
<p class="product-title" title="${res[i].ItemName}">${res[i].ItemName}</p>
|
||||
<p class="product-desc" title="Automation Evolved Evolved Evolved Evolved">
|
||||
${res[i].Description}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-card-footer">
|
||||
<span class="product-price inr-sign">${res[i].SalesPrice}</span>
|
||||
<a href="javascript:;" class="btn btnadd_${res[i].ItemId} cart-btn add-cart-btn btnTxt" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().btnChange('btnadd_${res[i].ItemId},btnadd_${tenureid}');" >Add</a>
|
||||
</div>
|
||||
<div class="offer-percentage">0%</div>
|
||||
<input type="hidden" id="hf_addonQuantity" value=${res[i].SubscriptionAddonsQuantity} /> <input type="hidden" id="hf_addonSku" value=${res[i].Sku} /> <input type="hidden" id="hf_CartItemId" value=${res[i].ItemId} />
|
||||
</div>`;$(".add-on-products-sec .ListAddons").html(html)})})}btnChange(itemid){var BtnText=$("."+itemid+"").text();BtnText=="Add"&&($("."+itemid+"").removeClass("add-cart-btn"),$("."+itemid+"").addClass("remove-cart-btn"),$("."+itemid+"").text("Remove"));BtnText=="Remove"&&($("."+itemid+"").addClass("add-cart-btn"),$("."+itemid+"").removeClass("remove-cart-btn"),$("."+itemid+"").text("Add"))}sendOtp(){var instance=this,ContactText=$(".txt_phonenumber").val().toString(),token;let Ismail=ContactText.includes("@");ContactText!=""?(Ismail==!1&&(ContactText.length==10?(token="123456",RegisterEmail.instance.isMail=Ismail,instance.fileCacheHelper.loadJsFile("apps/crm/contacts/managers/contactmanager.js",function(){Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getContactnumuberdetails(ContactText).then(function(response){var res=response.result;res!=null&&res!=""?Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Mobile Number Already Exists"):Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().sendEmail(ContactText,Ismail)})})):MessageHelper.Instance().showError("Please Enter Valid Input Details!","pricingFormErrMsg")),Ismail==!0&&(RegisterEmail.instance.isMail=Ismail,token="123456",Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpVerificationModal(),Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().sendEmail(ContactText,Ismail))):MessageHelper.Instance().showError("Please Enter Valid Input Details!","pricingFormErrMsg")}initiatePlansCarousel(){Unibase.Platform.Helpers.FileCacheHelper.Instance().loadFile({FileName:"libs/owl.carousel/owl.carousel.min.js",FileType:Unibase.Platform.Helpers.FileType.Js},function(){$("#biz-plans-carousel").owlCarousel({autoplay:!1,loop:!1,nav:!0,navText:['<i class="fa fa-angle-left"><\/i>','<i class="fa fa-angle-right"><\/i>',],dots:!1,autoHeight:!0,responsiveClass:!0,responsive:{0:{items:1},575:{items:1},767:{items:2},991:{items:2},1199:{items:3}}})})}loadCustomUiJs(){const formEl=$('[data-formuniquekey="bizgaze_transact_extension_subscription_userverification"],[data-formuniquekey="bizgaze_transact_extension_subscription_upgradeplan"]'),headerHeight=formEl.find(".pricing-details-header-wrap").outerHeight(!0),detailBodyPaddingBottom=parseInt(formEl.find(".pricing-details-body-wrap").css("padding-bottom")),carouselHeadingHeight=formEl.find(".plan-details-wrap .form-heading").outerHeight(!0);formEl.find(".pricing-details-body-wrap").css("height",`calc(100vh - ${headerHeight-2}px)`);const finalCarouselWrapHeight=headerHeight+carouselHeadingHeight+detailBodyPaddingBottom;$(window).width()>=991&&formEl.find(".plans-carousel-wrap").css({"max-height":`calc(100vh - ${finalCarouselWrapHeight}px)`,"overflow-y":"auto"});const planCardItem=formEl.find(".plan-card-item").first(),itemPropertiesHeight=parseInt(planCardItem.css("margin-top"))+parseInt(planCardItem.css("margin-bottom"))+parseInt(planCardItem.css("border-top")),itemHeaderHeight=planCardItem.find(".card-header").outerHeight(!0),itemFooterHeight=planCardItem.find(".card-footer").outerHeight(!0),planNameHeight=planCardItem.find(".plan-price-wrap").outerHeight(!0),finalItemListHeight=finalCarouselWrapHeight+itemPropertiesHeight+itemHeaderHeight+itemFooterHeight+planNameHeight;formEl.find(".plan-card-item .plan-list-group").css({height:`calc(100vh - ${finalItemListHeight+10}px)`})}otpInputTabChange(val){const ele=$(".otp-input");ele[val-1].value!=""?ele[val]&&ele[val].focus():ele[val-1].value==""&&ele[val-2]&&ele[val-2].focus()}sendEmail(email,Ismail){this.fileCacheHelper.loadJsFile("apps/transact/managers/subscriptions/subscriptionmanager.js",function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().sendRegistrationMail(email,Ismail).then(function(response){var res=response.message,registertoken;RegisterEmail.instance.registertoken=response.result;registertoken="123456";Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpVerificationModal()})})}otpVerificationModal(){const html=`<div class="modal fade otp-verification-modal" id="otpVerificationModal">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="otp-err-msg" id="otpErrMsg"></div>
|
||||
<img src="./imgs/otp-verify-img.png" class="otp-verify-img h-100p w-100p">
|
||||
<div class="otp-heading-wrap">
|
||||
<h5 class="otp-heading font-weight-bold mb-10">OTP Verification</h5>
|
||||
<p class="otp-desc">Enter 6 Digit Verification Code sent</p>
|
||||
</div>
|
||||
<div class="otp-input-group">
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(1);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(2);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(3);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(4);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(5);" maxlength=1>
|
||||
<input class="otp-input" type="text" onkeyup="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpInputTabChange(6);" maxlength=1>
|
||||
</div>
|
||||
<div class="otp-modal-footer mt-30">
|
||||
<p class="otp-timer text-danger d-none">Time: <span class="otp-expire-time">00:46</span></p>
|
||||
<a href="javascript:;" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().sendOtp();" class="otp-resend-link">Resend Code</a>
|
||||
<a href="javascript:;" class="btn subs-btn-outline-primary otp-submit-btn" id="otpSubmitBtn" onclick="Bizgaze.Apps.Transact.Controls.Subscriptions.RegisterEmail.Instance().otpSubmitHandler();">Submit</a>
|
||||
</div>
|
||||
<a href="javascript:;" class="modal-close-btn btn btn-icon btn-flush-danger btn-rounded flush-soft-hover w-30p h-30p" id="otpModalCloseBtn"><span class="btn-icon-wrap"><i class="las la-times"></i></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`,containerId=Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length-1];$(".otp-verification-modal").remove();$(`#${containerId}`).append(html);const otpModalEl=$("#otpVerificationModal");otpModalEl.addClass("show d-block");$(".otp-input").first().focus();$("#otpModalCloseBtn").click(function(){otpModalEl.removeClass("show d-block")});$(".otp-input-group .otp-input").on("input",function(){const inputEl=this;inputEl.value=inputEl.value.replace(/[^0-9]/g,"")})}otpSubmitHandler(){let enteredOtp="";$(".otp-input").each(function(){enteredOtp+=$(this).val()});let otp=RegisterEmail.instance.registertoken;"123456"===enteredOtp?($("#otpVerificationModal").removeClass("show d-block"),$(".txt_phonenumber").prop("disabled",!0),$("#phoneVerifyBtn").text("Verified").removeClass("btn-primary").addClass("btn-success").removeAttr("onclick"),$(".registration-proceed-btn").removeClass("d-none")):MessageHelper.Instance().showError("Invalid OTP!","otpErrMsg")}saveCartItems(registertoken){var CartItemData=[];RegisterEmail.instance.regmail=$("#ContactText").val();$(".List_cartItems").find(".CartItems").each(function(){var addcheck=$(this).find(".addonchk").hasClass("checked"),itemId=Number($(this).find("#hf_CartItemId").val()),registermail=$("#contactInput").val().toString(),registerToken=registertoken,btnTxt=$(this).find(".btnTxt").text();(addcheck||btnTxt=="Remove")&&CartItemData.push({ItemId:itemId,RegisterMail:registermail,RegisterToken:registerToken,CartItemId:0,IsMail:RegisterEmail.instance.isMail})});this.fileCacheHelper.loadJsFiles(["apps/transact/managers/subscriptions/subscriptionmanager.js","apps/transact/components/subscriptions/userregistration.component.js"],function(){Bizgaze.Apps.Transact.Managers.Subscriptions.SubscriptionManager.Instance().saveCartItems(CartItemData).then(function(response){var res=response.result,token=res.RegisterToken,regmail=res.RegisterMail;res!=null})})}TryUser(){var instance=this;instance.fileCacheHelper.loadJsFiles(["platform/forms/managers/formmanager.js","platform/apps/managers/appmanager.js","platform/forms/components/formviewer/formviewer.js","libs/moment/moment.min.js","platform/core/helpers/html/htmlhelper.js","apps/transact/managers/subscriptions/subscriptionmanager.js","apps/transact/components/subscriptions/userregistration.component.js","apps/transact/controls/subscriptions/addons.component.js","apps/transact/controls/subscriptions/orderdetails.component.js","platform/controls/autocomplete/autocomplete.component.js","platform/core/helpers/autocomplete/autocompletehelper.js","apps/transact/controls/subscriptions/tryuserregistration.component.js"],function(){Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId("Bizgaze_Platform_Crm_subscription_try_user").then(function(response){instance.fileCacheHelper.loadJsFiles(["platform/apps/enums/appconfigurationtypes.js","apps/transact/managers/subscriptions/subscriptionmanager.js"],function(){instance.navigationHelper.showLoading();var successObj={CallBack:function(id){var obj={id:id};Bizgaze.Apps.Transact.Controls.Subscriptions.TryUserRegistration.Instance().createTryTenant(obj.id)},Parameters:null},formviewerObj={FormId:response.result.FormId,AppConfigurationId:0,Pk_Value:0,PortletWidgetId:0,OnSuccess:successObj,OnFail:null,OnLoad:null,FormSize:Unibase.Platform.Helpers.Size.ExtraLarge};Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj)})})})}loadControlSettings(){}loadPropertySettings(){}bindEditFormDetails(){}static Instance(){return this.instance===undefined&&(this.instance=new RegisterEmail),this.instance}}Subscriptions.RegisterEmail=RegisterEmail})(Subscriptions=Controls.Subscriptions||(Controls.Subscriptions={}))})(Controls=Transact.Controls||(Transact.Controls={}))})(Transact=Apps.Transact||(Apps.Transact={}))})(Apps=Bizgaze.Apps||(Bizgaze.Apps={}))}(Bizgaze||(Bizgaze={}));
|
||||
+278
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+1678
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
+454
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+1579
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
+242
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+693
@@ -0,0 +1,693 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Widgets;
|
||||
(function (Widgets) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class _Widget extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.existingwidgets = [];
|
||||
this.existingwidetsname = [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
jsFiles() {
|
||||
return ["platform/widgets/components/widgethiddenfields.js", "tenants/themes/compact/widgets/reportwidgets/default.js", "tenants/themes/compact/widgets/kpiwidgets/default.js", 'tenants/themes/compact/widgets/detailwidgets/default.js', 'tenants/themes/compact/widgets/detailwidgets/singledata.js', 'tenants/themes/compact/widgets/detailwidgets/singlecolumn.js', 'tenants/themes/compact/widgets/detailwidgets/singlecolumn_noborder.js', "tenants/themes/compact/widgets/kpiwidgets/comparision.js", "tenants/themes/compact/widgets/kpiwidgets/icon.js", "tenants/themes/compact/widgets/kpiwidgets/valuewithpercentage.js", "tenants/themes/compact/widgets/kpiwidgets/twovalue.js", "tenants/themes/compact/widgets/reportwidgets/withnoheaderandfooter.js", "platform/widgets/components/widgetpermission.js", "tenants/themes/compact/widgets/kpiwidgets/twovaluebgcolor.js", "tenants/themes/compact/widgets/kpiwidgets/valuewithpercentagebgcolor.js", "tenants/themes/compact/widgets/kpiwidgets/twovaluecenterline.js", "tenants/themes/compact/widgets/kpiwidgets/owlcarouselslider.js", "tenants/themes/compact/widgets/kpiwidgets/valuewithpercentageprogressbar.js", "tenants/themes/compact/widgets/kpiwidgets/kpi_fulfillment.js", "tenants/themes/compact/widgets/kpiwidgets/carouselslider.js", "tenants/themes/compact/widgets/kpiwidgets/carouselsliderbgcolor.js", "platform/analytics/components/reportviewer/widgetreportviewer.js", "platform/analytics/components/reportviewer/reportviewer.js", "platform/analytics/enums/reporttype.js", "platform/analytics/providers/ireportviewer.js", "platform/analytics/components/reportbuilder/reportbuilder.js", "platform/analytics/enums/viewertype.js", "platform/analytics/components/tableviewer/tableviewer.js", "platform/analytics/components/templateviewer/templateviewer.js", "platform/analytics/components/reportviewer/_reportviewer.js", "platform/widgets/managers/widgetmanager.js", "tenants/themes/compact/widgets/detailwidgets/customdesign.js", "platform/core/enums/expressionoperator.js", "platform/analytics/components/commonfilter/_commonfilter.js", "/platform/apps/enums/appconfigurationtypes.js", "tenants/themes/compact/widgets/kpiwidgets/comparisionrightbarcolor.js", "tenants/themes/compact/widgets/kpiwidgets/comparisionbottombarcolor.js", "tenants/themes/compact/widgets/kpiwidgets/singlevalueborder.js", "tenants/themes/compact/widgets/kpiwidgets/twovaluebottombarcolor.js", "tenants/themes/compact/widgets/kpiwidgets/singlevaluepiechart.js", "tenants/themes/compact/widgets/kpiwidgets/iconbgcolor.js", "tenants/themes/compact/widgets/kpiwidgets/iconcolor.js", "tenants/themes/compact/widgets/kpiwidgets/iconleftbarcolor.js"];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = '';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
}
|
||||
widgetsModal(InstalledAppId, event) {
|
||||
var instance = this;
|
||||
let structureId = $(event).parents('.droppablePlaceCol').attr('id');
|
||||
instance.fileCacheHelper.loadJsFile('platform/widgets/enums/widgetlayout.js', null);
|
||||
instance.fileCacheHelper.loadJsFile('platform/widgets/enums/widgettype.js', null);
|
||||
let html = `<div class="modal fade dashboardWidgetModal px-2" id="dashboardWidgetModal" tabindex="-1" role="dialog" aria-labelledby="dashboardWidgetModal" aria-hidden="true" data-backdrop="static">
|
||||
<div class="WidgetModal modal-dialog h-100 my-0 py-25" role="document">
|
||||
<div class="modal-content h-100 bg-white p-0">
|
||||
<div class="modal-header d-block px-15 pb-0 border-0">
|
||||
<ul class="d-flex list-inline justify-content-between align-items-center">
|
||||
<li class="w-90 mr-2">
|
||||
<div class="nav-header header-wth-search p-0 d-flex justify-content-center">
|
||||
<div class="card-search-bar"> <div class="search-wrapper"> <input class="form-control txt_global_search" id="widget-search" type="text" placeholder="Search" autocomplete="off"> <i class="fa fa-search search-left-icon biz-highlight-bg-color"></i> <a href="javascript:;" class="filter-icon biz-highlight-bg-color" id="filter-icon_modal_bizgaze_edit_1633325781"> <i class="las la-filter"></i> </a> <a href="javascript:;" class="search-clear-icon biz-highlight-bg-color d-none" id="search-clear-icon_modal_bizgaze_edit_1633325781"> <i class="zmdi zmdi-close"></i> </a> </div><span class="search-icon-wrapper"> <a href="javascript:;" class="search_close_icon biz-text-dark d-none" id="search_close_icon_modal_bizgaze_edit_1633325781"><i class="fa fa-close"></i> </a> </span></div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="d-none d-xl-block">
|
||||
<a class="btn btn-outline-primary mr-auto ml-auto px-2 py-1" href="javascript:;" id="AddWidget_btnCreateWidget" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().createWidget()">
|
||||
Create Widget
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav nav-tabs d-flex flex-row border-0 gap-10 my-10" id="widgetsModal_popup" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link active allWidgetsModal" id="all-tab" data-toggle="tab" href="#allWidgetsModal" role="tab" aria-controls="all" aria-selected="true" onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getWidgets(0,-1,${structureId})">
|
||||
ALL
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="kpi-tab" data-toggle="tab" href="#kpiWidgetsModal" role="tab" aria-controls="kpi" aria-selected="false" onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getWidgets(0,Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Kpi),${structureId})">
|
||||
KPI'S
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="chart-reports-tab" data-toggle="tab" href="#chartReportsModal" role="tab" aria-controls="chart-reports" aria-selected="false" onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getWidgets(0,Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Report),${structureId})">
|
||||
Charts & Reports
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="user-design-tab" data-toggle="tab" href="#userDesignedModal" role="tab" aria-controls="userDesignedModal" aria-selected="false"
|
||||
onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getWidgets(0,Number(Unibase.Platform.Widgets.Enums.WidgetLayout.UserDesigned),${structureId})">
|
||||
User Design
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="details-tab" data-toggle="tab" href="#detailsWidgetModel" role="tab" aria-controls="detailsWidgetModal" aria-selected="false" onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getWidgets(0,Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Detail),${structureId})">
|
||||
Details
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="details-tab" data-toggle="tab" href="#commonwidgetsmodal" role="tab" aria-controls="commonwidgetsmodal" aria-selected="false" onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getWidgets(Number(Unibase.Platform.Widgets.Enums.WidgetType.CommonWidget),-1,${structureId})">
|
||||
Common Widgets
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="details-tab" data-toggle="tab" href="#addedwidgetsmodal" role="tab" aria-controls="addedwidgetsmodal" aria-selected="false" onclick = "Unibase.Platform.Widgets.Components._Widget.Instance().getAddedWidgets(null,null,${structureId})">
|
||||
Added Widgets
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div data-simplebar class="simple-scroll-bar modal-body tab-content px-3 py-0 mt-0" id="dashboardWidget-modal-content">
|
||||
<div class="tab-pane fade show active" id="allWidgetsModal" role="tabpanel" aria-labelledby="all-tab">
|
||||
<ul class="row" id="allWidgetsBind">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kpiWidgetsModal" role="tabpanel" aria-labelledby="kpi-tab">
|
||||
<ul class="row" id="kpiWidgetsBind">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="chartReportsModal" role="tabpanel" aria-labelledby="chart-reports-tab">
|
||||
<ul class="row" id="reportwidgetsBind">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="userDesignedModal" role="tabpanel" aria-labelledby="details-tab">
|
||||
<ul class="row" id="userDesignedBind">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="detailsWidgetModel" role="tabpanel" aria-labelledby="details-tab">
|
||||
<ul class="row" id="detailsWidgetBind">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="commonwidgetsmodal" role="tabpanel" aria-labelledby="details-tab">
|
||||
<ul class="row" id="commonwidgetsBind">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="addedwidgetsmodal" role="tabpanel" aria-labelledby="details-tab">
|
||||
<ul class="row" id="addedwidgetsBind">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer border-0 px-15 py-10 d-flex justify-content-between bg-white">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().saveWidgets(${structureId})">Proceed</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#detailsWidgetModal').remove();
|
||||
if (InstalledAppId != 0) {
|
||||
$('#layout-detail').after(html);
|
||||
$("#dashboardWidgetModal").modal('show').css({ 'padding-left': '' });
|
||||
$('.allWidgetsModal').trigger('click');
|
||||
$('.portletwidget-item').each(function (index, elem) {
|
||||
let widgetid = +$(this).attr('data-widgetid');
|
||||
let widgetName = $(this).attr('data-widgetname');
|
||||
let state = 'exist';
|
||||
if (instance.existingwidgets.indexOf(widgetid) < 0) {
|
||||
instance.existingwidgets.push(widgetid);
|
||||
instance.existingwidetsname.push({ "widgetId": widgetid, widgetName, state });
|
||||
}
|
||||
});
|
||||
}
|
||||
if (InstalledAppId == 0) {
|
||||
$("#dashboardwidget-container-outer").after(html);
|
||||
$("#dashboardWidgetModal").modal('show');
|
||||
$('.allWidgetsModal').trigger('click');
|
||||
$('.dashboardwidget-addeditem').each(function (index, elem) {
|
||||
let hf_portletwidgetId = $(this).find('.hf_portletwidgetId').val();
|
||||
let widgetid = +$(this).attr('id');
|
||||
let widgetName = $(this).find('#hf_widgetName_' + hf_portletwidgetId).val();
|
||||
let state = 'exist';
|
||||
if (instance.existingwidgets.indexOf(widgetid) < 0) {
|
||||
instance.existingwidgets.push(widgetid);
|
||||
instance.existingwidetsname.push({ "widgetId": widgetid, widgetName, state });
|
||||
}
|
||||
});
|
||||
}
|
||||
$('#dashboardWidgetModal').on('hide.bs.modal', function (event) {
|
||||
instance.existingwidetsname = [];
|
||||
instance.existingwidgets = [];
|
||||
$(this).remove();
|
||||
});
|
||||
$("#widget-search").on("keyup", function () {
|
||||
$('#dashboardWidget-modal-content li').removeClass('hidden');
|
||||
let searchTerm = String($(this).val()).toUpperCase();
|
||||
let id = $('#widgetsModal_popup .nav-item .nav-link.active').attr('href');
|
||||
let ul = $(id + ' ul').attr('id'), widgetName;
|
||||
$('#' + ul + ' li').each(function () {
|
||||
widgetName = $(this).attr('data-widgetname');
|
||||
if (widgetName.toUpperCase().indexOf(searchTerm) > -1) {
|
||||
$(this).removeClass('hidden');
|
||||
let checklength = $(this).find(".selected").length;
|
||||
if (checklength == 1) {
|
||||
$(this).removeClass("d-none");
|
||||
$(this).find("a").addClass("opacity-40");
|
||||
$(this).append('<div class="added_widget_dispalytext mr-25 opacity-95 position-absolute r-0 t-0 text-center text-success" style="margin-top: -1px;">Already Added</div>');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(this).addClass('hidden');
|
||||
}
|
||||
});
|
||||
if ($("#widget-search").val() == "") {
|
||||
$(".widgets_card").each(function () {
|
||||
let checklength = $(this).find(".selected").length;
|
||||
if (checklength == 1) {
|
||||
$(this).addClass("d-none");
|
||||
$(this).find("a").removeClass("opacity-40");
|
||||
$(this).find(".added_widget_dispalytext").remove();
|
||||
$(this).find(".selected").addClass("d-none");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
loadDetailPageModal(widgets, bindingDiv, installedAppId, portletId, structuredesignId) {
|
||||
let instance = this, widgetData = widgets.result, allhtml = '', kpihtml = '', detailhtml = '', reporthtml = '';
|
||||
for (var a = 0; a < widgetData.length; a++) {
|
||||
allhtml = '<li class="col-md-3 my-2" data-widgetType="' + bindingDiv + '" data-widgetName="' + widgetData[a].WidgetName + '"><a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,' + structuredesignId + ');"><div class="p-3 h-55p bg-grey-light-5 search" data-isselect="false" data-widgetid="' + widgetData[a].WidgetId + '" data-typeWidgets="" data-uniqueWidgetId = "' + widgetData[a].UniqueId + '" data-widgetName="' + widgetData[a].WidgetName + '"><p class="text-dark">' + widgetData[a].WidgetName + '</p></div></a></li>';
|
||||
$('#allWidgetsBind').append(allhtml);
|
||||
$('#commonwidgetsBind').append(allhtml);
|
||||
}
|
||||
if (bindingDiv == 'common-widgets') {
|
||||
let kpi_Widgets = widgetData.filter(x => x.WidgetLayoutName == "KPI");
|
||||
for (var k = 0; k < kpi_Widgets.length; k++) {
|
||||
kpihtml = '<li class="col-md-3 my-2" data-widgetType="' + bindingDiv + '" data-widgetName="' + kpi_Widgets[k].WidgetName + '"><a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,' + structuredesignId + ');"><div class="p-3 h-55p bg-grey-light-5" data-isselect="false" data-widgetid="' + kpi_Widgets[k].WidgetId + '" data-typeWidgets="" data-uniqueWidgetId = "' + kpi_Widgets[k].UniqueId + '" data-widgetName="' + kpi_Widgets[k].WidgetName + '"><p class="text-dark">' + kpi_Widgets[k].WidgetName + '</p></div></a></li>';
|
||||
$('#kpiWidgetsBind').append(kpihtml);
|
||||
}
|
||||
widgetData.filter(x => x.widgetlayoutname == "Detail");
|
||||
var details_Widgets = widgetData.filter(function (o) { return o.WidgetLayoutName === "Detail"; });
|
||||
for (var d = 0; d < details_Widgets.length; d++) {
|
||||
detailhtml = '<li class="col-md-3 my-2" data-widgetType="' + bindingDiv + '" data-widgetName="' + details_Widgets[d].WidgetName + '"><a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,' + structuredesignId + ');"><div class="p-3 h-55p bg-grey-light-5" data-isselect="false" data-widgetid="' + details_Widgets[d].WidgetId + '" data-typeWidgets="" data-uniqueWidgetId = "' + details_Widgets[d].UniqueId + '" data-widgetName="' + details_Widgets[d].WidgetName + '"><p class="text-dark">' + details_Widgets[d].WidgetName + '</p></div></a></li>';
|
||||
$('#detailsWidgetBind').append(detailhtml);
|
||||
}
|
||||
var report_Widgets = widgetData.filter(function (o) { return o.WidgetLayoutName === "Report"; });
|
||||
for (var r = 0; r < report_Widgets.length; r++) {
|
||||
reporthtml = '<li class="col-md-3 my-2" data-widgetType="' + bindingDiv + '" data-widgetName="' + report_Widgets[r].WidgetName + '"><a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,' + structuredesignId + ');"><div class="p-3 h-55p bg-grey-light-5" data-widgetid="' + report_Widgets[r].WidgetId + '" data-isselect="false" data-typeWidgets="" data-uniqueWidgetId = "' + report_Widgets[r].UniqueId + '" data-widgetName="' + report_Widgets[r].WidgetName + '"><p class="text-dark">' + report_Widgets[r].WidgetName + '</p></div></a></li>';
|
||||
$('#reportwidgetsBind').append(reporthtml);
|
||||
}
|
||||
}
|
||||
if (bindingDiv == 'already-added-widgets') {
|
||||
var already_Widgets = widgetData;
|
||||
for (var w = 0; w < already_Widgets.length; r++) {
|
||||
reporthtml = '<li class="col-md-3 my-2" data-widgetType="' + bindingDiv + '" data-widgetName="' + already_Widgets[w].WidgetName + '"><a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,' + structuredesignId + ');"><div class="p-3 h-55p bg-grey-light-5" data-widgetid="' + already_Widgets[w].WidgetId + '" data-isselect="false" data-typeWidgets="" data-uniqueWidgetId = "' + already_Widgets[w].UniqueId + '" data-widgetName="' + already_Widgets[w].WidgetName + '"><p class="text-dark">' + already_Widgets[w].WidgetName + '</p></div></a></li>';
|
||||
$('#addedwidgetsBind').append(already_Widgets);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < widgetData.length; i++) {
|
||||
var html = '<li class="nav-item widget-item widget-added-item mt-10 list-widget-' + widgetData[i].WidgetId + ' widgetid-' + widgetData[i].WidgetId + '' + bindingDiv + ' dsl-block datagroup" data-toggle="popover-hover" data-img="tenants/themes/default/imgs/imgpopover.png" value=' + widgetData[i].WidgetId + ' id="ListWidgets">' +
|
||||
'<input type="hidden" value=' + widgetData[i].WidgetId + ' id="hf_ListwidgetId" />' +
|
||||
'<input type="hidden" value=' + widgetData[i].WidgetUrl + ' id="widgetUrl-' + widgetData[i].WidgetId + '" />' +
|
||||
'<input type="hidden" value="' + widgetData[i].WidgetName + '" id="widgetName" />' +
|
||||
'<input type="hidden" value=' + widgetData[i].IsFiltarable + ' id="IsFiltarable" />' +
|
||||
'<input type="hidden" value=' + widgetData[i].UniqueId + ' id="hf_WidgetUniqueId" />' +
|
||||
'<input type="hidden" value=' + widgetData[i].Width + ' id="widgetWidth" />' +
|
||||
'<span><i class="las la-braille dragger"></i>' +
|
||||
'<span title="' + widgetData[i].WidgetName + '" class="dsl-block-name" style="color:#2f343a !important" >' + widgetData[i].WidgetName + '</span>' +
|
||||
'</span>' +
|
||||
'</li>';
|
||||
$('.' + bindingDiv + ':last').after(html);
|
||||
}
|
||||
instance.selectedWidget();
|
||||
}
|
||||
selectedWidget() {
|
||||
let selectedHtml = `<div class="selected">
|
||||
<i class="fa fa-check-circle text-success font-20"></i>
|
||||
</div>`;
|
||||
let widgetidSelect;
|
||||
$('#dashboardwidget-container').find('.widgetdataHere').each(function () {
|
||||
if ($(this).attr('data-strctwidgetindex') == undefined) {
|
||||
widgetidSelect = $(this).attr('id');
|
||||
}
|
||||
else {
|
||||
let widgetidArr = [];
|
||||
widgetidArr = $(this).attr('id').split('-');
|
||||
widgetidSelect = widgetidArr[1];
|
||||
}
|
||||
$('div[data-widgetid=' + widgetidSelect + ']').closest('li').find('.selected').remove();
|
||||
$('div[data-widgetid=' + widgetidSelect + ']').closest('li').append(selectedHtml);
|
||||
});
|
||||
}
|
||||
selectWidget(e, structuredesignId) {
|
||||
let instance = this;
|
||||
let installedappid = Number(Unibase.Themes.Providers.DetailHelper.installedAppId), portletId;
|
||||
if (installedappid != 0) {
|
||||
portletId = $('#layout-detail-tabs .nav-link.active').find('#hf_PortletId').val();
|
||||
}
|
||||
else {
|
||||
portletId = $('._bizgaze_detail_container').find('#hf_PortletId').val();
|
||||
}
|
||||
let widgetId = $(e).find('div').attr('data-widgetid');
|
||||
let widgetName = $(e).find('p').text();
|
||||
let selectedHtml = `<div class="selected">
|
||||
<i class="fa fa-check-circle text-success font-20"></i>
|
||||
</div>`;
|
||||
if ($(e).find('div.search').attr('data-isselect') == 'true') {
|
||||
$(e).find('div.search').attr('data-isselect', 'false');
|
||||
$(e).find('div.selected').remove();
|
||||
let state = "removed";
|
||||
let findindex = instance.existingwidgets.indexOf(+widgetId);
|
||||
if (findindex > -1) {
|
||||
instance.existingwidetsname[findindex].state = state;
|
||||
}
|
||||
else {
|
||||
instance.existingwidgets.push(+widgetId);
|
||||
instance.existingwidetsname.push({ widgetId: +widgetId, widgetName, state });
|
||||
}
|
||||
if (installedappid != 0) {
|
||||
Unibase.Themes.Compact.Components.Details.Instance().isPortletModified = false;
|
||||
}
|
||||
if (installedappid == 0) {
|
||||
$('#' + structuredesignId).find('#' + widgetId).remove();
|
||||
}
|
||||
}
|
||||
else if ($(e).find('div').attr('data-isselect') == 'false') {
|
||||
$(e).find('div').attr('data-isselect', 'true');
|
||||
$(e).find('div.card').append(selectedHtml);
|
||||
let state = 'added';
|
||||
let findindex = instance.existingwidgets.indexOf(+widgetId);
|
||||
if (findindex > -1) {
|
||||
instance.existingwidetsname[findindex].state = state;
|
||||
}
|
||||
else {
|
||||
instance.existingwidgets.push(+widgetId);
|
||||
instance.existingwidetsname.push({ widgetId: +widgetId, widgetName, state });
|
||||
}
|
||||
if (installedappid != 0) {
|
||||
Unibase.Themes.Compact.Components.Details.Instance().isPortletModified = true;
|
||||
}
|
||||
if (installedappid == 0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
getAppWidgets(widgettype, widgetlayout, _AppsStructureId) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/widgets/managers/widgetmanager.js", function () {
|
||||
var installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getAppWidgets_(installedAppId, widgettype, widgetlayout).then(function (response) {
|
||||
var _a, _b, _c;
|
||||
if (response != null) {
|
||||
var widgetData = response.result;
|
||||
$('#commonwidgetsBind').html('');
|
||||
$('#detailsWidgetBind').html('');
|
||||
$('#userDesignedBind').html('');
|
||||
$('#reportwidgetsBind').html('');
|
||||
$('#kpiWidgetsBind').html('');
|
||||
$('#allWidgetsBind').html('');
|
||||
for (var i = 0; i < widgetData.length; i++) {
|
||||
let findexistingwidget = instance.existingwidgets.indexOf(+widgetData[i].WidgetId);
|
||||
var html = `<li class="col-md-3 my-2 widgets_card" data-widgettype="${widgetData[i].WidgetTypeId}" data-widgetname="${widgetData[i].WidgetName}">
|
||||
<a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,${_AppsStructureId});">
|
||||
<div class="card flex-row p-3 bg-grey-light-5 search align-items-center justify-content-between" data-isselect="${((_a = instance.existingwidetsname[findexistingwidget]) === null || _a === void 0 ? void 0 : _a.state) == 'exist' || ((_b = instance.existingwidetsname[findexistingwidget]) === null || _b === void 0 ? void 0 : _b.state) == 'added' ? true : false}" data-widgetid="${widgetData[i].WidgetId}" data-typewidget="${widgetData[i].WidgetTypeId}" data-uniquewidgetid="${widgetData[i].UniqueId}" data-widgetname="${widgetData[i].WidgetName}">
|
||||
<p class="text-dark text-truncate mr-2">${widgetData[i].WidgetName}</p>`;
|
||||
if (findexistingwidget > -1) {
|
||||
if (((_c = instance.existingwidetsname[findexistingwidget]) === null || _c === void 0 ? void 0 : _c.state) != 'removed') {
|
||||
html += `<div class="selected">
|
||||
<i class="fa fa-check-circle text-success font-20"></i>
|
||||
</div>
|
||||
</div></a></li>`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
html += '</div></a></li >';
|
||||
}
|
||||
if (widgettype == 0 && widgetlayout == -1) {
|
||||
$('#allWidgetsBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Kpi)) {
|
||||
$('#kpiWidgetsBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Report)) {
|
||||
$('#reportwidgetsBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.UserDesigned)) {
|
||||
$('#userDesignedBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Detail)) {
|
||||
$('#detailsWidgetBind').append(html);
|
||||
}
|
||||
else if (widgettype == Number(Unibase.Platform.Widgets.Enums.WidgetType.CommonWidget)) {
|
||||
$('#commonwidgetsBind').append(html);
|
||||
}
|
||||
$(".widgets_card").each(function () {
|
||||
var checklength = $(this).find(".selected").length;
|
||||
if (checklength == 1) {
|
||||
$(this).addClass("d-none");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
getAddedWidgets() {
|
||||
let installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
let instance = this;
|
||||
$('#addedwidgetsBind').html('');
|
||||
$('#commonwidgetsBind').html('');
|
||||
$('#detailsWidgetBind').html('');
|
||||
$('#userDesignedBind').html('');
|
||||
$('#reportwidgetsBind').html('');
|
||||
$('#kpiWidgetsBind').html('');
|
||||
$('#allWidgetsBind').html('');
|
||||
if (installedappid != 0) {
|
||||
$('.portletwidget-item').each(function (index, elem) {
|
||||
let findexistingwidget = instance.existingwidgets.indexOf(+$(this).attr('data-widgetid'));
|
||||
var html = `<li class="col-md-3 my-2 added_widgets" data-widgetid="${$(this).attr('data-widgetid')}" data-widgetname="${$(this).attr('data-widgetname')}">
|
||||
<a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,undefined);">
|
||||
<div class="card flex-row justify-content-between align-items-center p-3 h-55p bg-grey-light-5 search" data-isselect="${instance.existingwidetsname[findexistingwidget].state != 'removed' ? true : false}" data-widgetid="${$(this).attr('data-widgetid')}" data-typewidgets="" data-uniquewidgetid="" data-widgetname="${$(this).attr('data-widgetname')}">
|
||||
<p class="text-dark text-truncate mr-2">${$(this).attr('data-widgetname')}</p></div></a></li>`;
|
||||
$('#addedwidgetsBind').append(html);
|
||||
});
|
||||
}
|
||||
else if (installedappid == 0) {
|
||||
$('.dashboardwidget-addeditem').each(function (index, elem) {
|
||||
let hf_portletwidgetId = $(this).find('.hf_portletwidgetId').val();
|
||||
let findexistingwidget = instance.existingwidgets.indexOf(+$(this).attr('id'));
|
||||
let widgetId = $(this).attr('id');
|
||||
let widgetItem = $(this).find('#hf_portletwidgetId').val();
|
||||
let widgetName;
|
||||
if ($(this).find('#hf_widgetName_' + widgetItem).val() != undefined) {
|
||||
widgetName = $(this).find('#hf_widgetName_' + widgetItem).val();
|
||||
}
|
||||
else {
|
||||
widgetName = $(this).find('#hf_kpi_widgetName_' + widgetId).text();
|
||||
}
|
||||
var html = `<li class="col-md-3 my-2" data-widgetid="${widgetId}" data-widgetname="${widgetName}">
|
||||
<a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,undefined);">
|
||||
<div class="card flex-row justify-content-between align-items-center p-3 h-55p bg-grey-light-5 search" data-isselect="${instance.existingwidetsname[findexistingwidget].state != 'removed' ? true : false}" data-widgetid="${$(this).attr('id')}" data-typewidgets="" data-uniquewidgetid="" data-widgetname="${$(this).find('#hf_widgetName_' + hf_portletwidgetId).val()}">
|
||||
<p class="text-dark text-truncate mr-2">${widgetName}</p></div></a></li>`;
|
||||
$('#addedwidgetsBind').append(html);
|
||||
});
|
||||
}
|
||||
}
|
||||
getWidgets(widgettype, widgetlayout, structureId) {
|
||||
let installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
let instance = this;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/widgets/managers/widgetmanager.js", function () {
|
||||
if (installedappid == 0) {
|
||||
instance.getDashboardWidgets(widgettype, widgetlayout, structureId.id);
|
||||
}
|
||||
else if (installedappid != 0) {
|
||||
let AppsStructureId;
|
||||
if (structureId != undefined) {
|
||||
AppsStructureId = $(structureId).attr('id');
|
||||
}
|
||||
instance.getAppWidgets(widgettype, widgetlayout, AppsStructureId);
|
||||
}
|
||||
});
|
||||
}
|
||||
getDashboardWidgets(widgettype, widgetlayout, structureId) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/widgets/managers/widgetmanager.js", function () {
|
||||
var installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDashboardWidgets(widgetlayout, widgettype).then(function (response) {
|
||||
var _a, _b;
|
||||
if (response != null) {
|
||||
var widgetData = response.result;
|
||||
$('#commonwidgetsBind').html('');
|
||||
$('#detailsWidgetBind').html('');
|
||||
$('#userDesignedBind').html('');
|
||||
$('#reportwidgetsBind').html('');
|
||||
$('#kpiWidgetsBind').html('');
|
||||
$('#allWidgetsBind').html('');
|
||||
for (var i = 0; i < widgetData.length; i++) {
|
||||
let findIndex = instance.existingwidgets.indexOf(widgetData[i].WidgetId);
|
||||
var html = `<li class=" col-md-3 my-2 widgets_card" data-widgettype="${widgetData[i].WidgetTypeId}" data-widgetname="${widgetData[i].WidgetName}">
|
||||
<a href="javascript:;" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().selectWidget(this,${structureId});">
|
||||
<div class="card h-100 mb-0 p-3 bg-grey-light-5 search justify-content-between align-items-center flex-row" data-isselect="${((_a = instance.existingwidetsname[findIndex]) === null || _a === void 0 ? void 0 : _a.state) == 'exist' || ((_b = instance.existingwidetsname[findIndex]) === null || _b === void 0 ? void 0 : _b.state) == 'added' ? true : false}" data-widgetid="${widgetData[i].WidgetId}" data-typewidget="${widgetData[i].WidgetTypeId}" data-uniquewidgetid="${widgetData[i].UniqueId}" data-widgetname="${widgetData[i].WidgetName}">
|
||||
<p class="text-dark text-truncate mr-2">${widgetData[i].WidgetName}</p>`;
|
||||
if (findIndex > -1) {
|
||||
if (instance.existingwidetsname[findIndex].state != 'removed') {
|
||||
html += `<div class="selected">
|
||||
<i class="fa fa-check-circle text-success font-20"></i>
|
||||
</div>
|
||||
</div></a></li>`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
html += '</div></a></li>';
|
||||
}
|
||||
if (widgettype == 0 && widgetlayout == -1) {
|
||||
$('#allWidgetsBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Kpi)) {
|
||||
$('#kpiWidgetsBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Report)) {
|
||||
$('#reportwidgetsBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.UserDesigned)) {
|
||||
$('#userDesignedBind').append(html);
|
||||
}
|
||||
else if (widgetlayout == Number(Unibase.Platform.Widgets.Enums.WidgetLayout.Detail)) {
|
||||
$('#detailsWidgetBind').append(html);
|
||||
}
|
||||
else if (widgettype == Number(Unibase.Platform.Widgets.Enums.WidgetType.CommonWidget)) {
|
||||
$('#commonwidgetsBind').append(html);
|
||||
}
|
||||
$(".widgets_card").each(function () {
|
||||
var checklength = $(this).find(".selected").length;
|
||||
if (checklength == 1) {
|
||||
$(this).addClass("d-none");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
saveWidgets(structureId) {
|
||||
let instance = this;
|
||||
console.log(instance.existingwidetsname);
|
||||
let installedappid = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
|
||||
instance.existingwidetsname.forEach((elem, index) => {
|
||||
if (elem.state == 'added') {
|
||||
if ($('#' + VisibleContainerId).find('.portletwidget-item.widgetid-' + elem.widgetId).length == 0) {
|
||||
let installedappid = Number(Unibase.Themes.Providers.DetailHelper.installedAppId), portletId;
|
||||
if (installedappid != 0) {
|
||||
portletId = $('#' + VisibleContainerId).find('#layout-detail-tabs .nav-link.active').find('#hf_PortletId').val();
|
||||
}
|
||||
else {
|
||||
portletId = $('#' + VisibleContainerId).find('._bizgaze_detail_container').find('#hf_PortletId').val();
|
||||
}
|
||||
let widgetId = elem.widgetId;
|
||||
let widgetName = elem.widgetName;
|
||||
let sortable = "";
|
||||
if (Unibase.Themes.Compact.Components.Index.Instance().isAppStructureEnable) {
|
||||
sortable = "dashboardwidget-item px-0";
|
||||
}
|
||||
if (installedappid != 0) {
|
||||
let dropInPortlet = `<div class="portletwidget-item ${sortable} dashboarddisplaynone portletwidget-addeditem widgetItem-${widgetId} widgetid-${widgetId} col-sm-12 mb-sm-20 mb-2" id="${widgetId}" data-portletwidgetid="" data-widgetid="${widgetId}" data-portletid="${portletId}" data-widgetname="${widgetName}">
|
||||
<div class="card"><input type="hidden" value="${widgetId}" id="hf_widgetId"><input type="hidden" value="0" id="hf_widgetId_uniq"><div class="card-header"><div class="dragWidget dargwidget-${widgetId} pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap editwidget editwidget-${widgetId} pull-right m-t-sm m-r-lg" id="editwidget">
|
||||
<a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Edit Widget" onclick="Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/widgets/components/widget.js',function () {Unibase.Platform.Widgets.Components.Widget.Instance().loadWidgetData(${widgetId},${installedappid}, true, 0));});"><span class="btn-icon-wrap"><i class="ti-pencil" id="EditWidget-${widgetId}"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="delete widget" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().deletePortletWidgets(0,${widgetId})"><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="card-body rounded-4 py-15 bg-white"><span class="biz-highlight-bg-color widget-font widget-title-link">${widgetName}</span></div></div></div>`;
|
||||
if (Unibase.Themes.Compact.Components.Index.Instance().isAppStructureEnable && structureId != undefined) {
|
||||
$('#' + VisibleContainerId).find(`#${structureId.id} .widgetplace:first`).append(dropInPortlet);
|
||||
}
|
||||
else {
|
||||
$('#' + VisibleContainerId).find('#tab-container').append(dropInPortlet);
|
||||
}
|
||||
}
|
||||
else if (installedappid == 0) {
|
||||
let dashboardHtml = `<div class="mt-2 dashboardwidget-item dashboarddisplaynone dashboardwidget-addeditem widgetItem-${widgetId} widgetid-${widgetId} w-100" id="${widgetId}"><div class="card"><input type="hidden" value="${widgetId}" id="hf_widgetId"><input type="hidden" value="0" id="hf_widgetId_uniq">
|
||||
<div class="card-header"><div class="dragWidget dargwidget-${widgetId} pull-left d-none" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap editwidget editwidget-${widgetId} pull-right m-t-sm m-r-lg" id="editwidget"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover d-none" title="Edit Widget" onclick="Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('platform/widgets/components/widget.js',function () {Unibase.Platform.Widgets.Components.Widget.Instance().loadWidgetData(${widgetId},${installedappid}, true, 0));});"><span class="btn-icon-wrap"><i class="ti-pencil" id="EditWidget-${widgetId}"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="delete widget" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().deletePortletWidgets(0,${widgetId})"><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div>
|
||||
<div class="card-body rounded-4 py-15 bg-white"><span class="biz-highlight-bg-color widget-font widget-title-link" id="hf_kpi_widgetName_${widgetId}">${widgetName}</span></div></div></div>`;
|
||||
$('#' + structureId.id).find('.widgetplace').first().append(dashboardHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (elem.state == 'removed') {
|
||||
if (installedappid != 0) {
|
||||
$('.portletwidget-item.widgetid-' + elem.widgetId).find('a[title="delete widget"]').click();
|
||||
}
|
||||
else if (installedappid == 0) {
|
||||
$('.dashboardwidget-addeditem.widgetid-' + elem.widgetId).find('a[title="delete widget"]').click();
|
||||
}
|
||||
instance.existingwidgets = instance.existingwidgets.filter(id => id != +elem.widgetId);
|
||||
instance.existingwidetsname = instance.existingwidetsname.filter(obj => obj.widgetId != elem.widgetId);
|
||||
}
|
||||
});
|
||||
}
|
||||
createWidget() {
|
||||
$('#dashboardWidgetModal').modal('hide');
|
||||
$('.dashboardcreatewidgetbtn').click();
|
||||
}
|
||||
structSetting(e) {
|
||||
let instance = this;
|
||||
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId();
|
||||
$('#' + VisibleContainerId).find("#structure_settingModal").remove();
|
||||
let block_len, Blockhtml = '', paramater_id = [], bindMobile = [], bindTab = [], data = [];
|
||||
block_len = $(e).parent().siblings().length;
|
||||
$(e).parent().siblings().each(function (i, e) {
|
||||
Blockhtml += '<li class="d-flex flex-column pt-1 pb-20" id="li_block_' + i + '"> <label for="txt_block_' + i + '" class="font-weight-600">Width - ' + i + ' <span class="text-danger">*</span></label> <input type="text" class="form-control shadow-none txt_block_' + i + '" data-isdynamic="false" placeholder="Width - ' + i + '*" data-placeholder="Enter Width - ' + i + '" data-validatename="Width - ' + i + '" data-label="Width - ' + i + ' *" autocomplete="off"> </li>';
|
||||
let id = $(this).attr('id');
|
||||
paramater_id.push(id);
|
||||
if ($('#' + VisibleContainerId).find("#" + id).attr('data-mobile_settingwidth') != undefined) {
|
||||
bindMobile = $('#' + VisibleContainerId).find("#" + id).attr('data-mobile_settingwidth').split('|');
|
||||
}
|
||||
if ($('#' + VisibleContainerId).find("#" + id).attr('data-tab_settingwidth') != undefined) {
|
||||
bindTab = $('#' + VisibleContainerId).find("#" + id).attr('data-tab_settingwidth').split('|');
|
||||
}
|
||||
data.push({ "Mobile": bindMobile[i], "Tab": bindTab[i], "id": id, "index": i });
|
||||
});
|
||||
let structbindhtml = '<ul class="card border-0"><li class="card-body p-0"><ul class="nav nav-tabs w-100 border-0 d-flex flex-row" id="structures-settings-m-t" role="tablist"><li class="nav-item"><a class="nav-link active border-0 ml-0" id="mobile-setting-t" data-toggle="tab" href="#mobile-tab-setting" role="tab" aria-controls="mobile" aria-selected="true">Mobile</a></li><li class="nav-item"><a class="nav-link border-0" id="tab-setting-t" data-toggle="tab" href="#tab-tab-setting" role="tab" aria-controls="tab" aria-selected="false">Tab</a></li></ul><div class="tab-content"><div class="tab-pane fade show active" id="mobile-tab-setting" role="tabpanel" aria-labelledby="mobile-tab"><ul class="d-flex flex-column">' + Blockhtml + '</ul></div><div class="tab-pane fade" id="tab-tab-setting" role="tabpanel" aria-labelledby="tab-tab"><ul class="d-flex flex-column">' + Blockhtml + '</ul></div></div></li></li>';
|
||||
let pasParameter = paramater_id.join('|');
|
||||
let modalhtml = '<div class="modal fade" id="structure_settingModal" tabindex="-1" role="dialog" data-backdrop="false" data-keyboard="false" aria-labelledby="structureModalLabel" aria-hidden="true" style="background-color: rgba(0,0,0, 0.4);"> <div class="modal-dialog" role="document"> <div class="modal-content"><div class="modal-body structres-setting-modal py-2" id="structres-setting-modal">' + structbindhtml + '</div><div class="modal-footer py-10 d-flex justify-content-between"> <a class="btn btn-secondary" data-dismiss="modal" data-btn_close="closed">Close</a> <a class="btn btn-primary" onclick="Unibase.Platform.Widgets.Components._Widget.Instance().structureSetting(this,`' + pasParameter + '`)">Save</a> </div></div></div></div>';
|
||||
if (Unibase.Themes.Providers.DetailHelper.installedAppId) {
|
||||
$('#' + VisibleContainerId).css('z-index', 1201);
|
||||
$('#' + VisibleContainerId).find(".detail-container-content-outer").append(modalhtml);
|
||||
}
|
||||
else {
|
||||
$('#' + VisibleContainerId).find("#dashboardwidget-container-outer").prepend(modalhtml);
|
||||
}
|
||||
$('#' + VisibleContainerId).find("#structure_settingModal").modal('show');
|
||||
for (var k = 0; k < data.length; k++) {
|
||||
if (data[k].Mobile != undefined && data[k].Mobile != null && data[k].Mobile != '') {
|
||||
$('#' + VisibleContainerId + ' #mobile-tab-setting').find('.txt_block_' + data[k].index).val(data[k].Mobile);
|
||||
}
|
||||
else {
|
||||
$('#' + VisibleContainerId + ' #mobile-tab-setting').find('.txt_block_' + data[k].index).val('');
|
||||
}
|
||||
if (data[k].Tab != undefined && data[k].Tab != null && data[k].Tab != '') {
|
||||
$('#' + VisibleContainerId + ' #tab-tab-setting').find('.txt_block_' + data[k].index).val(data[k].Tab);
|
||||
}
|
||||
else {
|
||||
$('#' + VisibleContainerId + ' #tab-tab-setting').find('.txt_block_' + data[k].index).val('');
|
||||
}
|
||||
}
|
||||
$('[data-btn_close="closed"]').on('click', function () {
|
||||
$('#' + Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId()).css('z-index', 9);
|
||||
});
|
||||
}
|
||||
structureSetting(e, id) {
|
||||
let instance = this, parameter = [], mobileWidth = [], _mobileWidth = '', tabWidth = [], _tabWidth = '', VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId();
|
||||
parameter = id.split('|');
|
||||
$('#' + VisibleContainerId).css('z-index', 9);
|
||||
$('#' + VisibleContainerId + ' #mobile-tab-setting').find('input[type=text]').each(function () {
|
||||
if (($(this).val() != undefined) && ($(this).val() != '') && ($(this).val() != null)) {
|
||||
mobileWidth.push($(this).val());
|
||||
}
|
||||
else {
|
||||
mobileWidth.push(0);
|
||||
}
|
||||
});
|
||||
_mobileWidth = mobileWidth.join('|');
|
||||
$('#' + VisibleContainerId + ' #tab-tab-setting').find('input[type=text]').each(function () {
|
||||
if (($(this).val() != undefined) && ($(this).val() != '') && ($(this).val() != null)) {
|
||||
tabWidth.push($(this).val());
|
||||
}
|
||||
else {
|
||||
tabWidth.push(0);
|
||||
}
|
||||
});
|
||||
_tabWidth = tabWidth.join('|');
|
||||
for (var i = 0; i < parameter.length; i++) {
|
||||
if ((parameter[i] != '') && (parameter[i] != undefined)) {
|
||||
$('#' + VisibleContainerId).find('#' + parameter[i]).attr({
|
||||
'data-Mobile_SettingWidth': _mobileWidth, 'data-Tab_SettingWidth': _tabWidth
|
||||
});
|
||||
}
|
||||
}
|
||||
$('#' + VisibleContainerId).find("#structres-setting-modal").siblings('.modal-footer').find('[data-dismiss="modal"]').click();
|
||||
}
|
||||
KpiCode() {
|
||||
if ($('#code-preview-slash').length == 0) {
|
||||
$('#option-back').before('<a class="btn btn-flush-theme mr-2 btn-icon flush-soft-hover font-22" id="code-preview-slash" data-icon="iconslash" href="javascript:;"><span class="btn-icon-wrap"><span class="line-icon"><i class="la la-eye-slash"></i></span></span></a>');
|
||||
$('#code-preview-slash').on('click', function () {
|
||||
let isExecute = false;
|
||||
if ($(this).attr('data-icon') == "iconslash" && isExecute == false) {
|
||||
isExecute = true;
|
||||
let html = $('.designsPreviewAppendClass textarea').val().toString();
|
||||
$('.designsPreviewAppendClass').html(html);
|
||||
Unibase.Platform.Widgets.Components.Widget.Instance().customHtml = html;
|
||||
$(this).attr('data-icon', 'icon');
|
||||
$(this).find('.la').removeClass('la-eye-slash').addClass('la-eye');
|
||||
}
|
||||
if ($(this).attr('data-icon') == "icon" && isExecute == false) {
|
||||
isExecute = true;
|
||||
let HTML = $('.designsPreviewAppendClass').html();
|
||||
$('.designsPreviewAppendClass').html('').append('<textarea class="border-dark h-80 w-100 " data-kpidesigns="CustomDesign" rows="9" cols="90" style="box-shadow: none;"></textarea>');
|
||||
$('.designsPreviewAppendClass textarea').val(HTML);
|
||||
$(this).attr('data-icon', 'iconslash');
|
||||
$(this).find('.la').removeClass('la-eye').addClass('la-eye-slash');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('#code-preview-slash').attr('data-icon', 'iconslash').find('.la').removeClass('la-eye').addClass('la-eye-slash');
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new Unibase.Platform.Widgets.Components._Widget();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Components._Widget = _Widget;
|
||||
})(Components = Widgets.Components || (Widgets.Components = {}));
|
||||
})(Widgets = Platform.Widgets || (Platform.Widgets = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Widgets;
|
||||
(function (Widgets) {
|
||||
class WidgetHiddenFields {
|
||||
constructor() {
|
||||
this.PortletWidgets = [];
|
||||
this.Portlets = [];
|
||||
this.NewWidgets = [];
|
||||
this.NewWidgetsForPortlet = [];
|
||||
this.SelectedWidgets = [];
|
||||
this.deleteWidget = [];
|
||||
this.editWidget = [];
|
||||
this.EditPortletAndWidgetsIds = [];
|
||||
this.uniq_new_portletwid = 0;
|
||||
this.wid = 0;
|
||||
this.pwid = 0;
|
||||
this.unix_pwid = 0;
|
||||
this.StructureDesigns = [];
|
||||
this.StructureDesignDelete = [];
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new WidgetHiddenFields();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Widgets.WidgetHiddenFields = WidgetHiddenFields;
|
||||
})(Widgets = Platform.Widgets || (Platform.Widgets = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+119
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Исполняемый файл
+12
@@ -0,0 +1,12 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Helpers;
|
||||
(function (Helpers) {
|
||||
class File {
|
||||
}
|
||||
Helpers.File = File;
|
||||
})(Helpers = Platform.Helpers || (Platform.Helpers = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
var Unibase;(function(Unibase){let Platform;(function(Platform){let Helpers;(function(Helpers){class File{}Helpers.File=File})(Helpers=Platform.Helpers||(Platform.Helpers={}))})(Platform=Unibase.Platform||(Unibase.Platform={}))})(Unibase||(Unibase={}));
|
||||
Ссылка в новой задаче
Block a user