Hi Tim,

Here is my _getQuery() method in article_facility_ajax

    /**
     * Returns SQL query for data to fetc
     *
     * @return string
     */
    protected function _getQuery()
    {
        $sFacilitiesTable = $this->_getViewName('facilities');
        $sO2CView = $this->_getViewName('object2facility');
        $oDb = oxDb::getDb();

        $sOxid = oxRegistry::getConfig()->getRequestParameter('oxid');
        $sSynchOxid =
oxRegistry::getConfig()->getRequestParameter('synchoxid');

        if ($sOxid) {
            $sQAdd = " from $sO2CView left join $sFacilitiesTable on
$sFacilitiesTable.oxid=$sO2CView.facilityid ";
            $sQAdd .= " where $sO2CView.oxobjectid = " . $oDb->quote($sOxid)
                      . " and $sFacilitiesTable.oxid is not null ";
        } else {
            $sQAdd = " from $sFacilitiesTable where $sFacilitiesTable.oxid
not in ( ";
            $sQAdd .= " select $sFacilitiesTable.oxid from $sO2CView "
                      . "left join $sFacilitiesTable on
$sFacilitiesTable.oxid=$sO2CView.facilityid ";
            $sQAdd .= " where $sO2CView.oxobjectid = " .
$oDb->quote($sSynchOxid)
                      . " and $sFacilitiesTable.oxid is not null ) and
$sFacilitiesTable.oxpriceto = '0'";
        }

        return $sQAdd;
    }


I simply replaced the categories and object2categories with mine two new
tables.


What am I doing wrong that I cant see. Looking forward to your reply.

Thanks,






*Mit freundlichen Grüßen | **Warm Regards**,*

Mirza Ahmad
M +4917645387460 | Skype: ahtasham82





On Wed, Sep 2, 2015 at 11:01 AM, Tim Aniol <[email protected]> wrote:

> Hi Mirza
>
> what does the _getQuery() Method in your ajax class do? If you have copied
> the article_extend_ajax class then it'll be select oxcategories.
>
> BR
> Tim
>
>
>
>
> Viele Grüße,
>
> Tim Aniol
> Senior Software-Entwickler
>
> Tel.: 0911 / 1809 45 - 30
> [email protected]
> PGP-Key: F2979268
> <http://pgp.mit.edu/pks/lookup?op=vindex&search=0x1FFB423FF2979268>
>
> solutionDrive GmbH
> Innere Hallerstraße 8a, 90419 Nürnberg
> Amtsgericht Nürnberg, HRB 28464
> GF Andreas Illig
> http://www.solutionDrive.de
> Tel +49 911 1809 45-29, Fax +49 911 1809 45-31
> [email protected]
>
> Vernetzen Sie sich mit uns auf Xing
> <https://www.xing.com/companies/solutiondrivegmbh> und Facebook
> <https://www.facebook.com/solutiondrivegmbh> oder folgen Sie uns auf
> Twitter <https://twitter.com/solutiondrive>!
> Am 02.09.15 um 10:43 schrieb Mirza Ahtasham Ahmad:
>
> Hi Everyone,
>
> I have an extra relation for articles. The new Table is named facilities
> and the relation table is object2facilities. I want to assign the these
> facilities to the articles just like the relation object2category.
>
> oxobject2category and mein object2facility are exactly the same just
> instead of catnid there is facilityid.
>
> For the assigning purpose I copied the "assign categories" button in the
> article_extend module. I adjusted/created the new popup and ajax files for
> it too (simply copied the one which were used for assign categories)
>
> Now the problem is, that when I click on my new button, "assign
> facilities", the popup shows up, but it loads the categories into the left
> container of the popup. I need to load facilities from my new facilities
> table. I cant figure it out where those are loaded. Can anybody help me
> here where I need to load my facilities and pass it to the popup template??
>
>
> PS: In my new ajax module (article_facility_ajax) I have adjusted the
> Columns array and it looks like this.
>
>     /**
>      * Columns array
>      *
>      * @var array
>      */
>     protected $_aColumns = array('container1' => array( // field , table,
>         visible, multilanguage, ident
>         array('title', 'facilities', 1, 1, 0),
>         array('info', 'facilities', 1, 1, 0),
>         array('oxid', 'facilities', 0, 0, 0),
>         array('oxid', 'facilities', 0, 0, 1)
>     ),
>                                  'container2' => array(
>                                      array('title', 'facilities', 1, 1, 0),
>                                      array('info', 'facilities', 1, 1, 0),
>                                      array('oxid', 'facilities', 0, 0, 0),
>                                      array('oxid', 'object2facility', 0,
> 0, 1),
>                                      array('oxtime', 'object2facility', 0,
> 0, 1),
>                                      array('oxid', 'facilities', 0, 0, 1)
>                                  ),
>     );
>
>
>
> Looking forward to your help.
>
> Thanks,
>
>
>
>
> *Mit freundlichen Grüßen | **Warm Regards**,*
>
> Mirza Ahmad
> M +4917645387460 | Skype: ahtasham82
>
>
>
>
>
>
> _______________________________________________
> dev-general mailing 
> [email protected]http://dir.gmane.org/gmane.comp.php.oxid.general
>
>
>
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general
>
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to