"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,175 +34,175 @@
* 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 (
'customCode' => '<input class="button" type="submit" value="{$MOD.LBL_ALLEGRO}" onClick="this.form.action.value=\'allegroTemplate\';">'
)
),
'hidden' => array (
'<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>'
)
), ),
'maxColumns' => '2', array(
'widths' => array ( 'customCode' => '<input class="button" type="submit" value="{$MOD.LBL_ALLEGRO}" onClick="this.form.action.value=\'allegroTemplate\';">'
array ( )
'label' => '10', ),
'field' => '30' 'hidden' => array(
), '<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>'
array ( )
'label' => '10',
'field' => '30'
)
),
'includes' => array (
array (
'file' => 'include/JSON.js'
),
// array('file'=>'include/javascript/quicksearch.js'),
// array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
array (
'file' => 'modules/EcmProducts/AjaxSearch/AjaxSearch.js'
),
array (
'file' => 'modules/EcmProducts/javascript/formloader.js'
),
array (
// 'file' => 'modules/EcmProducts/javascript/MyTable.js'
),
array (
// 'file' => 'modules/EcmProducts/javascript/EcmProductDetailView.js'
),
array (
'file' => 'modules/EcmProducts/javascript/ProductionTables.js'
),
array (
'file' => 'modules/EcmProducts/javascript/ProductionSummary.js'
)
)
), ),
'maxColumns' => '2',
// array('file'=>'modules/EcmQuotes/CreateItem.js'), 'widths' => array(
// array('file'=>'modules/EcmProducts/mintajax.js'), array(
// array('file'=>'modules/EcmProducts/helper.js'), 'label' => '10',
'field' => '30'
'panels' => array ( ),
'LBL_PRODUCT_INFORMATION' => array ( array(
array ( 'label' => '10',
'name', 'field' => '30'
'assigned_user_name' )
), ),
array ( 'includes' => array(
'code', array(
'product_active' 'file' => 'include/JSON.js'
), ),
array (
'ean', // array('file'=>'include/javascript/quicksearch.js'),
'ean2' // array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
), array(
array ( 'file' => 'modules/EcmProducts/AjaxSearch/AjaxSearch.js'
'vendor_name', ),
'part_no' array(
), 'file' => 'modules/EcmProducts/javascript/formloader.js'
array ( ),
'vendor_part_no', array(
'serial_no' // 'file' => 'modules/EcmProducts/javascript/MyTable.js'
), ),
array ( array(
'brand', // 'file' => 'modules/EcmProducts/javascript/EcmProductDetailView.js'
'brand_label' ),
), array(
array ( 'file' => 'modules/EcmProducts/javascript/ProductionTables.js'
'production', ),
'status' array(
), 'file' => 'modules/EcmProducts/javascript/ProductionSummary.js'
)
// array('product_category_name','product_subcategory_name'), )
// array('product_line_name'), ),
// array('sales_start_date','sales_end_date'),
// array('manufacturer_name','parent_name'), // array('file'=>'modules/EcmQuotes/CreateItem.js'),
// array('contact_name','website'), // array('file'=>'modules/EcmProducts/mintajax.js'),
// array('vendor_name','part_no'), // array('file'=>'modules/EcmProducts/helper.js'),
// array('vendor_part_no','serial_no'),
array ( 'panels' => array(
'group_ks', 'LBL_PRODUCT_INFORMATION' => array(
'mainproduct_name' array(
), 'name',
array ( 'assigned_user_name'
'active', ),
'is_mainproduct' array(
), 'code',
array ( 'product_active'
'group_name', ),
array(
), 'ean',
'ean2'
),
array(
'vendor_name',
'part_no'
),
array(
'vendor_part_no',
'serial_no'
),
array(
'brand',
'brand_label'
),
array(
'production',
'status'
),
// array('product_category_name','product_subcategory_name'),
// array('product_line_name'),
// array('sales_start_date','sales_end_date'),
// array('manufacturer_name','parent_name'),
// array('contact_name','website'),
// array('vendor_name','part_no'),
// array('vendor_part_no','serial_no'),
array(
'group_ks',
'mainproduct_name'
),
array(
'active',
'is_mainproduct'
),
array(
'group_name',
),
),
'LBL_PRICING_INFORMATION' => array(
array(
array(
'customCode' => '{$EXCHANGE_RATE_NAME}',
'label' => 'LBL_EXCHANGE_RATE_NAME'
), ),
'LBL_PRICING_INFORMATION' => array ( 'custom_duty_rate'
array ( ),
array ( array(
'customCode' => '{$EXCHANGE_RATE_NAME}', 'vat_name',
'label' => 'LBL_EXCHANGE_RATE_NAME' 'commission_rate'
), ),
'custom_duty_rate' array(
), 'purchase_price',
array ( 'srp_price'
'vat_name', ),
'commission_rate' array(
), 'selling_price',
array ( 'srp_price_eur'
'purchase_price', ),
'srp_price' array(
), 'fob_price',
array ( 'srp_promo_price'
'selling_price', ),
'srp_price_eur' array(
), 'ems_price'
array ( )
'fob_price', ),
'srp_promo_price' 'LBL_STOCK_INFORMATION' => array(
), array(
array ( array(
'ems_price' 'customCode' => '{$ORDERED}',
) 'label' => 'Zamówień'
), ),
'LBL_STOCK_INFORMATION' => array ( 'qty_per_unit'
array ( ),
array ( array(
'customCode' => '{$ORDERED}', 'qty_in_stock',
'label' => 'Zamówień' 'reorder_level'
), ),
'qty_per_unit' array(
), 'ems_qty_in_stock',
array ( 'qty_in_demand'
'qty_in_stock', ),
'reorder_level' array(
), array(
array ( 'customCode' => '{$INVENTORY_INFORMATION}',
'ems_qty_in_stock', 'label' => 'Inventory informations'
'qty_in_demand'
),
array (
array (
'customCode' => '{$INVENTORY_INFORMATION}',
'label' => 'Inventory informations'
),
'lead_time'
),
array (
'stock_addresses'
)
), ),
/* 'lead_time'
),
array(
'stock_addresses'
)
),
/*
'LBL_SELLING_THIS_MONTH_INFORMATION' => array ( 'LBL_SELLING_THIS_MONTH_INFORMATION' => array (
array ( array (
'this_month_val', 'this_month_val',
@@ -322,114 +323,114 @@ $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(
array(
array(
'label' => 'LBL_PRODUCT_PICTURE',
'customCode' => '{$PRODUCT_PICTURE}'
), ),
'LBL_DRIVERS_IMAGES' => array ( array(
array ( 'label' => 'LBL_PACKING_FRONT_PICTURE',
array ( 'customCode' => '{$PACKING_FRONT_PICTURE}'
'label' => 'LBL_PRODUCT_PICTURE', )
'customCode' => '{$PRODUCT_PICTURE}' ),
), array(
array ( array(
'label' => 'LBL_PACKING_FRONT_PICTURE', 'label' => 'LBL_DRIVER_1',
'customCode' => '{$PACKING_FRONT_PICTURE}' 'customCode' => '{$DRIVER_1_DOWNLOAD}'
)
),
array (
array (
'label' => 'LBL_DRIVER_1',
'customCode' => '{$DRIVER_1_DOWNLOAD}'
),
array (
'label' => 'LBL_DRIVER_2',
'customCode' => '{$DRIVER_2_DOWNLOAD}'
)
)
), ),
'LBL_QRCODE' => array ( array(
array ( 'label' => 'LBL_DRIVER_2',
array ( 'customCode' => '{$DRIVER_2_DOWNLOAD}'
'label' => '', )
'customCode' => '{$QRCODE}' )
) ),
) 'LBL_QRCODE' => array(
array(
array(
'label' => '',
'customCode' => '{$QRCODE}'
)
)
),
'LBL_LOGISTIC_INFORMATION' => array(
array(
'',
array(
'label' => 'LBL_CARTON_DIMENSIONS_1',
'customCode' => '{$CARTON_DIMENSIONS_1} x {$CARTON_DIMENSIONS_2} x {$CARTON_DIMENSIONS_3}'
)
),
array(
'fob_basis_name',
'carton_netto_weight'
),
array(
'',
'carton_brutto_weight'
),
array(
'pieces_per_carton',
'carton_volume_meter'
),
array(
'product_netto_weight',
'unit_id'
),
array(
'product_brutto_weight',
'country_of_origin'
),
array(
'packing_type_name',
''
),
array(
array(
'label' => 'LBL_PACKING_DIMENSIONS_1',
'customCode' => '{$PACKING_DIMENSIONS_1} x {$PACKING_DIMENSIONS_2} x {$PACKING_DIMENSIONS_3}'
), ),
'LBL_LOGISTIC_INFORMATION' => array ( ''
array ( ),
'', array(
array ( 'rma'
'label' => 'LBL_CARTON_DIMENSIONS_1', ),
'customCode' => '{$CARTON_DIMENSIONS_1} x {$CARTON_DIMENSIONS_2} x {$CARTON_DIMENSIONS_3}' array(
) 'boxes_per_layer',
), 'number_of_layers'
array ( ),
'fob_basis_name', array(
'carton_netto_weight' 'boxes_per_palette',
), 'pieces_per_palette'
array ( ),
'', array(
'carton_brutto_weight' 'palette_weight_brutto',
), ''
array ( )
'pieces_per_carton', ),
'carton_volume_meter' 'LBL_LOCALIZED_INFORMATION' => array(
), array(
array ( array(
'product_netto_weight', 'hideLabel' => true,
'unit_id' 'customCode' => '
),
array (
'product_brutto_weight',
'country_of_origin'
),
array (
'packing_type_name',
''
),
array (
array (
'label' => 'LBL_PACKING_DIMENSIONS_1',
'customCode' => '{$PACKING_DIMENSIONS_1} x {$PACKING_DIMENSIONS_2} x {$PACKING_DIMENSIONS_3}'
),
''
),
array (
'rma'
),
array (
'boxes_per_layer',
'number_of_layers'
),
array (
'boxes_per_palette',
'pieces_per_palette'
),
array (
'palette_weight_brutto',
''
)
),
'LBL_LOCALIZED_INFORMATION' => array (
array (
array (
'hideLabel' => true,
'customCode' => '
<script> <script>
{literal} {literal}
function select_lang(value) function select_lang(value)
@@ -477,111 +478,119 @@ $viewdefs ['EcmProducts'] ['DetailView'] = array (
<option value="fr">fr</option> <option value="fr">fr</option>
<option value="it">it</option> <option value="it">it</option>
<option value="es">es</option> <option value="es">es</option>
</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>
<div style="display:none;" id="remarks_en">{$REMARKS_en}</div> <div style="display:none;" id="remarks_en">{$REMARKS_en}</div>
<div style="display:none;" id="remarks_de">{$REMARKS_de}</div> <div style="display:none;" id="remarks_de">{$REMARKS_de}</div>
<div style="display:none;" id="remarks_fr">{$REMARKS_fr}</div> <div style="display:none;" id="remarks_fr">{$REMARKS_fr}</div>
<div style="display:none;" id="remarks_it">{$REMARKS_it}</div> <div style="display:none;" id="remarks_it">{$REMARKS_it}</div>
<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>
<div style="display:none;" id="short_description_en">{$SHORT_DESCRIPTION_en}</div> <div style="display:none;" id="short_description_en">{$SHORT_DESCRIPTION_en}</div>
<div style="display:none;" id="short_description_de">{$SHORT_DESCRIPTION_de}</div> <div style="display:none;" id="short_description_de">{$SHORT_DESCRIPTION_de}</div>
<div style="display:none;" id="short_description_fr">{$SHORT_DESCRIPTION_fr}</div> <div style="display:none;" id="short_description_fr">{$SHORT_DESCRIPTION_fr}</div>
<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>
<div style="display:none;" id="long_description_en">{$LONG_DESCRIPTION_en}</div> <div style="display:none;" id="long_description_en">{$LONG_DESCRIPTION_en}</div>
<div style="display:none;" id="long_description_de">{$LONG_DESCRIPTION_de}</div> <div style="display:none;" id="long_description_de">{$LONG_DESCRIPTION_de}</div>
<div style="display:none;" id="long_description_fr">{$LONG_DESCRIPTION_fr}</div> <div style="display:none;" id="long_description_fr">{$LONG_DESCRIPTION_fr}</div>
<div style="display:none;" id="long_description_it">{$LONG_DESCRIPTION_it}</div> <div style="display:none;" id="long_description_it">{$LONG_DESCRIPTION_it}</div>
<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>
<div style="display:none;" id="price_en">{$PRICE_en}</div> <div style="display:none;" id="price_en">{$PRICE_en}</div>
<div style="display:none;" id="price_de">{$PRICE_de}</div> <div style="display:none;" id="price_de">{$PRICE_de}</div>
<div style="display:none;" id="price_fr">{$PRICE_fr}</div> <div style="display:none;" id="price_fr">{$PRICE_fr}</div>
<div style="display:none;" id="price_it">{$PRICE_it}</div> <div style="display:none;" id="price_it">{$PRICE_it}</div>
<div style="display:none;" id="price_es">{$PRICE_es}</div>' <div style="display:none;" id="price_es">{$PRICE_es}</div>'
) )
) )
),
'LBL_PANEL_CATEGORIES' => array(
0 => array(
0 => array(
'name' => 'items_list_panel3',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS3}'
)
)
),
'LBL_PANEL_PRICES' => array(
0 => array(
0 => array(
'name' => 'items_list_panel4',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS4}'
)
)
),
'LBL_PRODUCTION_PANEL' => array(
array(
array (
'name' => 'usage_list',
'hideLabel' => true,
'customCode' => '${USAGE_LIST}'
)
)
),
'LBL_PRODUCTION_PANEL' => array(
array(
array(
'name' => 'production_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
<br><br><div id="summaryTable" style="width: 50%; padding-right: 0px;">Podsumowanie</div>'
)
)
),
'LBL_PANEL_ASSIGNMENT' => array(
array(
array(
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO'
), ),
array(
'name' => 'date_modified',
'LBL_PANEL_CATEGORIES' => array ( 'label' => 'LBL_DATE_MODIFIED',
0 => array ( 'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}'
0 => array ( )
'name' => 'items_list_panel3', ),
'allCols' => true, array(
'hideLabel' => true, array(
'customCode' => '{$POSITIONS3}' 'name' => 'date_entered',
) 'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}'
) )
), )
'LBL_PANEL_PRICES' => array ( )
0 => array ( )
0 => array (
'name' => 'items_list_panel4',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS4}'
)
)
),
'LBL_PRODUCTION_PANEL' => array (
array (
array (
'name' => 'production_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$MOD.LBL_COMPONENTS}<br><div id="componentsTable"></div><br><br>{$MOD.LBL_ACTIONS}<div id="actionsTable"></div>
<br><br><div id="summaryTable" style="width: 50%; padding-right: 0px;">Podsumowanie</div>'
)
)
),
'LBL_PANEL_ASSIGNMENT' => array (
array (
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO'
),
array (
'name' => 'date_modified',
'label' => 'LBL_DATE_MODIFIED',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}'
)
),
array (
array (
'name' => 'date_entered',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}'
)
)
)
)
); );
?>