Merge branch 'master' into tax
Conflicts: core/lib/Thelia/Core/Template/Loop/FeatureValue.php core/lib/Thelia/Model/Base/AttributeTemplate.php core/lib/Thelia/Model/Base/AttributeTemplateQuery.php core/lib/Thelia/Model/Map/AttributeTemplateTableMap.php install/thelia.sql local/config/schema.xml
This commit is contained in:
54
core/lib/Thelia/Form/CategoryDocumentModification.php
Normal file
54
core/lib/Thelia/Form/CategoryDocumentModification.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\DocumentModification;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process an document collection
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CategoryDocumentModification extends DocumentModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_category_document_modification';
|
||||
}
|
||||
}
|
||||
53
core/lib/Thelia/Form/CategoryImageModification.php
Normal file
53
core/lib/Thelia/Form/CategoryImageModification.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process an image collection
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CategoryImageModification extends ImageModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_category_image_modification';
|
||||
}
|
||||
}
|
||||
54
core/lib/Thelia/Form/ContentDocumentModification.php
Normal file
54
core/lib/Thelia/Form/ContentDocumentModification.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\DocumentModification;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process a file
|
||||
*
|
||||
* @package File
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class ContentDocumentModification extends DocumentModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_content_document_modification';
|
||||
}
|
||||
}
|
||||
53
core/lib/Thelia/Form/ContentImageModification.php
Normal file
53
core/lib/Thelia/Form/ContentImageModification.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process an image collection
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class ContentImageModification extends ImageModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_content_image_modification';
|
||||
}
|
||||
}
|
||||
54
core/lib/Thelia/Form/FolderDocumentModification.php
Normal file
54
core/lib/Thelia/Form/FolderDocumentModification.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\DocumentModification;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process a file
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class FolderDocumentModification extends DocumentModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_folder_document_modification';
|
||||
}
|
||||
}
|
||||
53
core/lib/Thelia/Form/FolderImageModification.php
Normal file
53
core/lib/Thelia/Form/FolderImageModification.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process an image collection
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class FolderImageModification extends ImageModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_folder_image_modification';
|
||||
}
|
||||
}
|
||||
138
core/lib/Thelia/Form/Image/DocumentModification.php
Normal file
138
core/lib/Thelia/Form/Image/DocumentModification.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form\Image;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Validator\Constraints\Image;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\BaseForm;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process a file
|
||||
* @todo refactor make all document using propel inheritance and factorise image behaviour into one single clean action
|
||||
*
|
||||
* @package File
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
abstract class DocumentModification extends BaseForm
|
||||
{
|
||||
/**
|
||||
*
|
||||
* in this function you add all the fields you need for your Form.
|
||||
* Form this you have to call add method on $this->form attribute :
|
||||
*
|
||||
* $this->form->add('name', 'text')
|
||||
* ->add('email', 'email', array(
|
||||
* 'attr' => array(
|
||||
* 'class' => 'field'
|
||||
* ),
|
||||
* 'label' => 'email',
|
||||
* 'constraints' => array(
|
||||
* new NotBlank()
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* ->add('age', 'integer');
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder->add(
|
||||
'file',
|
||||
'file',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Replace current document by this file'),
|
||||
'label_attr' => array(
|
||||
'for' => 'file'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'title',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
),
|
||||
'label' => Translator::getInstance()->trans('Title'),
|
||||
'label_attr' => array(
|
||||
'for' => 'title'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'description',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Description'),
|
||||
'label_attr' => array(
|
||||
'for' => 'description'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'chapo',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Chapo'),
|
||||
'label_attr' => array(
|
||||
'for' => 'chapo'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'postscriptum',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Post Scriptum'),
|
||||
'label_attr' => array(
|
||||
'for' => 'postscriptum'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'postscriptum',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Post Scriptum'),
|
||||
'label_attr' => array(
|
||||
'for' => 'postscriptum'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
146
core/lib/Thelia/Form/Image/ImageModification.php
Normal file
146
core/lib/Thelia/Form/Image/ImageModification.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form\Image;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Validator\Constraints\Image;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\BaseForm;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process an image
|
||||
* @todo refactor make all pictures using propel inheritance and factorise image behaviour into one single clean action
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
abstract class ImageModification extends BaseForm
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* in this function you add all the fields you need for your Form.
|
||||
* Form this you have to call add method on $this->form attribute :
|
||||
*
|
||||
* $this->form->add('name', 'text')
|
||||
* ->add('email', 'email', array(
|
||||
* 'attr' => array(
|
||||
* 'class' => 'field'
|
||||
* ),
|
||||
* 'label' => 'email',
|
||||
* 'constraints' => array(
|
||||
* new NotBlank()
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* ->add('age', 'integer');
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder->add(
|
||||
'file',
|
||||
'file',
|
||||
array(
|
||||
'constraints' => array(
|
||||
new Image(
|
||||
array(
|
||||
// 'minWidth' => 200,
|
||||
// 'minHeight' => 200
|
||||
)
|
||||
)
|
||||
),
|
||||
'label' => Translator::getInstance()->trans('Replace current image by this file'),
|
||||
'label_attr' => array(
|
||||
'for' => 'file'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'title',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
),
|
||||
'label' => Translator::getInstance()->trans('Title'),
|
||||
'label_attr' => array(
|
||||
'for' => 'title'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'description',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Description'),
|
||||
'label_attr' => array(
|
||||
'for' => 'description'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'chapo',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Chapo'),
|
||||
'label_attr' => array(
|
||||
'for' => 'chapo'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'postscriptum',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Post Scriptum'),
|
||||
'label_attr' => array(
|
||||
'for' => 'postscriptum'
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
'postscriptum',
|
||||
'text',
|
||||
array(
|
||||
'constraints' => array(),
|
||||
'label' => Translator::getInstance()->trans('Post Scriptum'),
|
||||
'label_attr' => array(
|
||||
'for' => 'postscriptum'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -47,25 +47,48 @@ class ProductCreationForm extends BaseForm
|
||||
"label_attr" => array("for" => "ref")
|
||||
))
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => "Product title *",
|
||||
"label_attr" => array("for" => "title")
|
||||
))
|
||||
->add("default_category", "integer", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Default product category."),
|
||||
"label" => Translator::getInstance()->trans("Default product category *"),
|
||||
"label_attr" => array("for" => "default_category_field")
|
||||
))
|
||||
->add("locale", "text", array(
|
||||
"constraints" => array(new NotBlank())
|
||||
))
|
||||
->add("visible", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("This product is online."),
|
||||
"label" => Translator::getInstance()->trans("This product is online"),
|
||||
"label_attr" => array("for" => "visible_field")
|
||||
))
|
||||
;
|
||||
;
|
||||
|
||||
if (! $change_mode) {
|
||||
$this->formBuilder
|
||||
->add("price", "number", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Product base price excluding taxes *"),
|
||||
"label_attr" => array("for" => "price_field")
|
||||
))
|
||||
->add("currency", "integer", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Price currency *"),
|
||||
"label_attr" => array("for" => "currency_field")
|
||||
))
|
||||
->add("tax_rule", "integer", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Tax rule for this product *"),
|
||||
"label_attr" => array("for" => "tax_rule_field")
|
||||
))
|
||||
->add("weight", "number", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Weight *"),
|
||||
"label_attr" => array("for" => "weight_field")
|
||||
))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkDuplicateRef($value, ExecutionContextInterface $context)
|
||||
|
||||
90
core/lib/Thelia/Form/ProductDetailsModificationForm.php
Normal file
90
core/lib/Thelia/Form/ProductDetailsModificationForm.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class ProductDetailsModificationForm extends BaseForm
|
||||
{
|
||||
use StandardDescriptionFieldsTrait;
|
||||
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("id", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("Prodcut ID *"),
|
||||
"label_attr" => array("for" => "product_id_field"),
|
||||
"constraints" => array(new GreaterThan(array('value' => 0)))
|
||||
))
|
||||
->add("price", "number", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Product base price excluding taxes *"),
|
||||
"label_attr" => array("for" => "price_field")
|
||||
))
|
||||
->add("price_with_tax", "number", array(
|
||||
"label" => Translator::getInstance()->trans("Product base price including taxes *"),
|
||||
"label_attr" => array("for" => "price_with_tax_field")
|
||||
))
|
||||
->add("currency", "integer", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Price currency *"),
|
||||
"label_attr" => array("for" => "currency_field")
|
||||
))
|
||||
->add("tax_rule", "integer", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Tax rule for this product *"),
|
||||
"label_attr" => array("for" => "tax_rule_field")
|
||||
))
|
||||
->add("weight", "number", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Weight *"),
|
||||
"label_attr" => array("for" => "weight_field")
|
||||
))
|
||||
->add("quantity", "number", array(
|
||||
"constraints" => array(new NotBlank()),
|
||||
"label" => Translator::getInstance()->trans("Current quantity *"),
|
||||
"label_attr" => array("for" => "quantity_field")
|
||||
))
|
||||
->add("sale_price", "number", array(
|
||||
"label" => Translator::getInstance()->trans("Sale price *"),
|
||||
"label_attr" => array("for" => "price_with_tax_field")
|
||||
))
|
||||
->add("onsale", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("This product is on sale"),
|
||||
"label_attr" => array("for" => "onsale_field")
|
||||
))
|
||||
->add("isnew", "integer", array(
|
||||
"label" => Translator::getInstance()->trans("Advertise this product as new"),
|
||||
"label_attr" => array("for" => "isnew_field")
|
||||
))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_product_details_modification";
|
||||
}
|
||||
}
|
||||
54
core/lib/Thelia/Form/ProductDocumentModification.php
Normal file
54
core/lib/Thelia/Form/ProductDocumentModification.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\DocumentModification;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process a file
|
||||
*
|
||||
* @package File
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class ProductDocumentModification extends DocumentModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_product_document_modification';
|
||||
}
|
||||
}
|
||||
53
core/lib/Thelia/Form/ProductImageModification.php
Normal file
53
core/lib/Thelia/Form/ProductImageModification.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
namespace Thelia\Form;
|
||||
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\Image\ImageModification;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 9/18/13
|
||||
* Time: 3:56 PM
|
||||
*
|
||||
* Form allowing to process an image collection
|
||||
*
|
||||
* @package Image
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class ProductImageModification extends ImageModification
|
||||
{
|
||||
|
||||
/**
|
||||
* Get form name
|
||||
* This name must be unique
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'thelia_product_image_modification';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user