<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум ReadyScript &mdash; Добавление полей, не отображается в админке]]></title>
		<link>https://forum.readyscript.ru/topic/1050/dobavlenie-polei-ne-otobrazhaetsya-v-adminke/</link>
		<atom:link href="https://forum.readyscript.ru/feed/rss/topic/1050/" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Добавление полей, не отображается в админке».]]></description>
		<lastBuildDate>Wed, 31 Oct 2018 11:06:27 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Добавление полей, не отображается в админке]]></title>
			<link>https://forum.readyscript.ru/post/9204/#p9204</link>
			<description><![CDATA[<p>Добрый день! Сталкнулся с подобной проблемой</p><div class="codebox"><pre><code>    function init()
    {
        $this -&gt;bind(&#039;orm.init.catalog.property-item&#039;);
    }

    public static function ormInitCatalogPropertyItem(\Catalog\Model\Orm\Property\Item $item){
        $item-&gt;getPropertyIterator()-&gt;append(array(
            t(&#039;Основные&#039;),
            &#039;test&#039; =&gt; new OrmType\Varchar(array(
                &#039;description&#039; =&gt; &#039;Описание поля&#039;,
                &#039;hint&#039; =&gt; &#039;Подсказка&#039;
            ))
        ));
    }</code></pre></div><p>Не хочет отображаться доп. поле и в базе product_prop не добавляется данный столбец. <br />С расширением др. orm-объектов подобных проблем не было</p>]]></description>
			<author><![CDATA[null@example.com (Айрат)]]></author>
			<pubDate>Wed, 31 Oct 2018 11:06:27 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/9204/#p9204</guid>
		</item>
		<item>
			<title><![CDATA[Re: Добавление полей, не отображается в админке]]></title>
			<link>https://forum.readyscript.ru/post/5750/#p5750</link>
			<description><![CDATA[<p>Вроде бы всё правильно. Надо смотреть. Обратитесь в поддержку, поможем. support@readyscript.ru</p>]]></description>
			<author><![CDATA[null@example.com (Закусило Александр)]]></author>
			<pubDate>Mon, 09 Jan 2017 12:47:16 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5750/#p5750</guid>
		</item>
		<item>
			<title><![CDATA[Re: Добавление полей, не отображается в админке]]></title>
			<link>https://forum.readyscript.ru/post/5748/#p5748</link>
			<description><![CDATA[<p>Добавил, вот состав файла, но без изменений<br /></p><div class="codebox"><pre><code>&lt;?php

namespace Custom\Config;
use \RS\Orm\Type as OrmType;


class Handlers extends \RS\Event\HandlerAbstract
{
    function init()
    {
        $this
            -&gt;bind(&#039;orm.init.catalog.property-dir&#039;);
            
    }
    /**Расширяем объект Характеристики
    * @param Catalog\Model\Orm\Property\dir $property - объект товара
    **/
    public static function ormInitCatalogPropertyDir(\Catalog\Model\Orm\Property\dir $dir)
    {
        $dir-&gt;getPropertyIterator()-&gt;append(array(                
                &#039;title_for_product&#039; =&gt; new OrmType\Varchar(array(
                    &#039;title&#039; =&gt; t(&#039;Как подписывать в карточке товара&#039;),
                    &#039;maxLength&#039; =&gt; &#039;255&#039;,
                    &#039;hint&#039; =&gt; t(&#039;Как подписывать в карточке товара, если не указать, то подставиться основное название&#039;),
                    &#039;description&#039; =&gt; t(&#039;Как подписывать в карточке товара&#039;),          
                )),
        ));
    }        
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Владимир)]]></author>
			<pubDate>Mon, 09 Jan 2017 12:00:38 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5748/#p5748</guid>
		</item>
		<item>
			<title><![CDATA[Re: Добавление полей, не отображается в админке]]></title>
			<link>https://forum.readyscript.ru/post/5737/#p5737</link>
			<description><![CDATA[<p>У Вас отсутствует при добавлении поля ключ <strong>title</strong> (наименование)<br /></p><div class="codebox"><pre><code>  &#039;title&#039; =&gt; t(&#039;Вот это поле я пропустил&#039;),
  &#039;maxLength&#039; =&gt; &#039;255&#039;,
  &#039;hint&#039; =&gt; t(&#039;Как подписывать в карточке товара, если не указать, то подставиться основное название&#039;),
  &#039;description&#039; =&gt; t(&#039;Как подписывать в карточке товара&#039;),          </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Закусило Александр)]]></author>
			<pubDate>Mon, 09 Jan 2017 08:00:20 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5737/#p5737</guid>
		</item>
		<item>
			<title><![CDATA[Добавление полей, не отображается в админке]]></title>
			<link>https://forum.readyscript.ru/post/5734/#p5734</link>
			<description><![CDATA[<p>Требуется добавить поле в таблицу product_prop_dir, сделал согласно видео уроку<br />Модуль устанавливается, поле добавляется в БД, но не выводится в админке.<br />Включил отображение ошибок, но ошибок нет никаких.<br />Где промахнулся?</p><p>Создал директории modules\custom\config</p><p>Вот содержимое файлов<br /><strong>file.inc.php</strong><br /></p><div class="codebox"><pre><code>&lt;?php
namespace Custom\Config;
use \RS\Orm\Type;


class File extends \RS\Orm\ConfigObject
{
   
}</code></pre></div><p><strong>handlers.inc.php</strong><br /></p><div class="codebox"><pre><code>&lt;?php

namespace Custom\Config;
use \RS\Orm\Type as OrmType;


class Handlers extends \RS\Event\HandlerAbstract
{
    function init()
    {
        $this
            -&gt;bind(&#039;orm.init.catalog.property-dir&#039;);
            
    }
    /**Расширяем объект Характеристики
    * @param Catalog\Model\Orm\Property\dir $property - объект товара
    **/
    public static function ormInitCatalogPropertyDir(\Catalog\Model\Orm\Property\dir $dir)
    {
        $dir-&gt;getPropertyIterator()-&gt;append(array(
            /*t(&#039;Дополнительно&#039;),*/
                &#039;title_for_product&#039; =&gt; new OrmType\Varchar(array(
                    &#039;maxLength&#039; =&gt; &#039;255&#039;,
                    &#039;hint&#039; =&gt; t(&#039;Как подписывать в карточке товара, если не указать, то подставиться основное название&#039;),
                    &#039;description&#039; =&gt; t(&#039;Как подписывать в карточке товара&#039;),          
                )),
        ));
    }        
}</code></pre></div><p><strong>install.inc.php</strong><br /></p><div class="codebox"><pre><code>&lt;?php
/**
* ReadyScript (http://readyscript.ru)
*
* @copyright Copyright (c) ReadyScript lab. (http://readyscript.ru)
* @license http://readyscript.ru/licenseAgreement/
*/
namespace Custom\Config;

/**
* Класс отвечает за установку и обновление модуля
*/
class Install extends \RS\Module\AbstractInstall
{
    function install()
    {
        
        $result = parent::install();
        if ($result) {
            $dir = new \Catalog\Model\Orm\Property\dir();
            Handlers::ormInitCatalogPropertyDir($dir);
            $dir-&gt;dbUpdate();
        }
        
        return $result;
    }
    
    /**
    * Функция обновления модуля, вызывается только при обновлении
    */
    function update()
    {
        $result = parent::update();
        if ($result) {
            $dir = new \Catalog\Model\Orm\Property\dir();
            Handlers::ormInitCatalogPropertyDir($dir);
            $dir-&gt;dbUpdate();

        }
        return $result;
    }     
     
    
}</code></pre></div><p><strong>module.xml</strong><br /></p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;config&gt;
    &lt;defaultValues&gt;    
        &lt;name multilanguage=&quot;true&quot;&gt;Дополнительный функционал&lt;/name&gt;
        &lt;description multilanguage=&quot;true&quot;&gt;Расширение дополнительного функционала&lt;/description&gt;        
        &lt;version&gt;1.0.0.0&lt;/version&gt;
        &lt;author&gt;Voltage&lt;/author&gt;        
    &lt;/defaultValues&gt;
&lt;/config&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Владимир)]]></author>
			<pubDate>Sun, 08 Jan 2017 14:51:09 +0000</pubDate>
			<guid>https://forum.readyscript.ru/post/5734/#p5734</guid>
		</item>
	</channel>
</rss>
