Example #1
0
 function showPreview()
 {
     /* @var $model \Billing\Searcher */
     $model = $this->getModel();
     if (!$model->getSUBSCRIBER()) {
         return;
     }
     \Page\View\ViewManager::getView($model->getSubscriber2(), $this, self::PREVIEW_ID . "_{$model->getSUBSCRIBER()}", TRUE);
 }
Example #2
0
<?php

namespace Billing;

use Zend\Config\Config;
date_default_timezone_set("Etc/GMT-5");
//Logger::getRootLogger()->debug(PHP_OS);
//define('APPLICATION_PATH', __DIR__);
//define('LIB_PATH', __DIR__."/../lib");
require_once __DIR__ . '/../vendor/autoload.php';
\Doctrine\Common\Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
Core::configureDefault((new Config(require __DIR__ . "/config.php"))->billing);
\Page\View\ViewManager::setViewClass('Billing\\Subscriber', 'Billing\\View\\SubscriberView');
    function show()
    {
        /* @var $model \Billing\Searcher */
        $model = $this->getModel();
        $this->_idView->show();
        $this->_filterView->show();
        ?>
            <div id='<?php 
        echo $this->getFullIo() . "_" . self::PREVIEW_ID;
        ?>
'>
        <?php 
        if ($model) {
            \Page\View\ViewManager::getView($model, $this, self::PREVIEW_ID, TRUE);
        }
        ?>
            </div>
        <script>
            $(function(){
                $("#<?php 
        echo $this->_filterView->getFullIo();
        ?>
").autocomplete({
                    source:"<?php 
        echo self::CALLBACK_FILENAME;
        ?>
"
                });
                
                var domFilter= document.getElementById("<?php 
        echo $this->_filterView->getFullIo();
        ?>
");
                var domId= document.getElementById("<?php 
        echo $this->_idView->getFullIo();
        ?>
");
                
                domFilter.loadTimer= new DisplacingTimer(document, function(sender){
                    //log4javascript.getDefaultLogger().debug("searching...");
                    $("#<?php 
        echo $this->getFullIo() . "_" . self::PREVIEW_ID;
        ?>
").load("<?php 
        echo self::CALLBACK_FILENAME;
        ?>
", {SUBSCRIBER:domId.value});
                }, 1000, DisplacingTimer.Type.timeout);

                //события обрабатываются "Выбрал из меню" и "Потерял фокус с изменением". А "Закрылось" не обрабатывается потому что закрыться можно и без изменения
                $("#<?php 
        echo $this->_filterView->getFullIo();
        ?>
").on("autocompletefocus", function( event, ui ) {
                    //log4javascript.getDefaultLogger().debug("focus...");
                    domId.value= ui.item.value;
                    event.target.value= ui.item.label;
                    domFilter.loadTimer.start();
                    return false;
                })
                .on("autocompleteselect", function( event, ui ) {
                    return false;
                });
            }); //$
        </script>
        <?php 
    }