diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-29 16:29:17 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-29 16:29:17 +0100 |
| commit | 851215fce6fb91c0bdacaad99bab9456252896bf (patch) | |
| tree | a07bbdf9adc7e51e6073ef56668b16b3deb248c4 /admin | |
| parent | efbe40f744e7c5606cfcd1a3c1670e19510a8b18 (diff) | |
| download | stock-851215fce6fb91c0bdacaad99bab9456252896bf.tar.gz stock-851215fce6fb91c0bdacaad99bab9456252896bf.tar.bz2 stock-851215fce6fb91c0bdacaad99bab9456252896bf.zip | |
Supplier xref: #SUP consolidates contact/part/price; group template for stockcomponent
- StockBase: loadXrefList() batch-fetches contact names for supplier rows
so xref_title is available in view templates (not just edit)
- StockBase: enrichXrefDisplay() handles supplier contact lookup for edit forms
- StockAssembly: enrichXrefDisplay() calls parent first for supplier handling
- schema_inc.php: #SUP template='sup'; supplier group template='sup' for
stockcomponent so view_xref_sup_group.tpl is selected
- New templates in stockcomponent/: view_xref_sup_group.tpl (Supplier/Part
No./Price/Note headings), view_xref_sup_item.tpl (contact link to
display_contact.php, dates/edit hidden in view mode), edit_xref_sup_item.tpl
- view_component.tpl: pass allow_edit=false to hide dates and action buttons
- edit_component.tpl: use getXrefListTemplate() for group dispatch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'admin')
| -rwxr-xr-x | admin/schema_inc.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 96c3be4..e58c2ed 100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -137,13 +137,14 @@ $xrefTypes = []; $xrefItems = []; foreach( [ 'stockcomponent', 'stockassembly' ] as $guid ) { - $xrefTypes[] = "INSERT INTO `{$X}liberty_xref_group` (`x_group`,`content_type_guid`,`title`,`sort_order`,`role_id`,`type_href`) VALUES ('supplier','{$guid}','Supplier', 1,3,'')"; + $supGrpTpl = ( $guid === 'stockcomponent' ) ? 'sup' : ''; + $xrefTypes[] = "INSERT INTO `{$X}liberty_xref_group` (`x_group`,`content_type_guid`,`title`,`sort_order`,`role_id`,`type_href`,`template`) VALUES ('supplier','{$guid}','Supplier', 1,3,'','{$supGrpTpl}')"; $qtyGrpTpl = ( $guid === 'stockassembly' ) ? 'bom' : ''; $xrefTypes[] = "INSERT INTO `{$X}liberty_xref_group` (`x_group`,`content_type_guid`,`title`,`sort_order`,`role_id`,`type_href`,`template`) VALUES ('quantity','{$guid}','Quantity', 2,3,'','{$qtyGrpTpl}')"; $xrefTypes[] = "INSERT INTO `{$X}liberty_xref_group` (`x_group`,`content_type_guid`,`title`,`sort_order`,`role_id`,`type_href`) VALUES ('values', '{$guid}','Values', 3,3,'')"; // Supplier sources — multi=1 (multiple suppliers per item) - $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('#SUP','{$guid}','supplier','Supplier', 1,3,'../contact/?content_id=','text',NULL)"; + $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('#SUP','{$guid}','supplier','Supplier', 1,3,'../contact/?content_id=','sup', NULL)"; $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('#PN', '{$guid}','supplier','Part Number', 1,3,'', 'text',NULL)"; $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('#PR', '{$guid}','supplier','Price', 1,3,'', 'text',NULL)"; $xrefItems[] = "INSERT INTO `{$X}liberty_xref_item` (`item`,`content_type_guid`,`x_group`,`cross_ref_title`,`multiple`,`role_id`,`cross_ref_href`,`template`,`data`) VALUES ('#URL','{$guid}','supplier','Supplier URL', 1,3,'', 'text',NULL)"; |
