Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -2,6 +2,6 @@
This snippet is used by the AdminUtilities Smarty plugin to generate
the position maagement block in tables
*}
<a href="{$admin_utilities_go_up_url}"><i class="glyphicon glyphicon-arrow-up"></i></a>
<a href="{$admin_utilities_go_up_url nofilter}" class="u-position-up"><i class="glyphicon glyphicon-arrow-up"></i></a>
<span class="{$admin_utilities_in_place_edit_class}" data-id="{$admin_utilities_object_id}">{$admin_utilities_current_position}</span>
<a href="{$admin_utilities_go_down_url}"><i class="glyphicon glyphicon-arrow-down"></i></a>
<a href="{$admin_utilities_go_down_url nofilter}" class="u-position-down"><i class="glyphicon glyphicon-arrow-down"></i></a>

View File

@@ -7,4 +7,4 @@ the header on a sortable column
{else if $admin_utilities_sort_direction == 'down'}
<i class="glyphicon glyphicon-chevron-down"></i>
{/if}
<a href="{$admin_utilities_sorting_url}">{$admin_utilities_header_text}</a>
<a href="{$admin_utilities_sorting_url nofilter}" class="u-sort-{$admin_utilities_sort_direction}">{$admin_utilities_header_text}</a>

View File

@@ -22,7 +22,7 @@
{if $editing_product == true}
{loop name="product_path" type="product" visible="*" id=$product_id}
<li>{intl l="Editing %title" title="$TITLE"}</li>
<li>{intl l="Editing %title" title="{$TITLE}"}</li>
{/loop}
{/if}
</ul>

View File

@@ -24,15 +24,15 @@
<select name="additional_folder_id" id="additional_folder_id" class="form-control">
<option value="">{intl l='Select a folder...'}</option>
{loop name="folders" type="folder-tree" folder="0" exclude=$exclude_from_tree backend_context="1" lang="$edit_language_id"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $DEFAULT_FOLDER==$ID}disabled="disabled"{/if}>
{$TITLE} {if $DEFAULT_FOLDER==$ID}{intl l=' (default)'}{/if}
{loop name="folders" type="folder-tree" folder="0" exclude=$exclude_from_tree backend_context="1" lang="$edit_language_id" return_url=false}
<option value="{$ID}" {if $DEFAULT_FOLDER==$ID}disabled="disabled"{/if}>
{option_offset l=$LEVEL label={$TITLE}}{if $DEFAULT_FOLDER==$ID}{intl l=' (default)'}{/if}
</option>
{/loop}
</select>
<span class="input-group-btn" id="content_add_button">
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
<button class="btn btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
@@ -54,14 +54,14 @@
<th>{intl l='Folder title'}</th>
{module_include location='product_folders_table_header'}
{hook name="product.folders-table-header" location="product_folders_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="additional_folders" type="folder" content=$content_id exclude=$DEFAULT_FOLDER backend_context="1" lang="$edit_language_id"}
{loop name="additional_folders" type="folder" content=$content_id exclude=$DEFAULT_FOLDER backend_context="1" lang="$edit_language_id" return_url=false}
<tr>
<td>{$ID}</td>
@@ -69,16 +69,14 @@
{$TITLE}
</td>
{module_include location='product_folders_table_row'}
{hook name="product.folders-table-row" location="product_folders_table_row" }
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.category" access="UPDATE"}
<a class="btn btn-default btn-xs delete-folder" title="{intl l='Remove the product from this category'}" href="#delete_folder_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.category" access="UPDATE"}
<a class="btn btn-default btn-xs delete-folder" title="{intl l='Remove the product from this category'}" href="#delete_folder_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</td>
</tr>
{/loop}
@@ -99,4 +97,4 @@
</div>
{* -- End folders management ------------------------------------- *}
</div>
</div>
</div>

View File

