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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue (-45 / +51 lines)
Lines 1-15 Link Here
1
<template>
1
<template>
2
    <transition name="modal">
2
    <div
3
        <div v-if="show_modal" class="modal">
3
        id="copy_item_to_train"
4
            <h2>{{ $__("Copy item to the following train") }}</h2>
4
        class="modal"
5
            <form @submit="copyItem($event)">
5
        role="dialog"
6
                <div class="page-section">
6
        aria-labelledby="copy_item_to_train_label"
7
                    <fieldset class="rows">
7
        aria-hidden="true"
8
                        <ol>
8
    >
9
                            <li>
9
        <div class="modal-dialog modal-lg">
10
                                <label class="required" for="train_list"
10
            <div class="modal-content modal-lg">
11
                                    >{{ $__("Select a train") }}:</label
11
                <form @submit="copyItem($event)">
12
                                >
12
                    <div class="modal-header">
13
                        <h1 class="modal-title" id="copy_item_to_train_label">
14
                            {{ $__("Copy item to the following train") }}
15
                        </h1>
16
                        <button
17
                            type="button"
18
                            class="btn-close"
19
                            data-bs-dismiss="modal"
20
                            aria-label="Close"
21
                        ></button>
22
                    </div>
23
                    <div class="modal-body">
24
                        <fieldset>
25
                            <ol>
26
                                <li class="form-group form-row">
27
                                    <label
28
                                        class="required col-form-label"
29
                                        for="train_list"
30
                                        >{{ $__("Select a train") }}:</label
31
                                    >
32
                                </li>
13
                                <v-select
33
                                <v-select
14
                                    v-model="train_id_selected_for_copy"
34
                                    v-model="train_id_selected_for_copy"
15
                                    label="name"
35
                                    label="name"
Lines 30-50 Link Here
30
                                <span class="required">{{
50
                                <span class="required">{{
31
                                    $__("Required")
51
                                    $__("Required")
32
                                }}</span>
52
                                }}</span>
33
                            </li>
53
                            </ol>
34
                        </ol>
54
                        </fieldset>
35
                    </fieldset>
55
                    </div>
36
                    <fieldset class="action">
56
                    <div class="modal-footer">
37
                        <input type="submit" value="Copy" />
57
                        <button class="btn btn-default approve" type="submit">
38
                        <input
58
                            <i class="fa fa-check"></i> Save
59
                        </button>
60
                        <button
61
                            class="btn btn-default deny cancel"
39
                            type="button"
62
                            type="button"
40
                            @click="show_modal = false"
63
                            data-bs-dismiss="modal"
41
                            :value="$__('Close')"
64
                        >
42
                        />
65
                            <i class="fa fa-times"></i> Cancel
43
                    </fieldset>
66
                        </button>
44
                </div>
67
                    </div>
45
            </form>
68
                </form>
69
            </div>
46
        </div>
70
        </div>
47
    </transition>
71
    </div>
72
48
    <div v-if="!initialized">{{ $__("Loading") }}</div>
73
    <div v-if="!initialized">{{ $__("Loading") }}</div>
49
    <div v-else id="trains_show">
74
    <div v-else id="trains_show">
50
        <Toolbar>
75
        <Toolbar>
Lines 294-300 export default { Link Here
294
                description: "",
319
                description: "",
295
            },
320
            },
296
            initialized: false,
321
            initialized: false,
297
            show_modal: false,
298
            item_table: {
322
            item_table: {
299
                display: false,
323
                display: false,
300
                data: [],
324
                data: [],
Lines 498-504 export default { Link Here
498
            )
522
            )
499
        },
523
        },
500
        selectTrainForCopy(train_item_id) {
524
        selectTrainForCopy(train_item_id) {
501
            this.show_modal = true
525
            $("#copy_item_to_train").show()
502
            this.train_item_id_to_copy = train_item_id
526
            this.train_item_id_to_copy = train_item_id
503
        },
527
        },
