Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordQuery;
use Thelia\Form\BaseForm;
class KeywordCategoryModificationForm extends BaseForm
{
protected function buildForm()
{
$keywordList = array();
foreach (KeywordQuery::create()->find() as $keyword) {
$keywordList[$keyword->getId()] = $keyword->getId();
}
$this->formBuilder
->add("keyword_list", "choice", array(
"choices" => $keywordList,
"multiple" => true
))
;
}
public function getName()
{
return 'keyword_category_modification';
}
}

View File

@@ -0,0 +1,50 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordQuery;
use Thelia\Form\BaseForm;
class KeywordContentModificationForm extends BaseForm
{
protected function buildForm()
{
$keywordList = array();
foreach (KeywordQuery::create()->find() as $keyword) {
$keywordList[$keyword->getId()] = $keyword->getId();
}
$this->formBuilder
->add("keyword_list", "choice", array(
"choices" => $keywordList,
"multiple" => true
))
;
}
public function getName()
{
return 'keyword_content_modification';
}
}

View File

@@ -0,0 +1,96 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordQuery;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints;
class KeywordCreationForm extends BaseForm
{
protected function buildForm()
{
$this->formBuilder
->add('title', 'text', array(
'constraints' => array(
new NotBlank()
),
'label' => Translator::getInstance()->trans('Title'),
'label_attr' => array(
'for' => 'keyword_title'
)
))
->add('code', 'text', array(
'constraints' => array(
new NotBlank(),
new Callback(array(
"methods" => array(
array($this, "verifyExistingCode")
)
))
),
'label' => Translator::getInstance()->trans('Unique identifier', array(), 'keyword'),
'label_attr' => array(
'for' => 'keyword_code'
)
))
->add("keyword_group_id", "integer", array(
"constraints" => array(
new GreaterThan(array(
'value' => 0
))
)
))
->add('visible', 'integer', array(
'label' => Translator::getInstance()->trans('Visible ?'),
'label_attr' => array(
'for' => 'keyword_visible'
)
))
->add("locale", "text", array(
"constraints" => array(
new NotBlank()
)
))
;
}
public function verifyExistingCode($value, ExecutionContextInterface $context)
{
$keyword = KeywordQuery::getKeywordByCode($value);
if ($keyword) {
$context->addViolation("This keyword identifier already exist.");
}
}
public function getName()
{
return 'admin_keyword_creation';
}
}

View File

@@ -0,0 +1,50 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordQuery;
use Thelia\Form\BaseForm;
class KeywordFolderModificationForm extends BaseForm
{
protected function buildForm()
{
$keywordList = array();
foreach (KeywordQuery::create()->find() as $keyword) {
$keywordList[$keyword->getId()] = $keyword->getId();
}
$this->formBuilder
->add("keyword_list", "choice", array(
"choices" => $keywordList,
"multiple" => true
))
;
}
public function getName()
{
return 'keyword_folder_modification';
}
}

View File

@@ -0,0 +1,88 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordGroupQuery;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints;
class KeywordGroupCreationForm extends BaseForm
{
protected function buildForm()
{
$this->formBuilder
->add('title', 'text', array(
'constraints' => array(
new NotBlank()
),
'label' => Translator::getInstance()->trans('Title'),
'label_attr' => array(
'for' => 'keyword_title'
)
))
->add('code', 'text', array(
'constraints' => array(
new NotBlank(),
new Callback(array(
"methods" => array(
array($this, "verifyExistingCode")
)
))
),
'label' => Translator::getInstance()->trans('Unique identifier', array(), 'keyword'),
'label_attr' => array(
'for' => 'keyword_code'
)
))
->add('visible', 'integer', array(
'label' => Translator::getInstance()->trans('Visible ?'),
'label_attr' => array(
'for' => 'keyword_visible'
)
))
->add("locale", "text", array(
"constraints" => array(
new NotBlank()
)
))
;
}
public function verifyExistingCode($value, ExecutionContextInterface $context)
{
$keywordGroup = KeywordGroupQuery::getKeywordGroupByCode($value);
if ($keywordGroup) {
$context->addViolation("This keyword group identifier already exist.");
}
}
public function getName()
{
return 'admin_keyword_group_creation';
}
}

View File

@@ -0,0 +1,69 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordGroupQuery;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Form\StandardDescriptionFieldsTrait;
/**
* Class KeywordGroupModificationForm
* @package Thelia\Form
* @author Michaël Espeche <mespeche@openstudio.fr>
*/
class KeywordGroupModificationForm extends KeywordGroupCreationForm
{
use StandardDescriptionFieldsTrait;
protected function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
;
// Add standard description fields, excluding title and locale, which a re defined in parent class
$this->addStandardDescFields(array('title', 'locale'));
}
public function verifyExistingCode($value, ExecutionContextInterface $context)
{
$keywordGroupId = $this->getRequest()->get('keyword_group_id');
$keywordGroupUpdated = KeywordGroupQuery::create()->findPk($keywordGroupId);
// If the sent code isn't identical to the keyword group code being updated
if ($keywordGroupUpdated->getCode() !== $value) {
// Check if code keyword with this code exist
parent::verifyExistingCode($value, $context);
}
}
public function getName()
{
return "admin_keyword_group_modification";
}
}

View File

@@ -0,0 +1,82 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordQuery;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Form\StandardDescriptionFieldsTrait;
/**
* Class KeywordModificationForm
* @package Thelia\Form
* @author Michaël Espeche <mespeche@openstudio.fr>
*/
class KeywordModificationForm extends KeywordCreationForm
{
use StandardDescriptionFieldsTrait;
protected function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
->add("keyword_group_id", "integer", array(
"constraints" => array(
new GreaterThan(
array('value' => 0)
)
),
'label' => Translator::getInstance()->trans('Change keyword group', array(), 'keyword'),
'label_attr' => array(
'for' => 'keyword_group_id'
)
)
)
;
// Add standard description fields, excluding title and locale, which a re defined in parent class
$this->addStandardDescFields(array('title', 'locale'));
}
public function verifyExistingCode($value, ExecutionContextInterface $context)
{
$keywordId = $this->getRequest()->get('keyword_id');
$keywordUpdated = KeywordQuery::create()->findPk($keywordId);
// If the sent code isn't identical to the keyword code being updated
if ($keywordUpdated->getCode() !== $value) {
// Check if code keyword with this code exist
parent::verifyExistingCode($value, $context);
}
}
public function getName()
{
return "admin_keyword_modification";
}
}

View File

@@ -0,0 +1,50 @@
<?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 Keyword\Form;
use Keyword\Model\KeywordQuery;
use Thelia\Form\BaseForm;
class KeywordProductModificationForm extends BaseForm
{
protected function buildForm()
{
$keywordList = array();
foreach (KeywordQuery::create()->find() as $keyword) {
$keywordList[$keyword->getId()] = $keyword->getId();
}
$this->formBuilder
->add("keyword_list", "choice", array(
"choices" => $keywordList,
"multiple" => true
))
;
}
public function getName()
{
return 'keyword_product_modification';
}
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="KeywordCategoryModificationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordContentModificationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordCreationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordFolderModificationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordGroupCreationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordGroupModificationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordModificationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
<file name="KeywordProductModificationForm.php" server="51.254.220.106//web/" local="131360630400000000" remote="131360630400000000" />
</dwsync>