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

first

parents
<?php
/**
* product_prop_value module configuration.
*
* @package sf
* @subpackage product_prop_value
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_prop_valueGeneratorConfiguration extends BaseProduct_prop_valueGeneratorConfiguration
{
}
<?php
/**
* product_prop_value module helper.
*
* @package sf
* @subpackage product_prop_value
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class product_prop_valueGeneratorHelper extends BaseProduct_prop_valueGeneratorHelper
{
}
<?php
require_once dirname(__FILE__).'/../lib/reviewGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/reviewGeneratorHelper.class.php';
/**
* review actions.
*
* @package sf
* @subpackage review
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class reviewActions extends autoReviewActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: Review
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: review
with_doctrine_route: true
actions_base_class: sfActions
order: 70
config:
actions: ~
fields:
name: {label: Имя}
phone: {label: Телефон}
body: {label: Текст}
file: {label: Изображение}
lang: {label: Язык}
created_at: {label: Дата}
is_activated: {label: Опубликован}
tags_list: {label: 'Теги'}
list:
layout: ~
title: 'Отзывы'
display: [name, phone, lang, is_activated, created_at]
max_per_page: 100
sort: [created_at, DESC]
object_actions:
_delete: ~
_edit: ~
search:
fields: [name, phone]
export: false
filter:
class: false
form: ~
edit:
title: Редактирование отзыва
new:
title: Добавление отзыва
tabs:
0: {label: 'Неопубликованные', where: 'r.is_activated = 0'}
1: {label: 'Опубликованные', where: 'r.is_activated = 1'}
\ No newline at end of file
<?php
/**
* review module configuration.
*
* @package sf
* @subpackage review
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class reviewGeneratorConfiguration extends BaseReviewGeneratorConfiguration
{
}
<?php
/**
* review module helper.
*
* @package sf
* @subpackage review
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class reviewGeneratorHelper extends BaseReviewGeneratorHelper
{
}
<?php
require_once dirname(__FILE__).'/../lib/suppliersGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/suppliersGeneratorHelper.class.php';
/**
* suppliers actions.
*
* @package sf
* @subpackage suppliers
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class suppliersActions extends autoSuppliersActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: Suppliers
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: suppliers
with_doctrine_route: true
actions_base_class: sfActions
order: 45
hr: true
config:
actions: ~
fields:
org: {label: Организация}
fio: {label: ФИО}
email: {label: Эл. почта}
phone: {label: Телефон}
created_at: {label: Дата создания}
list:
layout: ~
title: 'Поставщики'
display: [org, fio, phone, email]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: [org, fio]
export: false
filter:
class: false
form: ~
edit:
title: Редактирование поставщика
new:
title: Добавление поставщика
\ No newline at end of file
<?php
/**
* suppliers module configuration.
*
* @package sf
* @subpackage suppliers
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class suppliersGeneratorConfiguration extends BaseSuppliersGeneratorConfiguration
{
}
<?php
/**
* suppliers module helper.
*
* @package sf
* @subpackage suppliers
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class suppliersGeneratorHelper extends BaseSuppliersGeneratorHelper
{
}
<?php
require_once dirname(__FILE__).'/../lib/tagGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/tagGeneratorHelper.class.php';
/**
* tag actions.
*
* @package sf
* @subpackage tag
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class tagActions extends autoTagActions
{
protected function buildQuery()
{
$query = parent::buildQuery();
$query->leftJoin("r.Translation t");
return $query;
}
}
generator:
class: sfDoctrineGenerator
param:
model_class: Tag
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: tag
with_doctrine_route: true
actions_base_class: sfActions
order: 45
hr: true
config:
actions: ~
fields:
title: {label: 'Название'}
title_ru: {label: 'Название RU'}
title_en: {label: 'Название EN'}
created_at: {label: 'Дата создания'}
list:
layout: ~
title: 'Теги'
display: [_title]
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
/**
* tag module configuration.
*
* @package sf
* @subpackage tag
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class tagGeneratorConfiguration extends BaseTagGeneratorConfiguration
{
}
<?php
/**
* tag module helper.
*
* @package sf
* @subpackage tag
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class tagGeneratorHelper extends BaseTagGeneratorHelper
{
}
<?php
echo $tag->getTranslation()->ru->title;
?>
\ No newline at end of file
<?php
echo $tag->getTranslation()->en->title;
<?php
echo $tag->getTranslation()->ru->title;
\ No newline at end of file
<?php
require_once dirname(__FILE__).'/../lib/userGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/userGeneratorHelper.class.php';
/**
* user actions.
*
* @package sf
* @subpackage user
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class userActions extends autoUserActions
{
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid())
{
$notice = $form->getObject()->isNew() ? 'The item was created successfully.' : 'The item was updated successfully.';
try
{
$user = $form->save();
$old = $user->getModified(false, true);
$new = $user->getModified(true, true);
if($user->getEmail() && (count(array_diff($old, $new)) > 0 || $request->hasParameter('_send_password')))
{
$mailer = $this->getMailer();
$message = $mailer->compose(
sfConfig::get('app_email_sender', 'noreply@'.$request->getHost()),
array($user->getEmail()),
'Напоминание пароля ' . $request->getHost()
);
$message->setContentType('text/plain; charset=UTF-8');
$message->setBody($this->getPartial('user/mail_update', array('user'=> $user, 'host'=> $request->getHost())));
$result = $mailer->send($message);
}
$user->setIsSuperAdmin(false);
$user->save();
}
catch (Doctrine_Validator_Exception $e)
{
$errorStack = $form->getObject()->getErrorStack();
$message = get_class($form->getObject()) . ' has ' . count($errorStack) . " field" . (count($errorStack) > 1 ? 's' : null) . " with validation errors: ";
foreach ($errorStack as $field => $errors)
{
$message .= "$field (" . implode(", ", $errors) . "), ";
}
$message = trim($message, ', ');
$this->getUser()->setFlash('error', $message);
return sfView::SUCCESS;
}
$this->dispatcher->notify(new sfEvent($this, 'admin.save_object', array('object' => $user)));
if ($request->hasParameter('_save_and_add'))
{
$this->getUser()->setFlash('notice', $notice.' You can add another one below.');
$this->redirect('@user_new');
}
elseif ($request->hasParameter('_save_and_list'))
{
$this->redirect('@user');
}
else
{
if(!$request->isXmlHttpRequest())
{
$this->getUser()->setFlash('notice', $notice);
$this->redirect(array('sf_route' => 'user_edit', 'sf_subject' => $user));
}
}
}
else
{
$this->getUser()->setFlash('error', 'The item has not been saved due to some errors.', false);
$this->getResponse()->addHttpMeta('Sf-Form-Error', '1', true);
}
}
public function executeEdit(sfWebRequest $request)
{
$this->user = $this->getRoute()->getObject();
$this->form = $this->configuration->getForm($this->user);
$this->history = Doctrine::getTable('ClientOrder')->findByUserId($this->user->getId());
}
}
generator:
class: sfDoctrineGenerator
param:
model_class: User
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: user
with_doctrine_route: true
actions_base_class: sfActions
order: 90
skip: true
config:
actions: ~
fields:
id: {label: 'ID'}
username: {label: 'ИНН'}
fname: {label: 'Фамилия'}
iname: {label: 'Имя'}
oname: {label: 'Отчество'}
email: {label: 'Эл. почта'}
city_id: {label: 'Город'}
city: {label: 'Город'}
organization: {label: 'Организация'}
address: {label: 'Адрес'}
phone_number: {label: 'Номер телефона'}
salt: {label: ''}
discount: {label: 'Скидка'}
total_debt: {label: 'Задолженность'}
overdue_payment: {label: 'Просрочено'}
password: {label: 'Пароль'}
open_password: {label: 'Пароль'}
is_active: {label: 'Активирован'}
is_super_admin: {label: 'Администратор'}
last_login: {label: 'Синхронизация'}
manager: {label: 'Менеджер'}
manager_id: {label: 'Менеджер'}
created_at: {label: 'Дата регистрации'}
updated_at: {label: ''}
list:
table_method: onlyClients
layout: ~
title: 'Клиенты'
display: [_username, open_password, organization, last_login, is_active, created_at]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: [username, organization]
export: false
actions: []
sort: [last_login, desc]
filter:
class: false
form: ~
edit:
title: Редактирование
new:
title: Добавление
\ No newline at end of file
<?php
/**
* user module configuration.
*
* @package sf
* @subpackage user
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class userGeneratorConfiguration extends BaseUserGeneratorConfiguration
{
}
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