fix title name in insert.sql file

This commit is contained in:
Manuel Raynaud
2013-09-12 08:12:44 +02:00
parent 10f97a7348
commit 9304624708
5 changed files with 54 additions and 76 deletions

View File

@@ -63,7 +63,7 @@ class Address extends BaseLoop
),
'current'
),
Argument::createBooleanTypeArgument('default', false),
Argument::createBooleanTypeArgument('default'),
Argument::createIntListTypeArgument('exclude')
);
}
@@ -100,6 +100,8 @@ class Address extends BaseLoop
if ($default === true) {
$search->filterByIsDefault(1, Criteria::EQUAL);
} else if($default === false) {
$search->filterByIsDefault(0, Criteria::EQUAL);
}
$exclude = $this->getExclude();

View File

@@ -88,6 +88,7 @@ class Customer extends BaseCustomer implements UserInterface
->setPhone($phone)
->setCellphone($cellphone)
->setZipcode($zipcode)
->setCity($city)
->setCountryId($countryId)
->setIsDefault(1)
;
@@ -107,6 +108,7 @@ class Customer extends BaseCustomer implements UserInterface
->setPhone($phone)
->setCellphone($cellphone)
->setZipcode($zipcode)
->setCity($city)
->setCountryId($countryId)
->save($con)
;

View File

@@ -159,20 +159,40 @@ try {
for($i = 0; $i < 50; $i++) {
$customer = new Thelia\Model\Customer();
$customer->createOrUpdate(
1,
"thelia".$i,
"thelia".$i,
"5 rue rochon",
"",
"",
"0102030405",
"0601020304",
"63000",
"clermont-ferrand",
rand(1,3),
$faker->firstname,
$faker->lastname,
$faker->streetAddress,
$faker->streetAddress,
$faker->streetAddress,
$faker->phoneNumber,
$faker->phoneNumber,
$faker->postcode,
$faker->city,
64,
sprintf("test%d@thelia.net", $i),
$faker->email,
"azerty".$i
);
for ($j = 0; $j <= 3; $j++) {
$address = new Thelia\Model\Address();
$address->setLabel($faker->text(20))
->setTitleId(rand(1,3))
->setFirstname($faker->firstname)
->setLastname($faker->lastname)
->setAddress1($faker->streetAddress)
->setAddress2($faker->streetAddress)
->setAddress3($faker->streetAddress)
->setCellphone($faker->phoneNumber)
->setPhone($faker->phoneNumber)
->setZipcode($faker->postcode)
->setCity($faker->city)
->setCountryId(64)
->setCustomer($customer)
->save()
;
}
}
//features and features_av

View File

@@ -32,10 +32,10 @@ INSERT INTO `customer_title`(`id`, `by_default`, `position`, `created_at`, `upda
INSERT INTO `customer_title_i18n` (`id`, `locale`, `short`, `long`) VALUES
(1, 'fr_FR', 'Mr', 'Monsieur'),
(1, 'en_US', 'M', 'Mister'),
(2, 'fr_FR', 'Mrs', 'Madame'),
(2, 'en_US', 'Mme', 'Misses'),
(3, 'fr_FR', 'Miss', 'Madamemoiselle'),
(3, 'en_US', 'Mlle', 'Miss');
(2, 'fr_FR', 'Mme', 'Madame'),
(2, 'en_US', 'Mrs', 'Misses'),
(3, 'fr_FR', 'Mlle', 'Madamemoiselle'),
(3, 'en_US', 'Miss', 'Miss');
INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate`, `position` ,`by_default` ,`created_at` ,`updated_at`)
VALUES

View File

@@ -52,8 +52,8 @@
<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}">{$LONG}</option>
{loop type="title" name="title1" backend_context="1"}
<option value="{$ID}" {if $ID == $TITLE}selected{/if}>{$LONG}</option>
{/loop}
</select>
</div>
@@ -143,67 +143,20 @@
</tr>
</thead>
<tbody>
{loop name="address" type="address" customer="$customer_id" backend_context="1" default="0"}
<tr>
<td>
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
</address>
</td>
<td>
<div class="btn-group">
<a class="btn btn-default btn-xs" title="{intl l='Edit this address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-toggle="modal" rel="tooltip">
<span class="glyphicon glyphicon-pushpin"></span>
</a>
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_address_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
</td>
</tr>
<tr>
<td>
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
</address>
</td>
<td>
<div class="btn-group">
<a class="btn btn-default btn-xs" title="{intl l='Edit this address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-toggle="modal" rel="tooltip">
<span class="glyphicon glyphicon-pushpin"></span>
</a>
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_address_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
</td>
</tr>
<tr>
<td>
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
<strong>{loop name="address.title" type="title" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME} {$LASTNAME}</strong><br>
{$ADDRESS1}<br>
{$ADDRESS2}<br>
{$ADDRESS3}<br>
{if $PHONE}
<abbr title="{intl l="Phone"}">P:</abbr> {$PHONE}<br>
{/if}
{if $CELLPHONE}
<abbr title="{intl l="cell phone"}">P:</abbr> {$CELLPHONE}
{/if}
</address>
</td>
<td>
@@ -224,6 +177,7 @@
</div>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>