<?php
/*********************************************************************************
 * SugarCRM is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
$viewdefs ['EcmProducts'] ['DetailView'] = array (
		'templateMeta' => array (
				'form' => array (
						'buttons' => array (
								'EDIT',
								'DUPLICATE',
								'DELETE',
								'FIND_DUPLICATES',
								array (
										'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',
				'widths' => array (
						array (
								'label' => '10',
								'field' => '30' 
						),
						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' 
						) 
				) 
		),
		
		// array('file'=>'modules/EcmQuotes/CreateItem.js'),
		// array('file'=>'modules/EcmProducts/mintajax.js'),
		// array('file'=>'modules/EcmProducts/helper.js'),
		
		'panels' => array (
				'LBL_PRODUCT_INFORMATION' => array (
						array (
								'name',
								'assigned_user_name' 
						),
						array (
								'code',
								'product_active' 
						),
						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' 
								),
								'custom_duty_rate' 
						),
						array (
								'vat_name',
								'commission_rate' 
						),
						array (
								'purchase_price',
								'srp_price' 
						),
						array (
								'selling_price',
								'srp_price_eur' 
						),
						array (
								'fob_price',
								'srp_promo_price' 
						),
						array (
								'ems_price' 
						) 
				),
				'LBL_STOCK_INFORMATION' => array (
						array (
								array (
										'customCode' => '{$ORDERED}',
										'label' => 'Zamówień' 
								),
								'qty_per_unit' 
						),
						array (
								'qty_in_stock',
								'reorder_level' 
						),
						array (
								'ems_qty_in_stock',
								'qty_in_demand' 
						),
						array (
								array (
										'customCode' => '{$INVENTORY_INFORMATION}',
										'label' => 'Inventory informations' 
								),
								'lead_time' 
						),
						array (
							'stock_addresses'
						) 
				),
		        /*
				'LBL_SELLING_THIS_MONTH_INFORMATION' => array (
						array (
								'this_month_val',
								'this_month_qty' 
						),
						array (
								'this_month_cost',
								'this_month_margin' 
						) 
				),
				'LBL_SELLING_LAST_MONTH_INFORMATION' => array (
						array (
								'last_month_val',
								'last_month_qty' 
						),
						array (
								'last_month_cost',
								'last_month_margin' 
						) 
				),
				'LBL_SELLING_Q1_INFORMATION' => array (
						array (
								'q1_val',
								'q1_qty' 
						),
						array (
								'q1_cost',
								'q1_margin' 
						) 
				),
				'LBL_SELLING_LAST_Q1_INFORMATION' => array (
						array (
								'last_q1_val',
								'last_q1_qty' 
						),
						array (
								'last_q1_cost',
								'last_q1_margin' 
						) 
				),
				'LBL_SELLING_Q2_INFORMATION' => array (
						array (
								'q2_val',
								'q2_qty' 
						),
						array (
								'q2_cost',
								'q2_margin' 
						) 
				),
				'LBL_SELLING_LAST_Q2_INFORMATION' => array (
						array (
								'last_q2_val',
								'last_q2_qty' 
						),
						array (
								'last_q2_cost',
								'last_q2_margin' 
						) 
				),
				'LBL_SELLING_Q3_INFORMATION' => array (
						array (
								'q3_val',
								'q3_qty' 
						),
						array (
								'q3_cost',
								'q3_margin' 
						) 
				),
				'LBL_SELLING_LAST_Q3_INFORMATION' => array (
						array (
								'last_q3_val',
								'last_q3_qty' 
						),
						array (
								'last_q3_cost',
								'last_q3_margin' 
						) 
				),
				'LBL_SELLING_Q4_INFORMATION' => array (
						array (
								'q4_val',
								'q4_qty' 
						),
						array (
								'q4_cost',
								'q4_margin' 
						) 
				),
				'LBL_SELLING_LAST_Q4_INFORMATION' => array (
						array (
								'last_q4_val',
								'last_q4_qty' 
						),
						array (
								'last_q4_cost',
								'last_q4_margin' 
						) 
				),
				'LBL_SELLING_THIS_YEAR_INFORMATION' => array (
						array (
								'this_year_val',
								'this_year_qty' 
						),
						array (
								'this_year_cost',
								'this_year_margin' 
						) 
				),
				'LBL_SELLING_LAST_YEAR_INFORMATION' => array (
						array (
								'last_year_val',
								'last_year_qty' 
						),
						array (
								'last_year_cost',
								'last_year_margin' 
						) 
				), */
				'LBL_WWW_PANEL' => array (
						array (
								'www_available',
								'www_popular' 
						),
						array (
								'www_price_pln',
								'www_price_eur' 
						),
						array (
								'www_state',
								'www_manual_update' 
						),
						array (
								'www_state_desc_pl',
								'www_state_desc_en' 
						) 
				),
				'LBL_DRIVERS_IMAGES' => array (
						array (
								array (
										'label' => 'LBL_PRODUCT_PICTURE',
										'customCode' => '{$PRODUCT_PICTURE}' 
								),
								array (
										'label' => 'LBL_PACKING_FRONT_PICTURE',
										'customCode' => '{$PACKING_FRONT_PICTURE}' 
								) 
						),
						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' => '',
										'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}' 
								),
								'' 
						),
						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>
								{literal}
								function select_lang(value)
								{
									document.getElementById("remarks_pl").style.display="none";
									document.getElementById("short_description_pl").style.display="none";
									document.getElementById("long_description_pl").style.display="none";
									document.getElementById("price_pl").style.display="none";
						
									document.getElementById("remarks_en").style.display="none";
									document.getElementById("short_description_en").style.display="none";
									document.getElementById("long_description_en").style.display="none";
									document.getElementById("price_en").style.display="none";
						
									document.getElementById("remarks_de").style.display="none";
									document.getElementById("short_description_de").style.display="none";
									document.getElementById("long_description_de").style.display="none";
									document.getElementById("price_de").style.display="none";
						
									document.getElementById("remarks_fr").style.display="none";
									document.getElementById("short_description_fr").style.display="none";
									document.getElementById("long_description_fr").style.display="none";
									document.getElementById("price_fr").style.display="none";
						
									document.getElementById("remarks_it").style.display="none";
									document.getElementById("short_description_it").style.display="none";
									document.getElementById("long_description_it").style.display="none";
									document.getElementById("price_it").style.display="none";
						
									document.getElementById("remarks_es").style.display="none";
									document.getElementById("short_description_es").style.display="none";
									document.getElementById("long_description_es").style.display="none";
									document.getElementById("price_es").style.display="none";
									document.getElementById("remarks_"+value).style.display="block";
									document.getElementById("short_description_"+value).style.display="block";
									document.getElementById("long_description_"+value).style.display="block";
									document.getElementById("price_"+value).style.display="block";
								}
								{/literal}
								</script>
								   <select name="slang" id="slang" onchange="select_lang(this.value);">
      								<option value="pl">pl</option>
      								<option value="en">en</option>
      								<option value="de">de</option>
      								<option value="fr">fr</option>
      								<option value="it">it</option>
      								<option value="es">es</option>
    							   </select>' 
								) 
						),
						array (
								array (
										'' 
								),
								array (
										'label' => 'LBL_REMARKS',
										'customCode' => '
						<div id="remarks_pl">{$REMARKS_pl}</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_fr">{$REMARKS_fr}</div>
						<div style="display:none;" id="remarks_it">{$REMARKS_it}</div>
						<div style="display:none;" id="remarks_es">{$REMARKS_es}</div>' 
								) 
						),
						array (
								array (
										'label' => 'LBL_SHORT_DESCRIPTION',
										'customCode' => '
						<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_de">{$SHORT_DESCRIPTION_de}</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_es">{$SHORT_DESCRIPTION_es}</div>' 
								),
								array (
										'label' => 'LBL_LONG_DESCRIPTION',
										'customCode' => '
						<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_de">{$LONG_DESCRIPTION_de}</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_es">{$LONG_DESCRIPTION_es}</div>' 
								) 
						),
						array (
								array (
										'label' => 'LBL_PRICE',
										'customCode' => '
						<div id="price_pl">{$PRICE_pl}</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_fr">{$PRICE_fr}</div>
						<div style="display:none;" id="price_it">{$PRICE_it}</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' => '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}' 
								) 
						) 
				) 
		) 
);
?>
