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 60-65 Link Here
60
60
61
        const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %];
61
        const logged_in_user_lists = [% To.json(logged_in_user.virtualshelves.unblessed) | $raw %];
62
62
63
        const logged_in_user = [% To.json(logged_in_user.unblessed) | $raw %];
64
63
    </script>
65
    </script>
64
66
65
    [% Asset.js("js/vue/dist/main.js") | $raw %]
67
    [% Asset.js("js/vue/dist/main.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 144-150 export default { Link Here
144
            let datatable_url = this.datatable_url
154
            let datatable_url = this.datatable_url
145
            let default_search = this.$route.query.q
155
            let default_search = this.$route.query.q
146
            let actions = this.before_route_entered ? "edit_delete" : "select"
156
            let actions = this.before_route_entered ? "edit_delete" : "select"
157
            let filters = this.filters
147
            let table_id = this.table_id
158
            let table_id = this.table_id
159
            let logged_in_user = this.logged_in_user
148
160
149
            window["vendors"] = this.vendors.map(e => {
161
            window["vendors"] = this.vendors.map(e => {
150
                e["_id"] = e["id"]
162
                e["_id"] = e["id"]
Lines 169-179 export default { Link Here
169
                { _id: 1, _str: _("Yes") },
181
                { _id: 1, _str: _("Yes") },
170
            ]
182
            ]
171
183
184
            let additional_filters = {
185
                "user_roles.user_id": function () {
186
                    return filters.by_mine ? logged_in_user.borrowernumber : ""
187
                },
188
            }
172
            const table = $("#" + table_id).kohaTable(
189
            const table = $("#" + table_id).kohaTable(
173
                {
190
                {
174
                    ajax: {
191
                    ajax: {
175
                        url: datatable_url,
192
                        url: datatable_url,
176
                    },
193
                    },
194
                    embed: ["user_roles"],
177
                    order: [[0, "asc"]],
195
                    order: [[0, "asc"]],
178
                    autoWidth: false,
196
                    autoWidth: false,
179
                    search: { search: default_search },
197
                    search: { search: default_search },
Lines 417-423 export default { Link Here
417
                    },
435
                    },
418
                },
436
                },
419
                agreement_table_settings,
437
                agreement_table_settings,
420
                1
438
                1,
439
                additional_filters
421
            )
440
            )
422
        },
441
        },
423
    },
442
    },
424
- 

Return to bug 32924