vtiger Forum Index vtiger
The Honest Open Source CRM
 

12 and more columns in custom views + code cleaning in .tpl
Click here to go to the original topic

 
       vtiger Forum Index -> Usability & Themes - 5.0.4
Previous topic :: Next topic  
Author Message
jagi



Joined: 17 Jan 2006
Posts: 117
Location: Poland

Posted: Mon Feb 11, 2008 11:42 pm    Post subject: 12 and more columns in custom views + code cleaning in .tpl  

Sometimes we need more columns in list.

\modules\CustomView\EditView.php
Code:
for($i=1;$i<13;$i++)
   {
      $column[] = $choosecolhtml;
      $smarty->assign("CHOOSECOLUMN",$column);
   }

and ~105 line
Code:
for($i=1;$i<13;$i++)
   {
      $choosecolhtml[] = getByModule_ColumnsHTML($cv_module,$modulecollist,$selectedcolumnslist[$i-1]);
      $smarty->assign("CHOOSECOLUMN",$choosecolhtml);
      
   }


+ \Smarty\templates\CustomView.tpl start from ~ 157 line
replace 157-288 by

Code:
<tr class="dvtCellLabel">   
   {foreach name=numer item=COLUMN from=$CHOOSECOLUMN}
    {assign var=nr value=$smarty.foreach.numer.iteration}
   
      <td>{$nr} <select name="column{$nr}" id="column{$nr}" onChange="checkDuplicate();">
                   <option value="">{$MOD.LBL_NONE}</option>
         {foreach item=filteroption key=label from=$COLUMN}
            <optgroup label="{$label}" class=\"select\" style=\"border:none\">
               {foreach item=text from=$filteroption}
                {assign var=option_values value=$text.text}
                        <option {$text.selected} value={$text.value}>
         {if $MOD.$option_values neq ''}
                                {if $DATATYPE.0.$option_values eq 'M'}
                                        {$MOD.$option_values}   {$APP.LBL_REQUIRED_SYMBOL}
                                {else}
            {$MOD.$option_values}
                                {/if}
         {elseif $APP.$option_values neq ''}
                                {if $DATATYPE.0.$option_values eq 'M'}
                                        {$APP.$option_values}   {$APP.LBL_REQUIRED_SYMBOL}
                                {else}
            {$APP.$option_values}
                                {/if}
                        {else}
                                {if $DATATYPE.0.$option_values eq 'M'}
                                        {$option_values}    {$APP.LBL_REQUIRED_SYMBOL}
         {else}
            {$option_values}
         {/if}
                        {/if}
</option>
                    {/foreach}
         {/foreach}
                     {$COLUMN}
                 </select></td>
              {if $nr == 4 || $nr == 8}
              </tr>
              <tr class="dvtCellLabel">
              {/if}
{/foreach}
</tr>   

and on end
Code:
function checkDuplicate()
{
   var cvselect_array = new Array('column1','column2','column3','column4','column5','column6','column7','column8','column9','column10','column11','column12')


246 lines less in .tpl and works ;) - easy to change 12 colums to 16 .

live preview on http://vtiger.artcode.eu
Back to top  
allstar784



Joined: 25 Feb 2008
Posts: 3
Location: Chicago, IL

Posted: Mon Feb 25, 2008 4:25 pm    Post subject: 12 and more columns in custom views + code cleaning in .tpl  

this is great! Thanks so much. i will be testing out shortly. preview is excellent as well.
Back to top  
 
       vtiger Forum Index -> Usability & Themes - 5.0.4
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group