504
        copyItem(event) {
528
        copyItem(event) {
Lines 513-519 export default { Link Here
513
                .then(
537
                .then(
514
                    success => {
538
                    success => {
515
                        this.setMessage(this.$__("Item copied successfully."))
539
                        this.setMessage(this.$__("Item copied successfully."))
516
                        this.show_modal = false
540
                        $("#copy_item_to_train").hide()
517
                    },
541
                    },
518
                    error => {
542
                    error => {
519
                        this.setWarning(
543
                        this.setWarning(
Lines 721-744 export default { Link Here
721
.attribute_value {
745
.attribute_value {
722
    display: block;
746
    display: block;
723
}
747
}
724
.modal {
725
    position: fixed;
726
    z-index: 9998;
727
    overflow-y: inherit !important;
728
    top: 0;
729
    left: 0;
730
    width: 35%;
731
    height: 30%;
732
    background-color: rgba(0, 0, 0, 0.5);
733
    display: table;
734
    transition: opacity 0.3s ease;
735
    margin: auto;
736
    padding: 20px 30px;
737
    background-color: #fff;
738
    border-radius: 2px;
739
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
740
    transition: all 0.3s ease;
741
}
742
input[type="checkbox"] {
748
input[type="checkbox"] {
743
    float: left;
749
    float: left;
744
}
750
}
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/WaitingList.vue (-108 / +136 lines)
Lines 1-93 Link Here
1
<template>
1
<template>
2
    <transition name="modal_add_to_waiting_list">
2
    <div
3
        <div v-if="show_modal_add_to_waiting_list" class="modal">
3
        id="add_to_waiting_list"
4
            <h2>{{ $__("Add items to waiting list") }}</h2>
4
        class="modal"
5
            <form @submit="addItemsToWaitingList($event)">
5
        role="dialog"
6
                <div class="page-section">
6
        aria-labelledby="add_to_waiting_list_label"
7
                    <fieldset class="rows">
7
        aria-hidden="true"
8
                        <ol>
8
    >
9
                            <li>
9
        <div class="modal-dialog modal-lg">
10
                                <label class="required" for="barcode_list"
10
            <div class="modal-content modal-lg">
11
                                    >{{ $__("Barcode list") }}:</label
11
                <form @submit="addItemsToWaitingList($event)">
12
                                >
12
                    <div class="modal-header">
13
                                <textarea
13
                        <h1 class="modal-title" id="add_to_waiting_list_label">
14
                                    id="barcode_list"
14
                            {{ $__("Add items to waiting list") }}
15
                                    v-model="barcode_list"
15
                        </h1>
16
                                    :placeholder="$__('Barcodes')"
16
                        <button
17
                                    rows="10"
17
                            type="button"
18
                                    cols="50"
18
                            class="btn-close"
19
                                    required
19
                            data-bs-dismiss="modal"
20
                                />
20
                            aria-label="Close"
21
                            </li>
21
                        ></button>
22
                        </ol>
22
                    </div>
23
                    </fieldset>
23
                    <div class="modal-body">
24
                    <fieldset class="action">
24
                        <fieldset>
25
                        <input
25
                            <ol>
26
                            type="submit"
26
                                <li class="form-group form-row">
27
                            class="btn btn-primary"
27
                                    <label
28
                            :value="$__('Submit')"
28
                                        class="required col-form-label"
29
                        />
29
                                        for="barcode_list"
30
                        <input
30
                                        >{{ $__("Barcode list") }}:</label
31
                                    >
32
                                    <textarea
33
                                        id="barcode_list"
34
                                        v-model="barcode_list"
35
                                        :placeholder="$__('Barcodes')"
36
                                        rows="10"
37
                                        cols="50"
38
                                        required
39
                                    />
40
                                </li>
41
                            </ol>
42
                        </fieldset>
43
                    </div>
44
                    <div class="modal-footer">
45
                        <button class="btn btn-default approve" type="submit">
46
                            <i class="fa fa-check"></i> Save
47
                        </button>
48
                        <button
49
                            class="btn btn-default deny cancel"
31
                            type="button"
50
                            type="button"
32
                            @click="show_modal_add_to_waiting_list = false"
51
                            data-bs-dismiss="modal"
33
                            :value="$__('Close')"
52
                        >
34
                        />
53
                            <i class="fa fa-times"></i> Cancel
35
                    </fieldset>
54
                        </button>
36
                </div>
55
                    </div>
37
            </form>
56
                </form>
57
            </div>
38
        </div>
58
        </div>
39
    </transition>
59
    </div>
40
    <transition name="modal_add_to_train">
60
    <div
41
        <div v-if="show_modal_add_to_train" class="modal">
61
        id="add_to_train"
42
            <h2>{{ $__("Add items to a train") }}</h2>
62
        class="modal"
43
            <form @submit="addItemsToTrain($event)">
63
        role="dialog"
44
                <div class="page-section">
64
        aria-labelledby="add_to_train_label"
45
                    <fieldset class="rows">
65
        aria-hidden="true"
46
                        <ol>
66
    >
47
                            <li>
67
        <div class="modal-dialog modal-lg">
48
                                <label class="required" for="train_list"
68
            <div class="modal-content modal-lg">
49
                                    >{{ $__("Select a train") }}:</label
69
                <form @submit="addItemsToTrain($event)">
50
                                >
70
                    <div class="modal-header">
51
                                <v-select
71
                        <h1 class="modal-title" id="add_to_train_label">
52
                                    id="train_id"
72
                            {{ $__("Add items to a train") }}
53
                                    v-model="train_id_selected_for_add"
73
                        </h1>
54
                                    label="name"
74
                        <button
55
                                    :options="train_list"
56
                                    :reduce="t => t.train_id"
57
                                >
58
                                    <template #search="{ attributes, events }">
59
                                        <input
60
                                            :required="
61
                                                !train_id_selected_for_add
62
                                            "
63
                                            class="vs__search"
64
                                            v-bind="attributes"
65
                                            v-on="events"
66
                                        />
67
                                    </template>
68
                                </v-select>
69
                                <span class="required">{{
70
                                    $__("Required")
71
                                }}</span>
72
                            </li>
73
                        </ol>
74
                    </fieldset>
75
                    <fieldset class="action">
76
                        <input
77
                            type="submit"
78
                            class="btn btn-primary"
79
                            :value="$__('Submit')"
80
                        />
81
                        <input
82
                            type="button"
75
                            type="button"
83
                            @click="show_modal_add_to_train = false"
76
                            class="btn-close"
84
                            :value="$__('Close')"
77
                            data-bs-dismiss="modal"
85
                        />
78
                            aria-label="Close"
86
                    </fieldset>
79
                        ></button>
87
                </div>
80
                    </div>
88
            </form>
81
                    <div class="modal-body">
82
                        <fieldset>
83
                            <ol>
84
                                <li class="form-group form-row">
85
                                    <label
86
                                        class="required col-form-label"
87
                                        for="train_id"
88
                                        >{{ $__("Select a train") }}:</label
89
                                    >
90
                                    <v-select
91
                                        id="train_id"
92
                                        v-model="train_id_selected_for_add"
93
                                        label="name"
94
                                        :options="train_list"
95
                                        :reduce="t => t.train_id"
96
                                    >
97
                                        <template
98
                                            #search="{ attributes, events }"
99
                                        >
100
                                            <input
101
                                                :required="
102
                                                    !train_id_selected_for_add
103
                                                "
104
                                                class="vs__search"
105
                                                v-bind="attributes"
106
                                                v-on="events"
107
                                            />
108
                                        </template>
109
                                    </v-select>
110
                                    <span class="required">{{
111
                                        $__("Required")
112
                                    }}</span>
113
                                </li>
114
                            </ol>
115
                        </fieldset>
116
                    </div>
117
                    <div class="modal-footer">
118
                        <button class="btn btn-default approve" type="submit">
119
                            <i class="fa fa-check"></i> Save
120
                        </button>
121
                        <button
122
                            class="btn btn-default deny cancel"
123
                            type="button"
124
                            data-bs-dismiss="modal"
125
                        >
126
                            <i class="fa fa-times"></i> Cancel
127
                        </button>
128
                    </div>
129
                </form>
130
            </div>
89
        </div>
131
        </div>
90
    </transition>
132
    </div>
133
91
    <div v-if="!initialized">{{ $__("Loading") }}</div>
134
    <div v-if="!initialized">{{ $__("Loading") }}</div>
92
    <div
135
    <div
93
        v-else-if="!config.settings.not_for_loan_waiting_list_in"
136
        v-else-if="!config.settings.not_for_loan_waiting_list_in"
Lines 98-112 Link Here
98
    <div v-else id="waiting-list">
141
    <div v-else id="waiting-list">
99
        <Toolbar>
142
        <Toolbar>
100
            <a
143
            <a
144
                href="#add_to_waiting_list"
101
                class="btn btn-default"
145
                class="btn btn-default"
102
                @click="show_modal_add_to_waiting_list = true"
146
                role="button"
147
                data-bs-toggle="modal"
103
                ><font-awesome-icon icon="plus" />
148
                ><font-awesome-icon icon="plus" />
104
                {{ $__("Add to waiting list") }}</a
149
                {{ $__("Add to waiting list") }}</a
105
            >
150
            >
106
            <a
151
            <a
107
                v-if="last_items.length > 0"
152
                v-if="last_items.length > 0"
153
                href="#add_to_train"
108
                class="btn btn-default"
154
                class="btn btn-default"
109
                @click="show_modal_add_to_train = true"
155
                role="button"
156
                data-bs-toggle="modal"
110
                ><font-awesome-icon icon="plus" />
157
                ><font-awesome-icon icon="plus" />
111
                {{
158
                {{
112
                    $__("Add last %s items to a train").format(
159
                    $__("Add last %s items to a train").format(
Lines 167-174 export default { Link Here
167
            count_waiting_list_items: 0,
214
            count_waiting_list_items: 0,
168
            barcode_list: "",
215
            barcode_list: "",
169
            initialized: false,
216
            initialized: false,
170
            show_modal_add_to_waiting_list: false,
171
            show_modal_add_to_train: false,
172
            tableOptions: {
217
            tableOptions: {
173
                columns: this.getTableColumns(),
218
                columns: this.getTableColumns(),
174
                url: "/api/v1/preservation/waiting-list/items",
219
                url: "/api/v1/preservation/waiting-list/items",
Lines 207-212 export default { Link Here
207
        },
252
        },
208
        addItemsToTrain: function (e) {
253
        addItemsToTrain: function (e) {
209
            e.preventDefault()
254
            e.preventDefault()
255
            $("#add_to_train").modal("hide")
210
            let item_ids = this.last_items.map(i => i.item_id)
256
            let item_ids = this.last_items.map(i => i.item_id)
211
            this.$router.push({
257
            this.$router.push({
212
                name: "TrainsFormAddItems",
258
                name: "TrainsFormAddItems",
Lines 218-224 export default { Link Here
218
        },
264
        },
219
        addItemsToWaitingList: function (e) {
265
        addItemsToWaitingList: function (e) {
220
            e.preventDefault()
266
            e.preventDefault()
221
            this.show_modal_add_to_waiting_list = false
267
            $("#add_to_waiting_list").modal("hide")
222
            let items = []
268
            let items = []
223
            this.barcode_list
269
            this.barcode_list
224
                .split("\n")
270
                .split("\n")
Lines 334-354 export default { Link Here
334
#waiting_list {
380
#waiting_list {
335
    display: table;
381
    display: table;
336
}
382
}
337
.modal {
338
    position: fixed;
339
    z-index: 9990;
340
    top: 0;
341
    left: 0;
342
    width: 35%;
343
    height: 30%;
344
    background-color: rgba(0, 0, 0, 0.5);
345
    display: table;
346
    transition: opacity 0.3s ease;
347
    margin: auto;
348
    padding: 20px 30px;
349
    background-color: #fff;
350
    border-radius: 2px;
351
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
352
    transition: all 0.3s ease;
353
}
354
</style>
383
</style>
355
- 

Return to bug 37812