Skip to content

Commit 112a5ee

Browse files
authored
Merge pull request #531 from abhishek-webkul/check-in-document
Allow admin to upload check-in documents
2 parents 1503027 + eb9338b commit 112a5ee

File tree

18 files changed

+947
-69
lines changed

18 files changed

+947
-69
lines changed

Diff for: admin/themes/default/sass/controllers/_order.sass

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@
77
.booking_occupancy
88
.booking_occupancy_wrapper
99
max-height: 250px
10-
overflow-x: auto
10+
overflow-x: auto
11+
12+
#booking-documents-modal
13+
.documents-list
14+
table
15+
tbody
16+
img
17+
max-height: 55px
18+
max-width: 55px

Diff for: admin/themes/default/template/alerts.tpl

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{*
2+
* 2007-2017 PrestaShop
3+
*
4+
* NOTICE OF LICENSE
5+
*
6+
* This source file is subject to the Academic Free License (AFL 3.0)
7+
* that is bundled with this package in the file LICENSE.txt.
8+
* It is also available through the world-wide-web at this URL:
9+
* http://opensource.org/licenses/afl-3.0.php
10+
* If you did not receive a copy of the license and are unable to
11+
* obtain it through the world-wide-web, please send an email
12+
* to [email protected] so we can send you a copy immediately.
13+
*
14+
* DISCLAIMER
15+
*
16+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17+
* versions in the future. If you wish to customize PrestaShop for your
18+
* needs please refer to http://www.prestashop.com for more information.
19+
*
20+
* @author PrestaShop SA <[email protected]>
21+
* @copyright 2007-2017 PrestaShop SA
22+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
23+
* International Registered Trademark & Property of PrestaShop SA
24+
*}
25+
26+
{if isset($conf)}
27+
<div class="bootstrap">
28+
<div class="alert alert-success">
29+
<button type="button" class="close" data-dismiss="alert">&times;</button>
30+
{$conf}
31+
</div>
32+
</div>
33+
{/if}
34+
{if isset($errors) && count($errors) && current($errors) != '' && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)}
35+
<div class="bootstrap">
36+
<div class="alert alert-danger">
37+
<button type="button" class="close" data-dismiss="alert">&times;</button>
38+
{if count($errors) == 1}
39+
{reset($errors)}
40+
{else }
41+
{l s='%d errors' sprintf=$errors|count}
42+
<br/>
43+
<ol>
44+
{foreach $errors as $error}
45+
<li>{$error}</li>
46+
{/foreach}
47+
</ol>
48+
{/if}
49+
</div>
50+
</div>
51+
{/if}
52+
{if isset($informations) && count($informations) && $informations}
53+
<div class="bootstrap">
54+
<div class="alert alert-info">
55+
<button type="button" class="close" data-dismiss="alert">&times;</button>
56+
<ul id="infos_block" class="list-unstyled">
57+
{foreach $informations as $info}
58+
<li>{$info}</li>
59+
{/foreach}
60+
</ul>
61+
</div>
62+
</div>
63+
{/if}
64+
{if isset($confirmations) && count($confirmations) && $confirmations}
65+
<div class="bootstrap">
66+
<div class="alert alert-success" style="display:block;">
67+
{foreach $confirmations as $conf}
68+
{$conf}
69+
{/foreach}
70+
</div>
71+
</div>
72+
{/if}
73+
{if isset($warnings) && count($warnings)}
74+
<div class="bootstrap">
75+
<div class="alert alert-warning">
76+
<button type="button" class="close" data-dismiss="alert">&times;</button>
77+
{if count($warnings) > 1}
78+
<h4>{l s='There are %d warnings:' sprintf=count($warnings)}</h4>
79+
{/if}
80+
<ul class="list-unstyled">
81+
{foreach $warnings as $warning}
82+
<li>{$warning}</li>
83+
{/foreach}
84+
</ul>
85+
</div>
86+
</div>
87+
{/if}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{**
2+
* 2010-2023 Webkul.
3+
*
4+
* NOTICE OF LICENSE
5+
*
6+
* All right is reserved,
7+
* Please go through LICENSE.txt file inside our module
8+
*
9+
* DISCLAIMER
10+
*
11+
* Do not edit or add to this file if you wish to upgrade this module to newer
12+
* versions in the future. If you wish to customize this module for your
13+
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
14+
*
15+
* @author Webkul IN
16+
* @copyright 2010-2023 Webkul IN
17+
* @license LICENSE.txt
18+
*}
19+
20+
{if is_array($booking_documents) && count($booking_documents)}
21+
{foreach from=$booking_documents item=booking_document}
22+
<tr>
23+
<td class="text-center">
24+
<a href="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}&is_preview=1" target="_blank">
25+
{if $booking_document.file_type == HotelBookingDocument::FILE_TYPE_IMAGE}
26+
<img class="img img-responsive img-thumbnail" src="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}&is_preview=1">
27+
{elseif $booking_document.file_type == HotelBookingDocument::FILE_TYPE_PDF}
28+
<img class="img img-responsive img-thumbnail" src="{$pdf_icon_link}">
29+
{/if}
30+
</a>
31+
</td>
32+
<td class="text-left">{$booking_document.title}</td>
33+
<td class="text-center">{dateFormat date=$booking_document.date_add full=1}</td>
34+
<td class="text-center">
35+
<a class="btn btn-info" href="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}">
36+
<i class="icon icon-cloud-download"></i>
37+
</a>
38+
<a class="btn btn-danger btn-delete-document" data-id-htl-booking-document="{$booking_document.id_htl_booking_document}">
39+
<i class="icon icon-trash"></i>
40+
</a>
41+
</td>
42+
</tr>
43+
{/foreach}
44+
{else}
45+
<tr>
46+
<td class="list-empty" colspan="4">
47+
<div class="list-empty-msg">
48+
<i class="icon-warning-sign list-empty-icon"></i>
49+
{l s='No documents uploaded yet.'}
50+
</div>
51+
</td>
52+
</tr>
53+
{/if}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{**
2+
* 2010-2023 Webkul.
3+
*
4+
* NOTICE OF LICENSE
5+
*
6+
* All right is reserved,
7+
* Please go through LICENSE.txt file inside our module
8+
*
9+
* DISCLAIMER
10+
*
11+
* Do not edit or add to this file if you wish to upgrade this module to newer
12+
* versions in the future. If you wish to customize this module for your
13+
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
14+
*
15+
* @author Webkul IN
16+
* @copyright 2010-2023 Webkul IN
17+
* @license LICENSE.txt
18+
*}
19+
20+
<div class="modal-body text-center">
21+
<div class="row">
22+
<div class="col-lg-12">
23+
<div class="text-left errors-wrap"></div>
24+
<div class="documents-list">
25+
<table class="table table-bordered">
26+
<thead>
27+
<tr>
28+
<th class="text-center">{l s='Preview'}</th>
29+
<th class="text-left">{l s='Title'}</th>
30+
<th class="text-center">{l s='Upload Date'}</th>
31+
<th class="text-center">{l s='Actions'}</th>
32+
</tr>
33+
</thead>
34+
<tbody></tbody>
35+
</table>
36+
</div>
37+
<div class="add-new-document-form" style="margin-top: 10px;">
38+
<div class="text-left add-new-wrap">
39+
<a class="btn btn-primary btn-add-new-document">
40+
{l s='Upload new document'}
41+
</a>
42+
<span></span>
43+
</div>
44+
<form id="form-add-new-document" class="well" method="post" action="#" style="display: none; margin-top: 5px;">
45+
46+
<input type="hidden" name="id_htl_booking" value="0">
47+
48+
<div class="form-horizontal">
49+
<div class="form-group">
50+
<label class="control-label col-sm-2">
51+
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Write the title for the document. Invalid characters <>;=#{}'}">
52+
{l s='Title'}
53+
</span>
54+
</label>
55+
<div class="col-sm-10">
56+
<div class="input-group fixed-width-xxl">
57+
<input type="text" name="title" value="" placeholder="{l s='Eg. Passport, Driving license'}" />
58+
</div>
59+
</div>
60+
</div>
61+
<div class="form-group">
62+
<label class="control-label required col-sm-2">
63+
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Choose the document file to be uploaded.'}">
64+
{l s='File'}
65+
</span>
66+
</label>
67+
<div class="col-sm-10">
68+
<div class="input-file-wrap"></div>
69+
<div class="input-group fixed-width-xxl">
70+
<span class="input-group-addon"><i class="icon-file"></i></span>
71+
<input type="text" class="file-name" readonly="">
72+
<span class="input-group-btn">
73+
<button type="button" class="btn btn-default btn-add-file">
74+
<i class="icon-folder-open"></i>
75+
{l s='Add file'}
76+
</button>
77+
</span>
78+
</div>
79+
<p class="text-left" style="margin-top: 4px; font-style: italic;">
80+
{l s='Upload a PDF or an image file. Allowed image formats: .gif, .jpg, .jpeg and .png'}
81+
</p>
82+
</div>
83+
</div>
84+
<div class="clearfix btn-group-add-new">
85+
<button class="btn btn-primary pull-right upload" type="submit" name="submitAddPayment">
86+
{l s='Upload'}
87+
</button>
88+
<button class="btn btn-default pull-left cancel">
89+
{l s='Cancel'}
90+
</button>
91+
</div>
92+
</div>
93+
</form>
94+
</div>
95+
</div>
96+
</div>
97+
</div>
98+
99+
{addJsDefL name=txt_booking_document_upload_success}{l s='Document uploaded successfully.' js=1}{/addJsDefL}
100+
{addJsDefL name=txt_booking_document_delete_confirm}{l s='Are you sure?' js=1}{/addJsDefL}
101+
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}

