[+] Project: it's possible to create new genders, "Miss" gender is now added

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8578 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-09-14 15:15:51 +00:00
parent 62a578b314
commit 03eaee9bf4
35 changed files with 777 additions and 526 deletions
+30 -10
View File
@@ -45,10 +45,27 @@ class AdminCustomers extends AdminTab
ORDER BY c.date_add DESC ORDER BY c.date_add DESC
LIMIT 1 LIMIT 1
) as connect'; ) as connect';
$genders = array(1 => $this->l('M'), 2 => $this->l('F'), 9 => $this->l('?'));
$genders_icon = array('default' => 'unknown.gif');
$genders = array(0 => $this->l('?'));
foreach (Gender::getGenders() as $gender)
{
$genders_icon[$gender['id_gender']] = '../genders/'.$gender['id_gender'].'.jpg';
$genders[$gender['id_gender']] = $gender['name'];
}
$this->fieldsDisplay = array( $this->fieldsDisplay = array(
'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'id_gender' => array('title' => $this->l('Gender'), 'width' => 25, 'align' => 'center', 'icon' => array(1 => 'male.gif', 2 => 'female.gif', 'default' => 'unknown.gif'), 'orderby' => false, 'type' => 'select', 'select' => $genders, 'filter_key' => 'a!id_gender'), 'id_gender' => array(
'title' => $this->l('Gender'),
'width' => 30,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'select' => $genders,
'filter_key' => 'a!id_gender',
),
'lastname' => array('title' => $this->l('Last Name'), 'width' => 80), 'lastname' => array('title' => $this->l('Last Name'), 'width' => 80),
'firstname' => array('title' => $this->l('First name'), 'width' => 60), 'firstname' => array('title' => $this->l('First name'), 'width' => 60),
'email' => array('title' => $this->l('E-mail address'), 'width' => 120, 'maxlength' => 19), 'email' => array('title' => $this->l('E-mail address'), 'width' => 120, 'maxlength' => 19),
@@ -288,10 +305,12 @@ class AdminCustomers extends AdminTab
else else
$countBetterCustomers = '-'; $countBetterCustomers = '-';
$gender = new Gender($customer->id_gender);
echo ' echo '
<fieldset style="width:400px;float: left"><div style="float: right"><a href="'.self::$currentIndex.'&addcustomer&id_customer='.$customer->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div> <fieldset style="width:400px;float: left"><div style="float: right"><a href="'.self::$currentIndex.'&addcustomer&id_customer='.$customer->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div>
<span style="font-weight: bold; font-size: 14px;">'.$customer->firstname.' '.$customer->lastname.'</span> <span style="font-weight: bold; font-size: 14px;">'.$customer->firstname.' '.$customer->lastname.'</span>
<img src="../img/admin/'.($customer->id_gender == 2 ? 'female' : ($customer->id_gender == 1 ? 'male' : 'unknown')).'.gif" style="margin-bottom: 5px" /><br /> <img src="'.$gender->getImage().'" style="margin-bottom: 5px" /><br />
<a href="mailto:'.$customer->email.'" style="text-decoration: underline; color: blue">'.$customer->email.'</a><br /><br /> <a href="mailto:'.$customer->email.'" style="text-decoration: underline; color: blue">'.$customer->email.'</a><br /><br />
'.$this->l('ID:').' '.sprintf('%06d', $customer->id).'<br /> '.$this->l('ID:').' '.sprintf('%06d', $customer->id).'<br />
'.$this->l('Registration date:').' '.Tools::displayDate($customer->date_add, $this->context->language->id, true).'<br /> '.$this->l('Registration date:').' '.Tools::displayDate($customer->date_add, $this->context->language->id, true).'<br />
@@ -701,13 +720,14 @@ class AdminCustomers extends AdminTab
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').' '.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/tab-customers.gif" />'.$this->l('Customer').'</legend> <fieldset><legend><img src="../img/admin/tab-customers.gif" />'.$this->l('Customer').'</legend>
<label>'.$this->l('Gender:').' </label> <label>'.$this->l('Gender:').' </label>
<div class="margin-form"> <div class="margin-form">';
<input type="radio" size="33" name="id_gender" id="gender_1" value="1" '.($this->getFieldValue($obj, 'id_gender') == 1 ? 'checked="checked" ' : '').'/> foreach (Gender::getGenders() as $gender)
<label class="t" for="gender_1"> '.$this->l('Male').'</label> {
<input type="radio" size="33" name="id_gender" id="gender_2" value="2" '.($this->getFieldValue($obj, 'id_gender') == 2 ? 'checked="checked" ' : '').'/> echo '<input type="radio" size="33" name="id_gender" id="gender_'.$gender['id_gender'].'" value="'.$gender['id_gender'].'" '.($this->getFieldValue($obj, 'id_gender') == $gender['id_gender'] ? 'checked="checked" ' : '').'/>';
<label class="t" for="gender_2"> '.$this->l('Female').'</label> echo '<label class="t" for="gender_'.$gender['id_gender'].'"> '.$gender['name'].'</label> &nbsp; ';
<input type="radio" size="33" name="id_gender" id="gender_3" value="9" '.(($this->getFieldValue($obj, 'id_gender') == 9 OR !$this->getFieldValue($obj, 'id_gender')) ? 'checked="checked" ' : '').'/> }
<label class="t" for="gender_3"> '.$this->l('Unknown').'</label> echo ' <input type="radio" size="33" name="id_gender" id="gender_unknown" value="0" '.(($this->getFieldValue($obj, 'id_gender') == 9 || !$this->getFieldValue($obj, 'id_gender')) ? 'checked="checked" ' : '').'/>
<label class="t" for="gender_unknown"> '.$this->l('Unknown').'</label>
</div> </div>
<label>'.$this->l('Last name:').' </label> <label>'.$this->l('Last name:').' </label>
<div class="margin-form"> <div class="margin-form">
+109
View File
@@ -0,0 +1,109 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class AdminGenders extends AdminTab
{
public function __construct()
{
$this->table = 'gender';
$this->className = 'Gender';
$this->lang = true;
$this->edit = true;
$this->delete = true;
$this->fieldImageSettings = array('name' => 'image', 'dir' => 'genders');
$this->fieldsDisplay = array(
'id_gender' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'name' => array('title' => $this->l('Name'), 'width' => 150, 'filter_key' => 'b!name'),
'type' => array(
'title' => $this->l('Type'),
'width' => 100,
'orderby' => false,
'type' => 'select',
'select' => array(0 => $this->l('Male'), 1 => $this->l('Female')),
'filter_key' => 'a!type',
'callback' => 'displayGenderType',
'callback_object' => $this,
),
'image' => array('title' => $this->l('Image'), 'align' => 'center', 'image' => 'genders', 'orderby' => false, 'search' => false),
);
parent::__construct();
}
public function displayGenderType($value, $tr)
{
return $this->fieldsDisplay['type']['select'][$value];
}
public function displayForm($isMainTab = true)
{
parent::displayForm();
if (!($obj = $this->loadObject(true)))
return;
echo '
<form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
<fieldset><legend><img src="../img/admin/tab-genders.gif" />'.$this->l('Gender').'</legend>
<label>'.$this->l('Name:').' </label>
<div class="margin-form">';
foreach ($this->_languages as $language)
echo '
<div id="name_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
<input size="33" type="text" name="name_'.$language['id_lang'].'" value="'.htmlentities($this->getFieldValue($obj, 'name', (int)($language['id_lang'])), ENT_COMPAT, 'UTF-8').'" /><sup> *</sup>
<span class="hint" name="help_box">'.$this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer">&nbsp;</span></span>
</div>';
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name');
echo '</div><div class="clear">&nbsp;</div>';
echo '<label>'.$this->l('Type:').' </label>
<div class="margin-form">
<input type="radio" name="type" id="type_male" value="0" '.($this->getFieldValue($obj, 'type') == 0 ? 'checked="checked" ' : '').'/>
<label class="t" for="type_male"> '.$this->l('Male').'</label>
<input type="radio" name="type" id="type_female" value="1" '.($this->getFieldValue($obj, 'type') == 1 ? 'checked="checked" ' : '').'/>
<label class="t" for="type_female"> '.$this->l('Female').'</label>
</div>
<div class="clear"></div>';
echo '<label>'.$this->l('Image:').' </label>
<div class="margin-form">';
echo ' <input type="file" name="image" /> ';
if ($obj->getImage())
echo '<img src="'.$obj->getImage().'" />';
echo '</div>
<div class="clear"></div>';
echo '<div class="margin-form">
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
</div>
<div class="small"><sup>*</sup> '.$this->l('Required field').'</div>
</fieldset>
</form><br />';
}
}
+1 -2
View File
@@ -251,11 +251,10 @@ class AdminGroups extends AdminTab
foreach ($customers AS $k => $customer) foreach ($customers AS $k => $customer)
{ {
$imgGender = $customer['id_gender'] == 1 ? '<img src="../img/admin/male.gif" alt="'.$this->l('Male').'" />' : ($customer['id_gender'] == 2 ? '<img src="../img/admin/female.gif" alt="'.$this->l('Female').'" />' : '');
echo ' echo '
<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"> <tr class="'.($irow++ % 2 ? 'alt_row' : '').'">
<td>'.$customer['id_customer'].'</td> <td>'.$customer['id_customer'].'</td>
<td class="center">'.$imgGender.'</td> <td class="center"><img src="'.Gender::getStaticImage($customer['id_gender']).'" /></td>
<td>'.stripslashes($customer['lastname']).' '.stripslashes($customer['firstname']).'</td> <td>'.stripslashes($customer['lastname']).' '.stripslashes($customer['firstname']).'</td>
<td>'.stripslashes($customer['email']).'<a href="mailto:'.stripslashes($customer['email']).'"> <img src="../img/admin/email_edit.gif" alt="'.$this->l('Write to this customer').'" /></a></td> <td>'.stripslashes($customer['email']).'<a href="mailto:'.stripslashes($customer['email']).'"> <img src="../img/admin/email_edit.gif" alt="'.$this->l('Write to this customer').'" /></a></td>
<td>'.Tools::displayDate($customer['birthday'], $this->context->language->id).'</td> <td>'.Tools::displayDate($customer['birthday'], $this->context->language->id).'</td>
+1 -1
View File
@@ -210,7 +210,7 @@ class AdminImport extends AdminTab
'no' => array('label' => $this->l('Ignore this column')), 'no' => array('label' => $this->l('Ignore this column')),
'id' => array('label' => $this->l('ID')), 'id' => array('label' => $this->l('ID')),
'active' => array('label' => $this->l('Active (0/1)')), 'active' => array('label' => $this->l('Active (0/1)')),
'id_gender' => array('label' => $this->l('Gender ID (Mr = 1, Ms = 2, else 9)')), 'id_gender' => array('label' => $this->l('Gender ID (Mr = 1, Ms = 2, else 0)')),
'email' => array('label' => $this->l('E-mail *')), 'email' => array('label' => $this->l('E-mail *')),
'passwd' => array('label' => $this->l('Password *')), 'passwd' => array('label' => $this->l('Password *')),
'birthday' => array('label' => $this->l('Birthday (yyyy-mm-dd)')), 'birthday' => array('label' => $this->l('Birthday (yyyy-mm-dd)')),
+1 -2
View File
@@ -270,11 +270,10 @@ class AdminSearch extends AdminTab
$irow = 0; $irow = 0;
foreach ($this->_list['customers'] AS $k => $customer) foreach ($this->_list['customers'] AS $k => $customer)
{ {
$imgGender = $customer['id_gender'] == 1 ? '<img src="../img/admin/male.gif" alt="'.$this->l('Male').'" />' : ($customer['id_gender'] == 2 ? '<img src="../img/admin/female.gif" alt="'.$this->l('Female').'" />' : '');
echo ' echo '
<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"> <tr class="'.($irow++ % 2 ? 'alt_row' : '').'">
<td>'.$customer['id_customer'].'</td> <td>'.$customer['id_customer'].'</td>
<td class="center">'.$imgGender.'</td> <td class="center"><img src="'.Gender::getStaticImage($customer['id_gender']).'" /></td>
<td>'.stripslashes($customer['lastname']).' '.stripslashes($customer['firstname']).'</td> <td>'.stripslashes($customer['lastname']).' '.stripslashes($customer['firstname']).'</td>
<td>'.stripslashes($customer['email']).'<a href="mailto:'.stripslashes($customer['email']).'"> <img src="../img/admin/email_edit.gif" alt="'.$this->l('Write to this customer').'" /></a></td> <td>'.stripslashes($customer['email']).'<a href="mailto:'.stripslashes($customer['email']).'"> <img src="../img/admin/email_edit.gif" alt="'.$this->l('Write to this customer').'" /></a></td>
<td>'.Tools::displayDate($customer['birthday'], $this->context->language->id).'</td> <td>'.Tools::displayDate($customer['birthday'], $this->context->language->id).'</td>
+2
View File
@@ -96,6 +96,8 @@
'FileUploader' => '', 'FileUploader' => '',
'FrontControllerCore' => 'classes/FrontController.php', 'FrontControllerCore' => 'classes/FrontController.php',
'FrontController' => 'override/classes/FrontController.php', 'FrontController' => 'override/classes/FrontController.php',
'GenderCore' => 'classes/Gender.php',
'Gender' => '',
'GroupCore' => 'classes/Group.php', 'GroupCore' => 'classes/Group.php',
'Group' => 'override/classes/Group.php', 'Group' => 'override/classes/Group.php',
'GroupReductionCore' => 'classes/GroupReduction.php', 'GroupReductionCore' => 'classes/GroupReduction.php',
+1 -1
View File
@@ -1684,7 +1684,7 @@ abstract class AdminTabCore
else else
$echo = $tr[$key]; $echo = $tr[$key];
echo isset($params['callback']) ? call_user_func_array(array($this->className, $params['callback']), array($echo, $tr)) : $echo; echo isset($params['callback']) ? call_user_func_array(array((isset($params['callback_object'])) ? $params['callback_object'] : $this->className, $params['callback']), array($echo, $tr)) : $echo;
} }
else else
echo '--'; echo '--';
+1 -1
View File
@@ -40,7 +40,7 @@ class CustomerCore extends ObjectModel
public $note; public $note;
/** @var integer Gender ID */ /** @var integer Gender ID */
public $id_gender = 9; public $id_gender = 0;
/** @var integer Default group ID */ /** @var integer Default group ID */
public $id_default_group = _PS_DEFAULT_CUSTOMER_GROUP_; public $id_default_group = _PS_DEFAULT_CUSTOMER_GROUP_;
+97
View File
@@ -0,0 +1,97 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @since 1.5.0
*/
class GenderCore extends ObjectModel
{
public $id_gender;
public $name;
public $type;
protected $fieldsRequired = array('type');
protected $fieldsSize = array();
protected $fieldsValidate = array();
protected $fieldsRequiredLang = array('name');
protected $fieldsSizeLang = array('name' => 20);
protected $fieldsValidateLang = array('name' => 'isString');
protected $table = 'gender';
protected $identifier = 'id_gender';
public function __construct($id = null, $id_lang = null, $id_shop = null)
{
parent::__construct($id, $id_lang, $id_shop);
$this->image_dir = _PS_GENDERS_DIR_;
}
public function getFields()
{
$this->validateFields();
$fields['id_gender'] = (int)$this->id_gender;
$fields['type'] = (int)$this->type;
return $fields;
}
/**
* Check then return multilingual fields for database interaction
*
* @return array Multilingual fields
*/
public function getTranslationsFieldsChild()
{
$this->validateFieldsLang();
return $this->getTranslationsFields(array(
'name',
));
}
public function getGenders($id_lang = null)
{
if (is_null($id_lang))
$id_lang = Context::getContext()->language->id;
$sql = 'SELECT g.id_gender, gl.name
FROM '._DB_PREFIX_.'gender g
LEFT JOIN '._DB_PREFIX_.'gender_lang gl ON g.id_gender = gl.id_gender AND gl.id_lang = '.(int)$id_lang;
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
}
public function getStaticImage($id, $useUnknown = false)
{
if (!file_exists(_PS_GENDERS_DIR_.$id.'.jpg'))
return ($useUnknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false;
return _THEME_GENDERS_DIR_.$id.'.jpg';
}
public function getImage($useUnknown = false)
{
return Gender::getStaticImage($this->id, $useUnknown);
}
}
+2
View File
@@ -56,6 +56,7 @@ define('_THEME_SHIP_DIR_', _PS_IMG_.'s/');
define('_THEME_STORE_DIR_', _PS_IMG_.'st/'); define('_THEME_STORE_DIR_', _PS_IMG_.'st/');
define('_THEME_LANG_DIR_', _PS_IMG_.'l/'); define('_THEME_LANG_DIR_', _PS_IMG_.'l/');
define('_THEME_COL_DIR_', _PS_IMG_.'co/'); define('_THEME_COL_DIR_', _PS_IMG_.'co/');
define('_THEME_GENDERS_DIR_', _PS_IMG_.'genders/');
define('_SUPP_DIR_', _PS_IMG_.'su/'); define('_SUPP_DIR_', _PS_IMG_.'su/');
define('_PS_PROD_IMG_', 'img/p/'); define('_PS_PROD_IMG_', 'img/p/');
@@ -92,6 +93,7 @@ define('_PS_UPLOAD_DIR_', _PS_ROOT_DIR_.'/upload/');
define('_PS_TOOL_DIR_', _PS_ROOT_DIR_.'/tools/'); define('_PS_TOOL_DIR_', _PS_ROOT_DIR_.'/tools/');
define('_PS_GEOIP_DIR_', _PS_TOOL_DIR_.'geoip/'); define('_PS_GEOIP_DIR_', _PS_TOOL_DIR_.'geoip/');
define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_.'swift/'); define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_.'swift/');
define('_PS_GENDERS_DIR_', _PS_IMG_DIR_.'genders/');
define('_PS_FPDF_PATH_', _PS_TOOL_DIR_.'fpdf/'); define('_PS_FPDF_PATH_', _PS_TOOL_DIR_.'fpdf/');
define('_PS_TAASC_PATH_', _PS_TOOL_DIR_.'taasc/'); define('_PS_TAASC_PATH_', _PS_TOOL_DIR_.'taasc/');
define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_.'pear_xml_parser/'); define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_.'pear_xml_parser/');
+3 -1
View File
@@ -323,6 +323,8 @@ class AuthControllerCore extends FrontController
)); ));
} }
$this->context->smarty->assign('genders', Gender::getGenders());
/* Generate years, months and days */ /* Generate years, months and days */
if (isset($_POST['years']) AND is_numeric($_POST['years'])) if (isset($_POST['years']) AND is_numeric($_POST['years']))
$selectedYears = (int)($_POST['years']); $selectedYears = (int)($_POST['years']);
@@ -364,7 +366,7 @@ class AuthControllerCore extends FrontController
if (!empty($back)) if (!empty($back))
{ {
$this->context->smarty->assign('back', Tools::safeOutput($back)); $this->context->smarty->assign('back', Tools::safeOutput($back));
if (strpos($back, 'order.php') !== false) if (strpos($back, 'order') !== false)
{ {
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES'))
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true); $countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
+2 -1
View File
@@ -102,7 +102,8 @@ class IdentityControllerCore extends FrontController
'sl_month' => $birthday[1], 'sl_month' => $birthday[1],
'days' => Tools::dateDays(), 'days' => Tools::dateDays(),
'sl_day' => $birthday[2], 'sl_day' => $birthday[2],
'errors' => $this->errors 'errors' => $this->errors,
'genders' => Gender::getGenders(),
)); ));
$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active); $this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
+2 -1
View File
@@ -244,7 +244,8 @@ class OrderOpcControllerCore extends ParentOrderController
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
'errorCarrier' => Tools::displayError('You must choose a carrier before', false), 'errorCarrier' => Tools::displayError('You must choose a carrier before', false),
'errorTOS' => Tools::displayError('You must accept terms of service before', false), 'errorTOS' => Tools::displayError('You must accept terms of service before', false),
'isPaymentStep' => (bool)(isset($_GET['isPaymentStep']) AND $_GET['isPaymentStep']) 'isPaymentStep' => (bool)(isset($_GET['isPaymentStep']) AND $_GET['isPaymentStep']),
'genders' => Gender::getGenders(),
)); ));
/* Call a hook to display more information on form */ /* Call a hook to display more information on form */
self::$smarty->assign(array( self::$smarty->assign(array(
Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

+14
View File
@@ -670,6 +670,20 @@ CREATE TABLE `PREFIX_feature_value_lang` (
PRIMARY KEY (`id_feature_value`,`id_lang`) PRIMARY KEY (`id_feature_value`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `PREFIX_gender` (
`id_gender` int(11) NOT NULL AUTO_INCREMENT,
`type` tinyint(1) NOT NULL,
PRIMARY KEY (`id_gender`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `PREFIX_gender_lang` (
`id_gender` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(20) NOT NULL,
PRIMARY KEY (`id_gender`,`id_lang`),
KEY `id_gender` (`id_gender`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_group` ( CREATE TABLE `PREFIX_group` (
`id_group` int(10) unsigned NOT NULL auto_increment, `id_group` int(10) unsigned NOT NULL auto_increment,
`reduction` decimal(17,2) NOT NULL default '0.00', `reduction` decimal(17,2) NOT NULL default '0.00',
+1 -4
View File
@@ -940,7 +940,6 @@ INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `del
(2, 89, 0, 0, 0, 0), (2, 89, 0, 0, 0, 0),
(2, 90, 0, 0, 0, 0), (2, 90, 0, 0, 0, 0),
(2, 91, 0, 0, 0, 0), (2, 91, 0, 0, 0, 0),
(2, 92, 0, 0, 0, 0),
(3, 1, 1, 1, 1, 1), (3, 1, 1, 1, 1, 1),
(3, 2, 0, 0, 0, 0), (3, 2, 0, 0, 0, 0),
(3, 3, 0, 0, 0, 0), (3, 3, 0, 0, 0, 0),
@@ -1023,7 +1022,6 @@ INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `del
(3, 89, 0, 0, 0, 0), (3, 89, 0, 0, 0, 0),
(3, 90, 0, 0, 0, 0), (3, 90, 0, 0, 0, 0),
(3, 91, 0, 0, 0, 0), (3, 91, 0, 0, 0, 0),
(3, 92, 0, 0, 0, 0),
(4, 1, 1, 1, 1, 1), (4, 1, 1, 1, 1, 1),
(4, 2, 1, 1, 1, 1), (4, 2, 1, 1, 1, 1),
(4, 3, 1, 1, 1, 1), (4, 3, 1, 1, 1, 1),
@@ -1105,8 +1103,7 @@ INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `del
(4, 88, 1, 1, 1, 1), (4, 88, 1, 1, 1, 1),
(4, 89, 0, 0, 0, 0), (4, 89, 0, 0, 0, 0),
(4, 90, 0, 0, 0, 0), (4, 90, 0, 0, 0, 0),
(4, 91, 0, 0, 0, 0), (4, 91, 0, 0, 0, 0);
(4, 92, 0, 0, 0, 0);
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 2, id_module, 0, 1 FROM PREFIX_module); INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 2, id_module, 0, 1 FROM PREFIX_module);
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 3, id_module, 0, 1 FROM PREFIX_module); INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 3, id_module, 0, 1 FROM PREFIX_module);
+7 -7
View File
@@ -160,7 +160,7 @@ INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_a
(80, 'PS_ORDER_PROCESS_TYPE', 0, NOW(), NOW()), (80, 'PS_ORDER_PROCESS_TYPE', 0, NOW(), NOW()),
(81, 'PS_SPECIFIC_PRICE_PRIORITIES', 'id_shop;id_currency;id_country;id_group', NOW(), NOW()), (81, 'PS_SPECIFIC_PRICE_PRIORITIES', 'id_shop;id_currency;id_country;id_group', NOW(), NOW()),
(82, 'PS_TAX_DISPLAY', 0, NOW(), NOW()), (82, 'PS_TAX_DISPLAY', 0, NOW(), NOW()),
(83, 'PS_SMARTY_FORCE_COMPILE', 0, NOW(), NOW()), (83, 'PS_SMARTY_FORCE_COMPILE', 1, NOW(), NOW()),
(84, 'PS_DISTANCE_UNIT', 'km', NOW(), NOW()), (84, 'PS_DISTANCE_UNIT', 'km', NOW(), NOW()),
(85, 'PS_STORES_DISPLAY_CMS', 1, NOW(), NOW()), (85, 'PS_STORES_DISPLAY_CMS', 1, NOW(), NOW()),
(86, 'PS_STORES_DISPLAY_FOOTER', 1, NOW(), NOW()), (86, 'PS_STORES_DISPLAY_FOOTER', 1, NOW(), NOW()),
@@ -827,7 +827,7 @@ INSERT INTO `PREFIX_tab` (`id_tab`, `class_name`, `id_parent`, `position`) VALUE
(70, 'AdminPerformance', 8, 11),(71, 'AdminCustomerThreads', 29, 4),(72, 'AdminWebservice', 9, 12),(73, 'AdminStockMvt', 1, 9), (70, 'AdminPerformance', 8, 11),(71, 'AdminCustomerThreads', 29, 4),(72, 'AdminWebservice', 9, 12),(73, 'AdminStockMvt', 1, 9),
(80, 'AdminAddonsCatalog', 7, 1),(81, 'AdminAddonsMyAccount', 7, 2),(83, 'AdminThemes', 7, 3),(84, 'AdminGeolocation', 8, 12), (80, 'AdminAddonsCatalog', 7, 1),(81, 'AdminAddonsMyAccount', 7, 2),(83, 'AdminThemes', 7, 3),(84, 'AdminGeolocation', 8, 12),
(85, 'AdminTaxRulesGroup', 4, 3),(86, 'AdminLogs', 9, 13), (87,'AdminHome',-1,0), (85, 'AdminTaxRulesGroup', 4, 3),(86, 'AdminLogs', 9, 13), (87,'AdminHome',-1,0),
(88,'AdminShop', 0, 11), (89,'AdminGroupShop', 90, 1),(90, 'AdminShopUrl', 90, 2); (88,'AdminShop', 0, 11), (89,'AdminGroupShop', 88, 1),(90, 'AdminShopUrl', 88, 2),(91, 'AdminGenders', 2, 4);
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) (SELECT 1, id_tab, 1, 1, 1, 1 FROM PREFIX_tab); INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) (SELECT 1, id_tab, 1, 1, 1, 1 FROM PREFIX_tab);
@@ -844,7 +844,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(1, 61, 'Search Engines'),(1, 62, 'Referrers'),(1, 63, 'Groups'),(1, 64, 'Generators'),(1, 65, 'Shopping Carts'),(1, 66, 'Tags'),(1, 67, 'Search'), (1, 61, 'Search Engines'),(1, 62, 'Referrers'),(1, 63, 'Groups'),(1, 64, 'Generators'),(1, 65, 'Shopping Carts'),(1, 66, 'Tags'),(1, 67, 'Search'),
(1, 68, 'Attachments'),(1, 69, 'Configuration Information'),(1, 70, 'Performance'),(1, 71, 'Customer Service'),(1, 72, 'Webservice'),(1, 73, 'Stock Movements'), (1, 68, 'Attachments'),(1, 69, 'Configuration Information'),(1, 70, 'Performance'),(1, 71, 'Customer Service'),(1, 72, 'Webservice'),(1, 73, 'Stock Movements'),
(1, 80, 'Modules & Themes Catalog'),(1, 81, 'My Account'),(1, 82, 'Stores'),(1, 83, 'Themes'),(1, 84, 'Geolocation'),(1, 85, 'Tax Rules'),(1, 86, 'Log'), (1, 80, 'Modules & Themes Catalog'),(1, 81, 'My Account'),(1, 82, 'Stores'),(1, 83, 'Themes'),(1, 84, 'Geolocation'),(1, 85, 'Tax Rules'),(1, 86, 'Log'),
(1, 87, 'Home'), (1, 88, 'Shops'), (1, 89, 'Group Shops'), (1, 90, 'Shop Urls'); (1, 87, 'Home'), (1, 88, 'Shops'), (1, 89, 'Group Shops'), (1, 90, 'Shop Urls'),(1, 91, 'Genders');
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(2, 1, 'Catalogue'),(2, 2, 'Clients'),(2, 3, 'Commandes'),(2, 4, 'Paiement'),(2, 5, 'Transport'), (2, 1, 'Catalogue'),(2, 2, 'Clients'),(2, 3, 'Commandes'),(2, 4, 'Paiement'),(2, 5, 'Transport'),
@@ -859,7 +859,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(2, 62, 'Sites affluents'),(2, 63, 'Groupes'),(2, 64, 'Générateurs'),(2, 65, 'Paniers'),(2, 66, 'Tags'),(2, 67, 'Recherche'), (2, 62, 'Sites affluents'),(2, 63, 'Groupes'),(2, 64, 'Générateurs'),(2, 65, 'Paniers'),(2, 66, 'Tags'),(2, 67, 'Recherche'),
(2, 68, 'Documents joints'),(2, 69, 'Informations'),(2, 70, 'Performances'),(2, 71, 'SAV'),(2, 72, 'Service web'),(2, 73, 'Mouvements de Stock'), (2, 68, 'Documents joints'),(2, 69, 'Informations'),(2, 70, 'Performances'),(2, 71, 'SAV'),(2, 72, 'Service web'),(2, 73, 'Mouvements de Stock'),
(2, 80, 'Catalogue de modules et thèmes'),(2, 81, 'Mon compte'),(2, 82, 'Magasins'),(2, 83, 'Thèmes'),(2, 84, 'Géolocalisation'),(2, 85, 'Règles de taxes'),(2, 86, 'Log'), (2, 80, 'Catalogue de modules et thèmes'),(2, 81, 'Mon compte'),(2, 82, 'Magasins'),(2, 83, 'Thèmes'),(2, 84, 'Géolocalisation'),(2, 85, 'Règles de taxes'),(2, 86, 'Log'),
(2, 87,'Accueil'), (2, 88, 'Boutiques'), (2, 89, 'Groupes de boutique'), (2, 90, 'URLs de boutique'); (2, 87,'Accueil'), (2, 88, 'Boutiques'), (2, 89, 'Groupes de boutique'), (2, 90, 'URLs de boutique'),(2, 91, 'Genres');
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(3, 1, 'Catálogo'),(3, 2, 'Clientes'),(3, 3, 'Pedidos'),(3, 4, 'Pago'),(3, 5, 'Transporte'), (3, 1, 'Catálogo'),(3, 2, 'Clientes'),(3, 3, 'Pedidos'),(3, 4, 'Pago'),(3, 5, 'Transporte'),
@@ -873,7 +873,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(3, 55, 'Albaranes de entrega'),(3, 56, 'SEO & URLs'),(3, 57, 'CMS'),(3, 58, 'Mapeo de la imagen'),(3, 59, 'Mensajes del cliente'),(3, 60, 'Rastreo'), (3, 55, 'Albaranes de entrega'),(3, 56, 'SEO & URLs'),(3, 57, 'CMS'),(3, 58, 'Mapeo de la imagen'),(3, 59, 'Mensajes del cliente'),(3, 60, 'Rastreo'),
(3, 61, 'Motores de búsqueda'),(3, 62, 'Referido'),(3, 63, 'Grupos'),(3, 64, 'Generadores'),(3, 65, 'Carritos'),(3, 66, 'Etiquetas'),(3, 67, 'Búsqueda'),(3, 68, 'Adjuntos'), (3, 61, 'Motores de búsqueda'),(3, 62, 'Referido'),(3, 63, 'Grupos'),(3, 64, 'Generadores'),(3, 65, 'Carritos'),(3, 66, 'Etiquetas'),(3, 67, 'Búsqueda'),(3, 68, 'Adjuntos'),
(3, 69, 'Informaciones'),(3, 70, 'Rendimiento'),(3, 72, 'Web service'),(3, 71, 'Servicio al cliente'),(3, 73, 'Movimiento de Stock'), (3, 82, 'Tiendas'),(3, 83, 'Temas'),(3, 84, 'Geolocalización'),(3, 85, 'Reglas de Impuestos'),(3, 86, 'Log'), (3, 69, 'Informaciones'),(3, 70, 'Rendimiento'),(3, 72, 'Web service'),(3, 71, 'Servicio al cliente'),(3, 73, 'Movimiento de Stock'), (3, 82, 'Tiendas'),(3, 83, 'Temas'),(3, 84, 'Geolocalización'),(3, 85, 'Reglas de Impuestos'),(3, 86, 'Log'),
(3, 87,'Home'), (3, 88, 'Shops'), (3, 89, 'Group Shops'), (3, 90, 'Shop Urls'); (3, 87,'Home'), (3, 88, 'Shops'), (3, 89, 'Group Shops'), (3, 90, 'Shop Urls'),(3, 91, 'Genders');
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(4, 1, 'Katalog'),(4, 2, 'Kunden'),(4, 3, 'Bestellungen'),(4, 4, 'Zahlung'), (4, 1, 'Katalog'),(4, 2, 'Kunden'),(4, 3, 'Bestellungen'),(4, 4, 'Zahlung'),
@@ -888,7 +888,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(4, 61, 'Suchmaschinen'),(4, 62, 'Referrer'),(4, 63, 'Gruppen'),(4, 64, 'Generatoren'),(4, 65, 'Warenkörbe'),(4, 66, 'Tags'),(4, 67, 'Suche'), (4, 61, 'Suchmaschinen'),(4, 62, 'Referrer'),(4, 63, 'Gruppen'),(4, 64, 'Generatoren'),(4, 65, 'Warenkörbe'),(4, 66, 'Tags'),(4, 67, 'Suche'),
(4, 68, 'Anhänge'),(4, 69, 'Konfigurationsinformationen'),(4, 70, 'Leistung'),(4, 71, 'Kundenservice'),(4, 72, 'Webservice'),(4, 73, 'Lagerbewegungen'), (4, 68, 'Anhänge'),(4, 69, 'Konfigurationsinformationen'),(4, 70, 'Leistung'),(4, 71, 'Kundenservice'),(4, 72, 'Webservice'),(4, 73, 'Lagerbewegungen'),
(4, 80, 'Module und Themenkatalog'),(4, 81, 'Mein Konto'),(4, 82, 'Shops'),(4, 83, 'Themen'),(4, 84, 'Geotargeting'),(4, 85, 'Steuerregeln'),(4, 86, 'Log'), (4, 80, 'Module und Themenkatalog'),(4, 81, 'Mein Konto'),(4, 82, 'Shops'),(4, 83, 'Themen'),(4, 84, 'Geotargeting'),(4, 85, 'Steuerregeln'),(4, 86, 'Log'),
(4, 87,'Home'), (4, 88, 'Shops'), (4, 89, 'Group Shops'), (4, 90, 'Shop Urls'); (4, 87,'Home'), (4, 88, 'Shops'), (4, 89, 'Group Shops'), (4, 90, 'Shop Urls'),(4, 91, 'Genders');
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(5, 1, 'Catalogo'),(5, 2, 'Clienti'),(5, 3, 'Ordini'),(5, 4, 'Pagamento'), (5, 1, 'Catalogo'),(5, 2, 'Clienti'),(5, 3, 'Ordini'),(5, 4, 'Pagamento'),
@@ -903,7 +903,7 @@ INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
(5, 61, 'Motori di ricerca'),(5, 62, 'Referenti'),(5, 63, 'Gruppi'),(5, 64, 'Generatori'),(5, 65, 'Carrelli shopping'),(5, 66, 'Tag'),(5, 67, 'Cerca'), (5, 61, 'Motori di ricerca'),(5, 62, 'Referenti'),(5, 63, 'Gruppi'),(5, 64, 'Generatori'),(5, 65, 'Carrelli shopping'),(5, 66, 'Tag'),(5, 67, 'Cerca'),
(5, 68, 'Allegati'),(5, 69, 'Informazioni di configurazione'),(5, 70, 'Performance'),(5, 71, 'Servizio clienti'),(5, 72, 'Webservice'),(5, 73, 'Movimenti magazzino'), (5, 68, 'Allegati'),(5, 69, 'Informazioni di configurazione'),(5, 70, 'Performance'),(5, 71, 'Servizio clienti'),(5, 72, 'Webservice'),(5, 73, 'Movimenti magazzino'),
(5, 80, 'Moduli & Temi catalogo'),(5, 81, 'Il mio Account'),(5, 82, 'Negozi'),(5, 83, 'Temi'),(5, 84, 'Geolocalizzazione'),(5, 85, 'Regimi fiscali'),(5, 86, 'Log'), (5, 80, 'Moduli & Temi catalogo'),(5, 81, 'Il mio Account'),(5, 82, 'Negozi'),(5, 83, 'Temi'),(5, 84, 'Geolocalizzazione'),(5, 85, 'Regimi fiscali'),(5, 86, 'Log'),
(5, 87,'Home'), (5, 88, 'Shops'), (5, 89, 'Group Shops'), (5, 90, 'Shop Urls'); (5, 87,'Home'), (5, 88, 'Shops'), (5, 89, 'Group Shops'), (5, 90, 'Shop Urls'),(5, 91, 'Genders');
INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`) INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`)
(SELECT `id_tab`, id_lang, (SELECT tl.`name` (SELECT `id_tab`, id_lang, (SELECT tl.`name`
+1 -1
View File
@@ -374,7 +374,7 @@ class Ebay extends Module
if ($id_customer < 1) if ($id_customer < 1)
{ {
$customer = new Customer(); $customer = new Customer();
$customer->id_gender = 9; $customer->id_gender = 0;
$customer->id_default_group = 1; $customer->id_default_group = 1;
$customer->secure_key = md5(uniqid(rand(), true)); $customer->secure_key = md5(uniqid(rand(), true));
$customer->email = $order['email']; $customer->email = $order['email'];
+4 -2
View File
@@ -423,7 +423,8 @@ class Fianetfraud extends Module
else else
$orderFianet->billing_user->set_quality_professional(); $orderFianet->billing_user->set_quality_professional();
$orderFianet->billing_user->titre = (($customer->id_gender == 1) ? $this->l('Mr.') : (($customer->id_gender == 2 ) ? $this->l('Mrs') : $this->l('Mr.'))); $gender = new Gender($customer->id_gender);
$orderFianet->billing_user->titre = $gender->name;
$orderFianet->billing_user->nom = utf8_decode($address_invoice->lastname); $orderFianet->billing_user->nom = utf8_decode($address_invoice->lastname);
$orderFianet->billing_user->prenom = utf8_decode($address_invoice->firstname); $orderFianet->billing_user->prenom = utf8_decode($address_invoice->firstname);
$orderFianet->billing_user->societe = utf8_decode($address_invoice->company); $orderFianet->billing_user->societe = utf8_decode($address_invoice->company);
@@ -461,7 +462,8 @@ class Fianetfraud extends Module
else else
$orderFianet->delivery_user->set_quality_professional(); $orderFianet->delivery_user->set_quality_professional();
$orderFianet->delivery_user->titre = (($customer->id_gender == 1) ? $this->l('Mr.') : (($customer->id_gender == 2) ? $this->l('Mrs') : $this->l('Unknown')));
$orderFianet->delivery_user->titre = $gender->name;
$orderFianet->delivery_user->nom = utf8_decode($address_delivery->lastname); $orderFianet->delivery_user->nom = utf8_decode($address_delivery->lastname);
$orderFianet->delivery_user->prenom = utf8_decode($address_delivery->firstname); $orderFianet->delivery_user->prenom = utf8_decode($address_delivery->firstname);
+1 -1
View File
@@ -148,7 +148,7 @@ class FianetSceau extends Module
$user = $control->addChild('utilisateur'); $user = $control->addChild('utilisateur');
$name = $user->addChild('nom', $customer->lastname); $name = $user->addChild('nom', $customer->lastname);
if ($customer->id_gender == 1 OR $customer->id_gender == 2) if ($customer->id_gender)
$name->addAttribute('titre', 1); $name->addAttribute('titre', 1);
$user->addChild('prenom', $customer->firstname); $user->addChild('prenom', $customer->firstname);
$user->addChild('email', $customer->email); $user->addChild('email', $customer->email);
+1 -1
View File
@@ -198,7 +198,7 @@ class importerosc extends ImportModule
if (isset($customer['id_gender']) && array_key_exists($customer['id_gender'], $genderMatch)) if (isset($customer['id_gender']) && array_key_exists($customer['id_gender'], $genderMatch))
$customer['id_gender'] = $genderMatch[$customer['id_gender']]; $customer['id_gender'] = $genderMatch[$customer['id_gender']];
else else
$customer['id_gender'] = 9; $customer['id_gender'] = 0;
return $this->autoFormat($customers, $identifier); return $this->autoFormat($customers, $identifier);
} }
+4 -4
View File
@@ -51,10 +51,10 @@ countries = new Array();
<h3>{l s='Your personal information' mod='paypal'}</h3> <h3>{l s='Your personal information' mod='paypal'}</h3>
<p class="radio required"> <p class="radio required">
<span>{l s='Title'}</span> <span>{l s='Title'}</span>
<input type="radio" name="id_gender" id="id_gender1" value="1" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == 1}checked="checked"{/if} /> {foreach from=$genders key=k item=gender}
<label for="id_gender1" class="top">{l s='Mr.' mod='paypal'}</label> <input type="radio" name="id_gender" id="id_gender{$gender.id_gender}" value="{$gender.id_gender}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender.id_gender}checked="checked"{/if} />
<input type="radio" name="id_gender" id="id_gender2" value="2" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == 2}checked="checked"{/if} /> <label for="id_gender{$gender.id_gender}" class="top">{$gender.name}</label>
<label for="id_gender2" class="top">{l s='Ms.' mod='paypal'}</label> {/foreach}
</p> </p>
<p class="required text"> <p class="required text">
<label for="customer_firstname">{l s='First name' mod='paypal'}</label> <label for="customer_firstname">{l s='First name' mod='paypal'}</label>
+2 -1
View File
@@ -326,7 +326,8 @@ function displayAccount()
'zip' => (Tools::getValue('postcode') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('postcode'))) : (isset($result['SHIPTOZIP']) ? $result['SHIPTOZIP'] : '')), 'zip' => (Tools::getValue('postcode') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('postcode'))) : (isset($result['SHIPTOZIP']) ? $result['SHIPTOZIP'] : '')),
'payerID' => $payerID, 'payerID' => $payerID,
'ppToken' => strval(Context::getContext()->cookie->paypal_token), 'ppToken' => strval(Context::getContext()->cookie->paypal_token),
'errors'=> $errors 'errors'=> $errors,
'genders' => Gender::getGenders(),
)); ));
// Display all and exit // Display all and exit
+2 -16
View File
@@ -102,27 +102,13 @@ class Secuvad_flux
WHERE m.`name` = \''.pSQL($order->module).'\''); WHERE m.`name` = \''.pSQL($order->module).'\'');
$flux_xml = "<transaction>\n"; $flux_xml = "<transaction>\n";
switch ($customer->id_gender)
{
case 1:
$gender = 'M';
break;
case 2:
$gender = 'Mme';
break;
case 3:
$gender = 'Mlle';
break;
default:
$gender = 'M';
break;
}
$gender = new Gender($customer->id_gender);
if($address_invoice->company == '') if($address_invoice->company == '')
$flux_xml .= '<client mode="facturation" qualite="particulier">'."\n"; $flux_xml .= '<client mode="facturation" qualite="particulier">'."\n";
else else
$flux_xml .= '<client mode="facturation" qualite="entreprise">'."\n"; $flux_xml .= '<client mode="facturation" qualite="entreprise">'."\n";
$flux_xml .= '<nom titre="'.$gender .'">'.$address_invoice->lastname.'</nom>'."\n"; $flux_xml .= '<nom titre="'.$gender->name.'">'.$address_invoice->lastname.'</nom>'."\n";
$flux_xml .= '<prenom>'.$address_invoice->firstname.'</prenom>'."\n"; $flux_xml .= '<prenom>'.$address_invoice->firstname.'</prenom>'."\n";
if($address_invoice->company != '') if($address_invoice->company != '')
$flux_xml .= '<societe>'.$address_invoice->company.'</societe>'."\n"; $flux_xml .= '<societe>'.$address_invoice->company.'</societe>'."\n";
+2 -6
View File
@@ -352,11 +352,7 @@ class Socolissimo extends CarrierModule
public function hookExtraCarrier($params) public function hookExtraCarrier($params)
{ {
$customer = new Customer($params['address']->id_customer); $customer = new Customer($params['address']->id_customer);
$gender = array('1'=>'MR','2'=>'MME'); $gender = new Gender($customer->id_gender);
if (in_array((int)($customer->id_gender),array(1,2)))
$cecivility = $gender[(int)($customer->id_gender)];
else
$cecivility = 'MR';
$carrierSo = new Carrier((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID'))); $carrierSo = new Carrier((int)(Configuration::get('SOCOLISSIMO_CARRIER_ID')));
if (isset($carrierSo) AND $carrierSo->active) if (isset($carrierSo) AND $carrierSo->active)
@@ -371,7 +367,7 @@ class Socolissimo extends CarrierModule
'ORDERID' => $orderId, 'ORDERID' => $orderId,
'CENAME' => substr($this->lower($params['address']->lastname),0, 34), 'CENAME' => substr($this->lower($params['address']->lastname),0, 34),
'TRCLIENTNUMBER' => $this->upper((int)($params['address']->id_customer)), 'TRCLIENTNUMBER' => $this->upper((int)($params['address']->id_customer)),
'CECIVILITY' => $cecivility, 'CECIVILITY' => $gender->name,
'CEFIRSTNAME' => substr($this->lower($params['address']->firstname),0,29), 'CEFIRSTNAME' => substr($this->lower($params['address']->firstname),0,29),
'CECOMPANYNAME' => substr($this->upper($params['address']->company),0,38), 'CECOMPANYNAME' => substr($this->upper($params['address']->company),0,38),
'CEEMAIL' => $params['cookie']->email, 'CEEMAIL' => $params['cookie']->email,
@@ -124,17 +124,33 @@ class StatsPersonalInfos extends ModuleGraph
{ {
case 'gender': case 'gender':
$this->_titles['main'] = $this->l('Gender distribution'); $this->_titles['main'] = $this->l('Gender distribution');
$sql = 'SELECT `id_gender`, COUNT(`id_customer`) AS total $genders = array(
FROM `'._DB_PREFIX_.'customer` 0 => $this->l('Male'),
1 => $this->l('Female'),
2 => $this->l('Unknown'),
);
$sql = 'SELECT g.type, c.id_gender, COUNT(c.id_customer) AS total
FROM '._DB_PREFIX_.'customer c
LEFT JOIN '._DB_PREFIX_.'gender g ON c.id_gender = g.id_gender
WHERE 1 WHERE 1
'.$this->sqlShopRestriction(Shop::SHARE_CUSTOMER).' '.$this->sqlShopRestriction(Shop::SHARE_CUSTOMER, 'c').'
GROUP BY `id_gender`'; GROUP BY c.id_gender';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
$gender = array(1 => $this->l('Male'), 2 => $this->l('Female'), 9 => $this->l('Unknown'), 0 => $this->l('Unknown'));
$gendersResults = array();
foreach ($result as $row) foreach ($result as $row)
{ {
$this->_values[] = $row['total']; $type = (is_null($row['type'])) ? 2 : $row['type'];
$this->_legend[] = $gender[$row['id_gender']]; if (!isset($gendersResults[$type]))
$gendersResults[$type] = 0;
$gendersResults[$type] += $row['total'];
}
foreach ($gendersResults as $type => $total)
{
$this->_values[] = $total;
$this->_legend[] = $genders[$type];
} }
break; break;
+7
View File
@@ -0,0 +1,7 @@
<?php
class Gender extends GenderCore
{
}
+9 -9
View File
@@ -146,12 +146,12 @@ $(function(){ldelim}
</p> </p>
<p class="radio required"> <p class="radio required">
<span>{l s='Title'}</span> <span>{l s='Title'}</span>
<input type="radio" name="id_gender" id="id_gender1" value="1" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == '1'}checked="checked"{/if}> {foreach from=$genders key=k item=gender}
<label for="id_gender1" class="top">{l s='Mr.'}</label> <input type="radio" name="id_gender" id="id_gender{$gender.id_gender}" value="{$gender.id_gender}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender.id_gender}checked="checked"{/if} />
<input type="radio" name="id_gender" id="id_gender2" value="2" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == '2'}checked="checked"{/if}> <label for="id_gender{$gender.id_gender}" class="top">{$gender.name}</label>
<label for="id_gender2" class="top">{l s='Ms.'}</label> {/foreach}
</p> </p>
<p class="required text"> <p class="required text">
<label for="firstname">{l s='First name'}</label> <label for="firstname">{l s='First name'}</label>
<input type="text" class="text" id="firstname" name="firstname" onblur="$('#customer_firstname').val($(this).val());" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}"> <input type="text" class="text" id="firstname" name="firstname" onblur="$('#customer_firstname').val($(this).val());" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}">
<input type="hidden" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}"> <input type="hidden" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}">
@@ -309,10 +309,10 @@ $(function(){ldelim}
<h3>{l s='Your personal information'}</h3> <h3>{l s='Your personal information'}</h3>
<p class="radio required"> <p class="radio required">
<span>{l s='Title'}</span> <span>{l s='Title'}</span>
<input type="radio" name="id_gender" id="id_gender1" value="1" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == 1}checked="checked"{/if} /> {foreach from=$genders key=k item=gender}
<label for="id_gender1" class="top">{l s='Mr.'}</label> <input type="radio" name="id_gender" id="id_gender{$gender.id_gender}" value="{$gender.id_gender}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender.id_gender}checked="checked"{/if} />
<input type="radio" name="id_gender" id="id_gender2" value="2" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == 2}checked="checked"{/if} /> <label for="id_gender{$gender.id_gender}" class="top">{$gender.name}</label>
<label for="id_gender2" class="top">{l s='Ms.'}</label> {/foreach}
</p> </p>
<p class="required text"> <p class="required text">
<label for="customer_firstname">{l s='First name'}</label> <label for="customer_firstname">{l s='First name'}</label>
+4 -4
View File
@@ -43,10 +43,10 @@
<fieldset> <fieldset>
<p class="radio"> <p class="radio">
<span>{l s='Title'}</span> <span>{l s='Title'}</span>
<input type="radio" id="id_gender1" name="id_gender" value="1" {if $smarty.post.id_gender == 1 OR !$smarty.post.id_gender}checked="checked"{/if} /> {foreach from=$genders key=k item=gender}
<label for="id_gender1">{l s='Mr.'}</label> <input type="radio" name="id_gender" id="id_gender{$gender.id_gender}" value="{$gender.id_gender}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender.id_gender}checked="checked"{/if} />
<input type="radio" id="id_gender2" name="id_gender" value="2" {if $smarty.post.id_gender == 2}checked="checked"{/if} /> <label for="id_gender{$gender.id_gender}" class="top">{$gender.name}</label>
<label for="id_gender2">{l s='Ms.'}</label> {/foreach}
</p> </p>
<p class="required text"> <p class="required text">
<label for="firstname">{l s='First name'}</label> <label for="firstname">{l s='First name'}</label>
+4 -4
View File
@@ -140,10 +140,10 @@
</p> </p>
<p class="radio required"> <p class="radio required">
<span>{l s='Title'}</span> <span>{l s='Title'}</span>
<input type="radio" name="id_gender" id="id_gender1" value="1" {if isset($guestInformations) && $guestInformations.id_gender == 1}checked="checked"{/if} /> {foreach from=$genders key=k item=gender}
<label for="id_gender1" class="top">{l s='Mr.'}</label> <input type="radio" name="id_gender" id="id_gender{$gender.id_gender}" value="{$gender.id_gender}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender.id_gender}checked="checked"{/if} />
<input type="radio" name="id_gender" id="id_gender2" value="2" {if isset($guestInformations) && $guestInformations.id_gender == 2}checked="checked"{/if} /> <label for="id_gender{$gender.id_gender}" class="top">{$gender.name}</label>
<label for="id_gender2" class="top">{l s='Ms.'}</label> {/foreach}
</p> </p>
<p class="required text"> <p class="required text">
<label for="firstname">{l s='First name'}</label> <label for="firstname">{l s='First name'}</label>