[*] BO #PSFV-94 : update of the displayform method by helperForm in AdminQuickAccessesController

This commit is contained in:
lLefevre
2011-10-14 08:57:52 +00:00
parent d79fcf00fb
commit 4b55e21167
7 changed files with 181 additions and 139 deletions
+22 -23
View File
@@ -1,6 +1,6 @@
<?php
/*
* 2007-2011 PrestaShop
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
@@ -28,33 +28,32 @@
class OrderMessageCore extends ObjectModel
{
/** @var string name name */
public $name;
/** @var string message content */
public $message;
/** @var string Object creation date */
public $date_add;
protected $fieldsRequired = array();
protected $fieldsValidate = array();
protected $fieldsSize = array();
public $name;
protected $fieldsRequiredLang = array('name', 'message');
protected $fieldsSizeLang = array('name' => 128, 'message' => 1200);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'message' => 'isMessage');
protected $table = 'order_message';
protected $identifier = 'id_order_message';
protected $webserviceParameters = array(
/** @var string message content */
public $message;
/** @var string Object creation date */
public $date_add;
protected $fieldsRequired = array();
protected $fieldsValidate = array();
protected $fieldsSize = array();
protected $fieldsRequiredLang = array('name', 'message');
protected $fieldsSizeLang = array('name' => 128, 'message' => 1200);
protected $fieldsValidateLang = array('name' => 'isGenericName', 'message' => 'isMessage');
protected $table = 'order_message';
protected $identifier = 'id_order_message';
protected $webserviceParameters = array(
'fields' => array(
'id' => array('sqlId' => 'id_discount_type', 'xlink_resource' => 'order_message_lang'),
'date_add' => array('sqlId' => 'date_add')
)
);
public function getFields()
{
$this->validateFields();
@@ -73,7 +72,7 @@ class OrderMessageCore extends ObjectModel
SELECT om.id_order_message, oml.name, oml.message
FROM '._DB_PREFIX_.'order_message om
LEFT JOIN '._DB_PREFIX_.'order_message_lang oml ON (oml.id_order_message = om.id_order_message)
WHERE oml.id_lang = '.(int)($id_lang).'
WHERE oml.id_lang = '.(int)$id_lang.'
ORDER BY name ASC');
}
}
+21 -21
View File
@@ -28,32 +28,32 @@
class QuickAccessCore extends ObjectModel
{
/** @var string Name */
public $name;
/** @var string Link */
public $link;
/** @var boolean New windows or not */
public $new_window;
protected $fieldsRequired = array('link', 'new_window');
protected $fieldsSize = array('link' => 128);
protected $fieldsValidate = array('link' => 'isUrl', 'new_window' => 'isBool');
protected $fieldsRequiredLang = array('name');
protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName');
public $name;
/** @var string Link */
public $link;
/** @var boolean New windows or not */
public $new_window;
protected $fieldsRequired = array('link', 'new_window');
protected $fieldsSize = array('link' => 128);
protected $fieldsValidate = array('link' => 'isUrl', 'new_window' => 'isBool');
protected $fieldsRequiredLang = array('name');
protected $fieldsSizeLang = array('name' => 32);
protected $fieldsValidateLang = array('name' => 'isGenericName');
protected $table = 'quick_access';
protected $identifier = 'id_quick_access';
protected $table = 'quick_access';
protected $identifier = 'id_quick_access';
public function getFields()
{
$this->validateFields();
$fields['link'] = pSQL($this->link);
$fields['new_window'] = (int)($this->new_window);
$fields['new_window'] = (int)$this->new_window;
return $fields;
}
/**
* Check then return multilingual fields for database interaction
*
@@ -64,7 +64,7 @@ class QuickAccessCore extends ObjectModel
$this->validateFieldsLang();
return $this->getTranslationsFields(array('name'));
}
/**
* Get all available quick_accesses
*
@@ -75,7 +75,7 @@ class QuickAccessCore extends ObjectModel
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT *
FROM `'._DB_PREFIX_.'quick_access` qa
LEFT JOIN `'._DB_PREFIX_.'quick_access_lang` qal ON (qa.`id_quick_access` = qal.`id_quick_access` AND qal.`id_lang` = '.(int)($id_lang).')
LEFT JOIN `'._DB_PREFIX_.'quick_access_lang` qal ON (qa.`id_quick_access` = qal.`id_quick_access` AND qal.`id_lang` = '.(int)$id_lang.')
ORDER BY `name` ASC');
}
}