Files
crm.e5.pl/modules/ContactLeads/Popup_pickerEmails.html

348 lines
17 KiB
HTML
Raw Normal View History

2024-04-27 09:23:34 +02:00
<!--
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
<script>
function selectTabCSS(id){
document.getElementById("basic_form").style.display='none';
document.getElementById("advanced_form").style.display='none';
document.getElementById("link_basic").className='';
document.getElementById("link_advanced").className='';
document.getElementById("tab_basic").className='';
document.getElementById("tab_advanced").className='';
document.getElementById(id+"_form").style.display='';
document.getElementById("link_"+id).className='current';
document.getElementById("tab_"+id).className='active';
document.getElementById("tab").value=id;
if(id=="advanced"){
var bi=document.getElementById("basic_form").getElementsByTagName("input");
for(var i=0;i<bi.length;i++){
if(bi[i].type=="text")bi[i].value="";
if(bi[i].type=="checkbox")bi[i].checked=false;
}
var bs=document.getElementById("basic_form").getElementsByTagName("select");
for(var i=0;i<bs.length;i++){
bs[i].value="";
}
}
if(id=="basic"){
var ai=document.getElementById("advanced_form").getElementsByTagName("input");
for(var i=0;i<ai.length;i++){
if(ai[i].type=="text")ai[i].value="";
if(ai[i].type=="checkbox")ai[i].checked=false;
}
var as=document.getElementById("basic_form").getElementsByTagName("select");
for(var i=0;i<as.length;i++){
as[i].value="";
}
}
}
selectTabCSS(document.getElementById("tab").value);
</script>
<ul class="tablist">
<li class="active" id="tab_basic"><a class="current" id="link_basic" href="javascript:selectTabCSS('basic');">Basic Search</a></li>
<li class="" id="tab_advanced"><a class="" id="link_advanced" href="javascript:selectTabCSS('advanced');">Advanced Search</a></li>
</ul>
<form action="index.php" method="post" name="popup_query_form" id="search_form">
<input type="hidden" name="tab" id="tab" value="{TABB}" />
<input type="hidden" name="div" id="div" value="{DIV}" />
<input type="hidden" name="pre" id="pre" value="{PRE}" />
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="ContactLeads_CONTACTLEAD_offset" id="ContactLeads_CONTACTLEAD_offset" value="0" />
<input type="hidden" name="action" value="PopupEmails" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="request_data" value="{request_data}" />
<input type="hidden" name="record_id" value="" />
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
<table cellpaddin="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpaddin="0" cellspacing="0" border="0" width="100%" id="advanced_form" style="display:none;border-top: 0px none; margin-bottom: 4px;" class="tabForm">
<tr>
<td class="dataLabel" width="10%" nowrap="nowrap">First Name</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="first_name_advanced" id="first_name_advanced" size="30" maxlength="100" value="{FIRST_NAME}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Any Address</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="address_street_advanced" id="address_street_advanced" size="30" value="{ADDRESS}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Any Phone</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="phone_advanced" id="phone_advanced" size="30" value="{PHONE}" title="" tabindex="" type="text"></td>
</tr><tr>
<td class="dataLabel" width="10%" nowrap="nowrap">Last Name</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="last_name_advanced" id="last_name_advanced" size="30" maxlength="100" value="{LAST_NAME}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">City</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="address_city_advanced" id="address_city_advanced" size="30" value="{CITY}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Any Email</td><td class="dataField" width="30%" nowrap="nowrap"><input name="email_advanced" id="email_advanced" size="30" value="{EMAIL}" title="" tabindex="" type="text"></td>
</tr><tr>
<td class="dataLabel" width="10%" nowrap="nowrap">Account Name</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="account_name_advanced" tabindex="" id="account_name_advanced" size="" value="{ACCOUNT_NAME}" title="" type="text">
<input name="account_id_advanced" id="account_id_advanced" value="{ACCOUNT_ID}" type="hidden"><input name="btn_account_name_advanced" tabindex="" title="Select [Alt+T]" accesskey="T" class="button" value="Select" onclick='open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"search_form","field_to_name_array":{"id":"account_id_advanced","name":"account_name_advanced"}}, "single", true,"new");' type="button"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">State</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="address_state_advanced" id="address_state_advanced" size="30" value="{STATE}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Do Not Call</td>
<td class="dataField" width="30%" nowrap="nowrap">
<select id="do_not_call_advanced" name="do_not_call_advanced" tabindex="">
{DO_NOT_CALL_LIST}
</select>
</td>
</tr><tr>
<td class="dataLabel" width="10%" nowrap="nowrap">Assistant</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="assistant_advanced" id="assistant_advanced" size="30" maxlength="75" value="{ASSISTANT}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Postal Code</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="address_postalcode_advanced" id="address_postalcode_advanced" size="30" value="{POSTAL_CODE}" title="" tabindex="" type="text"></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Country</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="primary_address_country_advanced" id="primary_address_country_advanced" size="30" value="{COUNTRY}" title="" tabindex="" type="text"></td>
</tr><tr>
<td class="dataLabel" width="10%" nowrap="nowrap">Assigned to</td>
<td class="dataField" width="30%" nowrap="nowrap">
<select name="assigned_user_id_advanced[]" style="width: 150px;" multiple="true" size="6">
{ASSIGNED_TO_LIST}
</select>
</td>
</tr><tr>
<td colspan="20">
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="basic_form" style="border-top: 0px none; margin-bottom: 4px;" class="tabForm">
<tr>
<td class="dataLabel" nowrap="nowrap">{MOD.LBL_FIRST_NAME}&nbsp;&nbsp;<input type="text" name="first_name" size="20" class="dataField" value="{FIRST_NAME}" /></td>
<td class="dataLabel" nowrap="nowrap">{MOD.LBL_LAST_NAME}&nbsp;&nbsp;<input type="text" name="last_name" size="20" class="dataField" value="{LAST_NAME}" /></td>
<td class="dataLabel" width="10%" nowrap="nowrap">Account Name</td>
<td class="dataField" width="30%" nowrap="nowrap"><input name="account_name" tabindex="" id="account_name" size="" value="{ACCOUNT_NAME}" title="" type="text">
<input name="account_id" id="account_id" value="{ACCOUNT_ID}" type="hidden"><input name="btn_account_name" tabindex="" title="Select [Alt+T]" accesskey="T" class="button" value="Select" onclick='open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"search_form","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true,"new");' type="button"></td>
<td width="20%" align="right"> </td>
</tr>
<tr>
<td class="dataLabel" nowrap="nowrap">Only my items: <input type="checkbox" name="only_my_items" value="1" {OMI_CHECKED} /></td>
<td class="dataLabel" nowrap="nowrap">&nbsp;</td>
<td class="dataLabel" nowrap="nowrap">&nbsp;</td>
<td class="dataField" nowrap="nowrap">&nbsp;</td>
<td align="right"></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
<input type="button" name="button" class="button"
title="Clear"
value="Clear" onclick="selectTabCSS(document.getElementById('tab').value);location.reload();" />
</form>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
if(window.document.forms['popup_query_form'].request_data.value == "")
{
window.document.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
function add_to_div(module,id,name,email){
var pre=document.getElementById("pre").value;
if(pre=="contactleads_to")var addr="addressTo"+parent.opener.document.getElementById("idx").value;
if(pre=="contactleads_cc")var addr="addressCC"+parent.opener.document.getElementById("idx").value;
if(pre=="contactleads_bcc")var addr="addressBCC"+parent.opener.document.getElementById("idx").value;
var L=parent.opener.document.getElementById(pre+"_count").value;
L++;
var div=parent.opener.document.getElementById(pre+"_div");
div.setAttribute("style","width: 500px;padding-left:6px; max-height:50px; overflow:auto;display:none;");
var div_acc=document.createElement("div");
div_acc.setAttribute("id",pre+"_div_"+L);
div_acc.setAttribute("style","");
div.appendChild(div_acc);
var input=document.createElement("input");
input.setAttribute("name",pre+"_name_"+L);
input.setAttribute("type","text");
input.setAttribute("value",name);
div_acc.appendChild(input);
var input=document.createElement("input");
input.setAttribute("name",pre+"_id_"+L);
input.setAttribute("type","text");
input.setAttribute("style","display:none;");
input.setAttribute("value",id);
div_acc.appendChild(input);
var span=document.createElement("span");
span.innerHTML='&nbsp;';
div_acc.appendChild(span);
var img=document.createElement("img");
img.setAttribute("src","themes/Sugar/images/delete_inline.gif");
img.style.cursor="pointer";
img.onclick=function(){div.removeChild(div_acc);div.removeChild(br1);};
div_acc.appendChild(img);
var em=email.split("||");
for(var j=0;j<em.length;j++){
if(em[j]!="" && em[j]!=" "){
var input=document.createElement("input");
input.setAttribute("name",pre+"_email_check_"+L+"_"+j);
input.setAttribute("type","checkbox");
input.setAttribute("checked","checked");
input.setAttribute("value",em[j]);
div_acc.appendChild(input);
var span=document.createElement("span");
span.setAttribute("id",pre+"_email_"+L+"_"+j);
span.innerHTML="&nbsp;"+em[j];
div_acc.appendChild(span);
parent.opener.document.getElementById(addr).value=parent.opener.document.getElementById(addr).value+"; "+name+" <"+em[j]+">";
}
}
parent.opener.document.getElementById(pre+"_count").value=L;
window.close();
}
i=0;
</script>
<!-- END: SearchHeader -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView" id="table_acc">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20" class="listViewThS1">
<td scope="col" width="5%" class="listViewThS1" NOWRAP>{CHECKALL}</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_NAME}{arrow_start}{name_arrow}{arrow_end}</a>
</slot>
</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_TITLE}{arrow_start}{title_arrow}{arrow_end}</a>
</slot>
</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_ACCOUNT_NAME}{arrow_start}{account_name_arrow}{arrow_end}</a>
</slot>
</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_EMAIL_ADDRESS}{arrow_start}{email1_arrow}{arrow_end}</a>
</slot>
</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_OFFICE_PHONE}{arrow_start}{phone_work_arrow}{arrow_end}</a>
</slot>
</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">User{arrow_start}{assigned_user_name_arrow}{arrow_end}</a>
</slot>
</td>
</tr>
<!-- BEGIN: row -->
<tr height="20"
onmouseover="setPointer(this, '{CONTACTLEAD.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmouseout="setPointer(this, '{CONTACTLEAD.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmousedown="setPointer(this, '{CONTACTLEAD.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>
<{TAG.MAIN} href="#"
onclick="add_to_div('ContactLead','{CONTACTLEAD.ID}','{CONTACTLEAD.NAME}','{CONTACTLEAD.ADDRS}')"
class="listViewTdLinkS1">{CONTACTLEAD.NAME}</{TAG.MAIN}>
</slot>
</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>{CONTACTLEAD.TITLE}</slot>
</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot><a href="index.php?module=Accounts&action=DetailView&record={CONTACTLEAD.ACCOUNT_ID}">{CONTACTLEAD.ACCOUNT_NAME}</a></slot>
</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>{CONTACTLEAD.EMAIL1}</slot>
</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>{CONTACTLEAD.PHONE_WORK}</slot>
</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>{CONTACTLEAD.ASSIGNED_USER_NAME}</slot>
</td>
</tr>
<tr>
<td colspan="20" class="listViewHRS1"></td>
</tr>
<!-- END: row -->
</table>
{ASSOCIATED_JAVASCRIPT_DATA}
<script>
function addAll(m){
var checks=document.getElementById("table_acc").getElementsByTagName("input");
for(i=0;i<31;i++){
if(checks[i] && checks[i].name!="massall" && checks[i].checked==true){
if(associated_javascript_data[checks[i].value].ADDRS==null)var addrs="";
else var addrs=associated_javascript_data[checks[i].value].ADDRS
if(addrs!="")add_to_div('ContactLead',associated_javascript_data[checks[i].value].ID,associated_javascript_data[checks[i].value].NAME,addrs);
}
}
}
selectTabCSS(document.getElementById("tab").value);
</script>
<!-- END: main -->