View | Details | Raw Unified | Return to bug 35392
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts (-1 / +1 lines)
Lines 24-30 import { useVendorStore } from "../stores/vendors"; Link Here
24
import { useAVStore } from "../stores/authorised-values";
24
import { useAVStore } from "../stores/authorised-values";
25
import { useERMStore } from "../stores/erm";
25
import { useERMStore } from "../stores/erm";
26
import { useNavigationStore } from "../stores/navigation";
26
import { useNavigationStore } from "../stores/navigation";
27
import { useReportsStore } from "../stores/usage-reports";
27
import { useReportsStore } from "../stores/erm";
28
import i18n from "../i18n";
28
import i18n from "../i18n";
29
29
30
const pinia = createPinia();
30
const pinia = createPinia();
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js (+137 lines)
Lines 10-12 export const useERMStore = defineStore("erm", { Link Here
10
        },
10
        },
11
    }),
11
    }),
12
});
12
});
13
14
export const useReportsStore = defineStore("reports", {
15
    state: () => ({
16
        months_data: [
17
            { short: "Jan", description: "January", value: 1, active: true },
18
            { short: "Feb", description: "February", value: 2, active: true },
19
            { short: "Mar", description: "March", value: 3, active: true },
20
            { short: "Apr", description: "April", value: 4, active: true },
21
            { short: "May", description: "May", value: 5, active: true },
22
            { short: "Jun", description: "June", value: 6, active: true },
23
            { short: "Jul", description: "July", value: 7, active: true },
24
            { short: "Aug", description: "August", value: 8, active: true },
25
            { short: "Sep", description: "September", value: 9, active: true },
26
            { short: "Oct", description: "October", value: 10, active: true },
27
            { short: "Nov", description: "November", value: 11, active: true },
28
            { short: "Dec", description: "December", value: 12, active: true },
29
        ],
30
        query: null,
31
        title_property_column_options: {
32
            1: {
33
                id: 1,
34
                name: "Provider name",
35
                active: true,
36
                used_by: ["title", "item", "database", "platform"],
37
                column: {
38
                    title: __("Data provider"),
39
                    data: "provider_name",
40
                    searchable: true,
41
                    orderable: true,
42
                },
43
            },
44
            2: {
45
                id: 2,
46
                name: "Publisher",
47
                active: false,
48
                used_by: ["title", "item", "database"],
49
                column: {
50
                    title: __("Publisher"),
51
                    data: "publisher",
52
                    searchable: true,
53
                    orderable: true,
54
                },
55
            },
56
            3: {
57
                id: 3,
58
                name: "Platform",
59
                active: false,
60
                used_by: ["item", "database", "platform"],
61
                column: {
62
                    title: __("Platform"),
63
                    data: "platform",
64
                    searchable: true,
65
                    orderable: true,
66
                },
67
            },
68
            4: {
69
                id: 4,
70
                name: "Publisher ID",
71
                active: false,
72
                used_by: ["title", "database"],
73
                column: {
74
                    title: __("Publisher ID"),
75
                    data: "publisher_id",
76
                    searchable: true,
77
                    orderable: true,
78
                },
79
            },
80
            5: {
81
                id: 5,
82
                name: "Online ISSN",
83
                active: false,
84
                used_by: ["title"],
85
                column: {
86
                    title: __("Online ISSN"),
87
                    data: "online_issn",
88
                    searchable: true,
89
                    orderable: true,
90
                },
91
            },
92
            6: {
93
                id: 6,
94
                name: "Print ISSN",
95
                active: false,
96
                used_by: ["title"],
97
                column: {
98
                    title: __("Print ISSN"),
99
                    data: "print_issn",
100
                    searchable: true,
101
                    orderable: true,
102
                },
103
            },
104
            7: {
105
                id: 7,
106
                name: "DOI",
107
                active: false,
108
                used_by: ["title"],
109
                column: {
110
                    title: __("DOI"),
111
                    data: "title_doi",
112
                    searchable: true,
113
                    orderable: true,
114
                },
115
            },
116
            8: {
117
                id: 8,
118
                name: "URI",
119
                active: false,
120
                used_by: ["title"],
121
                column: {
122
                    title: __("URI"),
123
                    data: "title_uri",
124
                    searchable: true,
125
                    orderable: true,
126
                },
127
            },
128
        },
129
        report_type_map: {
130
            TR_B1: ["YOP", "ISBN"],
131
            TR_B2: ["YOP", "ISBN"],
132
            TR_B3: ["YOP", "Access_Type", "ISBN"],
133
            TR_J3: ["Access_Type"],
134
            TR_J4: ["YOP"],
135
        },
136
    }),
137
    actions: {
138
        getMonthsData() {
139
            return this.months_data;
140
        },
141
        getColumnOptions() {
142
            return this.title_property_column_options;
143
        },
144
        checkReportColumns(report_type, column) {
145
            if (!this.report_type_map.hasOwnProperty(report_type)) return false;
146
            return this.report_type_map[report_type].includes(column);
147
        },
148
    },
149
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/usage-reports.js (-139 lines)
Lines 1-138 Link Here
1
import { defineStore } from "pinia";
2
3
export const useReportsStore = defineStore("reports", {
4
    state: () => ({
5
        months_data: [
6
            { short: "Jan", description: "January", value: 1, active: true },
7
            { short: "Feb", description: "February", value: 2, active: true },
8
            { short: "Mar", description: "March", value: 3, active: true },
9
            { short: "Apr", description: "April", value: 4, active: true },
10
            { short: "May", description: "May", value: 5, active: true },
11
            { short: "Jun", description: "June", value: 6, active: true },
12
            { short: "Jul", description: "July", value: 7, active: true },
13
            { short: "Aug", description: "August", value: 8, active: true },
14
            { short: "Sep", description: "September", value: 9, active: true },
15
            { short: "Oct", description: "October", value: 10, active: true },
16
            { short: "Nov", description: "November", value: 11, active: true },
17
            { short: "Dec", description: "December", value: 12, active: true },
18
        ],
19
        query: null,
20
        title_property_column_options: {
21
            1: {
22
                id: 1,
23
                name: "Provider name",
24
                active: true,
25
                used_by: ["title", "item", "database", "platform"],
26
                column: {
27
                    title: __("Data provider"),
28
                    data: "provider_name",
29
                    searchable: true,
30
                    orderable: true,
31
                },
32
            },
33
            2: {
34
                id: 2,
35
                name: "Publisher",
36
                active: false,
37
                used_by: ["title", "item", "database"],
38
                column: {
39
                    title: __("Publisher"),
40
                    data: "publisher",
41
                    searchable: true,
42
                    orderable: true,
43
                },
44
            },
45
            3: {
46
                id: 3,
47
                name: "Platform",
48
                active: false,
49
                used_by: ["item", "database", "platform"],
50
                column: {
51
                    title: __("Platform"),
52
                    data: "platform",
53
                    searchable: true,
54
                    orderable: true,
55
                },
56
            },
57
            4: {
58
                id: 4,
59
                name: "Publisher ID",
60
                active: false,
61
                used_by: ["title", "database"],
62
                column: {
63
                    title: __("Publisher ID"),
64
                    data: "publisher_id",
65
                    searchable: true,
66
                    orderable: true,
67
                },
68
            },
69
            5: {
70
                id: 5,
71
                name: "Online ISSN",
72
                active: false,
73
                used_by: ["title"],
74
                column: {
75
                    title: __("Online ISSN"),
76
                    data: "online_issn",
77
                    searchable: true,
78
                    orderable: true,
79
                },
80
            },
81
            6: {
82
                id: 6,
83
                name: "Print ISSN",
84
                active: false,
85
                used_by: ["title"],
86
                column: {
87
                    title: __("Print ISSN"),
88
                    data: "print_issn",
89
                    searchable: true,
90
                    orderable: true,
91
                },
92
            },
93
            7: {
94
                id: 7,
95
                name: "DOI",
96
                active: false,
97
                used_by: ["title"],
98
                column: {
99
                    title: __("DOI"),
100
                    data: "title_doi",
101
                    searchable: true,
102
                    orderable: true,
103
                },
104
            },
105
            8: {
106
                id: 8,
107
                name: "URI",
108
                active: false,
109
                used_by: ["title"],
110
                column: {
111
                    title: __("URI"),
112
                    data: "title_uri",
113
                    searchable: true,
114
                    orderable: true,
115
                },
116
            },
117
        },
118
        report_type_map: {
119
            TR_B1: ["YOP", "ISBN"],
120
            TR_B2: ["YOP", "ISBN"],
121
            TR_B3: ["YOP", "Access_Type", "ISBN"],
122
            TR_J3: ["Access_Type"],
123
            TR_J4: ["YOP"],
124
        },
125
    }),
126
    actions: {
127
        getMonthsData() {
128
            return this.months_data;
129
        },
130
        getColumnOptions() {
131
            return this.title_property_column_options;
132
        },
133
        checkReportColumns(report_type, column) {
134
            if (!this.report_type_map.hasOwnProperty(report_type)) return false;
135
            return this.report_type_map[report_type].includes(column);
136
        },
137
    },
138
});
139
- 

Return to bug 35392