Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updating record with new Organization
#11
joebordes Wrote:Make sure your modules/Accounts/Accounts.js script is the same as the one on github.
Send that file to me and I'll have a look.

They are identical at one exception. On line 127 and 152 there are spaces before the code instead of a tab. I've actually tried changing those to tabs see if that was the problem, but no, the issue still persists.

See attachement.


Attached Files
.zip   Accounts.js.zip (Size: 4.34 KB / Downloads: 17)
Reply
#12
That is correct. Compare the include/utils directory, just in case, because the list of elements in the popup is created there, but I doubt that would be the problem.

If you want me to connect to your system I can't do much more without looking exactly at what problem you are having.

Another idea would be to see exactly the code in the link that is in the popup, make sure the whole address is there.

Contact me....
Joe
TSolucio
Reply
#13
I will have a look at those first.

This leads me to the question I asked here: <!-- l --><a class="postlink-local" href="http://discussions.corebos.org/viewtopic.php?f=5&t=24">viewtopic.php?f=5&t=24</a><!-- l -->
Reply
#14
After comparing the util folder 3 files were found to have slight differences, namely: CommonUtils.php, InventoryUtils.php and utils.php.

This once again leads me to know what is the most efficient way to keep my installation of corebos up to date. I can't, actually, I wont be updating lines of code on each file that changes, simply have no time for that. Is there any automated way to do this?

EDIT: I saw your post regarding github. Thanks.
Reply
#15
joebordes Wrote:Another idea would be to see exactly the code in the link that is in the popup, make sure the whole address is there.

This is the full address in the popup:

<!-- m --><a class="postlink" href="http://x.x.x.x/corebos/index.php?module=Accounts&action=Popup&popuptype=specific_contact_account_address&form=TasksEditView&form_submit=false&fromlink=&recordid=4845">http://x.x.x.x/corebos/index.php?module ... ordid=4845</a><!-- m -->

I've intentiontionaly hidden the IP address.

Or are you talking about the code of the pop up page?
Reply
#16
I went on and looked at the code of the pop-up page. Once I searched for the organization I wished, I looked at the code and here is what I see:

Code:
<html><head><script>
var image_pth = '';

function showAllRecords()
{
        modname = document.getElementById("relmod").name;
        idname= document.getElementById("relrecord_id").name;
        var locate = location.href;
        url_arr = locate.split("?");
        emp_url = url_arr[1].split("&");
        for(i=0;i< emp_url.length;i++)
        {
                if(emp_url[i] != '')
                {
                        split_value = emp_url[i].split("=");
                        if(split_value[0] == modname || split_value[0] == idname )
                                emp_url[i]='';
                        else if(split_value[0] == "fromPotential" || split_value[0] == "acc_id")
                                emp_url[i]='';

                }
        }
        correctUrl =emp_url.join("&");
        Url = "index.php?"+correctUrl;
        return Url;
}

//function added to get all the records when parent record doesn't relate with the selection module records while opening/loading popup.
function redirectWhenNoRelatedRecordsFound()
{
        var loadUrl = showAllRecords();
        window.location.href = loadUrl;
}
</script>
<link rel="stylesheet" type="text/css" href="themes/softed/style.css">
<script language="JavaScript" type="text/javascript" src="include/js/ListView.js"></script>
<script language="JavaScript" type="text/javascript" src="include/js/general.js"></script>
<script language="JavaScript" type="text/javascript" src="include/js/Inventory.js"></script>
<script language="JavaScript" type="text/javascript" src="include/js/json.js"></script>
<!-- vtlib customization: Javascript hook -->
<script language="JavaScript" type="text/javascript" src="include/js/vtlib.js"></script>
<!-- END -->
<script language="JavaScript" type="text/javascript" src="include/js/en_us.lang.js?"></script>
<script language="JavaScript" type="text/javascript" src="modules/Emails/Emails.js"></script>
<script language="JavaScript" type="text/javascript" src="modules/Accounts/Accounts.js"></script><script type="text/javascript" src="include/js/Inventory.js"></script><script type="text/javascript" src="include/js/Mail.js"></script><script type="text/javascript" src="include/js/Merge.js"></script>
<script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="modules/com_vtiger_workflow/resources/jquery-1.2.6.js"></script>
<script type="text/javascript">
    jQuery.noConflict();
