<?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".

 * *******************************************************************************/



  global $sugar_config;




/*

  if((!isset($focus->footer_text) || $focus->footer_text == '') && (!isset($focus->name) || $focus->name == '') && (!isset($focus->id) || $focus->id == '')) $focus->footer_text = translate('LBL_DEFAULT_FOOTER_TEXT', 'EcmDocumentTemplates');

  if((!isset($focus->header_text) || $focus->header_text == '') && (!isset($focus->name) || $focus->name == '') && (!isset($focus->id) || $focus->id == '')) $focus->header_text = translate('LBL_DEFAULT_HEADER_TEXT', 'EcmDocumentTemplates');

*/



$viewdefs['EcmGroupSales']['EditView'] = array (



  'templateMeta' => array (

      'form' => array (

        'enctype'=>'multipart/form-data',

        'buttons'=>array(

          array('customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="return SaveForm();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">'),

          //array('customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" accessKey="{$MOD.LBL_SEND_BUTTON_KEY}" class="button" onclick="prepSave();this.form.email_action.value=\'Save\';this.form.email_send.value=\'1\';this.form.email_type.value=\'out\';return fill_form(\'out\', \'MOD.ERR_NOT_ADDRESSED\');return SaveForm(); return false;" type="submit" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">'),

          array('customCode' => '<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="window.location=\'index.php?module=EcmGroupSales&action=DetailView&record=\'+this.form.record.value;" type="button" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">'),

          array('customCode' => '<input title="{$MOD.LBL_GO_TO_LIST_BUTTON_TITLE}" accessKey="{$MOD.LBL_GO_TO_LIST_BUTTON_KEY}" class="button" onclick="window.location=\'index.php?module=EcmGroupSales&action=index\'" type="button" name="button" value="{$MOD.LBL_GO_TO_LIST_BUTTON_LABEL}">'),

        ),

        'hidden'=>array(

          '<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>',

          '<input type="hidden" name="email_id" id="email_id" value=\'\'>',//{$fields.email_id.value}\'>',

//          '<input type="hidden" name="total" id="total" value=\'{$fields.total.value}\'>',

        ),

      ),



    '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'=>'modules/EcmGroupSales/formloader.js'),
      
      array('file'=>'modules/EcmGroupSales/MyTable.js'),

      array('file'=>'modules/EcmGroupSales/EcmGroupSales.js'),

    ),



  ),                          



  'panels' => array (



    'DETAILS'=> array(

      

      array(array('type' => 'tab','active' => true,)),

      

      array(

        array(

          'name' => 'formatted_number',

          'tabIndex' => 'f',

          'customCode' => '<input readonly="readonly" type="text" name="formatted_number" id="formatted_number" value=\'{$fields.formatted_number.value}\'>

                           <input type="hidden" name="number" id="number" value=\'{$fields.number.value}\'>'

        ),

        'assigned_user_name'

      ),



      array (

        'name',

        'parent_name'

      ),

      array (

        'status',

        array(

          'label'=>'LBL_TEMPLATE_NAME',

          'customCode'=>'<select id="template_id" name="template_id" onChange="document.getElementById(\'template_name\').value=this.options[this.selectedIndex].text;">{$DOCUMENT_TEMPLATES_OPTIONS}</select><input type="hidden" id="template_name" name="template_name" value="{$fields.template_name.value}">'

        ),
      ),
      
      array (

        array (
          'name' => 'register_date',
          'type' => 'datetime',
          'displayParams'=>array('showFormats'=>true)
        ),
        
      ),



      array(

        array(

          'allCols' => true,

          'hideLabel' => true,

          'customCode' => '<div class="tabForm" style="border-top:none;width:100%;height:1px;padding:0px;align:center;"></div><h4>{$MOD.LBL_TO_INFORMATIONS}</h4>'

        ),

      ),      



      array (

        array(

          'name' => 'parent_address_street',

          'tabIndex' => 'p',

          'customCode' => '<textarea id="parent_address_street" name="parent_address_street" rows="2" cols="30" maxlength="150">{$fields.parent_address_street.value}</textarea>',  

        ),

      ),

      array ('parent_address_postalcode', 'to_nip'),

      array ('parent_address_city', 'to_vatid'),

      array (

        'parent_address_country', 

        array(

          'name' => 'to_is_vat_free',

          'tabIndex' => 't',

          'customCode' => '<input type="checkbox" id="to_is_vat_free" name="to_is_vat_free" value="{$fields.to_is_vat_free.value}" {if $fields.to_is_vat_free.value == 1}checked{/if}>'

        ),

      ),

  

    ),

    

    'ITEMS'=> array(

      array(array('type' => 'tab')),

      array(

        array(

          'allCols' => true,

          'hideLabel' => true,

          'customCode' => '

          '

//          .'{literal}'.

//          '<script language="javascript">var parent_options='.$json->encode($app_list_strings['ecmworkitems_parent_dom']).';</script>'

//          .'{/literal}'.

          .'

          <link rel="stylesheet" type="text/css" href="modules/EcmGroupSales/MyTable.css" />

          <div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:300px;max-height:300px;overflow:auto;">

            <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="42%">{$MOD.LBL_EDITTABLE_NAME}</td>

                  <td width="5%">{$MOD.LBL_EDITTABLE_QUANTITY}</td>

                  <td width="13%">{$MOD.LBL_EDITTABLE_PRICE}</td>

                  <td width="8%">{$MOD.LBL_EDITTABLE_DISCOUNT}</td>

                  <td width="13%">{$MOD.LBL_EDITTABLE_TOTAL}</td>

                  <td width="6%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>

                </tr>

              </thead>

              <tbody id="tbody">

              </tbody>

            </table>

          </div>

            <table width="100%"" cellpadding="0" cellspacing="0" border="0">

              <tr>

                <td width="55%" class="dataLabel" valign="top">

                    <a href="javascript: N.moveUpRow();" >{$MOD.LBL_MOVE_ROW_UP}</a> - <a href="javascript: N.moveDownRow();" >{$MOD.LBL_MOVE_ROW_DOWN}</a>

                </td>                                                                               <!--color:#b3b9cf;-->

                <td width="40%" class="dataField" style="text-align: left;">

                <br>

                <table  id="result_table" cellpadding="0" cellspacing="0" style="width:100%; height:100%; border: 1px solid rgb(48,192,255);">

                <tr id="subtotal_tr"> 

                  <td class="positionsLabel" style="border-top:0px;">{$MOD.LBL_SUBTOTAL}</td>

                  <td class="positionsField" style="border-top:0px;"><input type="text" style="border:0px;font-weight:900;width:100%;text-align:right;" readonly="readonly" name="subtotal" id="subtotal" value=\'{$fields.subtotal.value}\'></td>

                </tr>

                <tr id="total_tr"> 

                  <td class="positionsLabel">{$MOD.LBL_TOTAL}</td>

                  <td class="positionsField"><input type="text" readonly="readonly" style="border:0px;font-weight:900;width:100%;text-align:right;" name="total" id="total" value=\'{$fields.total.value}\'></td>

                </tr>

                </table>

                </td>

                <td width="5%" class="dataField" style="text-align: left;">&nbsp;</td>

              </tr>

            </table>

          ',

        )

      ),

    ),

    

    'TEXTS'=> array(

      array(array('type' => 'tab')),



        array(array('label' => 'LBL_HEADER_TEXT','customCode' => ''),),

        array(array('tabIndex'=>'f', 'customCode'=>'<textarea id="header_text" name="header_text" rows="5" style="width:100%;">{$fields.header_text.value}</textarea>')),



        array(array('label' => 'LBL_FOOTER_TEXT','customCode' => ''),),

        array(array('tabIndex'=>'f', 'customCode'=>'<textarea id="footer_text" name="footer_text" rows="5" style="width:100%;">{$fields.footer_text.value}</textarea>')),



        array(array('label' => 'LBL_ADS_TEXT','customCode' => '{$MFP.ads}'),),

        array(array('tabIndex'=>'f', 'customCode'=>'<textarea id="ads_text" name="ads_text" rows="5" style="width:100%;">{$fields.ads_text.value}</textarea>')),



    ),



    'PREVIEW'=> array(

      array(array('type' => 'tab')),

      array(

        array(

          'allCols' => true,

          'hideLabel' => true,

          'customCode' => '<span id=\'previewPDF\' width="100%" height="100%"></span>'

        ),

      ),

    ),



    'EMAIL'=> array(

      array(

        array(

        'type' => 'tab',

        )

      ),

      array(

        array(

        'allCols' => true,

        'hideLabel' => true,

          'customCode' => '<span id=\'emailTAB\' width="100%" height="100%"></span>'

        ),

      ),

    ),



	),	



);











?>