Diff for: admin/themes/default/template/controllers/orders/helpers/view/view.tpl

+7-4
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@
275275
<tr>
276276
<th>{l s='Room No.'}</th>
277277
<th>{l s='Hotel Name'}</th>
278-
<th>{l s='Date From'}</th>
279-
<th>{l s='Date To'}</th>
278+
<th>{l s='Duration'}</th>
279+
<th>{l s='Documents'}</th>
280280
<th>{l s='Order Status'}</th>
281281
</tr>
282282
{if isset($htl_booking_order_data) && $htl_booking_order_data}
@@ -291,10 +291,13 @@
291291
</a>
292292
</td>
293293
<td>
294-
{dateFormat date=$data['date_from']}
294+
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
295295
</td>
296296
<td>
297-
{dateFormat date=$data['date_to']}
297+
<a class="btn btn-default" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
298+
<i class="icon icon-file-text"></i>
299+
{l s='Documents'} <span class="badge badge-info count-documents">{$data.num_checkin_documents}</span>
300+
</a>
298301
</td>
299302
<td>
300303
<form action="" method="post" class="form-horizontal row room_status_info_form">

Diff for: admin/themes/default/template/layout.tpl

+1-63
Original file line numberDiff line numberDiff line change
@@ -23,68 +23,6 @@
2323
* International Registered Trademark & Property of PrestaShop SA
2424
*}
2525
{$header}
26-
{if isset($conf)}
27-
<div class="bootstrap">
28-
<div class="alert alert-success">
29-
<button type="button" class="close" data-dismiss="alert">&times;</button>
30-
{$conf}
31-
</div>
32-
</div>
33-
{/if}
34-
{if count($errors) && current($errors) != '' && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)}
35-
36-
<div class="bootstrap">
37-
<div class="alert alert-danger">
38-
<button type="button" class="close" data-dismiss="alert">&times;</button>
39-
{if count($errors) == 1}
40-
{reset($errors)}
41-
{else }
42-
{l s='%d errors' sprintf=$errors|count}
43-
<br/>
44-
<ol>
45-
{foreach $errors as $error}
46-
<li>{$error}</li>
47-
{/foreach}
48-
</ol>
49-
{/if}
50-
</div>
51-
</div>
52-
{/if}
53-
{if isset($informations) && count($informations) && $informations}
54-
<div class="bootstrap">
55-
<div class="alert alert-info">
56-
<button type="button" class="close" data-dismiss="alert">&times;</button>
57-
<ul id="infos_block" class="list-unstyled">
58-
{foreach $informations as $info}
59-
<li>{$info}</li>
60-
{/foreach}
61-
</ul>
62-
</div>
63-
</div>
64-
{/if}
65-
{if isset($confirmations) && count($confirmations) && $confirmations}
66-
<div class="bootstrap">
67-
<div class="alert alert-success" style="display:block;">
68-
{foreach $confirmations as $conf}
69-
{$conf}
70-
{/foreach}
71-
</div>
72-
</div>
73-
{/if}
74-
{if count($warnings)}
75-
<div class="bootstrap">
76-
<div class="alert alert-warning">
77-
<button type="button" class="close" data-dismiss="alert">&times;</button>
78-
{if count($warnings) > 1}
79-
<h4>{l s='There are %d warnings:' sprintf=count($warnings)}</h4>
80-
{/if}
81-
<ul class="list-unstyled">
82-
{foreach $warnings as $warning}
83-
<li>{$warning}</li>
84-
{/foreach}
85-
</ul>
86-
</div>
87-
</div>
88-
{/if}
26+
{include file='./alerts.tpl'}
8927
{$page}
9028
{$footer}

0 commit comments

Comments
 (0)