"I'm component in" list in Product DetailView

This commit is contained in:
2025-05-09 17:38:55 +00:00
parent f1a0b7be5e
commit 21ab2d0962
4 changed files with 383 additions and 355 deletions

View File

@@ -639,6 +639,16 @@ $viewdefs['EcmProducts']['DetailView'] = array(
) )
) )
), ),
'LBL_USAGE_PANEL' => array(
array(
array(
'name' => 'usage_list',
'hideLabel' => true,
'allCols' => true,
'customCode' => '{$USAGE_LIST}'
)
)
),
'LBL_PRODUCTION_PANEL' => array( 'LBL_PRODUCTION_PANEL' => array(
array( array(
array( array(

View File

@@ -313,6 +313,14 @@ $detail->ss->assign("DIV_DESC_CARD",$desc);
//Added for Components //Added for Components
global $current_user; global $current_user;
$ul= $focus->getProductUsingComponent();
$usage_list = '';
foreach($ul as $key => $value) {
$usage_list .= "<a target='_blank' href='index.php?module=EcmProducts&action=DetailView&record=".$value['id']."'>".$value['code']."</a><br>";
}
$detail->ss->assign("USAGE_LIST", $usage_list);
$detail->ss->assign("CREATED_BY_NAME", $focus->created_by_name); $detail->ss->assign("CREATED_BY_NAME", $focus->created_by_name);
echo $detail->display(); echo $detail->display();

View File

@@ -52,6 +52,7 @@ $mod_strings = array (
'LBL_BRAND' => 'Marka', 'LBL_BRAND' => 'Marka',
'LBL_BRAND_LABEL' => 'Indeks etykiety', 'LBL_BRAND_LABEL' => 'Indeks etykiety',
'LBL_PRODUCTION_PANEL' => 'Elementy produkcji', 'LBL_PRODUCTION_PANEL' => 'Elementy produkcji',
'LBL_USAGE_PANEL' => 'Użycie jako komponent',
'LBL_ACTIONS' => 'Czynności', 'LBL_ACTIONS' => 'Czynności',
'LBL_QRODE' => 'QR', 'LBL_QRODE' => 'QR',
'LBL_SELLING_Q1_INFORMATION' => 'Sprzedaż Q1', 'LBL_SELLING_Q1_INFORMATION' => 'Sprzedaż Q1',

View File

@@ -1,4 +1,5 @@
<?php <?php
/********************************************************************************* /*********************************************************************************
* SugarCRM is a customer relationship management program developed by * SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc. * SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
@@ -33,59 +34,59 @@
* technical reasons, the Appropriate Legal Notices must display the words * technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM". * "Powered by SugarCRM".
********************************************************************************/ ********************************************************************************/
$viewdefs ['EcmProducts'] ['DetailView'] = array ( $viewdefs['EcmProducts']['DetailView'] = array(
'templateMeta' => array ( 'templateMeta' => array(
'form' => array ( 'form' => array(
'buttons' => array ( 'buttons' => array(
'EDIT', 'EDIT',
'DUPLICATE', 'DUPLICATE',
'DELETE', 'DELETE',
'FIND_DUPLICATES', 'FIND_DUPLICATES',
array ( array(
'customCode' => '{$CATALOGUE_NEW}' 'customCode' => '{$CATALOGUE_NEW}'
), ),
array ( array(
'customCode' => '<input class="button" type="submit" value="{$MOD.LBL_ALLEGRO}" onClick="this.form.action.value=\'allegroTemplate\';">' 'customCode' => '<input class="button" type="submit" value="{$MOD.LBL_ALLEGRO}" onClick="this.form.action.value=\'allegroTemplate\';">'
) )
), ),
'hidden' => array ( 'hidden' => array(
'<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>' '<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>'
) )
), ),
'maxColumns' => '2', 'maxColumns' => '2',
'widths' => array ( 'widths' => array(
array ( array(
'label' => '10', 'label' => '10',
'field' => '30' 'field' => '30'
), ),
array ( array(
'label' => '10', 'label' => '10',
'field' => '30' 'field' => '30'
) )
), ),
'includes' => array ( 'includes' => array(
array ( array(
'file' => 'include/JSON.js' 'file' => 'include/JSON.js'
), ),
// array('file'=>'include/javascript/quicksearch.js'), // array('file'=>'include/javascript/quicksearch.js'),
// array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'), // array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
array ( array(
'file' => 'modules/EcmProducts/AjaxSearch/AjaxSearch.js' 'file' => 'modules/EcmProducts/AjaxSearch/AjaxSearch.js'
), ),
array ( array(
'file' => 'modules/EcmProducts/javascript/formloader.js' 'file' => 'modules/EcmProducts/javascript/formloader.js'
), ),
array ( array(
// 'file' => 'modules/EcmProducts/javascript/MyTable.js' // 'file' => 'modules/EcmProducts/javascript/MyTable.js'
), ),
array ( array(
// 'file' => 'modules/EcmProducts/javascript/EcmProductDetailView.js' // 'file' => 'modules/EcmProducts/javascript/EcmProductDetailView.js'
), ),
array ( array(
'file' => 'modules/EcmProducts/javascript/ProductionTables.js' 'file' => 'modules/EcmProducts/javascript/ProductionTables.js'
), ),
array ( array(
'file' => 'modules/EcmProducts/javascript/ProductionSummary.js' 'file' => 'modules/EcmProducts/javascript/ProductionSummary.js'
) )
) )
@@ -95,33 +96,33 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
// array('file'=>'modules/EcmProducts/mintajax.js'), // array('file'=>'modules/EcmProducts/mintajax.js'),
// array('file'=>'modules/EcmProducts/helper.js'), // array('file'=>'modules/EcmProducts/helper.js'),
'panels' => array ( 'panels' => array(
'LBL_PRODUCT_INFORMATION' => array ( 'LBL_PRODUCT_INFORMATION' => array(
array ( array(
'name', 'name',
'assigned_user_name' 'assigned_user_name'
), ),
array ( array(
'code', 'code',
'product_active' 'product_active'
), ),
array ( array(
'ean', 'ean',
'ean2' 'ean2'
), ),
array ( array(
'vendor_name', 'vendor_name',
'part_no' 'part_no'
), ),
array ( array(
'vendor_part_no', 'vendor_part_no',
'serial_no' 'serial_no'
), ),
array ( array(
'brand', 'brand',
'brand_label' 'brand_label'
), ),
array ( array(
'production', 'production',
'status' 'status'
), ),
@@ -133,71 +134,71 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
// array('contact_name','website'), // array('contact_name','website'),
// array('vendor_name','part_no'), // array('vendor_name','part_no'),
// array('vendor_part_no','serial_no'), // array('vendor_part_no','serial_no'),
array ( array(
'group_ks', 'group_ks',
'mainproduct_name' 'mainproduct_name'
), ),
array ( array(
'active', 'active',
'is_mainproduct' 'is_mainproduct'
), ),
array ( array(
'group_name', 'group_name',
), ),
), ),
'LBL_PRICING_INFORMATION' => array ( 'LBL_PRICING_INFORMATION' => array(
array ( array(
array ( array(
'customCode' => '{$EXCHANGE_RATE_NAME}', 'customCode' => '{$EXCHANGE_RATE_NAME}',
'label' => 'LBL_EXCHANGE_RATE_NAME' 'label' => 'LBL_EXCHANGE_RATE_NAME'
), ),
'custom_duty_rate' 'custom_duty_rate'
), ),
array ( array(
'vat_name', 'vat_name',
'commission_rate' 'commission_rate'
), ),
array ( array(
'purchase_price', 'purchase_price',
'srp_price' 'srp_price'
), ),
array ( array(
'selling_price', 'selling_price',
'srp_price_eur' 'srp_price_eur'
), ),
array ( array(
'fob_price', 'fob_price',
'srp_promo_price' 'srp_promo_price'
), ),
array ( array(
'ems_price' 'ems_price'
) )
), ),
'LBL_STOCK_INFORMATION' => array ( 'LBL_STOCK_INFORMATION' => array(
array ( array(
array ( array(
'customCode' => '{$ORDERED}', 'customCode' => '{$ORDERED}',
'label' => 'Zamówień' 'label' => 'Zamówień'
), ),
'qty_per_unit' 'qty_per_unit'
), ),
array ( array(
'qty_in_stock', 'qty_in_stock',
'reorder_level' 'reorder_level'
), ),
array ( array(
'ems_qty_in_stock', 'ems_qty_in_stock',
'qty_in_demand' 'qty_in_demand'
), ),
array ( array(
array ( array(
'customCode' => '{$INVENTORY_INFORMATION}', 'customCode' => '{$INVENTORY_INFORMATION}',
'label' => 'Inventory informations' 'label' => 'Inventory informations'
), ),
'lead_time' 'lead_time'
), ),
array ( array(
'stock_addresses' 'stock_addresses'
) )
), ),
@@ -322,112 +323,112 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
'last_year_margin' 'last_year_margin'
) )
), */ ), */
'LBL_WWW_PANEL' => array ( 'LBL_WWW_PANEL' => array(
array ( array(
'www_available', 'www_available',
'www_popular' 'www_popular'
), ),
array ( array(
'www_price_pln', 'www_price_pln',
'www_price_eur' 'www_price_eur'
), ),
array ( array(
'www_state', 'www_state',
'www_manual_update' 'www_manual_update'
), ),
array ( array(
'www_state_desc_pl', 'www_state_desc_pl',
'www_state_desc_en' 'www_state_desc_en'
) )
), ),
'LBL_DRIVERS_IMAGES' => array ( 'LBL_DRIVERS_IMAGES' => array(
array ( array(
array ( array(
'label' => 'LBL_PRODUCT_PICTURE', 'label' => 'LBL_PRODUCT_PICTURE',
'customCode' => '{$PRODUCT_PICTURE}' 'customCode' => '{$PRODUCT_PICTURE}'
), ),
array ( array(
'label' => 'LBL_PACKING_FRONT_PICTURE', 'label' => 'LBL_PACKING_FRONT_PICTURE',
'customCode' => '{$PACKING_FRONT_PICTURE}' 'customCode' => '{$PACKING_FRONT_PICTURE}'
) )
), ),
array ( array(
array ( array(
'label' => 'LBL_DRIVER_1', 'label' => 'LBL_DRIVER_1',
'customCode' => '{$DRIVER_1_DOWNLOAD}' 'customCode' => '{$DRIVER_1_DOWNLOAD}'
), ),
array ( array(
'label' => 'LBL_DRIVER_2', 'label' => 'LBL_DRIVER_2',
'customCode' => '{$DRIVER_2_DOWNLOAD}' 'customCode' => '{$DRIVER_2_DOWNLOAD}'
) )
) )
), ),
'LBL_QRCODE' => array ( 'LBL_QRCODE' => array(
array ( array(
array ( array(
'label' => '', 'label' => '',
'customCode' => '{$QRCODE}' 'customCode' => '{$QRCODE}'
) )
) )
), ),
'LBL_LOGISTIC_INFORMATION' => array ( 'LBL_LOGISTIC_INFORMATION' => array(
array ( array(
'', '',
array ( array(
'label' => 'LBL_CARTON_DIMENSIONS_1', 'label' => 'LBL_CARTON_DIMENSIONS_1',
'customCode' => '{$CARTON_DIMENSIONS_1} x {$CARTON_DIMENSIONS_2} x {$CARTON_DIMENSIONS_3}' 'customCode' => '{$CARTON_DIMENSIONS_1} x {$CARTON_DIMENSIONS_2} x {$CARTON_DIMENSIONS_3}'
) )
), ),
array ( array(
'fob_basis_name', 'fob_basis_name',
'carton_netto_weight' 'carton_netto_weight'
), ),
array ( array(
'', '',
'carton_brutto_weight' 'carton_brutto_weight'
), ),
array ( array(
'pieces_per_carton', 'pieces_per_carton',
'carton_volume_meter' 'carton_volume_meter'
), ),
array ( array(
'product_netto_weight', 'product_netto_weight',
'unit_id' 'unit_id'
), ),
array ( array(
'product_brutto_weight', 'product_brutto_weight',
'country_of_origin' 'country_of_origin'
), ),
array ( array(
'packing_type_name', 'packing_type_name',
'' ''
), ),
array ( array(
array ( array(
'label' => 'LBL_PACKING_DIMENSIONS_1', 'label' => 'LBL_PACKING_DIMENSIONS_1',
'customCode' => '{$PACKING_DIMENSIONS_1} x {$PACKING_DIMENSIONS_2} x {$PACKING_DIMENSIONS_3}' 'customCode' => '{$PACKING_DIMENSIONS_1} x {$PACKING_DIMENSIONS_2} x {$PACKING_DIMENSIONS_3}'
), ),
'' ''
), ),
array ( array(
'rma' 'rma'
), ),
array ( array(
'boxes_per_layer', 'boxes_per_layer',
'number_of_layers' 'number_of_layers'
), ),
array ( array(
'boxes_per_palette', 'boxes_per_palette',
'pieces_per_palette' 'pieces_per_palette'
), ),
array ( array(
'palette_weight_brutto', 'palette_weight_brutto',
'' ''
) )
), ),
'LBL_LOCALIZED_INFORMATION' => array ( 'LBL_LOCALIZED_INFORMATION' => array(
array ( array(
array ( array(
'hideLabel' => true, 'hideLabel' => true,
'customCode' => ' 'customCode' => '
<script> <script>
@@ -480,11 +481,11 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
</select>' </select>'
) )
), ),
array ( array(
array ( array(
'' ''
), ),
array ( array(
'label' => 'LBL_REMARKS', 'label' => 'LBL_REMARKS',
'customCode' => ' 'customCode' => '
<div id="remarks_pl">{$REMARKS_pl}</div> <div id="remarks_pl">{$REMARKS_pl}</div>
@@ -495,8 +496,8 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
<div style="display:none;" id="remarks_es">{$REMARKS_es}</div>' <div style="display:none;" id="remarks_es">{$REMARKS_es}</div>'
) )
), ),
array ( array(
array ( array(
'label' => 'LBL_SHORT_DESCRIPTION', 'label' => 'LBL_SHORT_DESCRIPTION',
'customCode' => ' 'customCode' => '
<div id="short_description_pl">{$SHORT_DESCRIPTION_pl}</div> <div id="short_description_pl">{$SHORT_DESCRIPTION_pl}</div>
@@ -506,7 +507,7 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
<div style="display:none;" id="short_description_it">{$SHORT_DESCRIPTION_it}</div> <div style="display:none;" id="short_description_it">{$SHORT_DESCRIPTION_it}</div>
<div style="display:none;" id="short_description_es">{$SHORT_DESCRIPTION_es}</div>' <div style="display:none;" id="short_description_es">{$SHORT_DESCRIPTION_es}</div>'
), ),
array ( array(
'label' => 'LBL_LONG_DESCRIPTION', 'label' => 'LBL_LONG_DESCRIPTION',
'customCode' => ' 'customCode' => '
<div id="long_description_pl">{$LONG_DESCRIPTION_pl}</div> <div id="long_description_pl">{$LONG_DESCRIPTION_pl}</div>
@@ -517,8 +518,8 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
<div style="display:none;" id="long_description_es">{$LONG_DESCRIPTION_es}</div>' <div style="display:none;" id="long_description_es">{$LONG_DESCRIPTION_es}</div>'
) )
), ),
array ( array(
array ( array(
'label' => 'LBL_PRICE', 'label' => 'LBL_PRICE',
'customCode' => ' 'customCode' => '
<div id="price_pl">{$PRICE_pl}</div> <div id="price_pl">{$PRICE_pl}</div>
@@ -532,9 +533,9 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
), ),
'LBL_PANEL_CATEGORIES' => array ( 'LBL_PANEL_CATEGORIES' => array(
0 => array ( 0 => array(
0 => array ( 0 => array(
'name' => 'items_list_panel3', 'name' => 'items_list_panel3',
'allCols' => true, 'allCols' => true,
'hideLabel' => true, 'hideLabel' => true,
@@ -542,9 +543,9 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
) )
) )
), ),
'LBL_PANEL_PRICES' => array ( 'LBL_PANEL_PRICES' => array(
0 => array ( 0 => array(
0 => array ( 0 => array(
'name' => 'items_list_panel4', 'name' => 'items_list_panel4',
'allCols' => true, 'allCols' => true,
'hideLabel' => true, 'hideLabel' => true,
@@ -552,9 +553,18 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
) )
) )
), ),
'LBL_PRODUCTION_PANEL' => array ( 'LBL_PRODUCTION_PANEL' => array(
array ( array(
array ( array (
'name' => 'usage_list',
'hideLabel' => true,
'customCode' => '${USAGE_LIST}'
)
)
),
'LBL_PRODUCTION_PANEL' => array(
array(
array(
'name' => 'production_panel', 'name' => 'production_panel',
'allCols' => true, 'allCols' => true,
'hideLabel' => true, 'hideLabel' => true,
@@ -563,20 +573,20 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
) )
) )
), ),
'LBL_PANEL_ASSIGNMENT' => array ( 'LBL_PANEL_ASSIGNMENT' => array(
array ( array(
array ( array(
'name' => 'assigned_user_name', 'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO' 'label' => 'LBL_ASSIGNED_TO'
), ),
array ( array(
'name' => 'date_modified', 'name' => 'date_modified',
'label' => 'LBL_DATE_MODIFIED', 'label' => 'LBL_DATE_MODIFIED',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}' 'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}'
) )
), ),
array ( array(
array ( array(
'name' => 'date_entered', 'name' => 'date_entered',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}' 'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}'
) )
@@ -584,4 +594,3 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
) )
) )
); );
?>