</script>
<script type="text/javascript">

function add_data_to_relatedlist(entity_id,recordid,mod, popupmode, callback) {
    var return_module = document.getElementById('return_module').value;
    if(popupmode == 'ajax') {
        VtigerJS_DialogBox.block();
        new Ajax.Request(
            'index.php',
            {queue: {position: 'end', scope: 'command'},
             method: 'post',
             postBody: "module="+return_module+"&action="+return_module+"Ajax&file=updateRelations&destination_module="+mod+"&entityid="+entity_id+"&parentid="+recordid+"&mode=Ajax",
             onComplete: function(response) {
                    VtigerJS_DialogBox.unblock();
                    var res = JSON.parse(response.responseText);
                    if(typeof callback == 'function') {
                        callback(res);
                    }
                }
            }
        );
        return false;
    } else {
        
        opener.document.location.href="index.php?module=Emails&action=updateRelations&destination_module="+mod+"&entityid="+entity_id+"&parentid="+recordid+"&return_module=Emails&return_action=&parenttab=Marketing";
        window.close();
        
    }
}

function set_focus() {
    $('search_txt').focus();
}
</script>

</head><body onload="set_focus()" class="small" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mailClient mailClientBg">
    <tbody><tr>
        <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tbody><tr>
                                                                                <td class="moduleName" width="80%" style="padding-left:10px;">Organizations</td>
                                                                    <td width="30%" nowrap="" class="componentName" align="right">coreBOS</td>
                </tr>
            </tbody></table>
            <div id="status" style="position: absolute; display: none; right: 135px; top: 15px; height: 27px; white-space: nowrap;"><img src="themes/softed/images/status.gif"></div>
            <table width="100%" cellpadding="5" cellspacing="0" border="0" class="homePageMatrixHdr">
                <tbody><tr>
                    <td style="padding:10px;">
                        <form name="basicSearch" action="index.php" onsubmit="callSearch('Basic');return false;">
                        <table width="100%" cellpadding="5" cellspacing="0">
                        <tbody><tr>
                            <td width="20%" class="dvtCellLabel"><img src="themes/images/basicSearchLens.gif"></td>
                            <td width="30%" class="dvtCellLabel"><input type="text" name="search_text" id="search_txt" class="txtBox"> </td>
                            <td width="30%" class="dvtCellLabel"><b>In</b>&nbsp;
                                <select name="search_field" class="txtBox">
                                             <option label="Organization Name" value="accountname">Organization Name</option>
