Skip to content

Commit

Permalink
Merge pull request #531 from abhishek-webkul/check-in-document
Browse files Browse the repository at this point in the history
Allow admin to upload check-in documents
  • Loading branch information
rohit053 authored Feb 15, 2023
2 parents 1503027 + eb9338b commit 112a5ee
Show file tree
Hide file tree
Showing 18 changed files with 947 additions and 69 deletions.
10 changes: 9 additions & 1 deletion admin/themes/default/sass/controllers/_order.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@
.booking_occupancy
.booking_occupancy_wrapper
max-height: 250px
overflow-x: auto
overflow-x: auto

#booking-documents-modal
.documents-list
table
tbody
img
max-height: 55px
max-width: 55px
87 changes: 87 additions & 0 deletions admin/themes/default/template/alerts.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <[email protected]>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}

{if isset($conf)}
<div class="bootstrap">
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{$conf}
</div>
</div>
{/if}
{if isset($errors) && count($errors) && current($errors) != '' && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)}
<div class="bootstrap">
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{if count($errors) == 1}
{reset($errors)}
{else }
{l s='%d errors' sprintf=$errors|count}
<br/>
<ol>
{foreach $errors as $error}
<li>{$error}</li>
{/foreach}
</ol>
{/if}
</div>
</div>
{/if}
{if isset($informations) && count($informations) && $informations}
<div class="bootstrap">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<ul id="infos_block" class="list-unstyled">
{foreach $informations as $info}
<li>{$info}</li>
{/foreach}
</ul>
</div>
</div>
{/if}
{if isset($confirmations) && count($confirmations) && $confirmations}
<div class="bootstrap">
<div class="alert alert-success" style="display:block;">
{foreach $confirmations as $conf}
{$conf}
{/foreach}
</div>
</div>
{/if}
{if isset($warnings) && count($warnings)}
<div class="bootstrap">
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{if count($warnings) > 1}
<h4>{l s='There are %d warnings:' sprintf=count($warnings)}</h4>
{/if}
<ul class="list-unstyled">
{foreach $warnings as $warning}
<li>{$warning}</li>
{/foreach}
</ul>
</div>
</div>
{/if}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}

{if is_array($booking_documents) && count($booking_documents)}
{foreach from=$booking_documents item=booking_document}
<tr>
<td class="text-center">
<a href="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}&is_preview=1" target="_blank">
{if $booking_document.file_type == HotelBookingDocument::FILE_TYPE_IMAGE}
<img class="img img-responsive img-thumbnail" src="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}&is_preview=1">
{elseif $booking_document.file_type == HotelBookingDocument::FILE_TYPE_PDF}
<img class="img img-responsive img-thumbnail" src="{$pdf_icon_link}">
{/if}
</a>
</td>
<td class="text-left">{$booking_document.title}</td>
<td class="text-center">{dateFormat date=$booking_document.date_add full=1}</td>
<td class="text-center">
<a class="btn btn-info" href="{$link->getAdminLink('AdminBookingDocument')}&action=getDocument&id_document={$booking_document.id_htl_booking_document}">
<i class="icon icon-cloud-download"></i>
</a>
<a class="btn btn-danger btn-delete-document" data-id-htl-booking-document="{$booking_document.id_htl_booking_document}">
<i class="icon icon-trash"></i>
</a>
</td>
</tr>
{/foreach}
{else}
<tr>
<td class="list-empty" colspan="4">
<div class="list-empty-msg">
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No documents uploaded yet.'}
</div>
</td>
</tr>
{/if}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}

<div class="modal-body text-center">
<div class="row">
<div class="col-lg-12">
<div class="text-left errors-wrap"></div>
<div class="documents-list">
<table class="table table-bordered">
<thead>
<tr>
<th class="text-center">{l s='Preview'}</th>
<th class="text-left">{l s='Title'}</th>
<th class="text-center">{l s='Upload Date'}</th>
<th class="text-center">{l s='Actions'}</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="add-new-document-form" style="margin-top: 10px;">
<div class="text-left add-new-wrap">
<a class="btn btn-primary btn-add-new-document">
{l s='Upload new document'}
</a>
<span></span>
</div>
<form id="form-add-new-document" class="well" method="post" action="#" style="display: none; margin-top: 5px;">

