{extends file="admin-layout.tpl"} {block name="page-title"}{intl l='Search'}{/block} {block name="check-resource"}admin.search{/block} {block name="check-access"}view{/block} {block name="main-content"} {$searchTerm = {$smarty.get.search_term|trim}} {$page = $page|default:0} {capture name="more_results"}
{intl l="More results are available."}
{intl l="Please refine your search to see the other results."}
{/capture}
{hook name="search.top" location="search_top" }
{if $searchTerm|strlen > 0} {* customer search *}
{ifloop rel="customer_list"} {hook name="customers.header" location="customer_list_header" } {loop name="customer_list" type="customer" current="false" visible="*" backend_context="1" search_mode="sentence" search_term=$searchTerm search_in="ref,firstname,lastname,email" limit=26} {assign "lastOrderDate" ''} {assign "lastOrderAmount" ''} {assign "lastOrderCurrency" ''} {$hasOrders = false} {loop type="order" name="last-order" customer=$ID order="create-date-reverse" limit="1"} {assign "lastOrderDate" "{format_date date=$CREATE_DATE}"} {assign "lastOrderAmount" "{format_number number=$TOTAL_TAXED_AMOUNT}"} {loop type="currency" name="order-currency" id=$CURRENCY} {assign "lastOrderCurrency" $SYMBOL} {/loop} {$hasOrders = true} {/loop} {if $LOOP_COUNT < 26} {hook name="customers.row" location="customer_list_row" customer_id={$ID}} {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Customer'}
{intl l="customer ref"} {intl l="company"} {intl l="firstname & lastname"} {intl l="Email address"} {intl l="last order"} {intl l='order amount'} {intl l="Actions"}
{$REF} {$COMPANY|default:null} {$FIRSTNAME} {$LASTNAME} {mailto address="{$EMAIL}" encode="hex"} {$lastOrderDate} {$lastOrderCurrency} {$lastOrderAmount} {if $hasOrders} {$deleteClass = 'disabled'} {$deleteTitle = {intl l='This customer has orders, and can\'t be deleted.'}} {$deleteHref = ''} {else} {$deleteClass = 'customer-delete'} {$deleteTitle = {intl l='Delete this customer and all his orders'}} {$deleteHref = '#delete_customer_dialog'} {/if} {include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'title' => {intl l='Edit this customer'}, 'href' => {url path='/admin/customer/update' customer_id=$ID page=$page|default:null}, 'auth' => ['resource' => 'admin.customer'] ], [ 'title' => {intl l="Send a mail to this customer"}, 'href' => "mailto:$EMAIL", 'icon' => ['class' => 'glyphicon glyphicon-envelope'], 'auth' => ['resource' => 'admin.customer'] ], [ 'type' => 'delete', 'class' => $deleteClass, 'title' => $deleteTitle, 'href' => $deleteHref, 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.customer'] ] ]}
{elseloop rel="customer_list"}
{intl l="No customer found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end customer search *} {* order search *}
{ifloop rel="order-search"} {hook name="orders.table-header" location="orders_table_header" } {loop type="order" name="order-search" backend_context=1 customer="*" search_term=$searchTerm search_in="ref,customer_ref,customer_firstname,customer_lastname,customer_email,invoice_ref,transaction_ref,delivery_ref" limit=26} {loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS} {assign "orderInvoiceFirstName" $FIRSTNAME} {assign "orderInvoiceLastName" $LASTNAME} {assign "orderInvoiceCompany" $COMPANY|default:null} {/loop} {loop type="order-status" name="order-status" id=$STATUS} {assign "orderStatus" $TITLE} {assign "orderStatusLabel" "order_$CODE"} {assign "orderStatusCodeColor" $COLOR} {/loop} {loop type="currency" name="order-currency" id=$CURRENCY} {assign "currencySymbol" $SYMBOL} {/loop} {if $LOOP_COUNT < 26} {hook name="orders.table-row" location="orders_table_row" order_id={$ID}} {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Orders'}
{intl l="Order n°"} {intl l="Date & Hour"} {intl l="Invoice"} {intl l="Delivery"} {intl l="Transaction"} {intl l="Company"} {intl l="Name"} {intl l="Amount"} {intl l="Status"}{intl l="Actions"}
{$REF} {format_date date=$CREATE_DATE} {$INVOICE_REF} {$DELIVERY_REF} {$TRANSACTION_REF} {$orderInvoiceCompany} {$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper} {format_money number=$TOTAL_TAXED_AMOUNT symbol=$currencySymbol} {$orderStatus} {$buttons = [ [ 'type' => 'edit', 'title' => {intl l='Edit this order'}, 'href' => {url path="/admin/order/update/%id" id=$ID}, 'auth' => ['resource' => 'admin.order'] ] ]} {include file='renderer/buttons.html' buttons=$buttons}
{elseloop rel="order-search"}
{intl l="No order found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end order search *} {* category search *}
{ifloop rel="category-search"} {hook name="categories.header" location="category_list_header" } {loop type="category" name="category-search" backend_context=1 visible="*" search_mode="sentence" search_term=$searchTerm search_in="title,chapo,description,postscriptum" return_url=false limit=26} {if $LOOP_COUNT < 26} {hook name="categories.row" location="category_list_row" category_id={$ID} } {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Category'}
{intl l="ID"} {intl l="Category title"} {intl l='Online'} {intl l="Actions"}
{$ID} {$TITLE} {loop type="auth" name="can_change" role="ADMIN" resource="admin.category" access="UPDATE"}
{/loop} {elseloop rel="can_change"}
{/elseloop}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'folder-open', 'title' => {intl l='Browse this category'}, 'href' => {url path='admin/categories' category_id=$ID} ], [ 'type' => 'edit', 'title' => {intl l='Edit this category'}, 'href' => {url path='/admin/categories/update' category_id=$ID}, 'auth' => ['resource' => 'admin.category'] ], [ 'type' => 'delete', 'class' => 'category-delete', 'title' => {intl l='Delete this category'}, 'href' => '#category_delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.category'] ] ]}
{elseloop rel="category-search"}
{intl l="No category found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end category search *} {* product search *}
{ifloop rel="product-search"} {loop type="product" name="product-search" backend_context=1 visible="*" search_mode="sentence" search_term=$searchTerm search_in="id,ref,title,chapo,description,postscriptum" return_url=false limit=26} {if $LOOP_COUNT < 26} {$id_product=$ID} {hook name="products.row" location="product_list_row" product_id={$ID}} {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Product'}
{intl l="ID"} {intl l="Reference"} {intl l="Product title"} {intl l='Price'} {intl l='Online'} {intl l="Actions"}
{$ID} {loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"} {$TITLE} {/loop} {$REF} {if $VIRTUAL}{/if} {$TITLE}{format_money number=$BEST_PRICE symbol={currency attr="symbol"}} {loop type="auth" name="can_change" role="ADMIN" resource="admin.product" access="UPDATE"}
{/loop} {elseloop rel="can_change"}
{/elseloop}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'title' => {intl l='Edit this product'}, 'href' => {url path='/admin/products/update' product_id=$ID page=$page|default:null}, 'auth' => ['resource' => 'admin.product'] ], [ 'type' => 'delete', 'class' => 'product-delete', 'title' => {intl l='Delete this product'}, 'href' => '#product_delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.product'] ] ]}
{elseloop rel="product-search"}
{intl l="No product found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end product search *} {* folder search *}
{ifloop rel="folder-search"} {hook name="folders.header" location="folder_list_header" } {loop type="folder" name="folder-search" backend_context=1 visible="*" search_mode="sentence" search_term=$searchTerm search_in="title,chapo,description,postscriptum" return_url=false limit=26} {if $LOOP_COUNT < 26} {hook name="folders.row" location="folder_list_row" folder_id={$ID} } {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Folder'}
{intl l="ID"} {intl l="Folder title"} {intl l='Online'} {intl l="Actions"}
{$ID} {$TITLE} {loop type="auth" name="can_change" role="ADMIN" resource="admin.folder" access="UPDATE"}
{/loop} {elseloop rel="can_change"}
{/elseloop}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'folder-open', 'title' => {intl l='Browse this folder'}, 'href' => {url path='admin/folders' parent=$ID} ], [ 'type' => 'edit', 'title' => {intl l='Edit this folder'}, 'href' => {url path="/admin/folders/update/%id" id=$ID}, 'auth' => ['resource' => 'admin.folder'] ], [ 'type' => 'delete', 'class' => 'folder-delete', 'title' => {intl l='Delete this folder and all its contents'}, 'href' => '#folder_delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.folder'] ] ]}
{elseloop rel="folder-search"}
{intl l="No folder found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end folder search *} {* content search *}
{ifloop rel="content-search"} {hook name="contents.header" location="content_list_header" } {loop type="content" name="content-search" backend_context=1 visible="*" search_mode="sentence" search_term=$searchTerm search_in="title,chapo,description,postscriptum" return_url=false limit=26} {if $LOOP_COUNT < 26} {hook name="contents.row" location="content_list_row" } {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Content'}
{intl l="ID"} {intl l="Content title"} {intl l='Online'} {intl l="Actions"}
{$ID} {$TITLE} {loop type="auth" name="can_change" role="ADMIN" resource="admin.content" access="UPDATE"}
{/loop} {elseloop rel="can_change"}
{/elseloop}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'title' => {intl l='Edit this content'}, 'href' => {url path="/admin/content/update/{$ID}"}, 'auth' => ['resource' => 'admin.content'] ], [ 'type' => 'delete', 'class' => 'content-delete', 'title' => {intl l='Delete this content'}, 'href' => '#content_delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.content'] ] ]}
{elseloop rel="content-search"}
{intl l="No content found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end content search *} {* brand search *}
{ifloop rel="brand-search"} {hook name="brands.table-header" } {loop type="brand" name="brand-search" backend_context=1 visible="*" search_mode="sentence" search_term=$searchTerm search_in="title,chapo,description,postscriptum" return_url=false limit=26} {if $LOOP_COUNT < 26} {hook name="brands.table-row" brand_id=$ID} {else} {$smarty.capture.more_results nofilter} {/if} {/loop} {/ifloop}
{intl l='Brand'}
{intl l="ID"} {intl l="Brand title"} {intl l='Online'} {intl l="Actions"}
{$ID} {$TITLE} {loop type="auth" name="can_change" role="ADMIN" resource="admin.brand" access="UPDATE"}
{/loop} {elseloop rel="can_change"}
{/elseloop}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'title' => {intl l='Edit this brand'}, 'href' => {url path="/admin/brand/update/{$ID}"}, 'auth' => ['resource' => 'admin.brand'] ], [ 'type' => 'delete', 'class' => 'brand-delete', 'title' => {intl l='Delete this brand'}, 'href' => '#brand_delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.brand'] ] ]}
{elseloop rel="brand-search"}
{intl l="No brand found for \"%term\"" term=$searchTerm}
{/elseloop}
{* end brand search *} {else}
{intl l="Your search is too short"}
{/if}
{hook name="search.bottom" location="search_bottom" }
{* -- Delete category confirmation dialog ----------------------------------- *} {capture "category_delete_dialog"} {hook name="category.delete-form" location="category_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "category_delete_dialog" dialog_title = {intl l="Delete category"} dialog_message = {intl l="Do you really want to delete this category and all its content ?"} form_action = {token_url path='/admin/categories/delete'} form_content = {$smarty.capture.category_delete_dialog nofilter} } {* -- Delete product confirmation dialog ------------------------------------ *} {capture name="product_delete_dialog"} {hook name="product.delete-form" location="product_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "product_delete_dialog" dialog_title = {intl l="Delete product"} dialog_message = {intl l="Do you really want to delete this product and all it's components (images, documents)?
This can't be canceled."} form_action = {token_url path='/admin/products/delete'} form_content = {$smarty.capture.product_delete_dialog nofilter} } {* -- Delete folder confirmation dialog ----------------------------------- *} {capture name="folder_delete_dialog"} {hook name="folder.delete-form" location="folder_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "folder_delete_dialog" dialog_title = {intl l="Delete folder"} dialog_message = {intl l="Do you really want to delete this folder and all its content ?"} form_action = {token_url path='/admin/folders/delete'} form_content = {$smarty.capture.folder_delete_dialog nofilter} } {* -- Delete content confirmation dialog ----------------------------------- *} {capture name="content_delete_dialog"} {hook name="content.delete-form" location="folder_content_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "content_delete_dialog" dialog_title = {intl l="Delete content"} dialog_message = {intl l="Do you really want to delete this content ?"} form_action = {token_url path='/admin/content/delete'} form_content = {$smarty.capture.content_delete_dialog nofilter} } {* -- Delete customer confirmation dialog ----------------------------------- *} {capture "customer_delete_dialog"} {hook name="customer.delete-form" location="customer_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_customer_dialog" dialog_title = {intl l="Delete customer"} dialog_message = {intl l="Do you really want to delete this customer ?"} form_action = {token_url path='/admin/customer/delete'} form_content = {$smarty.capture.customer_delete_dialog nofilter} form_id = "customer_delete_dialog" } {* -- Delete brand confirmation dialog ----------------------------------- *} {capture "brand_delete_dialog"} {hook name="brand.delete-form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "brand_delete_dialog" dialog_title = {intl l="Delete brand"} dialog_message = {intl l="Do you really want to delete this brand ?"} form_action = {token_url path='/admin/brand/delete'} form_content = {$smarty.capture.brand_delete_dialog nofilter} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'} {/javascripts} {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'} {/javascripts} {javascripts file='assets/js/jquery.typewatch.js'} {/javascripts} {/block} {block name="javascript-last-call"} {hook name="search.js" location="search-js" } {/block}