<option label="Website" value="website">Website</option>
<option label="Phone" value="phone">Phone</option>
<option label="Assigned To" value="assigned_user_id">Assigned To</option>

                                </select>
                                <input type="hidden" name="searchtype" value="BasicSearch">
                                <input type="hidden" name="module" value="Accounts">
                                <input type="hidden" name="action" value="Popup">
                                <input type="hidden" name="query" value="true">
                                <input type="hidden" name="select_enable" id="select_enable" value="">
                                <input type="hidden" name="curr_row" id="curr_row" value="">
                                <input type="hidden" name="fldname_pb" value="">
                                <input type="hidden" name="productid_pb" value="">
                                <input name="popuptype" id="popup_type" type="hidden" value="specific_contact_account_address">
                                <input name="recordid" id="recordid" type="hidden" value="4845">
                                <input name="record_id" id="record_id" type="hidden" value="">
                                <input name="return_module" id="return_module" type="hidden" value="Emails">
                                <input name="from_link" id="from_link" type="hidden" value="">
                                <input name="maintab" id="maintab" type="hidden" value="">
                                <input type="hidden" id="relmod" name="" value="">
                                <input type="hidden" id="relrecord_id" name="" value="">
                                <input name="form" id="popupform" type="hidden" value="TasksEditView">
                                                                                                                                                            </td>
                            <td width="20%" class="dvtCellLabel">
                                <input type="button" name="search" value=" &nbsp;Search Now&nbsp; " onclick="callSearch('Basic');" class="crmbutton small create">
                            </td>
                        </tr>
                         <tr>
                            <td colspan="4" align="center">
                                <table width="100%" class="small">
                                <tbody><tr>    
                                    <td class="searchAlph" id="alpha_1" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=A&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_1&quot;)">A</td><td class="searchAlph" id="alpha_2" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=B&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_2&quot;)">B</td><td class="searchAlph" id="alpha_3" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=C&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_3&quot;)">C</td><td class="searchAlph" id="alpha_4" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=D&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_4&quot;)">D</td><td class="searchAlph" id="alpha_5" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=E&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_5&quot;)">E</td><td class="searchAlph" id="alpha_6" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=F&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_6&quot;)">F</td><td class="searchAlph" id="alpha_7" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=G&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_7&quot;)">G</td><td class="searchAlph" id="alpha_8" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=H&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_8&quot;)">H</td><td class="searchAlph" id="alpha_9" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=I&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_9&quot;)">I</td><td class="searchAlph" id="alpha_10" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=J&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_10&quot;)">J</td><td class="searchAlph" id="alpha_11" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=K&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_11&quot;)">K</td><td class="searchAlph" id="alpha_12" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=L&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_12&quot;)">L</td><td class="searchAlph" id="alpha_13" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=M&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_13&quot;)">M</td><td class="searchAlph" id="alpha_14" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=N&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_14&quot;)">N</td><td class="searchAlph" id="alpha_15" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=O&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_15&quot;)">O</td><td class="searchAlph" id="alpha_16" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=P&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_16&quot;)">P</td><td class="searchAlph" id="alpha_17" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=Q&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_17&quot;)">Q</td><td class="searchAlph" id="alpha_18" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=R&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_18&quot;)">R</td><td class="searchAlph" id="alpha_19" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=S&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_19&quot;)">S</td><td class="searchAlph" id="alpha_20" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=T&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_20&quot;)">T</td><td class="searchAlph" id="alpha_21" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=U&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_21&quot;)">U</td><td class="searchAlph" id="alpha_22" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=V&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_22&quot;)">V</td><td class="searchAlph" id="alpha_23" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=W&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_23&quot;)">W</td><td class="searchAlph" id="alpha_24" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=X&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_24&quot;)">X</td><td class="searchAlph" id="alpha_25" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=Y&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_25&quot;)">Y</td><td class="searchAlph" id="alpha_26" align="center" onclick="alphabetic(&quot;Accounts&quot;,&quot;gname=&amp;query=true&amp;search_field=accountname&amp;searchtype=BasicSearch&amp;operator=s&amp;type=alpbt&amp;search_text=Z&amp;popuptype=specific_contact_account_address&quot;,&quot;alpha_26&quot;)">Z</td>
                                </tr>
                                </tbody></table>
                            </td>
                        </tr>
                        </tbody></table>
                        </form>
                    </td>
                </tr>
                            </tbody></table>

            <div id="ListViewContents"><!-- BEGIN: main -->
<form name="selectall" method="POST">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="small">
    <tbody><tr>
            
        <td>&nbsp;</td>    
        <td style="padding-right:10px;" align="right"></td></tr>
       <tr>
        <td style="padding:10px;" colspan="3">

           <input name="module" type="hidden" value="Emails">
        <input name="action" type="hidden" value="">
        <input name="pmodule" type="hidden" value="Accounts">
        <input type="hidden" name="curr_row" value="">    
        <input name="entityid" type="hidden" value="">
        <input name="popuptype" id="popup_type" type="hidden" value="specific_contact_account_address">
        <input name="idlist" type="hidden" value="">
        <div style="overflow:auto;height:348px;">
        <table style="background-color: rgb(204, 204, 204);" class="small" border="0" cellpadding="5" cellspacing="1" width="100%">
        <tbody>
        <tr>
                                        <td class="lvtCol"><a href="javascript:;" onclick="getListViewSorted_js('Accounts','&amp;recordid=4845&amp;query=true&amp;search_field=accountname&amp;search_text=ORGANIZATION+NEW&amp;searchtype=BasicSearch&amp;popuptype=specific_contact_account_address&amp;return_module=Emails&amp;order_by=accountname&amp;sorder=DESC')" class="listFormHeaderLinks">Organization Name&nbsp;<img src="themes/images/arrow_down.gif" border="0"></a></td>
                            <td class="lvtCol"><a href="javascript:;" onclick="getListViewSorted_js('Accounts','&amp;recordid=4845&amp;query=true&amp;search_field=accountname&amp;search_text=ORGANIZATION+NEW&amp;searchtype=BasicSearch&amp;popuptype=specific_contact_account_address&amp;return_module=Emails&amp;order_by=smownerid&amp;sorder=DESC')" class="listFormHeaderLinks">Assigned To&nbsp;</a></td>
                                </tr>
                    <tr bgcolor="white" onmouseover="this.className='lvtColDataHover'" onmouseout="this.className='lvtColData'" class="lvtColData">
                                              <td><a href="javascript:window.close();" onclick="set_return_contact_address(&quot;4846&quot;, &quot;ORGANIZATION NEW&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;,&quot;&quot;, &quot;&quot;);" id="1">ORGANIZATION NEW</a></td>
                                   <td> Administrator</td>
                           </tr>
                      </tbody>
            </table>
            <div>
        </div></div></td>
    </tr>

