[Vtigercrm-commits] [vtiger-commits] r6380 - in /vtigercrm/trunk: Smarty/templates/DetailView.tpl Smarty/templates/DetailViewUI.tpl Smarty/templates/InventoryDetailView.tpl include/js/dtlviewajax.js include/js/general.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed May 24 15:59:18 EDT 2006
Author: saraj
Date: Wed May 24 13:59:09 2006
New Revision: 6380
Log:
issue in detailview ajax has been fixed
Added:
vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl
Modified:
vtigercrm/trunk/Smarty/templates/DetailView.tpl
vtigercrm/trunk/Smarty/templates/InventoryDetailView.tpl
vtigercrm/trunk/include/js/dtlviewajax.js
vtigercrm/trunk/include/js/general.js
Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DetailView.tpl Wed May 24 13:59:09 2006
@@ -217,174 +217,17 @@
<input type="hidden" id="hdtxt_IsAdmin" value={$keyadmin}></input>
- {if $label ne ''}
- {if $keycntimage ne ''}
- <td class="dvtCellLabel" align=right width=25%>{$keycntimage}</td>
- {else}
+ {if $label ne ''}
+ {if $keycntimage ne ''}
+ <td class="dvtCellLabel" align=right width=25%>{$keycntimage}</td>
+ {else}
<td class="dvtCellLabel" align=right width=25%>{$label}</td>
- {/if}
- {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72'} <!--TextBox-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" >
- {if $keyid eq '55'}<!--SalutationSymbol-->
- {$keysalut}
- {elseif $keyid eq '71' || $keyid eq '72'} <!--CurrencySymbol-->
- {$keycursymb}
- {/if}
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');">{$keyval} </div>
- <div id="editarea_{$label}" style="display:none;">
- <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="{$keyfldname}" maxlength='100' value="{$keyval}"></input>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '13'} <!--Email-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="mailto:{$keyval}" target="_blank"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="{$keyfldname}" maxlength='100' value="{$keyval}"></input>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '15' || $keyid eq '16'} <!--ComboBox-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"> {$keyval}</div>
- <div id="editarea_{$label}" style="display:none;">
- <select id="txtbox_{$label}" name="{$keyfldname}">
- {foreach item=arr from=$keyoptions}
- {foreach key=sel_value item=value from=$arr}
- <option value="{$sel_value}" {$value}>{$sel_value}</option>
- {/foreach}
- {/foreach}
- </select>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '53'} <!--Assigned To-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" onmouseover="hndMouseOver({$keyid},'{$label}');" onmouseout="hide('crmspanid');">
- <span id="dtlview_{$label}">
- {if $keyseclink eq ''}
- {$keyval}
- {else}
- <a href="{$keyseclink}">{$keyval}</a>
- {/if}
- </span>
- <div id="editarea_{$label}" style="display:none;">
- <input type="hidden" id="hdtxt_{$label}" value="{$keyval}"></input>
- <select id="txtbox_{$label}" onchange="setSelectValue('{$label}')" name="{$keyfldname}">
- {foreach item=arr key=id from=$keyoptions}
- {foreach key=sel_value item=value from=$arr}
- <option value="{$id}" {$value}>{$sel_value}</option>
- {/foreach}
- {/foreach}
- </select>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '17'} <!--WebSite-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="http://{$keyval}" target="_blank"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="{$keyfldname}" maxlength='100' value="{$keyval}"></input>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '19' || $keyid eq '20'} <!--TextArea/Description-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"> {$keyval}</div>
- <div id="editarea_{$label}" style="display:none;">
- <textarea id="txtbox_{$label}" name="txtbox_{$label}" class=detailedViewTextBox onFocus="this.className='detailedViewTextBoxOn'"onBlur="this.className='detailedViewTextBox'" cols="90" rows="8">{$keyval}</textarea>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} <!--TextArea/Street-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"> {$keyval}</div>
- <div id="editarea_{$label}" style="display:none;">
- <textarea id="txtbox_{$label}" name="txtbox_{$label}" class=detailedViewTextBox onFocus="this.className='detailedViewTextBoxOn'"onBlur="this.className='detailedViewTextBox'" rows=2>{$keyval}</textarea>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51'} <!--AccountPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input readonly id="popuptxt_{$label}" name="account_name" type="text" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Accounts&action=Popup&popuptype=specific&form=TasksEditView&form_submit=false","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'>
- <!--AccountPopup/WithClear-->{if $keyid eq '51'} <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.account_id.value=''; this.form.account_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>{/if}
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '56'} <!--CheckBox-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" onmouseover="hndMouseOver({$keyid},'{$label}');" onmouseout="hide('crmspanid');"><span id="dtlview_{$label}">{$keyval}</span>
- <div id="editarea_{$label}" style="display:none;">
- {if $keyval eq 'yes'}
- <input id="txtbox_{$label}" type="checkbox" style="border:1px solid #bababa;" checked value="1">
- {else}
- <input id="txtbox_{$label}" type="checkbox" style="border:1px solid #bababa;" value="0">
- {/if}
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '57'} <!--ContactPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="contact_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.contact_id.value=''; this.form.contact_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '59'} <!--ProductPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="product_name" readonly type="text" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Products&action=Popup&html=Popup_picker&form=HelpDeskEditView&popuptype=specific","test","width=600,height=400,resizable=1,scrollbars=1,top=150,left=200");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.product_id.value=''; this.form.product_name.value=''; return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '75' || $keyid eq '81'} <!--VendorPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="vendor_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$fldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Vendors&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'>
- {if $uitype eq 75} <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.vendor_id.value='';this.form.vendor_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>{/if}
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 76} <!--PotentialPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="potential_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Potentials&action=Popup&html=Popup_picker&popuptype=specific_potential_account_address&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.potential_id.value=''; this.form.potential_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 78} <!--QuotePopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="quote_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Quotes&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.quote_id.value=''; this.form.quote_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 82} <!--Email Body-->
- <td colspan="3" width=100% class="dvtCellInfo" align="left"><div id="dtlview_{$label}" style="width:100%;height:200px;overflow:hidden;border:1px solid gray" class="detailedViewTextBox" onmouseover="this.className='detailedViewTextBoxOn'" onmouseout="this.className='detailedViewTextBox'"> {$keyval}</div>
- </td>
- {elseif $keyid eq 80} <!--SalesOrderPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}"><div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="salesorder_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=SalesOrder&action=Popup&html=Popup_picker&popuptype=specific&form=DetailView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.salesorder_id.value=''; this.form.salesorder_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br><input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {else}
- <td class="dvtCellInfo" align="left" width=25%">{$keyval}</td>
- {/if}
- {else}
- <td class="dvtCellLabel" align=right></td>
- <td class="dvtCellInfo" align=left ></td>
+ {/if}
+
+ {include file="DetailViewUI.tpl"}
+ {else}
+ <td class="dvtCellLabel" align=right> </td>
+ <td class="dvtCellInfo" align=left > </td>
{/if}
{/foreach}
</tr>
Modified: vtigercrm/trunk/Smarty/templates/InventoryDetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/InventoryDetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/InventoryDetailView.tpl Wed May 24 13:59:09 2006
@@ -169,213 +169,21 @@
{assign var=keycursymb value=$data.cursymb}
{assign var=keysalut value=$data.salut}
{assign var=keycntimage value=$data.cntimage}
-
- {if $label ne ''}
- {if $keycntimage ne ''}
- <td class="dvtCellLabel" align=right width=25%>{$keycntimage}</td>
- {elseif $label neq 'Tax Class'}<!-- Avoid to display the label Tax Class -->
- <td class="dvtCellLabel" align=right width=25%>{$label}</td>
- {/if}
-
- {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72'} <!--TextBox-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" >
- {if $keyid eq '55'}<!--SalutationSymbol-->
- {$keysalut}
- {elseif $keyid eq '71' || $keyid eq '72'} <!--CurrencySymbol-->
- {$keycursymb}
- {/if}
-
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');">{$keyval} </div>
- <div id="editarea_{$label}" style="display:none;">
- <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="textbox_{$label}" maxlength='100' value="{$keyval}"></input>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '13'} <!--Email-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="mailto:{$keyval}" target="_blank"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="textbox_{$label}" maxlength='100' value="{$keyval}"></input>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '15' || $keyid eq '16'} <!--ComboBox-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"> {$keyval}</div>
- <div id="editarea_{$label}" style="display:none;">
- <select id="txtbox_{$label}" name="{$keyfldname}">
- {foreach item=arr from=$keyoptions}
- {foreach key=sel_value item=value from=$arr}
- <option value="{$sel_value}" {$value}>{$sel_value}</option>
- {/foreach}
- {/foreach}
- </select>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '17'} <!--WebSite-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="http://{$keyval}" target="_blank"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input class="detailedViewTextBox" onFocus="this.className='detailedViewTextBoxOn'" onBlur="this.className='detailedViewTextBox'" type="text" id="txtbox_{$label}" name="textbox_{$label}" maxlength='100' value="{$keyval}"></input>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '19' || $keyid eq '20'} <!--TextArea/Description-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"> {$keyval}</div>
- <div id="editarea_{$label}" style="display:none;">
- <textarea id="txtbox_{$label}" name="txtbox_{$label}" class=detailedViewTextBox onFocus="this.className='detailedViewTextBoxOn'"onBlur="this.className='detailedViewTextBox'" cols="90" rows="8">{$keyval}</textarea>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} <!--TextArea/Street-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"> {$keyval}</div>
- <div id="editarea_{$label}" style="display:none;">
- <textarea id="txtbox_{$label}" name="txtbox_{$label}" class=detailedViewTextBox onFocus="this.className='detailedViewTextBoxOn'"onBlur="this.className='detailedViewTextBox'" rows=2>{$keyval}</textarea>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51'} <!--AccountPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input readonly id="popuptxt_{$label}" name="account_name" type="text" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Accounts&action=Popup&popuptype=specific&form=TasksEditView&form_submit=false","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'>
- <!--AccountPopup/WithClear-->
- {if $keyid eq '51'}
-
- <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.account_id.value=''; this.form.account_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- {/if}
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '57'} <!--ContactPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="contact_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.contact_id.value=''; this.form.contact_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '59'} <!--ProductPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="product_name" readonly type="text" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Products&action=Popup&html=Popup_picker&form=HelpDeskEditView&popuptype=specific","test","width=600,height=400,resizable=1,scrollbars=1,top=150,left=200");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.product_id.value=''; this.form.product_name.value=''; return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq '75' || $keyid eq '81'} <!--VendorPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="vendor_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$fldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Vendors&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'>
- {if $uitype eq 75}
- <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.vendor_id.value='';this.form.vendor_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- {/if}
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/> or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 76} <!--PotentialPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="potential_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Potentials&action=Popup&html=Popup_picker&popuptype=specific_potential_account_address&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.potential_id.value=''; this.form.potential_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 78} <!--QuotePopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="quote_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=Quotes&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.quote_id.value=''; this.form.quote_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 82} <!--Email Body-->
- <td colspan="3" width=100% class="dvtCellInfo" align="left">
- <div id="dtlview_{$label}" style="width:100%;height:200px;overflow:hidden;border:1px solid gray" class="detailedViewTextBox" onmouseover="this.className='detailedViewTextBoxOn'" onmouseout="this.className='detailedViewTextBox'"> {$keyval}</div>
- </td>
- {elseif $keyid eq 80} <!--SalesOrderPopup-->
- <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}">
- <div id="dtlview_{$label}" onClick="hndMouseOver({$keyid},'{$label}');"><a href="{$keyseclink}"> {$keyval}</a></div>
- <div id="editarea_{$label}" style="display:none;">
- <input id="popuptxt_{$label}" name="salesorder_name" readonly type="text" style="border:1px solid #bababa;" value="{$keyval}"><input id="txtbox_{$label}" name="{$keyfldname}" type="hidden" value="{$keysecid}"> <img src="{$IMAGE_PATH}select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick='return window.open("index.php?module=SalesOrder&action=Popup&html=Popup_picker&popuptype=specific&form=DetailView","test","width=600,height=400,resizable=1,scrollbars=1");' align="absmiddle" style='cursor:hand;cursor:pointer'> <input type="image" src="{$IMAGE_PATH}clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.salesorder_id.value=''; this.form.salesorder_name.value='';return false;" align="absmiddle" style='cursor:hand;cursor:pointer'>
- <br>
- <input name="button_{$label}" type="button" class="small" value="Save" onclick="dtlViewAjaxSave('{$label}','{$MODULE}',{$keyid},'{$keytblname}','{$keyfldname}','{$ID}');hide('crmspanid');"/>
- or
- <a href="javascript:;" onclick="hndCancel('dtlview_{$label}','editarea_{$label}','{$label}')" class="link">Cancel</a>
- </div>
- </td>
- {elseif $keyid eq 83}<!-- Handle the Tax in Inventory -->
- <td align="right" class="dvtCellLabel">
- {$APP.LBL_VAT} :
-
- </td>
- <td class="dvtCellInfo" align="left">
- {$VAT_TAX}
- </td>
- <td colspan="2" class="dvtCellInfo"> </td>
- </tr>
- <tr>
- <td align="right" class="dvtCellLabel">
- {$APP.LBL_SALES} :
- </td>
- <td class="dvtCellInfo" align="left">
- {$SALES_TAX}
- </td>
- <td colspan="2" class="dvtCellInfo"> </td>
- </tr>
- <tr>
- <td align="right" class="dvtCellLabel">
- {$APP.LBL_SERVICE} :
- </td>
- <td class="dvtCellInfo" align="left" >
- {$SERVICE_TAX}
- </td>
-
- {else}
- <td class="dvtCellInfo" align="left" width=25%">{$keyval}</td>
+ {assign var=keyadmin value=$data.isadmin}
+
+ <input type="hidden" id="hdtxt_IsAdmin" value={$keyadmin}></input>
+
+ {if $label ne ''}
+ {if $keycntimage ne ''}
+ <td class="dvtCellLabel" align=right width=25%>{$keycntimage}</td>
+ {elseif $label neq 'Tax Class'}<!-- Avoid to display the label Tax Class -->
+ <td class="dvtCellLabel" align=right width=25%>{$label}</td>
+ {/if}
+ {include file="DetailViewUI.tpl"}
+ {else}
+ <td class="dvtCellLabel" align=right> </td>
+ <td class="dvtCellInfo" align=left > </td>
{/if}
- {else}
- <td class="dvtCellLabel" align=right></td>
- <td class="dvtCellInfo" align=left ></td>
- {/if}
{/foreach}
</tr>
{/foreach}
@@ -435,3 +243,9 @@
</tr>
</form>
</table>
+<script language="javascript">
+ var fieldname = new Array({$VALIDATION_DATA_FIELDNAME});
+ var fieldlabel = new Array({$VALIDATION_DATA_FIELDLABEL});
+ var fielddatatype = new Array({$VALIDATION_DATA_FIELDDATATYPE});
+</script>
+
Modified: vtigercrm/trunk/include/js/dtlviewajax.js
==============================================================================
--- vtigercrm/trunk/include/js/dtlviewajax.js (original)
+++ vtigercrm/trunk/include/js/dtlviewajax.js Wed May 24 13:59:09 2006
@@ -13,7 +13,7 @@
function showHide(showId, hideId)
{
- show(showId);
+ showBlock(showId);
hide(hideId);
}
@@ -35,7 +35,7 @@
function handleEdit()
{
- show(globaleditareaspanid) ;
+ showBlock(globaleditareaspanid) ;
hide(globaldtlviewspanid);
getObj(globaltxtboxid).focus();
return false;
Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Wed May 24 13:59:09 2006
@@ -33,11 +33,14 @@
d=document;
- if((p=n.indexOf("?"))>0&&parent.frames.length) {
-
- d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
-
- }
+ if(n != undefined)
+ {
+ if((p=n.indexOf("?"))>0&&parent.frames.length) {
+
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
+
+ }
+ }
@@ -703,137 +706,143 @@
function formValidate() {
for (var i=0; i<fieldname.length; i++) {
- var type=fielddatatype[i].split("~")
- if (type[1]=="M") {
- if (!emptyCheck(fieldname[i],fieldlabel[i],getObj(fieldname[i]).type))
- return false
- }
-
- switch (type[0]) {
- case "O" : break;
- case "V" : break;
- case "C" : break;
- case "DT" :
- if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
- {
- if (type[1]=="M")
- if (!emptyCheck(type[2],fieldlabel[i],getObj(type[2]).type))
- return false
-
- if(typeof(type[3])=="undefined") var currdatechk="OTH"
- else var currdatechk=type[3]
-
- if (!dateTimeValidate(fieldname[i],type[2],fieldlabel[i],currdatechk))
- return false
- if (type[4]) {
- if (!dateTimeComparison(fieldname[i],type[2],fieldlabel[i],type[5],type[6],type[4]))
+ if(getObj(fieldname[i]) != null)
+ {
+ var type=fielddatatype[i].split("~")
+ if (type[1]=="M") {
+ if (!emptyCheck(fieldname[i],fieldlabel[i],getObj(fieldname[i]).type))
+ return false
+ }
+
+ switch (type[0]) {
+ case "O" : break;
+ case "V" : break;
+ case "C" : break;
+ case "DT" :
+ if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
+ {
+ if (type[1]=="M")
+ if (!emptyCheck(type[2],fieldlabel[i],getObj(type[2]).type))
return false
- }
- }
- break;
- case "D" :
- if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
- {
- if(typeof(type[2])=="undefined") var currdatechk="OTH"
- else var currdatechk=type[2]
-
- if (!dateValidate(fieldname[i],fieldlabel[i],currdatechk))
- return false
- if (type[3]) {
- if (!dateComparison(fieldname[i],fieldlabel[i],type[4],type[5],type[3]))
+ if(typeof(type[3])=="undefined") var currdatechk="OTH"
+ else var currdatechk=type[3]
+
+ if (!dateTimeValidate(fieldname[i],type[2],fieldlabel[i],currdatechk))
+ return false
+ if (type[4]) {
+ if (!dateTimeComparison(fieldname[i],type[2],fieldlabel[i],type[5],type[6],type[4]))
+ return false
+
+ }
+ }
+ break;
+ case "D" :
+ if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
+ {
+ if(typeof(type[2])=="undefined") var currdatechk="OTH"
+ else var currdatechk=type[2]
+
+ if (!dateValidate(fieldname[i],fieldlabel[i],currdatechk))
return false
- }
- }
- break;
- case "T" :
- if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
- {
- if(typeof(type[2])=="undefined") var currtimechk="OTH"
- else var currtimechk=type[2]
-
- if (!timeValidate(fieldname[i],fieldlabel[i],currtimechk))
- return false
- if (type[3]) {
- if (!timeComparison(fieldname[i],fieldlabel[i],type[4],type[5],type[3]))
+ if (type[3]) {
+ if (!dateComparison(fieldname[i],fieldlabel[i],type[4],type[5],type[3]))
+ return false
+ }
+ }
+ break;
+ case "T" :
+ if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
+ {
+ if(typeof(type[2])=="undefined") var currtimechk="OTH"
+ else var currtimechk=type[2]
+
+ if (!timeValidate(fieldname[i],fieldlabel[i],currtimechk))
return false
- }
+ if (type[3]) {
+ if (!timeComparison(fieldname[i],fieldlabel[i],type[4],type[5],type[3]))
+ return false
+ }
+ }
+ break;
+ case "I" :
+ if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
+ {
+ if (getObj(fieldname[i]).value.length!=0)
+ {
+ if (!intValidate(fieldname[i],fieldlabel[i]))
+ return false
+ if (type[2]) {
+ if (!numConstComp(fieldname[i],fieldlabel[i],type[2],type[3]))
+ return false
+ }
+ }
+ }
+ break;
+ case "N" :
+ case "NN" :
+ if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
+ {
+ if (getObj(fieldname[i]).value.length!=0)
+ {
+ if (typeof(type[2])=="undefined") var numformat="any"
+ else var numformat=type[2]
+
+ if (type[0]=="NN") {
+
+ if (!numValidate(fieldname[i],fieldlabel[i],numformat,true))
+ return false
+ } else {
+ if (!numValidate(fieldname[i],fieldlabel[i],numformat))
+ return false
+ }
+ if (type[3]) {
+ if (!numConstComp(fieldname[i],fieldlabel[i],type[3],type[4]))
+ return false
+ }
+ }
+ }
+ break;
+ case "E" :
+ if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
+ {
+ if (getObj(fieldname[i]).value.length!=0)
+ {
+ var etype = "EMAIL"
+ if (!patternValidate(fieldname[i],fieldlabel[i],etype))
+ return false
+ }
+ }
+ break;
}
- break;
- case "I" :
- if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
- {
- if (getObj(fieldname[i]).value.length!=0)
- {
- if (!intValidate(fieldname[i],fieldlabel[i]))
- return false
- if (type[2]) {
- if (!numConstComp(fieldname[i],fieldlabel[i],type[2],type[3]))
- return false
- }
- }
- }
- break;
- case "N" :
- case "NN" :
- if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
- {
- if (getObj(fieldname[i]).value.length!=0)
- {
- if (typeof(type[2])=="undefined") var numformat="any"
- else var numformat=type[2]
-
- if (type[0]=="NN") {
-
- if (!numValidate(fieldname[i],fieldlabel[i],numformat,true))
- return false
- } else {
- if (!numValidate(fieldname[i],fieldlabel[i],numformat))
- return false
- }
- if (type[3]) {
- if (!numConstComp(fieldname[i],fieldlabel[i],type[3],type[4]))
- return false
- }
- }
- }
- break;
- case "E" :
- if (getObj(fieldname[i]) != null && getObj(fieldname[i]).value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
- {
- if (getObj(fieldname[i]).value.length!=0)
- {
- var etype = "EMAIL"
- if (!patternValidate(fieldname[i],fieldlabel[i],etype))
- return false
- }
- }
- break;
}
}
//added to check Start Date & Time,if Activity Status is Planned.//start
for (var j=0; j<fieldname.length; j++)
- {
- if(fieldname[j] == "date_start")
- {
- var datelabel = fieldlabel[j]
- var datefield = fieldname[j]
- var startdatevalue = getObj(datefield).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
- }
- if(fieldname[j] == "time_start")
- {
- var timelabel = fieldlabel[j]
- var timefield = fieldname[j]
- var timeval=getObj(timefield).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
- }
- if(fieldname[j] == "eventstatus" || fieldname[j] == "taskstatus")
- {
- var statusvalue = getObj(fieldname[j]).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
- var statuslabel = fieldlabel[j++]
- }
-
- }
- if(statusvalue == "Planned")
+ {
+
+ if(getObj(fieldname[i]) != null)
+ {
+ if(fieldname[j] == "date_start")
+ {
+ var datelabel = fieldlabel[j]
+ var datefield = fieldname[j]
+ var startdatevalue = getObj(datefield).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
+ }
+ if(fieldname[j] == "time_start")
+ {
+ var timelabel = fieldlabel[j]
+ var timefield = fieldname[j]
+ var timeval=getObj(timefield).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
+ }
+ if(fieldname[j] == "eventstatus" || fieldname[j] == "taskstatus")
+ {
+ var statusvalue = getObj(fieldname[j]).value.replace(/^\s+/g, '').replace(/\s+$/g, '')
+ var statuslabel = fieldlabel[j++]
+ }
+ }
+ }
+ if(statusvalue == "Planned")
{
var dateelements=splitDateVal(startdatevalue)
@@ -1103,13 +1112,22 @@
}
+/*
+* javascript function to display the div tag
+* @param divId :: div tag ID
+*/
+function showBlock(divId)
+{
+ var id = document.getElementById(divId);
+ id.style.display = 'block';
+}
+
/*
* javascript function to hide the div tag
* @param divId :: div tag ID
*/
function hide(divId)
-
{
var id = document.getElementById(divId);
More information about the vtigercrm-commits
mailing list