&configs=languages||schools||levels||courts||degrees||states||countries||eventtypes||newstypes
<select name="school" id="schools" class="desktop-select"> <option></option> [[getSchoolList]] </select>
<?php
global $modx;
$serviceID = (string)$modx->getOption('serviceID', $scriptProperties, '');
$type = (string)$modx->getOption('type', $scriptProperties, '');
$where = array('active' => 1);
$output = '';
$query = $modx->newQuery('birSchool');
$query->sortby('name','ASC');
$query->where($where);
$schools = $modx->getCollection('birSchool',$query);
foreach ($schools as $school) {
$output .= '<option value="'.$school->get('o_id').'">'.$school->get('name').'</option>';
}
return $output;<?php
global $modx;
$serviceID = (string)$modx->getOption('serviceID', $scriptProperties, '');
$type = (string)$modx->getOption('type', $scriptProperties, '');
$where = array('active' => 1);
$output = '';
$query = $modx->newQuery('birCourt');
$query->sortby('name','ASC');
$query->where($where);
$courts = $modx->getCollection('birCourt', $query);
foreach ($courts as $court) {
$output .= '<option value="'.$court->get('o_id').'">'.$court->get('name').'</option>';
}
return $output;could you show the xpdo-schema of the used package, please?
And which version of MIGX and MODX are you at?
{
"id":2,
"name":"Schools",
"formtabs":[
{
"MIGX_id":3,
"caption":"School",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":3,
"field":"name",
"caption":"Name",
"description":"School name",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":1
},
{
"MIGX_id":20,
"field":"o_id",
"caption":"Old ID",
"description":"can be created manually but will be generated automatically soon.Has to be unique!",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"none",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":2
},
{
"MIGX_id":21,
"field":"active",
"caption":"Active?",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"listbox",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"Yes==1||No==0",
"default":1,
"useDefaultIfEmpty":"0",
"pos":3
}
],
"pos":1
}
],
"contextmenus":"update||duplicate||publish||unpublish||activate||deactivate||remove",
"actionbuttons":"addItem",
"columnbuttons":"update||duplicate||publish||unpublish||activate||deactivate||remove",
"filters":"",
"extended":{
"migx_add":"Add new school",
"disable_add_item":"",
"add_items_directly":"",
"formcaption":"",
"update_win_title":"",
"win_id":"school",
"maxRecords":"",
"addNewItemAt":"bottom",
"multiple_formtabs":"",
"multiple_formtabs_label":"",
"multiple_formtabs_field":"",
"multiple_formtabs_optionstext":"",
"multiple_formtabs_optionsvalue":"",
"actionbuttonsperrow":4,
"winbuttonslist":"",
"extrahandlers":"",
"filtersperrow":4,
"packageName":"bir",
"classname":"birSchool",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"sortconfig":"",
"gridpagesize":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":1,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":"",
"hooksnippets":{
"aftersave":"updateOldIDHook"
},
"cmpmaincaption":"Main caption",
"cmptabcaption":"Schools",
"cmptabdescription":"Manage Schools here",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":1,
"header":"ID",
"dataIndex":"id",
"width":20,
"sortable":"false",
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
},
{
"MIGX_id":2,
"header":"Name",
"dataIndex":"name",
"width":200,
"sortable":true,
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
},
{
"MIGX_id":3,
"header":"Old ID",
"dataIndex":"o_id",
"width":100,
"sortable":"false",
"show_in_grid":"0",
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
},
{
"MIGX_id":4,
"header":"Active",
"dataIndex":"active",
"width":"",
"sortable":"false",
"show_in_grid":1,
"customrenderer":"",
"renderer":"this.renderSwitchStatusOptions",
"clickaction":"switchOption",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":[
{
"MIGX_id":1,
"name":"Active",
"use_as_fallback":"",
"value":1,
"clickaction":"",
"handler":"",
"image":"assets\/components\/migx\/style\/images\/tick.png"
},
{
"MIGX_id":2,
"name":"Not active",
"use_as_fallback":"",
"value":"0",
"clickaction":"",
"handler":"",
"image":"assets\/components\/migx\/style\/images\/cross.png"
}
],
"editor":"this.listboxEditor"
}
],
"createdby":1,
"createdon":"2016-12-04 10:20:10",
"editedby":1,
"editedon":"2017-03-22 14:31:22",
"deleted":0,
"deletedon":null,
"deletedby":0,
"published":1,
"publishedon":null,
"publishedby":0
}{
"id":4,
"name":"Courts",
"formtabs":[
{
"MIGX_id":4,
"caption":"Court",
"print_before_tabs":"0",
"fields":[
{
"MIGX_id":4,
"field":"name",
"caption":"Court name",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":1
},
{
"MIGX_id":19,
"field":"o_id",
"caption":"Old ID",
"description":"should be added as now it's obligatory field",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"none",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":2
}
],
"pos":1
}
],
"contextmenus":"update||duplicate||remove",
"actionbuttons":"addItem",
"columnbuttons":"update||duplicate||remove",
"filters":"",
"extended":{
"migx_add":"Add court item",
"disable_add_item":"",
"add_items_directly":"",
"formcaption":"",
"update_win_title":"",
"win_id":"",
"maxRecords":"",
"addNewItemAt":"bottom",
"multiple_formtabs":"",
"multiple_formtabs_label":"",
"multiple_formtabs_field":"",
"multiple_formtabs_optionstext":"",
"multiple_formtabs_optionsvalue":"",
"actionbuttonsperrow":4,
"winbuttonslist":"",
"extrahandlers":"",
"filtersperrow":4,
"packageName":"bir",
"classname":"birCourt",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"sortconfig":"",
"gridpagesize":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":1,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":"",
"hooksnippets":{
"aftersave":"updateOldIDHook"
},
"cmpmaincaption":"Main caption",
"cmptabcaption":"Courts",
"cmptabdescription":"Manage courts here",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":1,
"header":"ID",
"dataIndex":"id",
"width":15,
"sortable":true,
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
},
{
"MIGX_id":2,
"header":"Court name",
"dataIndex":"name",
"width":"",
"sortable":true,
"show_in_grid":1,
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
},
{
"MIGX_id":3,
"header":"Old ID",
"dataIndex":"o_id",
"width":"",
"sortable":true,
"show_in_grid":"0",
"customrenderer":"",
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":""
}
],
"createdby":1,
"createdon":"2016-12-04 15:17:07",
"editedby":1,
"editedon":"2017-03-22 14:27:57",
"deleted":0,
"deletedon":null,
"deletedby":0,
"published":1,
"publishedon":null,
"publishedby":0
}"packageName":"bir",
I see, in both cases your packageName is: bir
"packageName":"bir",
then you can find the xpdo-schema at core/components/bir/model/schema/
Or just go to the MIGX-CMP and put 'bir' into the packageName - field and Click 'Load Schema' at the XML Schema - tab
Then post that schema here, again
<?xml version="1.0" encoding="UTF-8"?>
<model package="bir" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="birLanguage" table="bir_language" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birSchool" table="bir_school" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="active" dbtype="tinyint" precision="1" phptype="boolean" attributes="unsigned" null="false" default="1">
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birState" table="bir_state" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="abbreviation" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birCountry" table="bir_country" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="abbreviation" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birLevel" table="bir_level" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birDegree" table="bir_degree" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birEventType" table="bir_event_type" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birNewsType" table="bir_news_type" extends="xPDOSimpleObject">
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
</object>
<object class="birCourt" table="bir_court" extends="xPDOSimpleObject">
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
</object>
</model>[[migxLoopCollection? &packageName=`bir` &classname=`birCourt` &limit=`10` ]]