</tbody></table>
<table width="100%" align="center" class="reportCreateBottom">
<tbody><tr>
    <td align="right" style="padding: 5px;"><img src="themes/images/start_disabled.gif" border="0" align="absmiddle">&nbsp;<img src="themes/images/previous_disabled.gif" border="0" align="absmiddle">&nbsp;<input class="small" name="pagenum" type="text" value="1" style="width: 3em;margin-right: 0.7em;" onchange="getListViewEntries_js('Accounts','parenttab=Marketing&amp;start='+this.value+'');" onkeypress="return VT_disableFormSubmit(event);"><span name="Accounts_listViewCountContainerName" class="small" style="white-space: nowrap;">of 1</span><img src="themes/images/next_disabled.gif" border="0" align="absmiddle">&nbsp;<img src="themes/images/end_disabled.gif" border="0" align="absmiddle">&nbsp;</td>    
<td width="35%">&nbsp;</td>
</tr>
</tbody></table>
</form>
</div>
        </td>
    </tr>
    
</tbody></table>

<script>
var gPopupAlphaSearchUrl = '';
var gsorder ='';
var gstart ='';
function callSearch(searchtype)
{
    gstart='';
    for(i=1;i<=26;i++)
    {
        var data_td_id = 'alpha_'+ eval(i);
        getObj(data_td_id).className = 'searchAlph';
    }
    gPopupAlphaSearchUrl = '';
    search_fld_val= document.basicSearch.search_field[document.basicSearch.search_field.selectedIndex].value;
    search_txt_val= encodeURIComponent(document.basicSearch.search_text.value.replace(/\'/,"\\'"));
    var urlstring = '';
    if(searchtype == 'Basic')
    {
    urlstring = 'search_field='+search_fld_val+'&searchtype=BasicSearch&search_text='+search_txt_val;
    }
    popuptype = $('popup_type').value;
    act_tab = $('maintab').value;
    urlstring += '&popuptype='+popuptype;
    urlstring += '&maintab='+act_tab;
    urlstring = urlstring +'&query=true&file=Popup&module=Accounts&action=AccountsAjax&ajax=true&search=true';
    urlstring +=gethiddenelements();
    record_id = document.basicSearch.record_id.value;

    //support for popupmode and callback
    urlstring += "&popupmode=";
    urlstring += "&callback=";

    if(record_id!='')
        urlstring += '&record_id='+record_id;
    $("status").style.display="inline";
    new Ajax.Request(
        'index.php',
        {queue: {position: 'end', scope: 'command'},
                method: 'post',
                postBody: urlstring,
                onComplete: function(response) {
                    $("status").style.display="none";
                    $("ListViewContents").innerHTML= response.responseText;
                }
            }
        );
}    
function alphabetic(module,url,dataid)
{
    gstart='';
    document.basicSearch.search_text.value = '';    
    for(i=1;i<=26;i++)
    {
    var data_td_id = 'alpha_'+ eval(i);
    getObj(data_td_id).className = 'searchAlph';
    }
    getObj(dataid).className = 'searchAlphselected';
    gPopupAlphaSearchUrl = '&'+url;    
    var urlstring ="module="+module+"&action="+module+"Ajax&file=Popup&ajax=true&search=true&"+url;
    urlstring +=gethiddenelements();
    record_id = document.basicSearch.record_id.value;
    if(record_id!='')
        urlstring += '&record_id='+record_id;
    $("status").style.display="inline";
    new Ajax.Request(
                'index.php',
                {queue: {position: 'end', scope: 'command'},
                                method: 'post',
                                postBody: urlstring,
                                onComplete: function(response) {
                                    $("status").style.display="none";
                                    $("ListViewContents").innerHTML= response.responseText;
                }
            }
        );
}
function gethiddenelements()
{
    gstart='';
    var urlstring=''    
    if(getObj('select_enable').value != '')
        urlstring +='&select=enable';    
    if(document.getElementById('curr_row').value != '')
        urlstring +='&curr_row='+document.getElementById('curr_row').value;    
    if(getObj('fldname_pb').value != '')
        urlstring +='&fldname='+getObj('fldname_pb').value;    
    if(getObj('productid_pb').value != '')
        urlstring +='&productid='+getObj('productid_pb').value;    
    if(getObj('recordid').value != '')
        urlstring +='&recordid='+getObj('recordid').value;
    if(getObj('relmod').value != '')
                urlstring +='&'+getObj('relmod').name+'='+getObj('relmod').value;
    if(getObj('relrecord_id').value != '')
            urlstring +='&'+getObj('relrecord_id').name+'='+getObj('relrecord_id').value;
    
    // vtlib customization: For uitype 10 popup during paging
    if(document.getElementById('popupform'))
        urlstring +='&form='+encodeURIComponent(getObj('popupform').value);
    if(document.getElementById('forfield'))
        urlstring +='&forfield='+encodeURIComponent(getObj('forfield').value);
    if(document.getElementById('srcmodule'))
        urlstring +='&srcmodule='+encodeURIComponent(getObj('srcmodule').value);
    if(document.getElementById('forrecord'))
        urlstring +='&forrecord='+encodeURIComponent(getObj('forrecord').value);
    // END
        
    if(document.getElementById('currencyid') != null && document.getElementById('currencyid').value != '')
        urlstring +='&currencyid='+document.getElementById('currencyid').value;

    var return_module = document.getElementById('return_module').value;
    if(return_module != '')
        urlstring += '&return_module='+return_module;
    return urlstring;
}
                                                                                                    
function getListViewEntries_js(module,url)
{
    gstart="&"+url;

    popuptype = document.getElementById('popup_type').value;
        var urlstring ="module="+module+"&action="+module+"Ajax&file=Popup&ajax=true&"+url;
        urlstring +=gethiddenelements();
    
            search_fld_val= document.basicSearch.search_field[document.basicSearch.search_field.selectedIndex].value;
        search_txt_val=document.basicSearch.search_text.value;
        if(search_txt_val != '')
            urlstring += '&query=true&search_field='+search_fld_val+'&searchtype=BasicSearch&search_text='+search_txt_val;
        if(gPopupAlphaSearchUrl != '')
        urlstring += gPopupAlphaSearchUrl;    
    else
        urlstring += '&popuptype='+popuptype;    
    
    record_id = document.basicSearch.record_id.value;
    if(record_id!='')
        urlstring += '&record_id='+record_id;

    urlstring += (gsorder !='') ? gsorder : '';
    var return_module = document.getElementById('return_module').value;
    if(module == 'Documents' && return_module == 'MailManager')
    {
        urlstring += '&callback=MailManager.add_data_to_relatedlist';
        urlstring += '&popupmode=ajax';
        urlstring += '&srcmodule=MailManager';
    }

    $("status").style.display = "";
    new Ajax.Request(
                'index.php',
                {queue: {position: 'end', scope: 'command'},
                                method: 'post',
                                postBody: urlstring,
                                onComplete: function(response) {
                                        $("ListViewContents").innerHTML= response.responseText;
                                    $("status").style.display = "none";
                }
            }
        );
}

function getListViewSorted_js(module,url)
{
    gsorder=url;
        var urlstring ="module="+module+"&action="+module+"Ajax&file=Popup&ajax=true"+url;
    record_id = document.basicSearch.record_id.value;
    if(record_id!='')
        urlstring += '&record_id='+record_id;
    urlstring += (gstart !='') ? gstart : '';
    $("status").style.display = "";
    new Ajax.Request(
                'index.php',
                {queue: {position: 'end', scope: 'command'},
                                method: 'post',
                                postBody: urlstring,
                                onComplete: function(response) {
                                        $("ListViewContents").innerHTML= response.responseText;
                                    $("status").style.display = "none";
                }
            }
        );
}

var product_labelarr = {
    CLEAR_COMMENT:'Clear Comment',
    DISCOUNT:'Discount',
    TOTAL_AFTER_DISCOUNT:'Total After Discount',
    TAX:'Tax',
    ZERO_DISCOUNT:'Zero Discount',
    PERCENT_OF_PRICE:'of Price',
    DIRECT_PRICE_REDUCTION:'Direct Price Reduction'
};

</script><!-- stopscrmprint -->        <script type="text/javascript">
            var userDateFormat = "dd-mm-yyyy";
            var default_charset = "UTF-8";
            var userCurrencySeparator = ",";
            var userDecimalSeparator = ".";
        </script>
</body></html>
Pay close attention to this part:

Code:
<td><a href="javascript:window.close();" onclick="set_return_contact_address(&quot;4846&quot;, &quot;ORGANIZATION NEW&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;,&quot;&quot;, &quot;&quot;);" id="1">ORGANIZATION NEW</a></td>
As you can see the scrypt is basically saying that all address fields should be replaced with empty data (&quot;&quot). What's up with that?
For testing purposes, I replaced within the html code of the page the first 2 quotes (&quot;&quot) with some text and once I clicked "Yes" it indeed filled the address field with the text.
Reply
#17
No, not that one. I need to see the code behind the link. right click on the organization name link, select the "inspect element" option, you will see that the link really calls a function, set_return_address (I think), with a bunch of parameters which are the address to overwrite. You have to make sure the parameters are full. If they aren't, the problem is in the utils directory, if they are, the problem is in Account.js file.
Joe
TSolucio
Reply
#18
joebordes Wrote:No, not that one. I need to see the code behind the link. right click on the organization name link, select the "inspect element" option, you will see that the link really calls a function, set_return_address (I think), with a bunch of parameters which are the address to overwrite. You have to make sure the parameters are full. If they aren't, the problem is in the utils directory, if they are, the problem is in Account.js file.

You might not have seen my previous post. I will try to compare the utils folder again but last time I checked there were 3 files that were different. At the time, I did replace those with the master branch ones and emptied all caches. I will try again see.
Reply
#19
Yes, we crossed posts, and, yes, the problem is with the code filling the popup set_return_address. The correct address has to be in the call. I'm not sure what could be producing that. maybe an incorrect SQL that can't retrieve the address. Truth is that it is strange as tha usually "just works".

Have you deleted any address field? Like POBox or something?
Joe
TSolucio
Reply
#20
Ok Joe, I've figured it out! It's actually entirely my fault, so I am sorry for the time wasted, but at least this arises some questions.

What happened is that I hid the default fields in the organization's layout editor because those "shipping address" and "billing address" labels simply didn't cut it out for me. I had forgotten about this. Anyways, since we neither ship nor bill anything to those contacts, therefore I created news fields with more appropriate labels like "mailing addresse" or "mailing city".

That said, it is strange that Vtiger/Corebos coressponds an organization's "shipping address" to a contact "mailling address" and a "billing address" to a contact "other address". Not really logical to me. In any case, for those who wish to retain this functionality, there should be a way to map user created fields (or non-default fields, if I may say so) of the organization to contact fields so that this doesn't happen. At present it's like Vtiger gives people the possibility of being flexible and being creative by creating customs fields but at the end only the defaults fields are the ones that count... strange!

The only way I would see this working logically at present would be by changing the label of the default fields to ones that are more apprpriate for me. The only problem is that my database is already in production and the data resides withing the custom fields I created, not the default fields.

Personally I don't really mind this not working for me as I don't find any use for it.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)