<input type="hidden" name="id_htl_booking" value="0">

<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Write the title for the document. Invalid characters <>;=#{}'}">
{l s='Title'}
</span>
</label>
<div class="col-sm-10">
<div class="input-group fixed-width-xxl">
<input type="text" name="title" value="" placeholder="{l s='Eg. Passport, Driving license'}" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label required col-sm-2">
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Choose the document file to be uploaded.'}">
{l s='File'}
</span>
</label>
<div class="col-sm-10">
<div class="input-file-wrap"></div>
<div class="input-group fixed-width-xxl">
<span class="input-group-addon"><i class="icon-file"></i></span>
<input type="text" class="file-name" readonly="">
<span class="input-group-btn">
<button type="button" class="btn btn-default btn-add-file">
<i class="icon-folder-open"></i>
{l s='Add file'}
</button>
</span>
</div>
<p class="text-left" style="margin-top: 4px; font-style: italic;">
{l s='Upload a PDF or an image file. Allowed image formats: .gif, .jpg, .jpeg and .png'}
</p>
</div>
</div>
<div class="clearfix btn-group-add-new">
<button class="btn btn-primary pull-right upload" type="submit" name="submitAddPayment">
{l s='Upload'}
</button>
<button class="btn btn-default pull-left cancel">
{l s='Cancel'}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

{addJsDefL name=txt_booking_document_upload_success}{l s='Document uploaded successfully.' js=1}{/addJsDefL}
{addJsDefL name=txt_booking_document_delete_confirm}{l s='Are you sure?' js=1}{/addJsDefL}
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@
<tr>
<th>{l s='Room No.'}</th>
<th>{l s='Hotel Name'}</th>
<th>{l s='Date From'}</th>
<th>{l s='Date To'}</th>
<th>{l s='Duration'}</th>
<th>{l s='Documents'}</th>
<th>{l s='Order Status'}</th>
</tr>
{if isset($htl_booking_order_data) && $htl_booking_order_data}
Expand All @@ -291,10 +291,13 @@
</a>
</td>
<td>
{dateFormat date=$data['date_from']}
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
</td>
<td>
{dateFormat date=$data['date_to']}
<a class="btn btn-default" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
<i class="icon icon-file-text"></i>
{l s='Documents'} <span class="badge badge-info count-documents">{$data.num_checkin_documents}</span>
</a>
</td>
<td>
<form action="" method="post" class="form-horizontal row room_status_info_form">
Expand Down
64 changes: 1 addition & 63 deletions admin/themes/default/template/layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,68 +23,6 @@
* International Registered Trademark & Property of PrestaShop SA
*}
{$header}
{if isset($conf)}
<div class="bootstrap">
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{$conf}
</div>
</div>
{/if}
{if count($errors) && current($errors) != '' && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)}

<div class="bootstrap">
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{if count($errors) == 1}
{reset($errors)}
{else }
{l s='%d errors' sprintf=$errors|count}
<br/>
<ol>
{foreach $errors as $error}
<li>{$error}</li>
{/foreach}
</ol>
{/if}
</div>
</div>
{/if}
{if isset($informations) && count($informations) && $informations}
<div class="bootstrap">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<ul id="infos_block" class="list-unstyled">
{foreach $informations as $info}
<li>{$info}</li>
{/foreach}
</ul>
</div>
</div>
{/if}
{if isset($confirmations) && count($confirmations) && $confirmations}
<div class="bootstrap">
<div class="alert alert-success" style="display:block;">
{foreach $confirmations as $conf}
{$conf}
{/foreach}
</div>
</div>
{/if}
{if count($warnings)}
<div class="bootstrap">
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{if count($warnings) > 1}
<h4>{l s='There are %d warnings:' sprintf=count($warnings)}</h4>
{/if}
<ul class="list-unstyled">
{foreach $warnings as $warning}
<li>{$warning}</li>
{/foreach}
</ul>
</div>
</div>
{/if}
{include file='./alerts.tpl'}
{$page}
{$footer}
Loading

0 comments on commit 112a5ee

Please sign in to comment.