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

(-)a/Koha/Schema/Result/ErmAgreement.pm (+7 lines)
Lines 270-275 __PACKAGE__->many_to_many("packages", "erm_eholdings_packages_agreements", "pack Link Here
270
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-11 11:52:09
270
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-11 11:52:09
271
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N93LnvdKirtuV6BSrTGzVg
271
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N93LnvdKirtuV6BSrTGzVg
272
272
273
__PACKAGE__->has_many(
274
  "user_roles",
275
  "Koha::Schema::Result::ErmUserRole",
276
  { "foreign.agreement_id" => "self.agreement_id" },
277
  { cascade_copy => 0, cascade_delete => 0 },
278
);
279
273
__PACKAGE__->add_columns(
280
__PACKAGE__->add_columns(
274
    '+is_perpetual' => { is_boolean => 1 }
281
    '+is_perpetual' => { is_boolean => 1 }
275
);
282
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt (+2 lines)
Lines 42-47 Link Here
42
42
43
        const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %];
43
        const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %];
44
44
45
        const logged_in_user = [% To.json(logged_in_user.unblessed) | $raw %];
46
45
    </script>
47
    </script>
46
48
47
    [% Asset.js("js/vue/dist/erm.js") | $raw %]
49
    [% Asset.js("js/vue/dist/erm.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-2 / +20 lines)
Lines 17-22 Link Here
17
                :config="fp_config"
17
                :config="fp_config"
18
            />
18
            />
19
19
20
            <label for="by_mine_filter">{{ $__("Show mine only") }}:</label>
21
            <input
22
                type="checkbox"
23
                id="by_mine_filter"
24
                v-model="filters.by_mine"
25
                @keyup.enter="filter_table"
26
            />
27
20
            <input
28
            <input
21
                @click="filter_table"
29
                @click="filter_table"
22
                id="filter_table"
30
                id="filter_table"
Lines 57-62 export default { Link Here
57
            get_lib_from_av,
65
            get_lib_from_av,
58
            map_av_dt_filter,
66
            map_av_dt_filter,
59
            table_id,
67
            table_id,
68
            logged_in_user,
60
        }
69
        }
61
    },
70
    },
62
    data: function () {
71
    data: function () {
Lines 68-73 export default { Link Here
68
                by_expired: this.$route.query.by_expired || false,
77
                by_expired: this.$route.query.by_expired || false,
69
                max_expiration_date:
78
                max_expiration_date:
70
                    this.$route.query.max_expiration_date || "",
79
                    this.$route.query.max_expiration_date || "",
80
                by_mine: this.$route.query.by_mine || false,
71
            },
81
            },
72
            before_route_entered: false,
82
            before_route_entered: false,
73
            building_table: false,
83
            building_table: false,
Lines 149-155 export default { Link Here
149
            let datatable_url = this.datatable_url
159
            let datatable_url = this.datatable_url
150
            let default_search = this.$route.query.q
160
            let default_search = this.$route.query.q
151
            let actions = this.before_route_entered ? "edit_delete" : "select"
161
            let actions = this.before_route_entered ? "edit_delete" : "select"
162
            let filters = this.filters
152
            let table_id = this.table_id
163
            let table_id = this.table_id
164
            let logged_in_user = this.logged_in_user
153
165
154
            window["vendors"] = this.vendors.map(e => {
166
            window["vendors"] = this.vendors.map(e => {
155
                e["_id"] = e["id"]
167
                e["_id"] = e["id"]
Lines 174-184 export default { Link Here
174
                { _id: 1, _str: _("Yes") },
186
                { _id: 1, _str: _("Yes") },
175
            ]
187
            ]
176
188
189
            let additional_filters = {
190
                "user_roles.user_id": function () {
191
                    return filters.by_mine ? logged_in_user.borrowernumber : ""
192
                },
193
            }
177
            const table = $("#" + table_id).kohaTable(
194
            const table = $("#" + table_id).kohaTable(
178
                {
195
                {
179
                    ajax: {
196
                    ajax: {
180
                        url: datatable_url,
197
                        url: datatable_url,
181
                    },
198
                    },
199
                    embed: ["user_roles"],
182
                    order: [[0, "asc"]],
200
                    order: [[0, "asc"]],
183
                    autoWidth: false,
201
                    autoWidth: false,
184
                    search: { search: default_search },
202
                    search: { search: default_search },
Lines 422-428 export default { Link Here
422
                    },
440
                    },
423
                },
441
                },
424
                agreement_table_settings,
442
                agreement_table_settings,
425
                1
443
                1,
444
                additional_filters
426
            )
445
            )
427
        },
446
        },
428
    },
447
    },
429
- 

Return to bug 32924