<?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.
 * asd
 * 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']['EditView'] = array( 
	'templateMeta'=>array(
		'form' => array(
			'buttons'=>array(
			        array(
			                'customCode'=>'<input class="button primary" type="submit" value="Zapisz" name="button" onclick="this.form.action.value=\'AjaxSave\';return check_form_(\'EditView\');" accesskey="S" title="Zapisz [Alt+S]">'
			        
			        ),
			'CANCEL',
			),
			'enctype'=> 'multipart/form-data',
			'hidden'=>array(
				'<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>
			        <input type="hidden" name="action" id="action" value="AjaxSave">',
			),
		     
		),
		'maxColumns'=>'2', 
        'widths'=>array(
            array('label'=>'10','field'=>'30'), 
            array('label'=>'10','field'=>'30'),                                                                                                                                  
		),

	),
	'panels'=>array(
		'LBL_PRODUCT_INFORMATION'=>array(
			array('name','assigned_user_name'),
			array('code','product_active'),
			array('B2B','B2C'),
			array(
				array(
					'name' =>'ean',
					'label' => 'LBL_EAN',
					'customCode' => '<input name="ean" id="ean" value="{$EAN}">
					<input type="button" class="button" onClick="generateEAN();" value="{$MOD.LBL_GENERATE_EAN}"/>
					<input type="hidden" name="newEan" id="newEan" value="0"/>
					',
				),
				array(
					'name' =>'ean2',
					'label' => 'LBL_EAN2',
					'customCode' => '<input name="ean2" id="ean2" value="{$EAN2}">
					<input type="button" class="button" onClick="generateEAN2(); alert(document.getElementById(\'newEan2\').value)" value="{$MOD.LBL_GENERATE_EAN}"/>
					<input type="hidden" name="newEan2" id="newEan2" value="0"/>
					',
				),	
			),
			//array('product_category_name','product_subcategory_name'),
			/*
				array(
				array(
					'name'=>'models',
					'label'=>'Models',
					'customCode'=>'{$SM}',
				),
				'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('serial_no'),
			array('status'),
		    array(
		            array(
		                    'label'=>'LBL_TAX_CLASS_NAME',
		                    'customCode'=>'<select tabindex="v" id="vat_id" name="vat_id">{$VAT_ID}</select>',
		            ),'unit_id'
),
		    array('pkwiu','ks_group'),
		//	array('flag','th'),
		),
			'LBL_PANEL_PRICES' => array (
					array (
							array (
									'name' => 'items_list_panel',
									'allCols' => true,
									'hideLabel' => true,
									'customCode' => '<table style="width:100%;"><tr><td style="width:40%;">
						<input type="hidden" name="position_list4" id="position_list4" value=\'{$POSITION_LIST4}\'>
						<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
          				<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV3">
							<table class="positions" style="width:100%;" id="itemsTable4">
								<thead id="head">
									<tr id="tr">
										<td width="70%">{$MOD.LBL_PRICE_NAME}</td>
										<td width="30%">{$MOD.LBL_PRICE_VALUE}</td>
										<td width="30%">{$MOD.LBL_PRICE_CURRENCY}</td>
									</tr>
								</thead>
								<tbody id="tbody">
								</tbody>
							</table>
						</div><br></td><td style="width:10%;"></td><td style="width:40%;">
							        <input type="hidden" name="position_list3" id="position_list3" value=\'{$POSITION_LIST3}\'>
						<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
          				<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV3">
							<table class="positions" style="width:100%;" id="itemsTable3">
								<thead id="head">
									<tr id="tr">
										<td width="80%">{$MOD.LBL_CATEGORY_NAME}</td>
										<td width="20%"></td>
									</tr>
								</thead>
								<tbody id="tbody">
								</tbody>
							</table>
						</div></td></tr></table>'
							)
					)
			),
		'LBL_STOCK_INFORMATION'=>array(
			array(
				'ems_ordered',
				'qty_per_unit'
			),
			array('qty_in_stock','reorder_level'),
			array('','qty_in_demand'),
			array('lead_time'),
		),
	        /*
		'LBL_DRIVERS_IMAGES'=>array(
			array(
				array(
					'label'=>'LBL_PRODUCT_PICTURE',
					'customCode'=>'<input name="product_picture" type="file" maxlength="255" value="" />{$PRODUCT_PICTURE_UPLOAD}',
	 			),
				array(
					'label'=>'LBL_PACKING_FRONT_PICTURE',
					'customCode'=>'<input name="packing_front_picture" type="file" maxlength="255" value="" />{$PACKING_FRONT_PICTURE_UPLOAD}',
	 			),
			),
			array(
				array(
					'label'=>'Usuń grafikę',
					'customCode'=>'<input name="delete_product_picture" type="checkbox" maxlength="255" value="1" />',
	 			),
				array(
					'label'=>'Usuń grafikę',
					'customCode'=>'<input name="delete_packing_front_picture" type="checkbox" maxlength="255" value="1" />',
	 			),
			),
			array(
				array(
					'label'=>'LBL_DRIVER_1',
					'customCode'=>'<input name="driver_1" type="file" maxlength="255" value="" />{$DRIVER_1_UPLOAD}',
	 			),
				array(
					'label'=>'LBL_DRIVER_2',
					'customCode'=>'<input name="driver_2" type="file" maxlength="255" value="" />{$DRIVER_2_UPLOAD}',
	 			),
			),
				array(
						array(
								'label'=>'Usuń sterowniki',
								'customCode'=>'<input name="delete_driver_1" type="checkbox" maxlength="255" value="1" />',
						),
						array(
								'label'=>'Usuń sterowniki',
								'customCode'=>'<input name="delete_driver_2" type="checkbox" maxlength="255" value="1" />',
						),
				),
		),
		'LBL_LOGISTIC_INFORMATION'=>array(
			array('moq',
				array(
					'label'=>'LBL_CARTON_DIMENSIONS_1',
					'customCode'=>'<input name="carton_dimensions_1" size="3" maxlength="25" type="text" value="{$CARTON_DIMENSIONS_1}" /> x 
   								   <input name="carton_dimensions_2" size="3" maxlength="25" type="text" value="{$CARTON_DIMENSIONS_2}" /> x 
   								   <input name="carton_dimensions_3" size="3" maxlength="25" type="text" value="{$CARTON_DIMENSIONS_3}" />'
   				),
			),
			array(
				array(
					'label'=>'LBL_FOB_BASIS_NAME',
					'customCode'=>'<select id="fob_basis_id" name="fob_basis_id">{$FOB_BASIS_ID}</select>',
				),
				'carton_netto_weight'
			),
			array('delivery_time_fob','carton_brutto_weight'),
			array('pieces_per_carton','carton_volume_meter'),
			array('product_brutto_weight','country_of_origin'),
			array(
				array(
					'label'=>'LBL_PACKING_TYPE_NAME',
					'customCode'=>'<select id="packing_type_id" name="packing_type_id">{$PACKING_TYPE_ID}</select>',
				),
				'certificate_of_origin'
			),
			array(
				array(
					'label'=>'LBL_PACKING_DIMENSIONS_1',
					'customCode'=>'<input name="packing_dimensions_1" size="3" maxlength="25" type="text" value="{$PACKING_DIMENSIONS_1}" /> x 
   								   <input name="packing_dimensions_2" size="3" maxlength="25" type="text" value="{$PACKING_DIMENSIONS_2}" /> x 
   								   <input name="packing_dimensions_3" size="3" maxlength="25" type="text" value="{$PACKING_DIMENSIONS_3}" />'
   				)
				,'form_a'
			),
			array('rma'),
			array ('boxes_per_layer','number_of_layers'),
			array ('boxes_per_palette','pieces_per_palette'),
			array ('palette_weight_brutto','product_netto_weight'),
		), */
		'LBL_LOCALIZED_INFORMATION'=>array(
			array(
				array(
					'hideLabel'=>true,
					'customCode'=>'
								<script>
								{literal}
								function select_lang(value)
								{
									//document.getElementById("ean_pl").style.display="none";
									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("ean_en").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("ean_de").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("ean_"+value).style.display="block";
									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>
    							   </select>',
				),
			),
			array(
/*			
				array(
					'label'=>'LBL_LOCAL_EAN',
					'customCode'=>'<input name="ean_pl" type="text" id="ean_pl" value="{$EAN_pl}" /><input style="display:none;" name="ean_en" type="text" id="ean_en" value="{$EAN_en}" /><input style="display:none;" name="ean_de" type="text" id="ean_de" value="{$EAN_de}" />',
				),
*/
				array (''),
				array(
					'label'=>'LBL_REMARKS',
					'customCode'=>'<input name="remarks_pl" type="text" id="remarks_pl" value="{$REMARKS_pl}" /><input style="display:none;" name="remarks_en" type="text" id="remarks_en" value="{$REMARKS_en}" /><input style="display:none;" name="remarks_de" type="text" id="remarks_de" value="{$REMARKS_de}" />',
				),
			),
			array(
				array(
					'label'=>'LBL_SHORT_DESCRIPTION',
					'customCode'=>'<textarea name="short_description_pl" type="text" id="short_description_pl">{$SHORT_DESCRIPTION_pl}</textarea><textarea style="display:none;" name="short_description_en" type="text" id="short_description_en">{$SHORT_DESCRIPTION_en}</textarea><textarea style="display:none;" name="short_description_de" type="text" id="short_description_de">{$SHORT_DESCRIPTION_de}</textarea>',
				),
				array(
					'label'=>'LBL_LONG_DESCRIPTION',
					'customCode'=>'<textarea name="long_description_pl" cols="80" rows="20" type="text" id="long_description_pl">{$LONG_DESCRIPTION_pl}</textarea><textarea cols="80" rows="20" style="display:none;" name="long_description_en" type="text" id="long_description_en">{$LONG_DESCRIPTION_en}</textarea><textarea cols="80" rows="20" style="display:none;" name="long_description_de" type="text" id="long_description_de">{$LONG_DESCRIPTION_de}</textarea>',
				),
			),
			array(
				array(
					'label'=>'LBL_PRICE',
					'customCode'=>'<input name="price_pl" type="text" id="price_pl" value="{$PRICE_pl}" /><input style="display:none;" name="price_en" type="text" id="price_en" value="{$PRICE_en}" /><input style="display:none;" name="price_de" type="text" id="price_de" value="{$PRICE_de}" />',
				),
			),
  		), 
  		
		'LBL_COMPONENTS'=>array(
			array(
				array(
					'name' => 'items_list_panel',
					'allCols' => true,
					'hideLabel' => true,
					'customCode' => '
						<link rel="stylesheet" type="text/css" href="modules/EcmProducts/MyTable.css" />
          				<link rel="stylesheet" type="text/css" href="modules/EcmProducts/AjaxSearch/AjaxSearch.css" />
          				<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV">
							<table class="positions" style="width:100%;" id="itemsTable">
								<thead id="head">
									<tr id="tr">
										<td width="4%">{$MOD.LBL_EDITTABLE_NO}</td>
										<td width="10%">{$MOD.LBL_EDITTABLE_CODE}</td>
										<td width="58%">{$MOD.LBL_EDITTABLE_NAME}</td>
										<td width="12%">{$MOD.LBL_EDITTABLE_UNIT}</td>
										<td width="10%">{$MOD.LBL_EDITTABLE_QUANTITY}</td>
										<td width="6%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>
									</tr>
								</thead>
								<tbody id="tbody">
								</tbody>
							</table>
						</div>',
				),
			),
		),  
	),                  
);
?>
