Commit 48680c56 authored by Яков's avatar Яков
Browse files

first

parents
<?php
if($product->getSupplierId() != '')
{
echo $product->getSuppliers()->getOrg();
}
\ No newline at end of file
<?php
include_partial('main/title', array('elem' => $product));
?>
\ No newline at end of file
<?php
$available = $product->getTranslation()->en->available;
if($available)
{
echo $product->getTranslation()->en->title;
}
else
{
echo '<div class="notActive">Не активно</div>';
}
\ No newline at end of file
<?php
$available = $product->getTranslation()->ru->available;
if($available)
{
echo $product->getTranslation()->ru->title;
}
else
{
echo '<div class="notActive">Не активно</div>';
}
\ No newline at end of file
<?php
require_once dirname(__FILE__) . '/../lib/product_propGeneratorConfiguration.class.php';
require_once dirname(__FILE__) . '/../lib/product_propGeneratorHelper.class.php';
/**
* product_prop actions.
*
* @package sf
* @subpackage product_prop
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_propActions extends autoProduct_propActions
{
protected function buildQuery()
{
$query = parent::buildQuery();
$query->leftJoin("r.Translation t");
return $query;
}
public function executeAjax_delete(sfWebRequest $request)
{
if ($request->hasParameter('id')) {
$id = $request->getParameter('id');
$elem = Doctrine::getTable("ProductPropList")->find($id);
if ($elem) {
$elem->delete();
$response['status'] = 'success';
} else {
$response['status'] = 'error';
$response['errorText'] = 'Не удалось удалить обьект';
}
} else {
$response['status'] = 'error';
$response['errorText'] = 'Не переданы необходимые параметры';
}
echo json_encode($response);
return sfView::NONE;
}
}
generator:
class: sfDoctrineGenerator
param:
model_class: ProductProp
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: product_prop
with_doctrine_route: true
actions_base_class: sfActions
order: 20
config:
actions: ~
fields:
title: {label: 'Название'}
title_ru: {label: 'Название RU'}
title_en: {label: 'Название EN'}
isList: {label: 'Значения справочника'}
created_at: {label: Дата создания}
list:
layout: ~
title: 'Характеристики товара'
display: [_title, isList]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: [title]
export: false
filter:
class: false
form: ~
edit:
title: Редактирование параметра
new:
title: Добавление параметра
\ No newline at end of file
<?php
/**
* product_prop module configuration.
*
* @package sf
* @subpackage product_prop
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_propGeneratorConfiguration extends BaseProduct_propGeneratorConfiguration
{
}
<?php
/**
* product_prop module helper.
*
* @package sf
* @subpackage product_prop
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_propGeneratorHelper extends BaseProduct_propGeneratorHelper
{
}
<?php
if ($prop->getIsList() && count($prop->getProductPropList()) > 0) { ?>
<?php
$strValue = $value->getTranslation()->ru->value;
$list = $prop->getProductPropList();
?>
<select name="<?php echo $baseFieldName . '[' . $prop['id'] . ']'; ?>">
<?php $selected = ($strValue == 0) ? ' selected="selected"' : '' ?>
<option value="0" <?php echo $selected; ?>></option>
<?php foreach ($list as $list_elem) { ?>
<?php $selected = ($strValue == $list_elem->getId()) ? ' selected="selected"' : '' ?>
<option value="<?php echo $list_elem->getId() ?>" <?php echo $selected ?>>
<?php echo $list_elem->getTranslation()->ru->variant; ?>
</option>
<?php } ?>
</select>
<?php } else { ?>
<table cellpadding="0" cellspacing="0" width="100" class="noStyleTable">
<tr>
<td>РУ</td>
<td>
<?php
echo '<input size="8" maxlength="8" name="' . $baseFieldName . '[' . $prop["id"] . '][ru]" value="' . $value->getTranslation()->ru->value . '" type="text"><i class="br5"></i>';
?>
</td>
</tr>
<tr>
<td>EN</td>
<td>
<?php
echo '<input size="8" maxlength="8" name="' . $baseFieldName . '[' . $prop["id"] . '][en]" value="' . $value->getTranslation()->en->value . '" type="text"><i class="br5"></i>';
?>
</td>
</tr>
</table>
<?php } ?>
<?php
$obj = $form->getObject();
if (!$form->isNew()) {
$list = $obj->getProductPropList();
?>
<div class="list">
<?php
if (count($list) > 0) {
echo '<table cellspacing="0" cellpadding="0" class="adminTable">';
echo '<tr><th>Значения</th><th></th></tr>';
foreach ($list as $list_elem) {
?>
<tr>
<td><?php
$arr = array();
foreach ($list_elem->getTranslation() as $t) {
$html = '<div class="ru_en_title">';
if (!isset($t['available']) || $t['available']) {
$html .= '<span class="small_gray">' . mb_strtoupper($t['lang']) . ':</span>' . $t['variant'] . '</div>';
if ($t['lang'] == 'ru') {
array_unshift($arr, $html);
} else {
$arr[] = $html;
}
}
}
echo implode('<i class="br5"></i>', $arr);
?></td>
<td>
<a class="custom_button custom_button_edit"
href="<?php echo url_for('@product_prop_list_edit?id=' . $list_elem->getId()) ?>"></a>
<a class="custom_button custom_button_delete"
onclick="propList.delete($(this) ,'<?php echo $list_elem->getId() ?>')"></a>
</td>
</tr>
<?php
}
echo '</table><i class="br15"></i>';
}
?>
<a class='green_btn' href='<?php echo url_for('@product_prop_list_new') . "?prop_id=" . $obj->getId() ?>'>Добавить значение</a>
</div>
<script type="text/javascript">
function listSwicher() {
if ($("input[name='product_prop[isList]']").prop('checked')) {
$('.list').show();
}
else {
$('.list').hide();
}
}
$("input[name='product_prop[isList]']").change(listSwicher);
$(document).ready(listSwicher)
</script>
<?php
}
?>
\ No newline at end of file
<?php
echo $product_prop->getTranslation()->ru->title;
?>
\ No newline at end of file
<?php
echo $product_prop->getTranslation()->en->title;
<?php
echo $product_prop->getTranslation()->ru->title;
<?php
require_once dirname(__FILE__).'/../lib/product_prop_listGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/product_prop_listGeneratorHelper.class.php';
/**
* product_prop_list actions.
*
* @package sf
* @subpackage product_prop_list
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_prop_listActions extends autoProduct_prop_listActions
{
public function executeNew(sfWebRequest $request)
{
$this->form = $this->configuration->getForm();
$this->product_prop_list = $this->form->getObject();
if (is_numeric($request->getParameter('prop_id')))
{
$this->form->setDefault('product_prop_id', $request->getParameter('prop_id'));
}
}
}
generator:
class: sfDoctrineGenerator
param:
model_class: ProductPropList
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: product_prop_list
with_doctrine_route: true
actions_base_class: sfActions
skip: true
order: 30
config:
actions: ~
fields:
id: {label: ''}
inner_id: {label: 'inner_id'}
title: {label: 'Значение'}
variant: {label: 'Значение'}
ProductProp: {label: 'Параметр товара'}
product_prop_id: {label: 'Параметр товара'}
created_at: {label: 'Дата создания'}
updated_at: {label: 'Дата изменения'}
list:
layout: ~
title: 'Значения справочника'
display: [_title, ProductProp]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: false
export: false
filter:
class: false
form: ~
edit:
title: Редактирование значения
new:
title: Добавление значения
\ No newline at end of file
<?php
/**
* product_prop_list module configuration.
*
* @package sf
* @subpackage product_prop_list
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_prop_listGeneratorConfiguration extends BaseProduct_prop_listGeneratorConfiguration
{
}
<?php
/**
* product_prop_list module helper.
*
* @package sf
* @subpackage product_prop_list
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_prop_listGeneratorHelper extends BaseProduct_prop_listGeneratorHelper
{
}
<?php
include_partial('main/title', array('elem' => $product_prop_list));
?>
\ No newline at end of file
<?php
require_once dirname(__FILE__).'/../lib/product_prop_valueGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/product_prop_valueGeneratorHelper.class.php';
/**
* product_prop_value actions.
*
* @package sf
* @subpackage product_prop_value
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_prop_valueActions extends autoProduct_prop_valueActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: ProductPropValue
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: product_prop_value
with_doctrine_route: true
actions_base_class: sfActions
order: 40
hr: true
skip: true
config:
actions: ~
fields:
id: {label: ''}
Product: {label: 'Товар'}
product_id: {label: 'Товар'}
ProductProp: {label: 'Характеристика'}
prop_id: {label: 'Характеристика'}
Offer: {label: 'Предложение'}
offer_id: {label: 'Предложение'}
created_at: {label: ''}
updated_at: {label: ''}
list:
layout: ~
title: 'Значения'
display: [Product, Offer, ProductProp]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: false
export: false
filter:
class: false
form: ~
edit:
title: Редактирование
new:
title: Добавление
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment