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

View File

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

View File

@@ -159,20 +159,40 @@ try {
for($i = 0; $i < 50; $i++) { for($i = 0; $i < 50; $i++) {
$customer = new Thelia\Model\Customer(); $customer = new Thelia\Model\Customer();
$customer->createOrUpdate( $customer->createOrUpdate(
1, rand(1,3),
"thelia".$i, $faker->firstname,
"thelia".$i, $faker->lastname,
"5 rue rochon", $faker->streetAddress,
"", $faker->streetAddress,
"", $faker->streetAddress,
"0102030405", $faker->phoneNumber,
"0601020304", $faker->phoneNumber,
"63000", $faker->postcode,
"clermont-ferrand", $faker->city,
64, 64,
sprintf("test%d@thelia.net", $i), $faker->email,
"azerty".$i "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 //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 INSERT INTO `customer_title_i18n` (`id`, `locale`, `short`, `long`) VALUES
(1, 'fr_FR', 'Mr', 'Monsieur'), (1, 'fr_FR', 'Mr', 'Monsieur'),
(1, 'en_US', 'M', 'Mister'), (1, 'en_US', 'M', 'Mister'),
(2, 'fr_FR', 'Mrs', 'Madame'), (2, 'fr_FR', 'Mme', 'Madame'),
(2, 'en_US', 'Mme', 'Misses'), (2, 'en_US', 'Mrs', 'Misses'),
(3, 'fr_FR', 'Miss', 'Madamemoiselle'), (3, 'fr_FR', 'Mlle', 'Madamemoiselle'),
(3, 'en_US', 'Mlle', 'Miss'); (3, 'en_US', 'Miss', 'Miss');
INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate`, `position` ,`by_default` ,`created_at` ,`updated_at`) INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate`, `position` ,`by_default` ,`created_at` ,`updated_at`)
VALUES VALUES

View File

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