Ja:Inline Relational Record Editing 1:n

From TYPO3Wiki

Jump to: navigation, search
 List Projects The Inline Relational Record Editing-project
list pages
See Current Project Members, Wishlist 
    you can help if you like!

Contents

 ??????????????

Fig.1: ??????????? 2 ?????????????? 2 ??????/?????????????????????
Enlarge
Fig.1: ??????????? 2 ??????
???????? 2 ??????/?????????????????????

Inline Relational Record Editing ??? 1:n ?????????? "select" ???? TCEforms ???????????????????? 1:n ???????????????????????????????????? (?) ?????????????????

??????? Fig.1 ??? 2 ???????"company" ? "person" ?????????IRRE ??? 1:n ????????????

1:n ???????????????:

  •  ????? (????????????) ??????????? (??????????????) ????????????????????
  •  ??????????????????????
  •  ?????????????????????????????
  •  ??????????????????


 ????????????????

Fig.2: ?????????????????????????????? uid ?????????????????????????????
Enlarge
Fig.2: ????????????????????????
?????? uid ?????????????????????????????

select ????????????????????????????????????????????? uid ???? 1 ????????????????? BLOB ??????????????????Fig.2 ?????"person" ????? uid ? "company" ????? "employees" ??????????????????????? uid ?????????????????????????????

company.employees = '13,18,21,35'

???????????????????????????????? IRRE ??????????????1:n ??????????? select ?????????????????????????? inline ?????????????????????


TCA ?????:

$TCA['company'] = Array(
  'ctrl' => ...,
  'interface' => ...,
  'feInterface' => ...,
  'columns' => Array(
    'hidden' => ...,
    'employees' => Array(
      'exclude' => 1,
      'label' => 'LLL:EXT:myextension/locallang_db.xml:company.employees',
      'config' => Array(
        'type' => 'inline',
        'foreign_table' => 'person',
        'maxitems' => 10,
        'appearance' => Array(
          'collapseAll' => 1,
          'expandSingle' => 1,
        ),
      ),
    ),
  ),
  'types' => ...
  'palettes' => ...
);

 ????????????????????

Fig.3: ???????/???????????????????????????? uid ??????????????????
Enlarge
Fig.3: ???????/????????????????
???????????? uid ??????????????????

?????????????????????????Fig.3 ???????????????? uid ???????????????????????????????????????????? uid ????????"company" ? "employees" ????????????????????????????????????2 ??????????????????????????????????????????????????????? pid ?????????????

???????????????? 1 ??????????? ("company") ?????????????????????"company" ?????? "association" ???????? "person" ????????????????????????? "company" ? "association" ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

???????????????????? uid ????????TCA ? "foreign_field" ????????


????: company

uidpidtstampcrdate_intcruser_iddeletedhiddentitleemployees
2411613543021161354302100Big Company Corp.4

????: person

uidcompanyuidpidtstampcrdate_intcruser_iddeletedhiddenfirstnamelastnamebirthdate
132411613543021161354302100JohnDoe1979-02-03
182411613543021161354302100SteveMiller1977-07-13
212411613543021161354302100JaneKowalczcky1981-11-06
352411613543021161354302100KateMcGuyver1982-08-30


TCA ?????:

$TCA['company'] = Array(
  'ctrl' => ...,
  'interface' => ...,
  'feInterface' => ...,
  'columns' => Array(
    'hidden' => ...,
    'employees' => Array(
      'exclude' => 1,
      'label' => 'LLL:EXT:myextension/locallang_db.xml:company.employees',
      'config' => Array(
        'type' => 'inline',
        'foreign_table' => 'person',
        'foreign_field' => 'companyuid',
        'maxitems' => 10,
        'appearance' => Array(
          'collapseAll' => 1,
          'expandSingle' => 1,
        ),
      ),
    ),
  ),
  'types' => ...
  'palettes' => ...
);


????????? TCA ?????????????????? foreign field ????????????? (??? type input)?TCEforms ?????? "foreign field" ?????????????????????? inline ????????????? uid ??????????????????????????


???? TCA ????? - ??????? "companyuid" ????????????????:

$TCA['person'] = Array(
  ...
  'columns' => Array(
    'companyuid' => Array(
      ...
      'config' => Array(
        'type' => 'input',
      ),
    ),
  ...
);


???????????????????? TCA ??????????????????? foreign_sortby ????????????????????????????????????????

sortby ??????????????????????????? (inline ??????????????????? sortby ??????????????):

  1. $TCA[<table>][<colums>][<field>]['config']['foreign_sortby']
  2. $TCA[<table>]['ctrl']['sortby']
  3. $TCA[<table>]['ctrl']['default_sortby']

?? 1 ???????????? foreign_label ??????inline ?????????? $TCA[<table>]['ctrl']['label'] ???????????????????????????????????????????????


TCA ?????:

$TCA['company'] = Array(
  ...
  'columns' => Array(
    'employees' => Array(
      ...
      'config' => Array(
        'type' => 'inline',
        'foreign_table' => 'person',
        'foreign_field' => 'companyuid',
        'foreign_sortby' => 'sorting',
        'foreign_label' => 'lastname',
        'maxitems' => 10,
        'appearance' => Array(
          'collapseAll' => 1,
          'expandSingle' => 1,
        ),
      ),
    ),
  ),
  ...
);

 ????????????

Fig.4: ????????????????????company ????? person ????????????? (??????) ??????????????
Enlarge
Fig.4: ????????????????????
company ????? person ????????????? (??????) ??????????????

???? "person" ? "company" ? "association" ??????????????????????????????????????????????????????????? MM ?????????????????????????? company_person_mm ? association_person_mm ??????????? 2 ?????????

??????????? "_mm" ???????????? MM ?????????????????????????????? 1:n ?????????????????"person" ???????????????????"person" ????????????? "company" ????? "association" ??????????????????


????: company_person_mm

uid_localuid_foreigntablenamessortingsorting_foreign
213 1
218 2
221 3
235 4

????: association_person_mm

uid_localuid_foreigntablenamessortingsorting_foreign
415 1
423 2


 ??????? inline ????????

??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

????????????? TCA ???????????????????????????????????? attributes ??????????????"person" ?????????????????????????????


TCA ?????:

$TCA['association'] = Array(
  'ctrl' => ...,
  'interface' => ...,
  'feInterface' => ...,
  'columns' => Array(
    'hidden' => ...,
    'members' => Array(
      'exclude' => 1,
      'label' => 'LLL:EXT:myextension/locallang_db.xml:association.members',
      'config' => Array(
        'type' => 'inline',
        'foreign_table' => 'association_person_mm',
        'foreign_field' => 'uid_local',
        'maxitems' => 10,
      ),
    ),
  ),
  'types' => ...
  'palettes' => ...
);

 ???????? inline ????????

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

???"person" ?????????????????????????????????


TCA ?????:

$TCA['association'] = Array(
  'ctrl' => ...,
  'interface' => ...,
  'feInterface' => ...,
  'columns' => Array(
    'hidden' => ...,
    'members' => Array(
      'exclude' => 1,
      'label' => 'LLL:EXT:myextension/locallang_db.xml:association.members',
      'config' => Array(
        'type' => 'inline',
        'foreign_table' => 'person',
        'MM' => 'association_person_mm',
        'maxitems' => 10,
        'appearance' => Array(
          'collapseAll' => 1,
          'expandSingle' => 1,
        ),
      ),
    ),
  ),
  'types' => ...
  'palettes' => ...
);
Personal tools