@@ -1,29 +1,29 @@
{* Customer address creation / modification fields, used in the customer-edit.html template *}
{form_hidden_fields form=$form}
{form_hidden_fields}
<input type="hidden" name="customer_id" value="{$customer_id}">
<input type="hidden" name="page" value="{$page}">
{form_field form=$form field='success_url'}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/customer/update'} customer_id=$customer_id page=$page" />
{/form_field}
{form_field form=$form field='label'}
{form_field field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{$label}">
</div>
{/form_field}
{form_field form=$form field='company'}
{form_field field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
{form_field field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
@@ -37,7 +37,7 @@
<div class="row">
<div class="col-md-6">
{form_field form=$form field='firstname'}
{form_field field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Firstname'}">
@@ -45,7 +45,7 @@
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='lastname'}
{form_field field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Lastname'}">
@@ -54,20 +54,20 @@
</div>
</div>
{form_field form=$form field='address1'}
{form_field field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
{form_field field='address2'}
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
{form_field field='address3'}
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
@@ -75,7 +75,7 @@
<div class="row">
<div class="col-md-3">
{form_field form=$form field='zipcode'}
{form_field field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Zip code'}">
@@ -83,7 +83,7 @@
{/form_field}
</div>
<div class="col-md-9">
{form_field form=$form field='city'}
{form_field field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='City'}">
@@ -92,20 +92,33 @@
</div>
</div>
{form_field form=$form field='country'}
{form_field field='country'}
{$countryFieldId=$label_attr.for}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select {if $required}required{/if} name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<label for="{$dialog_type}-{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select {if $required}required{/if} name="{$name}" id="{$dialog_type}-{$label_attr.for}" class="form-control">
{loop type="country" name="country1" visible="*"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field field='state'}
<div class="form-group group-modal-state{if $error}has-error{/if}">
<label for="{$dialog_type}-{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select name="{$name}" id="{$dialog_type}-{$label_attr.for}" class="form-control"
data-thelia-state="1" data-thelia-country="#{$dialog_type}-{$countryFieldId}" data-thelia-toggle=".group-modal-state">
{loop type="state" name="state1" visible="*"}
<option value="{$ID}" {if {$value} == $ID}selected{/if} data-country="{$COUNTRY}">{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='phone'}
{form_field field='phone'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Phone number'}">
@@ -113,7 +126,7 @@
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='cellphone'}
{form_field field='cellphone'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Cellular phone number'}">

View File

@@ -4,11 +4,16 @@ A generic document upload form
Parameters:
documentType = Document type (category, product, folder, content, module)
parentId = Document parent id, ex: category id
resource = Document parent resource name
*}
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{hook name="tab-document.top" id=$parentId type=$documentType}
<div class="document-manager" >
<form action="{url path="/admin/document/type/$documentType/$parentId/save-ajax"}" method="post" class="dropzone" id="documents-dropzone" enctype="multipart/form-data">
<form action="{url path="/admin/document/type/%document/%id/save-ajax" document=$documentType id=$parentId}" method="post" class="dropzone" id="documents-dropzone" enctype="multipart/form-data">
<div class="fallback">
<input name="file" type="file" />
<button type="submit" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-send"></span> {intl l="Send files"}</button>
@@ -24,15 +29,40 @@ Parameters:
</form>
<div class="existing-document">
{include file='includes/document-upload-list-ajax.html'}
{include file='includes/document-upload-list-ajax.html'
documentType=$documentType
parentId=$parentId
resource=$resource
}
</div>
</div>
{hook name="tab-document.bottom" id=$parentId type=$documentType}
<script>
var documentDropZoneUrl = "{url path="/admin/document/type/$documentType/$parentId/save-ajax"}";
var documentListUrl = "{url path="/admin/document/type/$documentType/$parentId/list-ajax"}";
var documentReorder = "{url path="/admin/document/type/$documentType/$parentId/update-position"}";
var documentDropZoneUrl = "{url path="/admin/document/type/%document/%id/save-ajax" document=$documentType id=$parentId}";
var documentListUrl = "{url path="/admin/document/type/%document/%id/list-ajax" document=$documentType id=$parentId}";
var documentReorder = "{url path="/admin/document/type/%document/%id/update-position" document=$documentType id=$parentId}";
var documentListErrorMessage = "{intl l='Can\'t load documents, please refresh this page.'}";
var documentReorderErrorMessage = "{intl l='Can\'t reorder documents, please refresh this page.'}";
</script>
<div class="modal fade" id="document_delete_dialog" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{intl l="delete document"}</h3>
</div>
<div class="modal-body">
{intl l="Do you really want to delete this document ?"}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span>{intl l="No"}</button>
<button type="button" id="submit-delete-document" data-element-id="" class="btn btn-primary"><span class="glyphicon glyphicon-check"></span>{intl l="Yes"}</button>
</div>
</div>
</div>
</div>

View File

@@ -5,23 +5,39 @@ A generic document upload form
Parameters:
documentType = Document type (category, product, folder, content, module)
parentId = Document parent id, ex: category id
resource = Document parent resource name
*}
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{ifloop rel="document"}
<ul id="js-sort-document" class="list-unstyled document-list">
{loop type="document" name="document" source="{$documentType}" order="manual" source_id="{$parentId}"}
{loop type="document" name="document" source=$documentType order="manual" source_id=$parentId visible="*"}
<li class="clearfix ui-state-default" data-sort-id="{$ID}">
<a href="{$DOCUMENT_PATH}" title="{$TITLE}" class="pull-left" target="_blank">{$TITLE}</a>
<div class="btn-group pull-right">
<a class="image-update-btn btn btn-default btn-xs disabled js-sorted-position" href="#">{$POSITION}</a>
<a class="document-update-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/$ID/update"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="document-delete-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/delete/$ID"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-trash"></span>
</a>
<a class="document-update-btn btn btn-default btn-xs disabled js-sorted-position" href="#">{$POSITION}</a>
{loop type="auth" name="can_change" role="ADMIN" resource="{$resource|default:"admin.$documentType"}" access="UPDATE"}
<a class="document-toggle-btn btn btn-default btn-xs {if $VISIBLE}visibility-visible{/if}" href="{url path="/admin/document/type/$documentType/$ID/toggle"}" data-error-message="{intl l='Please retry'}">
<i class="glyphicon glyphicon-eye-open"></i><i class="glyphicon glyphicon-eye-close"></i>
</a>
<a class="document-update-btn btn btn-default btn-xs" href="{url path="/admin/document/type/%document/%id/update" document=$documentType id=$ID}" data-error-message="{intl l='Please retry'}">
<i class="glyphicon glyphicon-edit"></i>
</a>
{/loop}
{elseloop rel="can_change"}
<a class="btn btn-default btn-xs">
<i class="glyphicon {if $VISIBLE}glyphicon-eye-open{else}glyphicon-eye-close{/if}"></i>
</a>
{/elseloop}
{loop type="auth" name="can_delete" role="ADMIN" resource="{$resource|default:"admin.$documentType"}" access="DELETE"}
<a class="document-delete-btn btn btn-default btn-xs" id="document-{$ID}" data-id="{$ID}" href="{url path="/admin/document/type/%document/delete/%id" document=$documentType id=$ID}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</li>
{/loop}

View File

@@ -0,0 +1,196 @@
{if $DESCRIPTION}
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
{$DESCRIPTION nofilter}
</div>
</div>
</div>
{/if}
{if $useRange}
<div class="row vertical-row-space">
<div class="col-md-4">
{form_field field="range_date_start"}
<div class="row">
<div class="col-md-12">
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div class="col-md-12">
<select id="{$label_attr.for}_year" name="{$name}[year]">
{foreach from=$years item=m}
<option value="{$m}"{if {$smarty.now|date_format:'%Y'} == $m} selected{/if}>{$m}</option>
{/foreach}
</select>
<select id="{$label_attr.for}_month" name="{$name}[month]">
{foreach from=$months item=m}
<option value="{$m}"{if {$smarty.now|date_format:'%m'} == $m} selected{/if}>{$m}</option>
{/foreach}
</select>
<select id="{$label_attr.for}_day" class="hidden" name="{$name}[day]">
{foreach from=$days item=m}
<option value="{$m}">{$m}</option>
{/foreach}
</select>
</div>
</div>
{/form_field}
</div>
<div class="col-md-4">
{form_field field="range_date_end"}
<div class="row">
<div class="col-md-12">
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div class="col-md-12">
<select id="{$label_attr.for}_year" name="{$name}[year]">
{foreach from=$years item=m}
<option value="{$m}"{if {$smarty.now|date_format:'%Y'} == $m} selected{/if}>{$m}</option>
{/foreach}
</select>
<select id="{$label_attr.for}_month" name="{$name}[month]">
{foreach from=$months item=m}
<option value="{$m}"{if {$smarty.now|date_format:'%m'} + 1 == $m} selected{/if}>{$m}</option>
{/foreach}
</select>
<select id="{$label_attr.for}_day" class="hidden" name="{$name}[day]">
{foreach from=$days item=m}
<option value="{$m}">{$m}</option>
{/foreach}
</select>
</div>
</div>
{/form_field}
</div>
</div>
{/if}
<div class="row">
<div class="col-md-12">
{ifloop rel="serializer"}
<div class="row vertical-row-space">
<div class="col-xs-4">
{form_field field="serializer"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<select id="{$label_attr.for}" name="{$name}" required>
{loop type="serializer" name="serializer"}
<option value="{$ID}"{if $value == $ID} selected{/if}>{$NAME} (.{$EXTENSION})</option>
{/loop}
</select>
</div>
{/form_field}
</div>
<div class="col-xs-4">
{form_field field="language"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<select id="{$label_attr.for}" name="{$name}" required>
{loop type="lang" name="export-lang"}
<option value="{$ID}"{if $ID == {lang attr="id"}} selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
</div>
{ifloop rel="archiver"}
<div class="col-xs-4">
{form_field field="do_compress"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<div id="export-compression-switch" class="make-switch switch-small" data-on-label="<i class=&quot;glyphicon glyphicon-ok-circle&quot;></i>" data-on="success" data-off-label="<i class=&quot;glyphicon glyphicon-remove-circle&quot;></i>" data-off="danger">
<input id="{$label_attr.for}" type="checkbox" name="{$name}" />
</div>
</div>
{/form_field}
</div>
{* Exact same loop as below *}
{* Only needed for ifloop statement *}
{* Prevent coding style break *}
{loop type="archiver" name="archiver" available=true}{/loop}
{/ifloop}
</div>
{ifloop rel="archiver"}
<div class="row vertical-row-space export-compression-selection-row">
<div class="col-xs-4">
{form_field field="archiver"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<select id="{$label_attr.for}" name="{$name}" required>
{loop type="archiver" name="archiver" available=true}
<option value="{$ID}"{if $value == $NAME} selected{/if}>{$NAME} (.{$EXTENSION})</option>
{/loop}
</select>
</div>
{/form_field}
</div>
{if $hasImages}
<div class="col-xs-4">
{form_field field="images"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<div class="make-switch switch-small" data-on-label="<i class=&quot;glyphicon glyphicon-ok-circle&quot;></i>" data-on="success" data-off-label="<i class=&quot;glyphicon glyphicon-remove-circle&quot;></i>" data-off="danger">
<input id="{$label_attr.for}" type="checkbox" name="{$name}" />
</div>
</div>
{/form_field}
</div>
{/if}
{if $hasDocuments}
<div class="col-xs-4">
{form_field field="documents"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<div class="make-switch switch-small" data-on-label="<i class=&quot;glyphicon glyphicon-ok-circle&quot;></i>" data-on="success" data-off-label="<i class=&quot;glyphicon glyphicon-remove-circle&quot;></i>" data-off="danger">
<input id="{$label_attr.for}" type="checkbox" name="{$name}" />
</div>
</div>
{/form_field}
</div>
{/if}
</div>
{/ifloop}
{/ifloop}
{elseloop rel="serializer"}
<div class="alert alert-warning">
{intl l="You can't do exports, you don't have any serializer that handles this."}
</div>
{/elseloop}
</div>
</div>

View File

@@ -11,7 +11,7 @@
{if $editing_folder == true}
{intl l='Editing %fold' fold="{$TITLE}"}
{else}
{$TITLE} <a href="{url path="/admin/folders/update/$ID"}" title="{intl l='Edit this folder'}">{intl l="(edit)"}</a>
{$TITLE} <a href="{url path="/admin/folders/update/%id" id=$ID}" title="{intl l='Edit this folder'}">{intl l="(edit)"}</a>
{/if}
</li>
{else}
@@ -22,7 +22,7 @@
{if $editing_content == true}
{loop name="content_path" type="content" visible="*" id=$content_id}
<li>{intl l="Editing %title" title="$TITLE"}</li>
<li>{intl l="Editing %title" title="{$TITLE}"}</li>
{/loop}
{/if}
</ul>

View File

@@ -36,7 +36,7 @@ Parameters:
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {$dialog_cancel_label|default:{intl l="No"}}</button>
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l="Yes"}}</button>
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l="Yes"}}</button>
</div>
</form>

View File

@@ -10,6 +10,7 @@ A generic modal creation dialog template. Parameters
dialog_cancel_label = The cancel button label. Default create
form_action = The form action URL. Form is submitted when OK button is clicked
form_attributes = additional form attibutes
form_enctype = The form encoding
form_error_message = The form error message (optional)
@@ -25,7 +26,7 @@ A generic modal creation dialog template. Parameters
<h3>{$dialog_title nofilter}</h3>
</div>
<form method="POST" action="{$form_action nofilter}" {$form_enctype nofilter}>
<form method="POST" action="{$form_action nofilter}" {$form_enctype nofilter} {$form_attributes nofilter}>
<div class="modal-body">
{if ! empty($form_error_message)}<div class="alert alert-danger" id="{$dialog_id}_error">{$form_error_message nofilter}</div>{/if}
@@ -35,7 +36,7 @@ A generic modal creation dialog template. Parameters
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {$dialog_cancel_label|default:{intl l='Cancel'}}</button>
<button {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
<button {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
</div>
</form>

View File

@@ -20,10 +20,28 @@ Parameters:
{/if}
{/form}
{*
Prevent multiple form submissions
you can deactivate this behavior in setting data-submitting='0' on the form tag
*}
$('#{$dialog_id} form').on("submit", function(e) {
var submitting = $(this).data('submitting');
if (submitting == '1') {
e.preventDefault();
return false;
}
if (submitting != '0') {
$(this).data('submitting', '1');
}
});
{* Always reset create dialog on close *}
$('#{$dialog_id}').on('hidden.bs.modal', function() {
var submitting = false;
// Hide error message
$('#{$dialog_id}_error').remove();

View File

@@ -26,7 +26,7 @@ A generic modal creation dialog template. Parameters
</div>
<div class="modal-footer">
<button {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} type="button" data-dismiss="modal" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
<button {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} type="button" data-dismiss="modal" class="btn btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
</div>
</div>

View File

@@ -0,0 +1,89 @@
// Get module hook classnames when a module is selected in the creation dialog
$('#module_id').change(function(ev) {
var $classnameSelect = $('#classname');
$classnameSelect.html('<option value="">{intl l='Please wait, loading...'}</option>').prop('disabled', true);
var moduleId = $("#module_id").val();
$.ajax({
url : "{url path="/admin/module-hooks/get-module-hook-classnames"}/" + moduleId,
success : function(data) {
$classnameSelect.empty();
if (data.length == 0) {
$classnameSelect.append(
'<option value="">{intl l='This module cannot be placed in a hook'}</option>'
)
} else {
$(data).each(function(idx, item) {
$classnameSelect.empty().append(
'<option value="' + item + '">' + item + '</option>'
)
});
$classnameSelect.prop('disabled', false);
// For initializing the selected option when editing a module hook
if ('' != currentClassname) {
$classnameSelect.val(currentClassname);
currentClassname = '';
}
}
// Get related methods
$('#classname').change();
},
error : function() {
alert("{intl l='Sorry, an error occurred, please try again.'}");
}
})
});
// Get module hook methods when a module is selected in the creation dialog
$('#classname').change(function(ev) {
var $methodSelect = $('#method');
var moduleId = $("#module_id").val();
var classname = $("#classname").val();
$methodSelect.prop('disabled', true);
if ('' == classname) {
$methodSelect.empty();
return;
}
$methodSelect.html('<option value="">{intl l='Please wait, loading...'}</option>');
$.ajax({
url : "{url path="/admin/module-hooks/get-module-hook-methods"}/" + moduleId + '/' + classname,
success : function(data) {
$methodSelect.empty();
if (data.length == 0) {
$methodSelect.append(
'<option value="">{intl l='This classname has no method'}</option>'
)
} else {
$(data).each(function(idx, item) {
$methodSelect.append(
'<option value="' + item + '">' + item + '</option>'
)
});
$methodSelect.prop('disabled', false);
// For initializing the selected option when editing a module hook
if ('' != currentMethod) {
$methodSelect.val(currentMethod);
currentMethod = '';
}
}
},
error : function() {
alert("{intl l='Sorry, an error occurred, please try again.'}");
}
})
});

View File

@@ -4,11 +4,16 @@ A generic image upload form
Parameters:
imageType = Image type (category, product, folder, content, module)
parentId = Image parent id, ex: category id
resource = Image parent resource name
*}
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{hook name="tab-image.top" id=$parentId type=$imageType}
<div class="image-manager" >
<form action="{url path="/admin/image/type/$imageType/$parentId/save-ajax"}" method="post" class="dropzone" id="images-dropzone" enctype="multipart/form-data">
<form action="{url path="/admin/image/type/%image/%id/save-ajax" image=$imageType id=$parentId}" method="post" class="dropzone" id="images-dropzone" enctype="multipart/form-data">
<div class="fallback">
<input name="file" type="file" />
<button type="submit" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-send"></span> {intl l="Send files"}</button>
@@ -16,7 +21,7 @@ Parameters:
<div class="btn-browse hide">
{intl l="Drop files to upload"}
<span>Or</span>
<span>{intl l="Or"}</span>
<button type="button" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-upload"></span> {intl l="Browse files"}</button>
</div>
@@ -24,15 +29,21 @@ Parameters:
</form>
<div class="existing-image">
{include file='includes/image-upload-list-ajax.html'}
{include file='includes/image-upload-list-ajax.html'
imageType=$imageType
parentId=$parentId
resource=$resource
}
</div>
</div>
{hook name="tab-image.bottom" id=$parentId type=$imageType}
<script>
var imageDropZoneUrl = "{url path="/admin/image/type/$imageType/$parentId/save-ajax"}";
var imageListUrl = "{url path="/admin/image/type/$imageType/$parentId/list-ajax"}";
var imageReorder = "{url path="/admin/image/type/$imageType/$parentId/update-position"}";
var imageDropZoneUrl = "{url path="/admin/image/type/%image/%id/save-ajax" image=$imageType id=$parentId}";
var imageListUrl = "{url path="/admin/image/type/%image/%id/list-ajax" image=$imageType id=$parentId}";
var imageReorder = "{url path="/admin/image/type/%image/%id/update-position" image=$imageType id=$parentId}";
var imageListErrorMessage = "{intl l='Can\'t load images, please refresh this page.'}";
var imageReorderErrorMessage = "{intl l='Can\'t reorder images, please refresh this page.'}";
</script>
@@ -49,7 +60,7 @@ Parameters:
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span>{intl l="No"}</button>
<button type="button" id="submit-delete-image" data-element-id="" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span>{intl l="Yes"}</button>
<button type="button" id="submit-delete-image" data-element-id="" class="btn btn-primary"><span class="glyphicon glyphicon-check"></span>{intl l="Yes"}</button>
</div>
</div>
</div>

View File

@@ -5,25 +5,46 @@ A generic image upload form
Parameters:
imageType = Image type (category, product, folder, content, module)
parentId = Image parent id, ex: category id
resource = Image parent resource name
*}
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{ifloop rel="image"}
<ul id="js-sort-image" class="row list-unstyled">
{loop type="image" name="image" source="{$imageType}" order="manual" source_id="{$parentId}" width="200" height="100" resize_mode="borders"}
{loop type="image" name="image" backend_context="on" source=$imageType order="manual" source_id=$parentId width="200" height="100" resize_mode="borders" visible="*"}
<li class="col-sm-6 col-md-3 ui-state-default" data-sort-id="{$ID}">
<a href="{url path="/admin/image/type/$imageType/$ID/update"}" title="{intl l='Update this image'}" class="thumbnail">
<img src="{$IMAGE_URL}" alt="{$TITLE}">
<a href="{url path="/admin/image/type/%image/%id/update" image=$imageType id=$ID}" title="{intl l='Update this image'}" class="thumbnail">
{if $PROCESSING_ERROR}
<img src="//placehold.it/200x100&text={intl l='Image+file+not+found'}" alt="{$TITLE}">
{else}
<img src="{$IMAGE_URL nofilter}" alt="{$TITLE}">
{/if}
</a>
<div class="btn-group" >
<a class="image-update-btn btn btn-default btn-xs disabled js-sorted-position" href="#">{$POSITION}</a>
<a class="image-update-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/$ID/update"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-edit"></span>
{loop type="auth" name="can_change" role="ADMIN" resource="{$resource|default:"admin.$imageType"}" access="UPDATE"}
<a class="image-toggle-btn btn btn-default btn-xs {if $VISIBLE}visibility-visible{/if}" href="{url path="/admin/image/type/%image/%id/toggle" image=$imageType id=$ID}" data-error-message="{intl l='Please retry'}">
<i class="glyphicon glyphicon-eye-open"></i><i class="glyphicon glyphicon-eye-close"></i>
</a>
<a class="image-delete-btn btn btn-default btn-xs" id="image-{$ID}" href="{url path="/admin/image/type/$imageType/delete/$ID"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-trash"></span>
<a class="image-update-btn btn btn-default btn-xs" href="{url path="/admin/image/type/%image/%id/update" image=$imageType id=$ID}" data-error-message="{intl l='Please retry'}">
<i class="glyphicon glyphicon-edit"></i>
</a>
{/loop}
{elseloop rel="can_change"}
<a class="btn btn-default btn-xs">
<i class="glyphicon {if $VISIBLE}glyphicon-eye-open{else}glyphicon-eye-close{/if}"></i>
</a>
{/elseloop}
{loop type="auth" name="can_delete" role="ADMIN" resource="{$resource|default:"admin.$imageType"}" access="DELETE"}
<a class="image-delete-btn btn btn-default btn-xs" id="image-{$ID}" href="{url path="/admin/image/type/%image/delete/%id" image=$imageType id=$ID}" data-error-message="{intl l='Please retry'}">
<i class="glyphicon glyphicon-trash"></i>
</a>
{/loop}
</div>
</li>
{/loop}

View File

@@ -0,0 +1,46 @@
{if $DESCRIPTION}
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
{$DESCRIPTION nofilter}
</div>
</div>
</div>
{/if}
<div class="row">
<div class="col-md-12">
<div class="row vertical-row-space">
<div class="col-xs-6">
{form_field field="language"}
<div>
<label for="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<select id="{$label_attr.for}" name="{$name}" required>
{loop name="import-lang" type="lang"}
<option value="{$ID}"{if $ID == {lang attr="id"}} selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
</div>
<div class="col-xs-6">
{form_field field="file_upload"}
<div>
<label form="{$label_attr.for}">
{$label}
</label>
</div>
<div>
<input id="{$label_attr.for}" type="file" name="{$name}" accept="{$ALLOWED_MIME_TYPES}" required aria-required="true" />
<div class="small">Accepted formats&nbsp;: {$ALLOWED_EXTENSIONS}</div>
</div>
{/form_field}
</div>
</div>
</div>
</div>

View File

@@ -10,13 +10,14 @@ Parameters:
- show_currencies: true/false. If true, show the currency selection bar
- page_url: the current page URL. Default is $current_url. Used to switchedition anguage.
- close_url: no default. URL displayed when close button is clicked. If empty, the close button is not displayed.
-page_bottom: true/false. If true, the toolbar will have a style suitable for page bottom
*}
<div class="row inner-toolbar">
<div class="row inner-toolbar{if $page_bottom} inner-toolbar-bottom{/if}">
<div class="col-md-3 inner-actions">
{if $hide_flags != true}
<ul class="nav nav-pills">
{loop name="lang_list" type="lang"}
{loop name="lang_list" type="lang" backend_context="1"}
<li {if $ID == $edit_language_id}class="active"{/if}>
{if $current_tab}
{$lang_url = {url path={$page_url|default:$current_url nofilter} edit_language_id=$ID current_tab=$current_tab}}
@@ -24,7 +25,7 @@ Parameters:
{$lang_url = {url path={$page_url|default:$current_url nofilter} edit_language_id=$ID}}
{/if}
<a class="language-change-button" data-language-id="{$ID}" href="{$lang_url nofilter}" title="{intl l='Edit information in %lng' lng={$TITLE}}">
<img src="{image file="../assets/img/flags/{$CODE}.png"}" alt="{$TITLE}" />
<img src="{image file="assets/img/flags/$CODE.png"}" alt=$TITLE />
</a>
</li>
{/loop}
@@ -37,8 +38,8 @@ Parameters:
<div class="row">
<div class="col-md-12">
<div class="button-group">
{loop name="currency_list" type="currency"}
<a class="btn btn-sm {if $ID == $edit_currency_id}btn-primary{else}btn-default{/if}" href="{url noamp=1 path='/admin/products/update' edit_currency_id=$ID product_id=$product_id current_tab='prices'}" title="{intl l='Edit prices in %curr' curr={$NAME}}">
{loop name="currency_list" type="currency" backend_context="1"}
<a class="btn btn-sm {if $ID == $edit_currency_id}btn-primary{else}btn-default{/if}" href="{url noamp=1 path={$page_url|default:$current_url nofilter} edit_currency_id=$ID product_id=$product_id current_tab='prices'}" title="{intl l='Edit prices in %curr' curr={$NAME}}">
{$SYMBOL}
</a>
{/loop}
@@ -48,7 +49,7 @@ Parameters:
{/if}
</div>
<div class="col-md-6 inner-actions">
<div class="col-md-6 inner-actions text-right">
{if $hide_submit_buttons != true}
{if $hide_save_buttons != true}
<button type="submit" name="save_mode" value="stay" class="form-submit-button btn btn-sm btn-default btn-success" title="{intl l='Save'}">{intl l='Save'} <span class="glyphicon glyphicon-ok"></span></button>
@@ -58,7 +59,7 @@ Parameters:
{/if}
{/if}
{if ! empty($close_url)}
<a href="{$close_url}" class="page-close-button btn btn-sm btn-default">{intl l='Close'} <span class="glyphicon glyphicon-remove"></span></a>
<a href="{$close_url nofilter}" class="page-close-button btn btn-sm btn-default">{intl l='Close'} <span class="glyphicon glyphicon-remove"></span></a>
{/if}
</div>
</div>

View File

@@ -0,0 +1,288 @@
{hook name="main.before-top-menu" location="before_top_menu" }
<ul class="nav in" id="side-menu">
<li class="sidebar-search">
{loop name="top-bar-search" type="auth" role="ADMIN" resource="admin.search" access="VIEW"}
<form action="{url path='/admin/search'}">
<div class="input-group">
<input type="text" class="form-control" id="search_term" name="search_term" placeholder="{intl l='Search'}" value="{trim($smarty.get.search_term)}">
<span class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</form>
{/loop}
<!-- /input-group -->
</li>
<li class="{if $admin_current_location == 'home'}active{/if}" id="home_menu">
<a href="{url path='/admin/home'}" title="{intl l="Home"}"><span class="icon-home"></span> <span class="item-text">{intl l="Home"}</span></a>
</li>
{loop name="menu-auth-customer" type="auth" role="ADMIN" resource="admin.customer" access="VIEW"}
{ifhook rel="main.top-menu-customer"}
{hookblock name="main.top-menu-customer" fields="id,class,url,title"}
<li class="{if $admin_current_location == 'customer'}active{/if}" id="customers_menu">
<a title="{intl l="Customers"}" href="#collapse-customer" {if $admin_current_location == 'customer'}class="open"{/if}>
<span class="icon-customers"></span>
<span class="item-text">{intl l="Customers"} <span class="caret"></span></span>
</a>
<ul id="collapse-customer" class="collapse {if $admin_current_location == 'customer'}in{/if}" role="menu">
<li role="menuitem" id="customers_menu">
<a href="{url path='/admin/customers'}" title="{intl l="Customers"}">
{intl l="Customers"}
</a>
</li>
{forhook rel="main.top-menu-customer"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
</ul>
</li>
{/hookblock}
{/ifhook}
{elsehook rel="main.top-menu-customer"}
<li class="{if $admin_current_location == 'customer'}active{/if}" id="customers_menu">
<a href="{url path='/admin/customers'}" title="{intl l="Customers"}">
<span class="icon-customers"></span>
<span class="item-text">{intl l="Customers"}</span>
</a>
</li>
{/elsehook}
{/loop}
{loop name="menu-auth-order" type="auth" role="ADMIN" resource="admin.order" access="VIEW"}
<li class="{if $admin_current_location == 'order'}active{/if}" id="orders_menu">
<a title="{intl l="Orders"}" href="#collapse-orders" {if $admin_current_location == 'order'}class="open"{/if}>
<span class="icon-orders"></span>
<span class="item-text">{intl l="Orders"} <span class="caret"></span></span>
</a>
<ul id="collapse-orders" class="collapse {if $admin_current_location == 'order'}in{/if}" role="menu">
<li role="menuitem">
<a class="clearfix" href="{url path='admin/orders'}">
<span class="pull-left">{intl l="All orders"}</span>
<span class="label label-default pull-right">{count type="order" customer="*" backend_context="1"}</span>
</a>
</li>
{loop name="order-status-list" type="order-status"}
{$count = {count type="order" customer="*" backend_context="1" status={$ID}}}
{if $count}
<li role="menuitem">
<a class="clearfix" data-target="{url path="admin/orders/$LABEL"}" href="{url path="admin/orders" status={$ID}}">
<span class="pull-left">{$TITLE}</span>
<span class="label pull-right" style="background-color: {$COLOR};">{$count}</span>
</a>
</li>
{/if}
{/loop}
{hookblock name="main.top-menu-order" fields="id,class,url,title"}
{forhook rel="main.top-menu-order"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
{/hookblock}
</ul>
</li>
{/loop}
{loop name="menu-auth-catalog" type="auth" role="ADMIN" resource="admin.category" access="VIEW"}
{ifhook rel="main.top-menu-catalog"}
{hookblock name="main.top-menu-catalog" fields="id,class,url,title"}
<li class="{if $admin_current_location == 'catalog'}active{/if}" id="catalog_menu">
<a title="{intl l="Catalog"}" href="#collapse-catalog" {if $admin_current_location == 'catalog'}class="open"{/if}>
<span class="icon-catalog"></span>
<span class="item-text">{intl l="Catalog"} <span class="caret"></span></span>
</a>
<ul id="collapse-catalog" class="collapse {if $admin_current_location == 'catalog'}in{/if}" role="menu">
<li role="menuitem" id="catalog_menu">
<a title="{intl l="Catalog"}" href="{url path='/admin/catalog'}">
{intl l="Catalog"}
</a>
</li>
{forhook rel="main.top-menu-catalog"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
</ul>
</li>
{/hookblock}
{/ifhook}
{elsehook rel="main.top-menu-catalog"}
<li class="{if $admin_current_location == 'catalog'}active{/if}" id="catalog_menu">
<a title="{intl l="Catalog"}" href="{url path='/admin/catalog'}">
<span class="icon-catalog"></span>
<span class="item-text">{intl l="Catalog"}</span>
</a>
</li>
{/elsehook}
{/loop}
{loop name="menu-auth-content" type="auth" role="ADMIN" resource="admin.folder" access="VIEW"}
{ifhook rel="main.top-menu-content"}
{hookblock name="main.top-menu-content" fields="id,class,url,title"}
<li class="{if $admin_current_location == 'content'}active{/if}" id="contents_menu">
<a title="{intl l="Folders"}" href="#collapse-content" {if $admin_current_location == 'content'}class="open"{/if}>
<span class="icon-records"></span>
<span class="item-text">{intl l="Folders"} <span class="caret"></span></span>
</a>
<ul id="collapse-content" class="collapse {if $admin_current_location == 'content'}in{/if}" role="menu">
<li role="menuitem" id="contents_menu">
<a title="{intl l="Folders"}" href="{url path='/admin/folders'}">
{intl l="Folders"}
</a>
</li>
{forhook rel="main.top-menu-content"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
</ul>
</li>
{/hookblock}
{/ifhook}
{elsehook rel="main.top-menu-content"}
<li class="{if $admin_current_location == 'folder'}active{/if}" id="contents_menu">
<a title="{intl l="Folders"}" href="{url path='/admin/folders'}">
<span class="icon-records"></span>
<span class="item-text">{intl l="Folders"}</span>
</a>
</li>
{/elsehook}
{/loop}
{loop name="menu-auth-tools" type="auth" role="ADMIN" resource="admin.tools" access="VIEW"}
<li class="{if $admin_current_location == 'tools'}active{/if}" id="tools_menu">
<a title="{intl l="Tools"}" href="#collapse-tools" {if $admin_current_location == 'tools'}class="open"{/if}>
<span class="icon-tools"></span>
<span class="item-text">{intl l="Tools"} <span class="caret"></span></span>
</a>
<ul id="collapse-tools" class="collapse {if $admin_current_location == 'tools'}in{/if}" role="menu">
{loop name="auth-coupon" type="auth" role="ADMIN" resource="admin.coupon" access="VIEW"}
<li role="menuitem"><a href="{url path='/admin/coupon'}">{intl l="Coupons"}</a></li>
{/loop}
{loop name="auth-sales" type="auth" role="ADMIN" resource="admin.sales" access="VIEW"}
<li role="menuitem"><a href="{url path='/admin/sales'}">{intl l="Sales management"}</a></li>
{/loop}
{loop name="auth-brand" type="auth" role="ADMIN" resource="admin.brand" access="VIEW"}
<li role="menuitem"><a href="{url path='/admin/brand'}">{intl l="Brands"}</a></li>
{/loop}
{loop name="auth-export" type="auth" role="ADMIN" resource="admin.export" access="VIEW"}
<li role="menuitem"><a href="{url path='/admin/export'}">{intl l="Export"}</a></li>
{/loop}
{loop name="auth-import" type="auth" role="ADMIN" resource="admin.import" access="VIEW"}
<li role="menuitem"><a href="{url path='/admin/import'}">{intl l="Import"}</a></li>
{/loop}
{hookblock name="main.top-menu-tools" fields="id,class,url,title"}
{forhook rel="main.top-menu-tools"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
{/hookblock}
</ul>
</li>
{/loop}
{loop name="menu-auth-modules" type="auth" role="ADMIN" resource="admin.module" access="VIEW"}
{ifhook rel="main.top-menu-modules"}
{hookblock name="main.top-menu-modules" fields="id,class,url,title"}
<li class="{if $admin_current_location == 'modules'}active{/if}" id="modules_menu">
<a title="{intl l="Modules"}" href="#collapse-modules" {if $admin_current_location == 'modules'}class="open"{/if}>
<span class="icon-modules"></span>
<span class="item-text">{intl l="Modules"}<span class="caret"></span></span>
</a>
<ul id="collapse-modules" class="collapse {if $admin_current_location == 'modules'}in{/if}" role="menu">
<li role="menuitem" id="modules_menu">
<a title="{intl l="Modules"}" href="{url path='/admin/modules'}">
{intl l="Modules"}
</a>
</li>
{forhook rel="main.top-menu-modules"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
</ul>
</li>
{/hookblock}
{/ifhook}
{elsehook rel="main.top-menu-modules"}
<li class="{if $admin_current_location == 'modules'}active{/if}" id="modules_menu">
<a title="{intl l="Modules"}" href="{url path='/admin/modules'}">
<span class="icon-modules"></span>
<span class="item-text">{intl l="Modules"}</span>
</a>
</li>
{/elsehook}
{/loop}
{loop name="menu-auth-config" type="auth" role="ADMIN" resource="admin.configuration" access="VIEW"}
{ifhook rel="main.top-menu-configuration"}
{hookblock name="main.top-menu-configuration" fields="id,class,url,title"}
<li class="{if $admin_current_location == 'configuration'}active{/if}" id="config_menu">
<a title="{intl l="Configuration"}" href="#collapse-configuration" {if $admin_current_location == 'configuration'}class="open"{/if}>
<span class="icon-configuration"></span>
<span class="item-text">{intl l="Configuration"}<span class="caret"></span></span>
</a>
<ul id="collapse-configuration" class="collapse {if $admin_current_location == 'configuration'}in{/if}" role="menu">
{forhook rel="main.top-menu-configuration"}
<li role="menuitem">
<a {if $id}id="{$id}" {/if} class="{$class}" data-target="{$url}" href="{$url}">
{$title}
</a>
</li>
{/forhook}
</ul>
</li>
{/hookblock}
{/ifhook}
{elsehook rel="main.top-menu-configuration"}
<li class="{if $admin_current_location == 'configuration'}active{/if}" id="config_menu">
<a title="{intl l="Configuration"}" href="{url path='/admin/configuration'}">
<span class="icon-configuration"></span>
<span class="item-text">{intl l="Configuration"}</span>
</a>
</li>
{/elsehook}
{/loop}
{hook name="main.in-top-menu-items" location="in_top_menu_items" admin_current_location=$admin_current_location}
</ul>
{hook name="main.topbar-bottom" }
{hook name="main.after-top-menu" location="after_top_menu" }

View File

@@ -16,11 +16,14 @@
label="{intl l='ID'}"
}
</th>
<th>&nbsp;</th>
<th>
{admin_sortable_header
current_order=$module_order
order='alpha'
reverse_order='alpha_reverse'
order='title'
reverse_order='title_reverse'
path={url path='/admin/modules'}
request_parameter_name='module_order'
label="{intl l='Name'}"
@@ -38,16 +41,7 @@
}
</th>
<th>
{admin_sortable_header
current_order=$module_order
order='title'
reverse_order='title_reverse'
path={url path='/admin/modules'}
request_parameter_name='module_order'
label="{intl l='Description'}"
}
</th>
<th>{intl l="version"}</th>
<th class="text-center">
{admin_sortable_header
@@ -71,32 +65,46 @@
}
</th>
{module_include location='modules_table_header'}
{hook name="modules.table-header" location="modules_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="module" name="module.{$module_type}" module_type={$module_type|default:1} order=$module_order backend_context=1}
<tr {if ! $EXISTS}class="warning"{/if}>
{$hidden = $smarty.post.hidden|default:'0'}
{loop type="module" name="module.{$module_type}" module_type={$module_type|default:1} order=$module_order backend_context=1 hidden=$hidden }
{loop type="auth" role="ADMIN" name="can_view_module.{$module_type}" access="VIEW" resource="admin.module" module=$CODE}
<tr id="module-{$ID}" {if ! $EXISTS || $MANDATORY}class="warning"{/if}>
<td>{$ID}</td>
<td nowrap>
<a href="#" class="module-information text-info" data-id="{$ID}" title="{intl l='Get more information about this module'}"><span class="glyphicon glyphicon-question-sign"></span></a>
<a href="#" class="module-documentation text-primary" data-id="{$ID}" title="{intl l='Read module documentation'}"><span class="glyphicon glyphicon-book"></span></a>
</td>
<td>{$TITLE}</td>
<td>{$CODE}</td>
<td>{$CHAPO}</td>
<td>{$VERSION}</td>
{if $EXISTS}
<td class="text-center">
<div class="make-switch switch-small module-activation" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok-circle'></i>" data-off-label="<i class='glyphicon glyphicon-remove-circle'></i>">
{if $MANDATORY ne 1 || $ACTIVE eq 0}
<div class="make-switch switch-small module-activation" data-mandatory="{$MANDATORY}" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok-circle'></i>" data-off-label="<i class='glyphicon glyphicon-remove-circle'></i>">
<input type="checkbox" {if $ACTIVE}checked{/if}>
</div>
<noscript>
{if $ACTIVE}
<a title="{intl l="Deactivate %title module" title={$TITLE}}" href="{url path="/admin/module/toggle-activation/{$ID}"}">{intl l="deactivation"}</a>
<a title="{intl l="Deactivate %title module" title={$TITLE}}" href="{url path="/admin/module/toggle-activation/%id" id=$ID}">{intl l="deactivation"}</a>
{else}
<a title="{intl l="activate %title module" title={$TITLE}}" href="{url path="/admin/module/toggle-activation/{$ID}"}">{intl l="activation"}</a>
<a title="{intl l="activate %title module" title={$TITLE}}" href="{url path="/admin/module/toggle-activation/%id" id=$ID}">{intl l="activation"}</a>
{/if}
</noscript>
{else}
<i class="glyphicon glyphicon-ban-circle text-danger" aria-hidden="true"></i>
{/if}
</td>
<td class="text-center">
@@ -117,33 +125,75 @@
</td>
{/if}
{module_include location='modules_table_row'}
{hook name="modules.table-row" location="modules_table_row" module_code={$CODE} }
<td class="text-right">
<div class="btn-group">
<td class="actions">
{if $module_type == 2}
{ifloop rel="area-attached"}
{$zones=""}
{loop name="area-attached" type="area" module_id=$ID}
{$zones="`$zones`, `$NAME`"}
{$zone_count=$LOOP_TOTAL}
{/loop}
{$title={intl l='%count shipping zone(s) are attached to this module: %zones. Click here to change' count={$zone_count} zones={$zones|ltrim:', '}}}
{$btnstyle="btn-info"}
{$icon=''}
{/ifloop}
{elseloop rel="area-attached"}
{$title={intl l='No shipping zone attached to this module, click here to attach one'}}
{$icon='<span class="glyphicon glyphicon glyphicon-exclamation-sign"></span> '}
{$btnstyle="btn-danger"}
{/elseloop}
<a class="{if ! $ACTIVE}disabled {/if} btn {$btnstyle} btn-xs config-btn-{$ID}" title="{$title}" href="{url path="/admin/configuration/shipping_zones/update/%id" id=$ID}">{$icon nofilter}{intl l="Shipping zones"}</a>
{/if}
<div class="separate-from-left btn-toolbar btn toolbar-primary">
<span class="glyphicon glyphicon-cog"></span>
</div>
<div class="toolbar-options hidden">
{if $EXISTS}
{if $CONFIGURABLE == 1}
{loop type="auth" name="can_change" role="ADMIN" module=$CODE access="VIEW"}
<a class="{if ! $ACTIVE}disabled {/if} btn btn-primary btn-xs" id="config-btn-{$ID}" title="{intl l='Configure this module'}" href="{url path="/admin/module/$CODE"}">{intl l="Configure"}</a>
<a class="config-btn-{$ID}{if ! $ACTIVE} disabled no-follow-link{/if}" title="{intl l='Configure this module'}" href="{url path="/admin/module/%code" code=$CODE}"><span class="glyphicon glyphicon-wrench"></span></a>
{/loop}
{/if}
{if $HOOKABLE}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.module-hook" access="VIEW"}
<a class="hook-btn-{$ID}{if ! $ACTIVE} disabled no-follow-link{/if}" title="{intl l="Manage its hooks"}" href="{url path="/admin/module-hooks" module="$ID"}" ><span class="glyphicon glyphicon-indent-left"></span></a>
{/loop}
{/if}
{*loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"}
<a class="btn btn-default btn-xs" title="{intl l='Read the documentation of this module'}" href="{url path="/admin/module/documentation/$ID"}"><span class="glyphicon glyphicon-book"></span></a>
<a title="{intl l='Read the documentation of this module'}" href="{url path="/admin/module/documentation/$ID"}"></a>
{/loop*}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.module" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this module'}" href="{url path="/admin/module/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
<a title="{intl l='Edit this module'}" href="{url path="/admin/module/update/%id" id=$ID}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{/if}
{if $MANDATORY ne 1}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.module" access="DELETE"}
<a class="btn btn-default btn-xs module-delete-action" title="{intl l='Delete this module'}" href="#delete_module_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
<a class="module-delete-action" title="{intl l='Delete this module'}" href="#delete_module_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{/loop}
{/if}
</div>
</td>
</tr>
{/loop}
{/loop}
{elseloop rel="module.`$module_type`"}
<tr>
<td colspan="8">
<br />
<div class="alert alert-info">
{intl l="No module of this type was found."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,17 @@
<div class="col-md-12">
<div class="general-block-decorator">
<div class="title title-without-tabs">
{intl l='Errors'}
</div>
<div class="form-container">
{foreach $module_errors as $module_code => $module_error}
<div class="alert alert-warning">
{intl l="Module %mod: %error" mod={$module_code} error={$module_error->getMessage()}}. <a href="#" class="module-error-more">{intl l="Click to view details."}</a>
<div class="more hidden"><br><pre><code>{$module_error}</code></pre></div>
</div>
{/foreach}
</div>
</div>
</div>

View File

@@ -0,0 +1,88 @@
<div class="hook-modules table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th> {intl l='Module name'}</th>
<th> {intl l='Module code'}</th>
<th class="text-center">{intl l='Enable/Disable'}</th>
<th class="text-center">{intl l='Position'}</th>
<th class="text-center">{intl l='Action'}</th>
</tr>
</thead>
<tbody>
{loop type="module_hook" name="hook.{$hook_id}" hook="{$hook_id}" backend_context=1 lang=$lang_id}
{assign var="visible" value="{if $MODULE_ACTIVE && $HOOK_ACTIVE}{if $ACTIVE}1{else}0{/if}{else}0{/if}" }
<tr class="hook-module {if ! $MODULE_ACTIVE}inactive{/if}"
data-visible="{$visible}"
data-active="{if $ACTIVE}1{else}0{/if}"
data-hook-active="{if $HOOK_ACTIVE}1{else}0{/if}"
data-module-active="{if $MODULE_ACTIVE}1{else}0{/if}"
data-module-id="{$MODULE_ID}"
>
<td>{$ID}</td>
<td>{$MODULE_TITLE}</td>
<td>{$MODULE_CODE}</td>
<td class="text-center">
{if ! $by_module }
{if $MODULE_ACTIVE && $HOOK_ACTIVE && !$by_module}
<div class="make-switch switch-small module-hook-activation" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok-circle'></i>" data-off-label="<i class='glyphicon glyphicon-remove-circle'></i>">
<input type="checkbox" {if $ACTIVE}checked{/if}>
</div>
<noscript>
{if $ACTIVE}
<a title="{intl l="Deactivate hook" title={$TITLE}}" href="{url path="/admin/module-hooks/toggle-activation/%id" id=$ID}">{intl l="deactivation"}</a>
{else}
<a title="{intl l="activate hook" title={$TITLE}}" href="{url path="/admin/module-hooks/toggle-activation/%id" id=$ID}">{intl l="activation"}</a>
{/if}
</noscript>
{else}
<i class='glyphicon glyphicon-remove-circle'> {intl l="deactivated"}
{/if}
{else}
-
{/if}
</td>
<td class="text-center">
{if ! $by_module }
{admin_position_block
resource="admin.hooks"
access="UPDATE"
path={url path="admin/module-hooks/update-position"}
url_parameter="module_hook_id"
in_place_edit_class="moduleHookPositionChange"
position=$POSITION
id=$ID
}
{else}
-
{/if}
</td>
<td class="actions">
<div class="btn-toolbar btn toolbar-primary">
<span class="glyphicon glyphicon-cog"></span>
</div>
<div class="toolbar-options hidden">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.module-hook" access="UPDATE"}
<a class="module-hook-change" title="{intl l='Change this hook'}" href="{url path="/admin/module-hook/update/%id" id=$ID}">
<span class="glyphicon glyphicon-edit"></span>
</a>
{/loop}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.module-hook" access="DELETE"}
<a class="module-hook-delete" title="{intl l='Delete this hook'}" href="#delete_module_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="hook.{$hook_id}"}
<tr>
<td colspan="5">No modules hooked here</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,80 @@
<div class="col-md-6 install-module-col">
<div class="general-block-decorator">
<div class="title title-without-tabs">
{intl l='Install or update a module'}
</div>
<div class="form-container">
{form name="thelia.admin.module.install"}
<form method="POST" action="{url path='/admin/module/install'}" {form_enctype} id="module-install">
{form_hidden_fields}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/module'}" />
{/form_field}
{flash type="module-installed"}
<div class="alert alert-success">{$MESSAGE}</div>
{/flash}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{form_field field='module'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} :
<span class="label-help-block">{intl l="Your module should be packaged in a zip file."}</span>
</label>
<div class="input-group">
<input type="file" id="{$label_attr.for}" {if $required}required="required"{/if} name="{$name}" value="{$value}" title="{intl l='Module file'}" placeholder="{intl l='Module file'}" class="form-control">
<span class="input-group-btn">
<input type="submit" class="form-submit-button btn btn-sm btn-success" value="{intl l="Install !"}" >
</span>
</div>
</div>
{/form_field}
</form>
{/form}
</div>
</div>
</div>
<div class="col-md-6 install-module-col">
<div class="general-block-decorator">
<div class="title title-without-tabs">
{intl l="Search a module"}
</div>
<div class="row">
<div class="col-md-7">
<p>{intl l="Discover all our modules on <a href='http://thelia.net/modules' target='_blank'>Thelia Modules</a> !"}</p>
<form action="http://thelia.net/modules/search" method="get" target="_blank">
<div class="input-group">
<input type="text" class="form-control" id="q" name="q" placeholder="{intl l='Search on Thelia Modules'}">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</form>
</div>
<div class="col-md-5">
<p>{intl l="Display protected modules ?"}</p>
<form action="{url path="admin/modules"}" method="post">
{$visible = $smarty.post.visible|default:'0'}
<div class="input-group">
<select name="hidden" class="form-control">
<option value="0">{intl l='No'}</option>
<option value="1" {if $visible} selected {/if}>{intl l='Yes'}</option>
</select>
<span class="input-group-btn">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-eye-open"></span></button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@@ -1,5 +1,9 @@
{capture name="module_include"}
{module_include location=$location countvar='module_count'}
{if $location}
{hook name="$hook" location="$location" id="$id" view="$view" countvar="module_count"}
{else}
{hook name="$hook" id="$id" view="$view" countvar="module_count"}
{/if}
{/capture}
{if trim($smarty.capture.module_include) == ''}

View File

@@ -6,7 +6,7 @@
*}
{if $message}
<div class="alert alert-{$type|default:danger}{if not $dismissable} alert-dismissable{/if}">
<div class="alert alert-{$alertTtype|default:"danger"}{if not $dismissable} alert-dismissable{/if}">
{if not $dismissable}<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>{/if}
{$message}
</div>

View File

@@ -1,69 +1,73 @@
{*
A generic pager for thelia back-office
Parameters :
$loop_ref: the name of the related loop
$max_page_count : maximum number of pages to display
$page_url : the URL of the page. The parameter page=x is appended to this URL.
*}
{* Prepare the URL so that the page=x parameter coumd be safely appended *}
{if strpos($page_url, '?')}
{$page_url="$page_url&"}
{else}
{$page_url="$page_url?"}
{/if}
<div class="text-center">
<ul class="pagination pagination-centered">
{pageloop rel=$loop_ref limit=$max_page_count}
{$prev_page = $PREV}
{$next_page = $NEXT}
{$last_page = $LAST}
{$has_prev = $CURRENT > 1}
{$has_next = $CURRENT < $LAST}
{$has_pages_after = $END < $LAST && $LAST > $max_page_count}
{$has_pages_before = $START > 1}
{if $PAGE == $START}
{if $has_prev}
<li><a title="{intl l="Go to first page"}" href="{$page_url}page=1">&laquo;</a></li>
<li><a title="{intl l="Go to previous page"}" href="{$page_url}page=$prev_page">&lsaquo;</a></li>
{if $has_pages_before}
<li title="{intl l="More pages before"}" class="disabled"><a href="#">&hellip;</a></li>
{/if}
{else}
<li class="disabled"><a href="#">&laquo;</a></li>
<li class="disabled"><a href="#">&lsaquo;</a></li>
{/if}
{/if}
{if $PAGE != $CURRENT}
<li><a href="{$page_url}page={$PAGE}">{$PAGE}</a></li>
{else}
<li class="active"><a href="#">{$PAGE}</a></li>
{/if}
{if $PAGE == $END}
{if $has_next}
{if $has_pages_after}
<li title="{intl l="More pages after"}" class="disabled"><a href="#">&hellip;</a></li>
{/if}
<li><a title="{intl l="Go to next page"}" href="{$page_url}page={$next_page}">&rsaquo;</a></li>
<li><a title="{intl l="Go to last page"}" href="{$page_url}page={$last_page}">&raquo;</a></li>
{else}
<li class="disabled"><a href="#">&rsaquo;</a></li>
<li class="disabled"><a href="#">&raquo;</a></li>
{/if}
{/if}
{/pageloop}
</ul>
</div>
{*
A generic pager for thelia back-office
Parameters :
$loop_ref: the name of the related loop
$max_page_count : maximum number of pages to display
$page_url : the URL of the page. The parameter page=x is appended to this URL.
*}
{* Prepare the URL so that the page=x parameter coumd be safely appended *}
{if strpos($page_url, '?')}
{$page_url="$page_url&"}
{else}
{$page_url="$page_url?"}
{/if}
{if !$page_param_name}
{assign var="page_param_name" value="page"}
{/if}
<div class="text-center">
<ul class="pagination pagination-centered">
{pageloop rel=$loop_ref limit=$max_page_count}
{$prev_page = $PREV}
{$next_page = $NEXT}
{$last_page = $LAST}
{$has_prev = $CURRENT > 1}
{$has_next = $CURRENT < $LAST}
{$has_pages_after = $END < $LAST && $LAST > $max_page_count}
{$has_pages_before = $START > 1}
{if $PAGE == $START}
{if $has_prev}
<li><a title="{intl l="Go to first page"}" href="{$page_url nofilter}{$page_param_name}=1">&laquo;</a></li>
<li><a title="{intl l="Go to previous page"}" href="{$page_url nofilter}{$page_param_name}={$prev_page}">&lsaquo;</a></li>
{if $has_pages_before}
<li title="{intl l="More pages before"}" class="disabled"><a href="#">&hellip;</a></li>
{/if}
{else}
<li class="disabled"><a href="#">&laquo;</a></li>
<li class="disabled"><a href="#">&lsaquo;</a></li>
{/if}
{/if}
{if $PAGE != $CURRENT}
<li><a href="{$page_url nofilter}{$page_param_name}={$PAGE}">{$PAGE}</a></li>
{else}
<li class="active"><a href="#">{$PAGE}</a></li>
{/if}
{if $PAGE == $END}
{if $has_next}
{if $has_pages_after}
<li title="{intl l="More pages after"}" class="disabled"><a href="#">&hellip;</a></li>
{/if}
<li><a title="{intl l="Go to next page"}" href="{$page_url nofilter}{$page_param_name}={$next_page}">&rsaquo;</a></li>
<li><a title="{intl l="Go to last page"}" href="{$page_url nofilter}{$page_param_name}={$last_page}">&raquo;</a></li>
{else}
<li class="disabled"><a href="#">&rsaquo;</a></li>
<li class="disabled"><a href="#">&raquo;</a></li>
{/if}
{/if}
{/pageloop}
</ul>
</div>

View File

@@ -1,7 +1,7 @@
<div class="form-container">
{form name="thelia.admin.product.modification"}
<form method="POST" action="{url path='/admin/products/save'}" {form_enctype form=$form} class="clearfix">
<form method="POST" action="{url path='/admin/products/save'}" {form_enctype} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
@@ -11,22 +11,24 @@
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{hook name="product.modification.form_top" product_id=$ID}
{* Be sure to get the product ID, even if the form could not be validated*}
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="product_id" value="{$product_id}">
<input type="hidden" name="current_tab" value="general">
{form_hidden_fields form=$form}
{form_hidden_fields}
{form_field form=$form field='id'}
{form_field field='id'}
<input type="hidden" name="{$name}" value="{$value}">
{/form_field}
{form_field form=$form field='success_url'}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY page=$page}">
{/form_field}
{form_field form=$form field='locale'}
{form_field field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}">
{/form_field}
@@ -34,7 +36,7 @@
<div class="row">
<div class="col-md-8">
{form_field form=$form field='ref'}
{form_field field='ref'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
@@ -49,8 +51,9 @@
</div>
<div class="col-md-4">
{hook name="product.modification.form-right.top" product_id=$ID}
{form_field form=$form field='default_category'}
{form_field field='default_category'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
@@ -58,10 +61,10 @@
</label>
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
<option value="0">{intl l="Top level"}</option>
<option value="0" disabled>{intl l="Top level"}</option>
{loop name="cat-parent" type="category-tree" category="0" visible="*" product="0"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $DEFAULT_CATEGORY == $ID}selected="selected"{/if}>{$TITLE}</option>
{loop name="cat-parent" type="category-tree" category="0" visible="*" product="0" return_url=false}
<option value="{$ID}" {if $DEFAULT_CATEGORY == $ID}selected="selected"{/if}>{option_offset l=$LEVEL+1 label={$TITLE}}</option>
{/loop}
</select>
@@ -69,17 +72,57 @@
</div>
{/form_field}
{custom_render_form_field form=$form field='brand_id'}
<select {form_field_attributes form=$form field='brand_id'}>
{form_field field='virtual'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Virtual product'}</label>
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $VIRTUAL != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
<div id="virtual-product-file" class="{if $VIRTUAL == 0}hidden {/if}form-group {if $error}has-error{/if}">
{if $PSE_COUNT == 1}
{custom_render_form_field field='virtual_document_id'}
<select {form_field_attributes field='virtual_document_id' extra_class='document-selector'} data-pse="{$PRODUCT_SALE_ELEMENT}" data-product="{$ID}">
<option value="0">{intl l="No document"}</option>
{loop name="virtual-documents" type="document" product=$ID visible="0" }
<option value="{$ID}" {if $value == $ID}selected="selected"{/if}>{$TITLE} ({$DOCUMENT_FILE})</option>
{/loop}
</select>
{/custom_render_form_field}
<div id="virtual-product-message" class="{ifloop rel="virtual-documents"}hidden{/ifloop}">
<div class="alert alert-warning">
<p>
{intl l="There is no files to associate to your product. Only documents that are not visible can be selected !"}<br />
<a href='javascript:jQuery("#tab-documents").tab("show");'>{intl l="Add document to your product."}</a>
</p>
</div>
</div>
{else}
{form_field field='virtual_document_id'}
<input type="hidden" name="{$name}" value="-1" />
{/form_field}
<p>
<a href="#prices" data-toggle="tab">{intl l="Associate files to your combinations"}</a>
</p>
{/if}
</div>
{custom_render_form_field field='brand_id'}
<select {form_field_attributes field='brand_id'}>
<option value="0">{intl l="No brand"}</option>
{loop name="brand-list" type="brand" visible="*"}
{loop name="brand-list" type="brand" visible="*" return_url=false}
<option value="{$ID}" {if $BRAND_ID == $ID}selected="selected"{/if}>{$TITLE}</option>
{/loop}
</select>
{/custom_render_form_field}
{form_field form=$form field='visible'}
{form_field field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
<div class="checkbox">
@@ -90,9 +133,13 @@
</div>
</div>
{/form_field}
{hook name="product.modification.form-right.bottom" product_id=$ID}
</div>
</div>
{hook name="product.modification.form_bottom" product_id=$ID}
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
@@ -106,4 +153,4 @@
</form>
{/form}
</div>
</div>

View File

@@ -15,7 +15,7 @@
{if $has_at_least_one_combination == false}
{form name="thelia.admin.product_default_sale_element.update"}
<form method="POST" action="{url path='/admin/product/default-price/update'}" {form_enctype form=$form} class="clearfix">
<form method="POST" action="{url path='/admin/product/default-price/update'}" {form_enctype} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
@@ -30,25 +30,25 @@
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="prices" />
{form_hidden_fields form=$form}
{form_hidden_fields}
{form_field form=$form field='product_id'}
{form_field field='product_id'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='product_sale_element_id'}
{form_field field='product_sale_element_id'}
<input type="hidden" name="{$name}" value="{$default_product_sale_element_id}" />
{/form_field}
{form_field form=$form field='isdefault'}
{form_field field='isdefault'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='reference'}
{form_field field='reference'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='success_url'}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
@@ -57,7 +57,7 @@
{$currency_symbol = $SYMBOL}
{$currency_name = $NAME}
{form_field form=$form field='currency'}
{form_field field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
@@ -75,7 +75,7 @@
<div class="row">
<div class="col-md-4">
{form_field form=$form field='tax_rule'}
{form_field field='tax_rule'}
<div class="form-group {if $error}has-error{/if}">
<label for="tax_rule_field" class="control-label">{$label} : </label>
<div class="form-group">
@@ -86,7 +86,6 @@
{/loop}
</select>
</div>
</div>
{/form_field}
</div>
@@ -106,7 +105,7 @@
<p></p> <!-- LAME !!! FIXME -->
{form_field form=$form field='use_exchange_rate'}
{form_field field='use_exchange_rate'}
{if $current_currency_is_default}
<input type="hidden" name="{$name}" value="0">
{$show_pricing_fields = true}
@@ -123,7 +122,7 @@
{/if}
{/form_field}
{form_field form=$form field='price'}
{form_field field='price'}
<div class="form-group {if $error}has-error{/if}">
<label for="price_without_tax" class="control-label">{$label} : </label>
@@ -134,7 +133,7 @@
</div>
{/form_field}
{form_field form=$form field='price_with_tax'}
{form_field field='price_with_tax'}
<div class="form-group">
<label for="price_with_tax" class="control-label">{intl l="Product price including taxes"} : </label>
<div class="input-group">
@@ -144,7 +143,7 @@
</div>
{/form_field}
{module_include location='product_details_pricing_form'}
{hook name="product.details-pricing-form" location="product_details_pricing_form" }
</div>
</div>
@@ -155,7 +154,7 @@
<div class="well well-sm">
<p class="title title-without-tabs">{intl l='Stock'}</p>
{form_field form=$form field='ean_code'}
{form_field field='ean_code'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
@@ -165,7 +164,7 @@
</div>
{/form_field}
{form_field form=$form field='weight'}
{form_field field='weight'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
@@ -176,7 +175,7 @@
</div>
{/form_field}
{form_field form=$form field='quantity'}
{form_field field='quantity'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
@@ -186,7 +185,7 @@
</div>
{/form_field}
{module_include location='product_details_details_form'}
{hook name="product.details-details-form" location="product_details_details_form" }
</div>
</div>
@@ -197,7 +196,7 @@
<div class="well well-sm">
<p class="title title-without-tabs">{intl l='Promotion'}</p>
{form_field form=$form field='sale_price'}
{form_field field='sale_price'}
<div class="form-group {if $error}has-error{/if}">
<label for="sale_price_without_tax" class="control-label">{$label} : </label>
@@ -208,7 +207,7 @@
</div>
{/form_field}
{form_field form=$form field='sale_price_with_tax'}
{form_field field='sale_price_with_tax'}
<div class="form-group">
<label for="sale_price_with_tax" class="control-label">{$label} : </label>
<div class="input-group">
@@ -218,7 +217,7 @@
</div>
{/form_field}
{form_field form=$form field='onsale'}
{form_field field='onsale'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
@@ -229,7 +228,7 @@
</div>
{/form_field}
{form_field form=$form field='isnew'}
{form_field field='isnew'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
@@ -240,7 +239,7 @@
</div>
{/form_field}
{module_include location='product_details_promotion_form'}
{hook name="product.details-promotion-form" location="product_details_promotion_form" }
</div>
</div>
</div>
@@ -253,7 +252,7 @@
{if $has_at_least_one_combination}
{form name="thelia.admin.product_sale_element.update"}
<form method="POST" action="{url path='/admin/product/combinations/update'}" {form_enctype form=$form}>
<form method="POST" action="{url path='/admin/product/combinations/update'}" {form_enctype}>
<div class="row">
<div class="col-md-12">
@@ -269,13 +268,13 @@
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="prices" />
{form_hidden_fields form=$form}
{form_hidden_fields}
{form_field form=$form field='product_id'}
{form_field field='product_id'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='success_url'}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
@@ -285,14 +284,14 @@
{$currency_symbol = $SYMBOL}
{$current_currency_is_default = $IS_DEFAULT}
{form_field form=$form field='currency'}
{form_field field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
{/loop}
<div class="row">
<div class="col-md-4">
{form_field form=$form field='tax_rule'}
{form_field field='tax_rule'}
<div class="form-group {if $error}has-error{/if}">
<label for="tax_rule_field" class="control-label">{$label} : </label>
<div class="form-group">
@@ -307,7 +306,7 @@
{/form_field}
</div>
<div class="col-md-4">
{form_field form=$form field='use_exchange_rate'}
{form_field field='use_exchange_rate'}
{if $current_currency_is_default}
<input type="hidden" name="{$name}" value="0">
{$show_pricing_fields = true}
@@ -327,19 +326,19 @@
</div>
</div>
{module_include location='product_before_combinations'}
{hook name="product.before-combinations" location="product_before_combinations" }
<table class="table table-striped table-condensed" id="category_list">
<table class="table table-striped table-condensed table-responsive" id="combinations_list">
<caption>
{intl l='Attribute Combinations'}
{module_include location='product_combinations_list_caption'}
{hook name="product.combinations-list-caption" location="product_combinations_list_caption" }
{loop type="auth" name="can_create" role="ADMIN" resource="admin.product" access="UPDATE"}
<a class="btn btn-default btn-primary action-btn" id="open_combination_builder" title="{intl l='Quickly create combinations using the combination builder'}" href="#combination_builder_dialog" data-toggle="modal">
<a class="btn btn-primary action-btn" id="open_combination_builder" title="{intl l='Quickly create combinations using the combination builder'}" href="#combination_builder_dialog" data-toggle="modal">
{intl l='Combination builder'}
</a>
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new combination'}" href="#combination_creation_dialog" data-toggle="modal">
<a class="btn btn-primary action-btn" title="{intl l='Add a new combination'}" href="#combination_creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
@@ -347,25 +346,24 @@
<thead>
<tr>
<th class="text-center">{intl l='Reference'}</th>
<th class="text-center">{intl l='EAN Code'}</th>
<th class="text-center">{intl l='Stock'}</th>
<th class="text-center">{intl l='Price<br />w/o taxes (%currency)' currency={$currency_symbol}}</th>
<th class="text-center">{intl l='Price<br />w/ taxes (%currency)' currency={$currency_symbol}}</th>
<th class="text-center">{intl l='Weight<br />(Kg)'}</th>
<th class="text-center">{intl l='Default'}</th>
<th class="text-center">{intl l='Sale'}</th>
<th class="text-center">{intl l='New'}</th>
<th class="text-center">{intl l='Sale price<br />w/o taxes (%currency)' currency={$currency_symbol}}</th>
<th class="text-center">{intl l='Sale price<br />w/ taxes (%currency)' currency={$currency_symbol}}</th>
<th class="actions">&nbsp;</th>
<th class="col-sm-2 text-center">{intl l='Reference'}</th>
<th class="col-sm-2 text-center">{intl l='EAN Code'}</th>
<th class="col-sm-1 text-center">{intl l='Stock'}</th>
<th class="col-sm-1 text-center"><small>{intl l='Price (%currency)<br />w/o taxes' currency={$currency_symbol}}</small></th>
<th class="col-sm-1 text-center"><small>{intl l='Price (%currency)<br />w/ taxes' currency={$currency_symbol}}</small></th>
<th class="col-sm-1 text-center"><small>{intl l='Weight<br />(Kg)'}</small></th>
<th class="text-center"><small>{intl l='Default'}</small></th>
<th class="text-center"><small>{intl l='Sale'}</small></th>
<th class="text-center"><small>{intl l='New'}</small></th>
<th class="col-sm-1 text-center"><small>{intl l='Sale price (%currency)<br />w/o taxes' currency={$currency_symbol}}</small></th>
<th class="col-sm-1 text-center"><small>{intl l='Sale price (%currency)<br />w/ taxes' currency={$currency_symbol}}</small></th>
</tr>
</thead>
<tbody>
{* Get number of PSE defined, assumin the form have the same number of values for each fields *}
{* Get number of PSE defined, assume the form have the same number of values for each fields *}
{form_field form=$form field='product_sale_element_id' value_key=0}
{form_field field='product_sale_element_id' value_key=0}
{$pse_count = $total_value_count}
{/form_field}
@@ -373,87 +371,104 @@
<tr>
<td colspan="10">
{form_field form=$form field='product_sale_element_id' value_key=$idx}
<input type="hidden" name="{$name}" value="{$value}" />
{form_field field='product_sale_element_id' value_key=$idx}
<input type="hidden" name="{$name}" value="{$value}" />
{$current_pse_id = $value}
{/form_field}
{$current_pse_id = $value}
<div class="btn-group">
<a class="btn btn-default btn-xs pse-assoc-image pse-assoc-image-document" data-target="#pse-assoc-image-document-modal" data-id="{$value}" title="{intl l="Associate images"}">
<span class="glyphicon glyphicon-picture"></span>
</a>
<a class="btn btn-default btn-xs pse-assoc-document pse-assoc-image-document" data-target="#pse-assoc-image-document-modal" data-id="{$value}" title="{intl l="Associate documents"}">
<span class="glyphicon glyphicon-file"></span>
</a>
{if $VIRTUAL}
<a class="btn btn-success btn-xs pse-assoc-virtual pse-assoc-image-document" data-type="virtual" data-target="#pse-assoc-image-document-modal" data-id="{$value}" title="{intl l="Associate downloadable file"}">
<span class="glyphicon glyphicon-download"></span>
</a>
{/if}
</div>
{loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$current_pse_id backend_context="1"}
{if $LOOP_COUNT > 1} - {/if}{$ATTRIBUTE_TITLE}
{/loop}
{/form_field}
</td>
<a class="btn btn-default btn-xs combination-delete" title="{intl l='Delete this combination'}" href="#combination_delete_dialog" data-id="{$current_pse_id}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
<td colspan="2" class="text-right">ID: {$current_pse_id}</td>
</tr>
{assign var='combination_list' value=array()}
{loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$current_pse_id backend_context="1" order="manual"}
{$combination_list[$ATTRIBUTE_TITLE][] = $ATTRIBUTE_AVAILABILITY_TITLE}
{/loop}
{format_array_2d values=$combination_list}
</td>
<td class="text-right">ID: {$current_pse_id}</td>
</tr>
<tr>
{form_field form=$form field='reference' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control" type="text" name="{$name}" value="{$value}" /></td>
{form_field field='reference' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control input-sm" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='ean_code' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control" type="text" name="{$name}" value="{$value}" /></td>
{form_field field='ean_code' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control input-sm" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='quantity' value_key=$idx}
{form_field field='quantity' value_key=$idx}
<td {if $error}class="has-error"{/if}>
<input class="form-control text-right" required type="text" name="{$name}" value="{$value}" />
<input class="form-control input-sm text-right" required type="text" name="{$name}" value="{$value}" />
</td>
{/form_field}
{form_field form=$form field='price' value_key=$idx}
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} required data-price-type="price-without-tax" data-rel-price="price_with_tax_{$idx}" id="price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right" required type="text" name="{$name}" value="{$value}" /></td>
{form_field field='price' value_key=$idx}
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} required data-price-type="price-without-tax" data-rel-price="price_with_tax_{$idx}" id="price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right input-sm" required type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='price_with_tax' value_key=$idx}
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} data-price-type="price-with-tax" data-rel-price="price_without_tax_{$idx}" id="price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" /></td>
{form_field field='price_with_tax' value_key=$idx}
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} data-price-type="price-with-tax" data-rel-price="price_without_tax_{$idx}" id="price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right input-sm" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='weight' value_key=$idx}
<td {if $error}class="has-error"{/if}><input required class="form-control text-right" type="text" name="{$name}" value="{$value}" /></td>
{form_field field='weight' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control text-right input-sm" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='default_pse'}
{form_field field='default_pse'}
<td class="{if $error}has-error {/if}text-center">
<input class="form-control" type="radio" name="{$name}" value="{$current_pse_id}" {if $value == $current_pse_id}checked="checked"{/if}/>
<input class="input-sm" type="radio" name="{$name}" value="{$current_pse_id}" {if $value == $current_pse_id}checked="checked"{/if}/>
</td>
{/form_field}
{form_field form=$form field='onsale' value_key=$idx}
{form_field field='onsale' value_key=$idx}
<td class="{if $error}has-error {/if}text-center">
<input class="form-control" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
<input class="input-sm" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
</td>
{/form_field}
{form_field form=$form field='isnew' value_key=$idx}
{form_field field='isnew' value_key=$idx}
<td class="{if $error}has-error {/if}text-center">
<input class="form-control" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
<input class="input-sm" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
</td>
{/form_field}
{form_field form=$form field='sale_price' value_key=$idx}
{form_field field='sale_price' value_key=$idx}
<td {if $error}class="has-error"{/if}>
<input {if !$show_pricing_fields}readonly{/if} required data-price-type="sale-price-without-tax" data-rel-price="sale_price_with_tax_{$idx}" id="sale_price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" />
<input {if !$show_pricing_fields}readonly{/if} required data-price-type="sale-price-without-tax" data-rel-price="sale_price_with_tax_{$idx}" id="sale_price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right input-sm" type="text" name="{$name}" value="{$value}" />
</td>
{/form_field}
{form_field form=$form field='sale_price_with_tax' value_key=$idx}
{form_field field='sale_price_with_tax' value_key=$idx}
<td {if $error}class="has-error"{/if}>
<input {if !$show_pricing_fields}readonly{/if} data-price-type="sale-price-with-tax" data-rel-price="sale_price_without_tax_{$idx}" id="sale_price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" />
<input {if !$show_pricing_fields}readonly{/if} data-price-type="sale-price-with-tax" data-rel-price="sale_price_without_tax_{$idx}" id="sale_price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right input-sm" type="text" name="{$name}" value="{$value}" />
</td>
{/form_field}
<td class="actions">
<a class="btn btn-default btn-xs combination-delete" title="{intl l='Delete this combination'}" href="#combination_delete_dialog" data-id="{$current_pse_id}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>
{hook name="product.combinations-row" pse=$current_pse_id idx=$idx}
{/for}
</tbody>
</table>
{module_include location='product_after_combinations'}
{hook name="product.after-combinations" location="product_after_combinations" }
{include
@@ -491,9 +506,25 @@
</div>
</div>
{/if}
</div>
{module_include location='product_after_combinations'}
</div>
{* PSE / Image-Document combination modal *}
<div id="pse-modal-container">
<div class="modal fade" id="pse-assoc-image-document-modal" tabindex="-1" role="dialog" aria-labelledby="associate_images_documents_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="associate_images_documents_label"></h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
{* -- Adding a new combination ------------------------------------------------- *}
@@ -525,7 +556,7 @@
</select>
<span class="input-group-btn" id="add_attr_value_button">
<button class="btn btn-default btn-primary action-btn add-value-to-combination" type="button"><span class="glyphicon glyphicon-plus-sign"></span></button>
<button class="btn btn-primary action-btn add-value-to-combination" type="button"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
@@ -583,7 +614,7 @@
<input type="hidden" name="product_sale_element_id" id="combination_delete_id" value="" />
{module_include location='category_delete_form'}
{hook name="product.combination-delete-form" location="product_combination_delete_form" }
{/capture}
@@ -610,9 +641,9 @@
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="prices" />
{form_hidden_fields form=$form}
{form_hidden_fields}
{form_field form=$form field='product_id'}
{form_field field='product_id'}
<input type="hidden" name="{$name}" value="{$product_id}" />
{/form_field}
@@ -621,12 +652,12 @@
{loop type="currency" name="get-currency-symbol" id=$edit_currency_id backend_context="1"}
{$currency_symbol = $SYMBOL}
{form_field form=$form field='currency'}
{form_field field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
{/loop}
{form_field form=$form field='success_url'}
{form_field field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/products/update' product_id=$product_id current_tab='prices'}" />
{/form_field}
@@ -644,11 +675,11 @@
<li>
<strong>{$TITLE}</strong>
<ul class="list-unstyled">
{loop name="product-attributes-av" type="attribute_availability" attribute="{$ID}" order="manual" backend_context="1" lang=$edit_language_id}
{loop name="product-attributes-av" type="attribute_availability" attribute=$ID order="manual" backend_context="1" lang=$edit_language_id}
<li>
<div class="checkbox">
<label>
{form_field form=$form field='attribute_av' value_key=$index}
{form_field field='attribute_av' value_key=$index}
<input data-attribute-id="{$ATTRIBUTE_ID}" class="attribute_av_value" type="checkbox" name="{$name}" value="{$ATTRIBUTE_ID}:{$ID}" {if $value == "$ATTRIBUTE_ID:$ID"}checked="checked"{/if}>{$TITLE}
{/form_field}
</label>
@@ -663,47 +694,54 @@
</ul>
</div>
</div>
{loop type="product_sale_elements" name="product_sale_elements_combination_form" product=$product_id default="yes" limit=1 backend_context=1}
<div class="col-md-6">
{form_field form=$form field='price'}
{form_field field='price'}
<div class="form-group {if $error}has-error{/if}">
<label for="price_without_tax" class="control-label">{$label} : </label>
<label for="price-without-tax-modal" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="price_without_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Price excl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
<div class="input-group">
<input type="text" id="price-without-tax-modal" data-price-type="price-without-tax-modal" data-rel-price="price-with-tax-modal" name="{$name}" class="price_field automatic_price_field form-control" value="{if $value}{$value}{else}{$PRICE}{/if}" title="{$label}" placeholder="{intl l='Price excl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='reference'}
<div class="form-group">
<label for="price-with-tax-modal" class="control-label">{intl l="Product price including taxes"} : </label>
<div class="input-group">
<input type="text" id="price-with-tax-modal" data-price-type="price-with-tax-modal" data-rel-price="price-without-tax-modal" class="price_field automatic_price_field form-control" value="{if $value}{$value}{else}{$PRICE}{/if}" title="{intl l='Product price including taxes'}" placeholder="{intl l='Price incl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{form_field field='reference'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Combination reference'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{if $value}{$value}{else}{$REF}{/if}" title="{$label}" placeholder="{intl l='Combination reference'}">
</div>
</div>
{/form_field}
{form_field form=$form field='ean_code'}
{form_field field='ean_code'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Combination EAN Code'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{if $value}{$value}{else}{$EAN_CODE}{/if}" title="{$label}" placeholder="{intl l='Combination EAN Code'}">
</div>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='weight'}
{form_field field='weight'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product weight'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{if $value}{$value}{else}{$WEIGHT}{/if}" title="{$label}" placeholder="{intl l='Product weight'}">
<span class="input-group-addon">{intl l="Kg"}</span>
</div>
</div>
@@ -711,49 +749,51 @@
</div>
<div class="col-md-6">
{form_field form=$form field='quantity'}
{form_field field='quantity'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Stock'} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Current quantity'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{if $value}{$value}{else}{$QUANTITY}{/if}" title="{$label}" placeholder="{intl l='Current quantity'}">
</div>
</div>
{/form_field}
</div>
</div>
{form_field form=$form field='sale_price'}
{form_field field='sale_price'}
<div class="form-group {if $error}has-error{/if}">
<label for="sale_price_without_tax" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="sale_price_without_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
<input type="text" id="sale_price_without_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{if $value}{$value}{else}{$PROMO_PRICE}{/if}" title="{$label}" placeholder="{intl l='Product price'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='onsale'}
{form_field field='onsale'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1">
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $IS_PROMO}checked{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{form_field form=$form field='isnew'}
{form_field field='isnew'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1">
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $IS_NEW}checked{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{/loop}
<div class="well well-sm" style="margin-bottom: 0"><b>{intl l='<span id="number_of_generated_combinations">0</span> combinations'}</b></div>
</div>
@@ -771,7 +811,7 @@
dialog_ok_label = {intl l="Create combinations"}
form_action = {url path='/admin/product/combination/build'}
form_enctype = {form_enctype form=$form}
form_enctype = {form_enctype}
form_error_message = ''
ok_button_id = "combination_builder_dialog_ok"

View File

@@ -1,6 +1,9 @@
{hook name="tab-seo.top" id=$current_id type=$seoType}
{form name="thelia.admin.seo"}
<div class="form-container">
<form method="POST" action="{$formAction}" {form_enctype form=$form} class="clearfix">
<form method="POST" action="{$formAction}" {form_enctype} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
@@ -14,23 +17,25 @@
<input type="hidden" name="current_id" value="{$current_id}">
<input type="hidden" name="current_tab" value="seo">
{form_hidden_fields form=$form}
{form_hidden_fields}
{render_form_field form=$form field="success_url"}
{render_form_field field="success_url" value="{$success_url nofilter}"}
{* Display error message if exist *}
{include file='includes/notifications.html' message=$form_error_message}
{include file='includes/notifications.html' message=$form_error_message alert_type="danger"}
{custom_render_form_field form=$form field='url'}
{custom_render_form_field field='url'}
<div class="input-group">
<span class="input-group-addon">{$url_language|default:{config key="url_site"}}/</span>
<input type="text" {form_field_attributes form=$form field='url'}>
<span class="input-group-addon">{$url_language|default:{config key="url_site"} nofilter}/</span>
<input type="text" {form_field_attributes field='url'}>
</div>
{/custom_render_form_field}
{render_form_field form=$form field="meta_title"}
{render_form_field form=$form field="meta_description"}
{render_form_field form=$form field="meta_keywords"}
{render_form_field field="meta_title"}
{render_form_field field="meta_description"}
{render_form_field field="meta_keywords"}
{hook name="tab-seo.update-form" id=$current_id type=$seoType}
{include
file = "includes/inner-form-toolbar.html"
@@ -41,4 +46,7 @@
}
</form>
</div>
</div>
{/form}
{hook name="tab-seo.bottom" id=$current_id type=$seoType}

View File

@@ -1,6 +1,6 @@
{* The standard description fields, used by many Thelia objects *}
{render_form_field form=$form field='title'}
{render_form_field form=$form field="chapo"}
{render_form_field form=$form field="description" extra_class="wysiwyg"}
{render_form_field form=$form field="postscriptum"}
{render_form_field field='title'}
{render_form_field field="chapo"}
{render_form_field field="description" extra_class="wysiwyg"}
{render_form_field field="postscriptum"}