Merge branch 'master' into frontend

Conflicts:
	core/lib/Thelia/Controller/Admin/OrderController.php
This commit is contained in:
touffies
2013-11-12 11:09:55 +01:00
62 changed files with 1649 additions and 1700 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,9 +4,12 @@
{check_auth role="ADMIN" resource="{block name="check-resource"}{/block}" access="{block name="check-access"}{/block}" login_tpl="/admin/login"}
{/block}
{* -- Define some stuff for Smarty ----------------------------------------- *}
{* -- Define some stuff for Smarty ------------------------------------------ *}
{config_load file='variables.conf'}
{* -- Declare assets directory, relative to template base directory --------- *}
{declare_assets directory='assets'}
<!DOCTYPE html>
<html lang="{$lang_code}">
<head>
@@ -22,7 +25,7 @@
{block name="before-bootstrap-css"}{/block}
{stylesheets file='assets/less/*' filters='less,cssembed'}
{stylesheets file='assets/less/main.less' filters='less'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}

View File

@@ -1,111 +0,0 @@
{* Update an Address *}
{form name="thelia.admin.address.update"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "edit_address_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label} }" placeholder="{intl l='Label'}">
</div>
{/form_field}
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='City'}">
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "edit_address_dialog"
dialog_title = {intl l="Edit an address"}
dialog_body = {$smarty.capture.edit_address_dialog nofilter}
dialog_ok_label = {intl l="Edit this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="/admin/address/save/{$address_id}"}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}

View File

@@ -2,4 +2,4 @@
@import "bootstrap/bootstrap.less";
/* Thelia Admin */
@import "thelia/thelia.less";
@import "thelia/thelia.less";

View File

@@ -9,7 +9,6 @@
<div class="customers edit-customer">
<div id="wrapper" class="container">
{loop name="customer_edit" type="customer" current="false" id="$customer_id" backend_context="1" lang="$edit_language_id"}
<ul class="breadcrumb">
@@ -30,18 +29,21 @@
<div class="col-md-12">
{form name="thelia.admin.customer.update"}
<form method="POST" action="{url path="/admin/customer/update/{$ID}"}" {form_enctype form=$form} class="clearfix">
<form method="POST" action="{url path='/admin/customer/save'}" {form_enctype form=$form} class="clearfix">
<div class="row inner-toolbar clearfix">
<div class="col-md-6 inner-actions pull-right">
<button type="submit" name="save_mode" value="stay" class="btn btn-default btn-primary" title="{intl l='Save'}">{intl l='Save'} <span class="glyphicon glyphicon-ok"></span></button>
<button type="submit" name="save_mode" value="close" class="btn btn-default btn-info" title="{intl l='Save and close'}">{intl l='Save and close'} <span class="glyphicon glyphicon-remove"></span></button>
</div>
</div>
{form_hidden_fields form=$form}
{include
file="includes/inner-form-toolbar.html"
hide_flags = true
close_url = {url path='/admin/customers'}
}
{form_hidden_fields form=$form}
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="customer_id" value="{$customer_id}" />
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path="/admin/customer/update/{$ID}"}" />
<input type="hidden" name="{$name}" value="{url path='/admin/customers' page=$page}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
@@ -51,7 +53,7 @@
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1" backend_context="1"}
@@ -63,15 +65,29 @@
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$FIRSTNAME}" title="{$label}" placeholder="{intl l='Firstname'}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$LASTNAME}" title="{$label}" placeholder="{intl l='Lastname'}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='email'}
<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 type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='password'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} (leave blank to keep current customer password) {if $required} <span class="required">*</span>{/if} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Password'}">
</div>
{/form_field}
@@ -81,50 +97,50 @@
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$COMPANY}" title="{$label}" placeholder="{intl l='Company'}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input 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='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$ADDRESS1}" title="{$label}" placeholder="{intl l='Address'}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Address'}">
</div>
{/form_field}
{form_field form=$form field='address2'}
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$ADDRESS2}" title="{$label}" placeholder="{intl l='Additional address'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
</div>
{/form_field}
{form_field form=$form field='address3'}
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$ADDRESS3}" title="{$label}" placeholder="{intl l='Additional address'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$ZIPCODE}" title="{$label}" placeholder="{intl l='Zip code'}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$CITY}" title="{$label}" placeholder="{intl l='City'}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='City'}">
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}" {if $ID == $COUNTRY}selected{/if}>{$TITLE}</option>
<option value="{$ID}" {if {$value} == $ID}selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
@@ -149,13 +165,14 @@
<thead>
<tr>
<th>{intl l="Address"}</th>
<th>{intl l="Actions"}</th>
<th class="text-center">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="address" type="address" customer="$customer_id" backend_context="1" default="0"}
<tr>
<td>
{$LABEL}
<address>
<strong>{loop name="address.title" type="title" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME} {$LASTNAME}</strong><br>
{$ADDRESS1}
@@ -166,21 +183,21 @@
<br>{$TITLE}
{/loop}
{if $PHONE}
<br> <abbr title="{intl l="Phone"}">P:</abbr>{$PHONE}
<br>{intl l="Phone"}: {$PHONE}
{/if}
{if $CELLPHONE}
<br> <abbr title="{intl l="cell phone"}">P:</abbr>{$CELLPHONE}
<br>{intl l="Cellular phone"}: {$CELLPHONE}
{/if}
</address>
</td>
<td>
<td class="text-center">
<div class="btn-group">
<a class="btn btn-default btn-xs customer-update-address" title="{intl l='Edit this address'}" href="#" data-id="{$ID}">
<a class="btn btn-default btn-xs customer-update-address" title="{intl l='Edit this address'}" href="{url path='/admin/address/update' address_id=$ID}">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs customer-address-use" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-id="{$ID}" data-toggle="modal" rel="tooltip">
<a class="btn btn-default btn-xs customer-address-use" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-toggle="modal" data-id="{$ID}" data-toggle="modal" rel="tooltip">
<span class="glyphicon glyphicon-pushpin"></span>
</a>
@@ -262,168 +279,117 @@
</div>
</div>
<div id="address-update-modal"></div>
{* Add an Address *}
{* -- Add an Address -------------------------------------------------------- *}
{form name="thelia.admin.address.create"}
{form name="thelia.admin.address.create"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "address_creation_dialog"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "address_creation_dialog"}
{form_hidden_fields form=$form}
<input type="hidden" name="customer_id" value="{$customer_id}">
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path="/admin/customer/update/{$customer_id}"}" />
{/form_field}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Label'}">
</div>
{/form_field}
{include file='includes/customer_address_form_fields.html' customer_id=$customer_id page=$page}
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input 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'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Firstname'}" required>
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Lastname'}" required>
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Address'}" required>
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input 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'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Zip code'}" required>
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='City'}" required>
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "address_creation_dialog"
dialog_title = {intl l="Create an address"}
dialog_body = {$smarty.capture.address_creation_dialog nofilter}
dialog_ok_label = {intl l="Create this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='/admin/address/create'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{* Default confirmation dialog *}
{capture "use_address_dialog"}
<input type="hidden" name="address_id" id="address_use_id" value="" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
file = "includes/generic-create-dialog.html"
dialog_id = "use_address_dialog"
dialog_title = {intl l="Use address by default"}
dialog_message = {intl l="Do you really want to use this address by default ?"}
dialog_id = "address_creation_dialog"
dialog_title = {intl l="Create a customer address"}
dialog_body = {$smarty.capture.address_creation_dialog nofilter}
form_action = {url path='/admin/address/use'}
form_content = {$smarty.capture.use_address_dialog nofilter}
dialog_ok_label = {intl l="Create this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='/admin/address/create'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{* Delete confirmation dialog *}
{/form}
{capture "delete_address_dialog"}
<input type="hidden" name="address_id" id="address_delete_id" value="" />
{/capture}
{* -- Update an Address ----------------------------------------------------- *}
{include
file = "includes/generic-confirm-dialog.html"
{if $address_id > 0}
{form name="thelia.admin.address.update"}
dialog_id = "delete_address_dialog"
dialog_title = {intl l="Delete address"}
dialog_message = {intl l="Do you really want to delete this address ?"}
{* Capture the dialog body, to pass it to the generic dialog *}
form_action = {url path='/admin/address/delete'}
form_content = {$smarty.capture.delete_address_dialog nofilter}
}
{capture "address_update_dialog"}
<input type="hidden" name="address_id" id="address_update_id" value="{$address_id}" />
{include file='includes/customer_address_form_fields.html' customer_id=$customer_id page=$page}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "address_update_dialog"
dialog_title = {intl l="Edit a customer address"}
dialog_body = {$smarty.capture.address_update_dialog nofilter}
dialog_ok_label = {intl l="Save this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="/admin/address/save"}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{/if}
{* -- Confirm making an address the default --------------------------------- *}
{capture "use_address_dialog"}
<input type="hidden" name="address_id" id="address_use_id" value="" />
<input type="hidden" name="customer_id" value="{$customer_id}">
<input type="hidden" name="page" value="{$page}">
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "use_address_dialog"
dialog_title = {intl l="Use address by default"}
dialog_message = {intl l="Do you really want to use this address by default ?"}
form_action = {url path='/admin/address/use'}
form_content = {$smarty.capture.use_address_dialog nofilter}
}
{* -- Delete confirmation dialog -------------------------------------------- *}
{capture "delete_address_dialog"}
<input type="hidden" name="address_id" id="address_delete_id" value="" />
<input type="hidden" name="customer_id" value="{$customer_id}">
<input type="hidden" name="page" value="{$page}">
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_address_dialog"
dialog_title = {intl l="Delete address"}
dialog_message = {intl l="Do you really want to delete this address ?"}
form_action = {url path='/admin/address/delete'}
form_content = {$smarty.capture.delete_address_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/main.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
(function($) {
$(document).ready(function(){
$(function() {
$("a.customer-address-delete").click(function(e){
$("#address_delete_id").val($(this).data("id"));
});
@@ -432,23 +398,29 @@
$("#address_use_id").val($(this).data("id"));
});
$("a.customer-update-address").click(function(e){
var baseUrl = "{url path="/admin/address/update/"}";
$('body').append('<div class="modal-backdrop fade in" id="loading-event"><div class="loading"></div></div>');
$.ajax({
method: 'get',
url: baseUrl+$(this).data('id')
}).done(function(data){
$("#loading-event").remove();
$("#address-update-modal").html(data);
$("#edit_address_dialog").modal("show");
});
});
// JS stuff for creation form
{include
file = "includes/generic-js-dialog.html"
dialog_id = "address_creation_dialog"
form_name = "thelia.admin.address.create"
}
$(document).on("hidden.bs.modal", "#edit_address_dialog", function(ev){
$("#edit_address_dialog").remove();
});
// If $address_id is defined, show the edit dialog
{if $address_id > 0}
// JS stuff for update form
{include
file = "includes/generic-js-dialog.html"
dialog_id = "address_update_dialog"
form_name = "thelia.admin.address.update"
}
$('#address_update_dialog').modal();
{/if}
});
})(jQuery);
</script>
{/block}

View File

@@ -7,9 +7,6 @@
{block name="check-access"}view{/block}
{block name="main-content"}
{assign var=customer_page value={$smarty.get.page|default:1}}
<div class="customer">
<div id="wrapper" class="container">
@@ -41,27 +38,83 @@
<thead>
<tr>
<th class="object-title">
{intl l="customer ref"}
{admin_sortable_header
current_order=$customer_order
order='reference'
reverse_order='reference_reverse'
path={url path='/admin/customers'}
request_parameter_name='customer_order'
label="{intl l='Reference'}"
}
</th>
{module_include location='category_list_header'}
{module_include location='customer_list_header'}
<th>
{intl l="firstname & lastname"}
<th class="object-title">
{admin_sortable_header
current_order=$customer_order
order='lastname'
reverse_order='lastname_reverse'
path={url path='/admin/customers'}
request_parameter_name='customer_order'
label="{intl l='Last name'}"
}
</th>
<th>
{intl l="last order"}
<th class="object-title">
{admin_sortable_header
current_order=$customer_order
order='firstname'
reverse_order='firstname_reverse'
path={url path='/admin/customers'}
request_parameter_name='customer_order'
label="{intl l='First name'}"
}
</th>
<th>{intl l='order amount'}</th>
<th class="object-title">
{admin_sortable_header
current_order=$customer_order
order='registration_date'
reverse_order='registration_date_reverse'
path={url path='/admin/customers'}
request_parameter_name='customer_order'
label="{intl l='Registration date'}"
}
</th>
<th class="object-title">{intl l='Date of last order'}</th>
<th class="object-title">{intl l='Last order amount'}</th>
{* TODO
<th class="object-title">
{admin_sortable_header
current_order=$customer_order
order='last_order'
reverse_order='last_order_reverse'
path={url path='/admin/customers'}
request_parameter_name='customer_order'
label="{intl l='Date of last order'}"
}
</th>
<th class="object-title">
{admin_sortable_header
current_order=$customer_order
order='order_amount'
reverse_order='order_amount_reverse'
path={url path='/admin/customers'}
request_parameter_name='customer_order'
label="{intl l='Last order amount'}"
}
</th>
*}
<th class="actions">{intl l='Actions'}</th>
</tr>
</thead>
<tbody>
{loop name="customer_list" type="customer" current="false" visible="*" backend_context="1" page={$customer_page} limit={$display_customer}}
{loop name="customer_list" type="customer" current="false" visible="*" order=$customer_order backend_context="1" page=$page limit=$display_customer}
{assign "lastOrderDate" ''}
{assign "lastOrderAmount" ''}
{assign "lastOrderCurrency" ''}
@@ -75,14 +128,23 @@
{/loop}
<tr>
<td><a href="{url path="/admin/customer/update/{$ID}"}">{$REF}</a></td>
<td><a href="{url path="/admin/customer/update" customer_id=$ID page=$page}">{$REF}</a></td>
<td class="object-title">
{$FIRSTNAME} {$LASTNAME}
{$LASTNAME}
</td>
<td class="object-title">
{$FIRSTNAME}
</td>
{module_include location='customer_list_row'}
<td>
{format_date date=$CREATE_DATE}
</td>
<td>
{$lastOrderDate}
</td>
@@ -94,7 +156,7 @@
<div class="btn-group">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.customer" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path="/admin/customer/update/{$ID}" }"><i class="glyphicon glyphicon-edit"></i></a>
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path='/admin/customer/update' customer_id=$ID page=$page}"><i class="glyphicon glyphicon-edit"></i></a>
{/loop}
{loop type="auth" name="can_send_mail" role="ADMIN" resource="admin.customer" access="VIEW"}
<a class="btn btn-default btn-xs" title="{intl l="Send a mail to this customer"}" href="mailto:{$EMAIL}"><span class="glyphicon glyphicon-envelope"></span></a>
@@ -111,10 +173,10 @@
<tfoot>
<tr>
<td colspan="6">
<div class="text-center">
<ul class="pagination pagination-centered">
{if $customer_page != 1}
{if $page != 1}
<li><a href="{url path="/admin/customers" page="1"}">&laquo;</a></li>
{else}
<li class="disabled"><a href="#">&laquo;</a></li>
@@ -137,7 +199,7 @@
{/if}
</ul>
</div>
</td>
</tr>
</tfoot>
@@ -163,7 +225,7 @@
{form_field form=$form field='success_url'}
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
<input type="hidden" name="{$name}" value="{url path='/admin/customer/update/_ID_'}" />
<input type="hidden" name="{$name}" value="{url path='/admin/customer/update' customer_id='_ID_'}" />
{/form_field}
{form_field form=$form field="password"}
@@ -283,7 +345,7 @@
{* Delete confirmation dialog *}
{capture "delete_customer_dialog"}
<input type="hidden" name="customer_page" value="{$customer_page}">
<input type="hidden" name="page" value="{$page}">
<input type="hidden" name="customer_id" id="delete_customer_id">
{/capture}

View File

@@ -0,0 +1,123 @@
{* Customer address creation / modification fields, used in the customer-edit.html template *}
{form_hidden_fields form=$form}
<input type="hidden" name="customer_id" value="{$customer_id}">
<input type="hidden" name="page" value="{$page}">
{form_field form=$form 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'}
<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'}
<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'}
<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="title" name="title1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form 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'}">
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form 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'}">
</div>
{/form_field}
</div>
</div>
{form_field form=$form 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'}
<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'}
<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>
{/form_field}
<div class="row">
<div class="col-md-3">
{form_field form=$form 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'}">
</div>
{/form_field}
</div>
<div class="col-md-9">
{form_field form=$form 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'}">
</div>
{/form_field}
</div>
</div>
{form_field form=$form field='country'}
<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"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form 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'}">
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form 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'}">
</div>
{/form_field}
</div>
</div>

View File

@@ -39,15 +39,22 @@
<td class="text-right">
<div class="btn-group">
{* {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>
{/loop}*}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="UPDATE"}
{loop type="auth" name="can_change" role="ADMIN" module=$CODE access="VIEW"}
<a class="btn btn-primary btn-xs" title="{intl l='Configure this module'}" href="{url path="/admin/module/update/$CODE"}">{intl l="Configure"}</a>
{/loop}
{*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>
{/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>
{/loop}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.modules" access="DELETE"}
{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>
{/loop}
</div>

View File

@@ -65,7 +65,7 @@
<td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td>
<td>{format_date date=$CREATE_DATE}</td>
<td>{$orderInvoiceCompany}</td>
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td><a href="{url path='/admin/customer/update' customer_id=$CUSTOMER}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td>{$TOTAL_TAXED_AMOUNT}</td>
<td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td>
@@ -122,7 +122,7 @@
</tfoot>
{/ifloop}
</table>
</div>
</div>

View File

@@ -9,7 +9,7 @@
<div class="modules">
<div id="wrapper" class="container">
<div class="clearfix">
<ul class="breadcrumb pull-left">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
@@ -68,7 +68,7 @@
{/loop}
<tr>
<td><a href="{url path="/admin/customer/update/{$ID}"}">{$REF}</a></td>
<td><a href="{url path='/admin/customer/update' customer_id=$ID}">{$REF}</a></td>
<td>
{$COMPANY}
@@ -91,7 +91,7 @@
<div class="btn-group">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.customer" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path="/admin/customer/update/{$ID}" }"><i class="glyphicon glyphicon-edit"></i></a>
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path='/admin/customer/update' customer_id=$ID }"><i class="glyphicon glyphicon-edit"></i></a>
{/loop}
{loop type="auth" name="can_send_mail" role="ADMIN" resource="admin.customer" access="VIEW"}
<a class="btn btn-default btn-xs" title="{intl l="Send a mail to this customer"}" href="mailto:{$EMAIL}"><span class="glyphicon glyphicon-envelope"></span></a>
@@ -148,7 +148,7 @@
<td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td>
<td>{format_date date=$CREATE_DATE}</td>
<td>{$orderInvoiceCompany}</td>
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td><a href="{url path='/admin/customer/update' customer_id=$CUSTOMER}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td>{$TOTAL_TAXED_AMOUNT}</td>
<td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td>

View File

@@ -1,4 +1,3 @@
/* Bootstrap */
@import "bootstrap/bootstrap.less";
@@ -9,4 +8,4 @@
@import "thelia/import.less";
/* Theme */
@import "../themes/default/less/import.less";
@import "../themes/default/less/import.less";

View File

@@ -1,3 +1,5 @@
{* Declare assets directory, relative to template base directory *}
{declare_assets directory='assets'}
{block name="no-return-functions"}{/block}
{assign var="company_name" value="{config key="company_name"}"}
{if not $company_name}
@@ -47,7 +49,7 @@ GNU General Public License : http://www.gnu.org/licenses/
{/block}
{* Stylesheets *}
{stylesheets file='assets/less/styles.less' filters='less,cssembed'}
{stylesheets file='assets/less/styles.less' filters='less'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}