VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/keeview_app/html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/keeview_app/html/mobile_contact_view.js
"use strict";

theme.formContactShow = function(host, params){
    var scrollInto = function(value){
        if (sectionList[value]) sectionList[value].scrollIntoView();
    };
    var drawContactView = function(){
        var viewContact = DOMElement.div({
            attrs: {
                style: {
                    paddingTop: "var(--control-verticle-distance-2)"
                }
            }
        });
        host.drawContactViewFunc(viewContact);
        var childs = [
            {
                class: 'm-mk-section-header-name',
                child: { text: LanguageModule.text("txt_general_information") },
            }
        ];
        childs.push({
            class: 'm-mk-section-header-right',
            child: [
                DOMElement.a({
                    attrs: {
                        onclick: function(){
                            params.func.editContact();
                        }
                    },
                    text: LanguageModule.text("txt_edit")
                })
            ]
        });
        var res = absol.buildDom({
            attr: {
                "data-sectionid": "general_information"
            },
            child: [
                absol.buildDom({
                    class: ["m-mk-section-header", "first"],
                    child: childs
                }),
                viewContact
            ]
        });
        return res;
    };
    host.nameViewCtn = DOMElement.div({});
    var data_ctn = DOMElement.div({});
    data_ctn.appendChild(drawContactView());
    var activitiesCtn = absol.buildDom({
        attr: {
            "data-sectionid": "to_do"
        }
    });
    data_ctn.appendChild(activitiesCtn);
    var sectionList = {};
    absol.$("div", data_ctn, function(elt){
        var id = elt.getAttribute("data-sectionid");
        if (!id) return;
        sectionList[id] = elt;
    });
    var header = absol.buildDom({
        tag: 'mheaderbar',
        props: {
            actionIcon: DOMElement.i({
                attrs: {
                    className: "material-icons"
                },
                text: "arrow_back_ios"
            }),
            title: host.nameViewCtn,
            quickmenu: {
                props: {
                    extendClasses: 'cd-context-menu',
                    items: [
                        {
                            text: LanguageModule.text("txt_general_information"),
                            icon: DOMElement.i({
                                attrs: {
                                    className: "mdi mdi-information-outline"
                                }
                            }),
                            extendClasses: "bsc-quickmenu",
                            cmd: function(){
                                scrollInto("general_information");
                            }
                        },
                        {
                            text: LanguageModule.text("txt_to_do"),
                            extendClasses: "bsc-quickmenu",
                            icon: DOMElement.span({
                                attrs: {
                                    className: "mdi mdi-clock-time-eight-outline"
                                }
                            }),
                            cmd: function(){
                                scrollInto("to_do");
                            }
                        }
                    ]
                },
                onSelect: function (x) {
                    x.cmd();
                }
            }
        },
        on: {
            action: function(){
                host.frameList.removeLast();
                window.backLayoutFunc.pop();
            }
        }
    });
    var singlePage = absol.buildDom({
        tag: 'tabframe',
        child:[
            header,
            DOMElement.div({
                attrs: {
                    className: "card-mobile-content"
                },
                children: [data_ctn]
            })
        ]
    });
    host.frameList.addChild(singlePage);
    singlePage.requestActive();
    window.backLayoutFunc.push({
        func: function(){
            params.frameList.removeLast();
            window.backLayoutFunc.pop();
        }
    });
    contentModule.activitiesInformation({
        workSelected: "both",
        tableName: "contact",
        instanceid: host.contactid,
        addActivitiesSelected: "normal",
        frameList: host.frameList
    }).then(function(result){
        var activities = result.getActivitiesContent();
        activitiesCtn.appendChild(activities);
    });
};

theme.formContactEdit = function(params){
    var commands = [{
        icon:  DOMElement.i({
            attrs: {
                className: "material-icons"
            },
            text: "save"
        }),
        cmd: function(){
            params.func.save().then(function(){
                params.frameList.removeLast();
                window.backLayoutFunc.pop();
            });
        }
    }];
    var header = absol.buildDom({
        tag: 'mheaderbar',
        props: {
            actionIcon: DOMElement.i({
                attrs: {
                    className: "material-icons"
                },
                text: "arrow_back_ios"
            }),
            title: params.title,
            commands: commands
        },
        on: {
            action: function(){
                params.func.cancel().then(function(){
                    params.frameList.removeLast();
                    window.backLayoutFunc.pop();
                });
            },
            command: function(event){
                event.commandItem.cmd();
            }
        }
    });
    var singlePage = absol.buildDom({
        tag: 'tabframe',
        child:[
            header,
            DOMElement.div({
                attrs: {
                    className: "card-mobile-content"
                },
                children: [params.formContainer]
            })
        ]
    });
    params.frameList.addChild(singlePage);
    singlePage.requestActive();
    window.backLayoutFunc.push({
        func: function(){
            params.func.cancel().then(function(){
                params.frameList.removeLast();
                window.backLayoutFunc.pop();
            });
        }
    });
};

theme.formContactInit = function (params){
    var commands = [];
    if (params.cmdbutton.add !== undefined){
        commands.push({
            icon:  DOMElement.i({
                attrs: {
                    className: "material-icons"
                },
                text: "add"
            }),
            cmd: params.cmdbutton.add
        });
    }
    commands.push({
        icon:  DOMElement.i({
            attrs: {
                className: "material-icons"
            },
            text: "search"
        }),
        cmd: function(){
            header.searchMode(true);
        }
    });
    var inputsearchbox = absol.buildDom({
        tag: 'searchcrosstextinput',
        style: {
            width: "var(--searchbox-width)"
        },
        props:{
            placeholder: LanguageModule.text("txt_search")
        },
        on: {
            stoptyping: function(){
                params.func.filter_change_func();
            }
        }
    });
    var header = absol.buildDom({
        tag: 'headerbarwithsearch',
        props: {
            actionIcon: DOMElement.i({
                attrs: {
                    className: "material-icons"
                },
                text: "arrow_back_ios"
            }),
            title: LanguageModule.text("txt_contact"),
            commands: commands
        },
        data:{
            searchInput: inputsearchbox
        },
        on: {
            action: params.cmdbutton.close,
            command: function(event){
                event.commandItem.cmd();
            }
        }
    });
    var singlePage = absol.buildDom({
        tag: 'tabframe',
        child:[
            header,
            DOMElement.div({
                attrs: {
                    className: "card-mobile-content"
                },
                children: [params.data_container]
            })
        ]
    });
    singlePage.inputsearchbox = inputsearchbox;
    return singlePage;
};
ModuleManagerClass.register({
    name: "Contact_view",
    prerequisites: ["ModalElement"]
});

VaKeR 2022