/** * Imprime la forma para agregar un nuevo registro sobre el DIV identificado por "formDiv". * * @param callerid * @param customerid * @param contactid * @return $html (string) Devuelve una cadena de caracteres que contiene la forma para insertar * un nuevo registro. */ function formAdd($callerid = null, $customerid = null, $contactid = null, $campaignid = 0, $diallistid = 0, $note = '', $srcname) { global $locate, $config; $html = ' <!-- No edit the next line --> <form method="post" name="f" id="f"> <table border="1" width="100%" class="adminlist"> <tr> <td nowrap align="left" colspan="2">' . $locate->Translate("add_record") . ' <a href="?" onclick="dial(\'' . $callerid . '\',\'\',\'\',\'\',\'' . $diallistid . '\');return false;">' . $callerid . '</a><input type="hidden" value="' . $callerid . '" id="iptcallerid" name="iptcallerid"> <span id="diallist_control"></span>'; if ($campaignid > 0) { $html .= "<span id=\"diallist_control\"><input type=\"button\" id=\"insert_dnc_list\" name=\"insert_dnc_list\" value=\"" . $locate->Translate("Add Dnc_list") . "\" onclick=\"xajax_insertIntoDnc('" . $callerid . "','" . $campaignid . "');return false;\"/>"; if ($diallistid > 0) { $html .= " <input type=\"button\" id=\"skip_diallist\" name=\"skip_diallist\" value=\"" . $locate->Translate("Skip this number") . "\" onclick=\"xajax_skipDiallist('" . $callerid . "','" . $diallistid . "');return false;\"/>"; } $html .= '</span>'; } $html .= '</td> </tr>'; if ($customerid == null || $customerid == 0) { $customerid = 0; $html .= ' <tr> <td nowrap align="left">' . $locate->Translate("customer_name") . '</td> <td align="left">'; if ($_SESSION['curuser']['language'] != 'ZH' && $_SESSION['curuser']['country'] != 'cn') { $html .= '<select id="customertitle" name="customertitle"> <option value="Mr" >' . $locate->Translate("Mr") . '</option> <option value="Miss">' . $locate->Translate("Miss") . '</option> <option value="Ms" >' . $locate->Translate("Ms") . '</option> <option value="Mrs" >' . $locate->Translate("Mrs") . '</option> <option value="other" >' . $locate->Translate("Other") . '</option> </select> '; if (!empty($srcname) && $srcname != '<unknown>') { $html .= '<input type="text" id="customer" name="customer" value="' . $srcname . '" onkeyup="ajax_showOptions(this,\'getCustomersByLetters\',event)" size="25" maxlength="50" autocomplete="off">'; } else { $html .= '<input type="text" id="customer" name="customer" value="" onkeyup="ajax_showOptions(this,\'getCustomersByLetters\',event)" size="25" maxlength="50" autocomplete="off">'; } } else { if (!empty($srcname) && $srcname != '<unknown>') { $html .= '<input type="text" id="customer" name="customer" value="' . $srcname . '" onkeyup="ajax_showOptions(this,\'getCustomersByLetters\',event)" size="25" maxlength="50" autocomplete="off">'; } else { $html .= '<input type="text" id="customer" name="customer" value="" onkeyup="ajax_showOptions(this,\'getCustomersByLetters\',event)" size="25" maxlength="50" autocomplete="off">'; } $html .= ' <select id="customertitle" name="customertitle"> <option value="Mr" >' . $locate->Translate("Mr") . '</option> <option value="Miss">' . $locate->Translate("Miss") . '</option> <option value="Ms" >' . $locate->Translate("Ms") . '</option> <option value="Mrs" >' . $locate->Translate("Mrs") . '</option> <option value="other" >' . $locate->Translate("Other") . '</option> </select>'; } if ($config['system']['customer_leads'] == 'move') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" />' . $locate->Translate("move_to_customer_lead"); } else { if ($config['system']['customer_leads'] == 'copy') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" />' . $locate->Translate("copy_to_customer_lead"); } else { if ($config['system']['customer_leads'] == 'default_move') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" checked/>' . $locate->Translate("move_to_customer_lead"); } else { if ($config['system']['customer_leads'] == 'default_copy') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" checked/>' . $locate->Translate("copy_to_customer_lead"); } } } } $html .= '<br /><input type="button" value="' . $locate->Translate("confirm") . '" id="btnConfirmCustomer" name="btnConfirmCustomer" onclick="btnConfirmCustomerOnClick();"><input type="hidden" id="customerid" name="customerid" value="0"> <input type="hidden" id="hidAddCustomerDetails" name="hidAddCustomerDetails" value="OFF"> [<a href=? onclick=" if (xajax.$(\'hidAddCustomerDetails\').value == \'OFF\'){ showObj(\'trAddCustomerDetails\'); xajax.$(\'hidAddCustomerDetails\').value = \'ON\'; }else{ hideObj(\'trAddCustomerDetails\'); xajax.$(\'hidAddCustomerDetails\').value = \'OFF\'; }; return false;"> ' . $locate->Translate("detail") . ' </a>] [<a href=? onclick=" if (xajax.$(\'hidAddBankDetails\').value == \'OFF\'){ showObj(\'trAddBankDetails\'); xajax.$(\'hidAddBankDetails\').value = \'ON\'; }else{ hideObj(\'trAddBankDetails\'); xajax.$(\'hidAddBankDetails\').value = \'OFF\'; } return false;">' . $locate->Translate("bank") . '</a>] [<a href=? onclick="addSchedulerDial(\'0\'); return false;">' . $locate->Translate("Scheduler Dial") . '</a>] <input type="hidden" id="addedSchedulerDialId" name="addedSchedulerDialId" value="" /> </td> </tr> <tr id="trAddSchedulerDial" name="trAddSchedulerDial" style="display:none"> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("first_name") . '</td> <td align="left"><input type="text" id="first_name" name="first_name" size="35" maxlength="50"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("last_name") . '</td> <td align="left"><input type="text" id="last_name" name="last_name" size="35" maxlength="50"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("address") . '</td> <td align="left"><input type="text" id="address" name="address" size="35" maxlength="200"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("customer_contact") . '</td> <td align="left"> <input type="text" id="customerContact" name="customerContact" size="35" maxlength="35"><br> <select id="customerContactGender" name="customerContactGender"> <option value="male">' . $locate->Translate("male") . '</option> <option value="female">' . $locate->Translate("female") . '</option> <option value="unknown" selected>' . $locate->Translate("unknown") . '</option> </select> </td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("address") . '</td> <td align="left"><input type="text" id="address" name="address" size="35" maxlength="200"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("zipcode") . '/' . $locate->Translate("city") . '</td> <td align="left"> <input type="text" id="zipcode" name="zipcode" size="10" maxlength="10"> <input type="text" id="city" name="city" size="17" maxlength="50"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("state") . '</td> <td align="left"><input type="text" id="state" name="state" size="35" maxlength="50"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("country") . '</td> <td align="left"><input type="text" id="country" name="country" size="35" maxlength="50"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("customer_phone") . '</td> <td align="left"><input type="text" id="customerPhone" name="customerPhone" size="35" maxlength="50">-<input type="text" id="customerPhone_ext" name="customerPhone_ext" size="8" maxlength="8"></td> </tr> <tr name="trAddCustomerDetails" id="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("mobile") . '</td> <td align="left"><input type="text" id="mainMobile" name="mainMobile" size="35" value="' . $callerid . '"></td> </tr> <tr name="trAddCustomerDetails" id="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("email") . '</td> <td align="left"><input type="text" id="mainEmail" name="mainEmail" size="35"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("website") . '</td> <td align="left"><input type="text" id="website" name="website" size="35" maxlength="100" value="http://"><br><input type="button" value="' . $locate->Translate("browser") . '" onclick="openWindow(xajax.$(\'website\').value);return false;"></td> </tr> <!--<tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("zipcode") . '</td> <td align="left"><input type="text" id="zipcode" name="zipcode" size="10" maxlength="10"></td> </tr>--> <tr name="trAddCustomerDetails" id="trAddCustomerDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("fax") . '</td> <td align="left"><input type="text" id="mainFax" name="mainFax" size="35">-<input type="text" id="mainFax_ext" name="mainFax_ext" size="8" maxlength="8"></td> </tr> <tr id="trAddCustomerDetails" name="trAddCustomerDetails" style="display:none"> <td nowrap align="left" style="border-bottom:1px double orange;">' . $locate->Translate("category") . '</td> <td align="left" style="border-bottom:1px double orange"><input type="text" id="category" name="category" size="35"></td> </tr>'; /* * control bank data */ $html .= ' <input type="hidden" id="hidAddBankDetails" name="hidAddBankDetails" value="OFF"> <!--********************--> <tr id="trAddBankDetails" name="trAddBankDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("bank_account_name") . '</td> <td align="left"><input type="text" id="bankaccountname" name="bankaccountname" size="35"></td> </tr> <tr id="trAddBankDetails" name="trAddBankDetails" style="display:none"> <td nowrap align="left" style="border-top:1px double orange;">' . $locate->Translate("bank_name") . '</td> <td align="left" style="border-top:1px double orange"><input type="text" id="bankname" name="bankname" size="35"></td> </tr> <tr id="trAddBankDetails" name="trAddBankDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("bank_zip") . '</td> <td align="left"><input type="text" id="bankzip" name="bankzip" size="35"></td> </tr> <tr id="trAddBankDetails" name="trAddBankDetails" style="display:none"> <td nowrap align="left">' . $locate->Translate("bank_account") . '</td> <td align="left"><input type="text" id="bankaccount" name="bankaccount" size="35"></td> </tr> <!--********************--> '; } else { $customer =& astercrm::getCustomerByID($customerid); $html .= ' <tr> <td nowrap align="left"><a href=? onclick="xajax_showCustomer(' . $customerid . ');return false;">' . $locate->Translate("customer_name") . '</a></td> <td align="left">'; if ($_SESSION['curuser']['language'] != 'ZH' && $_SESSION['curuser']['country'] != 'cn') { $html .= $locate->Translate($customer['customertitle']) . ' <input type="text" id="customer" name="customer" value="' . $customer['customer'] . '" onkeyup="ajax_showOptions(this,\'getCustomersByLetters\',event)" size="25" maxlength="50" autocomplete="off" readOnly>'; } else { $html .= '<input type="text" id="customer" name="customer" value="' . $customer['customer'] . '" onkeyup="ajax_showOptions(this,\'getCustomersByLetters\',event)" size="25" maxlength="50" autocomplete="off" readOnly> ' . $locate->Translate($customer['customertitle']); } if ($config['system']['customer_leads'] == 'move') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" />' . $locate->Translate("move_to_customer_lead"); } else { if ($config['system']['customer_leads'] == 'copy') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" />' . $locate->Translate("copy_to_customer_lead"); } else { if ($config['system']['customer_leads'] == 'default_move') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" checked/>' . $locate->Translate("move_to_customer_lead"); } else { if ($config['system']['customer_leads'] == 'default_copy') { $html .= ' <input type="checkbox" name="customer_leads_check" id="customer_leads" checked/>' . $locate->Translate("copy_to_customer_lead"); } } } } $html .= '<BR /><input type="button" value="' . $locate->Translate("cancel") . '" id="btnConfirmCustomer" name="btnConfirmCustomer" onclick="btnConfirmCustomerOnClick();"><input type="hidden" id="customerid" name="customerid" value="' . $customerid . '"></td> </tr> '; } if ($config['system']['enable_contact'] != '0') { //控制contact模块的显示与隐藏 if ($contactid == null) { $html .= ' <tr> <td nowrap align="left">' . $locate->Translate("contact") . '</td> <td align="left"><input type="text" id="contact" name="contact" value="" onkeyup="ajax_showOptions(this,\'customerid=' . $customerid . '&getContactsByLetters\',event)" size="35" maxlength="50" autocomplete="off"><BR /><input id="btnConfirmContact" name="btnConfirmContact" type="button" onclick="btnConfirmContactOnClick();return false;" value="' . $locate->Translate("confirm") . '"><input type="hidden" id="contactid" name="contactid" value=""> <input type="hidden" id="contactDetail" name="contactDetail" value="OFF"> [<a href=? onclick=" if (xajax.$(\'contactDetail\').value == \'OFF\'){ xajax.$(\'genderTR\').style.display = \'\'; xajax.$(\'positionTR\').style.display = \'\'; xajax.$(\'phoneTR\').style.display = \'\'; xajax.$(\'phone1TR\').style.display = \'\'; xajax.$(\'phone2TR\').style.display = \'\'; xajax.$(\'mobileTR\').style.display = \'\'; xajax.$(\'faxTR\').style.display = \'\'; xajax.$(\'emailTR\').style.display = \'\'; xajax.$(\'contactDetail\').value = \'ON\'; }else{ xajax.$(\'genderTR\').style.display = \'none\'; xajax.$(\'positionTR\').style.display = \'none\'; xajax.$(\'phoneTR\').style.display = \'none\'; xajax.$(\'phone1TR\').style.display = \'none\'; xajax.$(\'phone2TR\').style.display = \'none\'; xajax.$(\'mobileTR\').style.display = \'none\'; xajax.$(\'faxTR\').style.display = \'none\'; xajax.$(\'emailTR\').style.display = \'none\'; xajax.$(\'contactDetail\').value = \'OFF\'; }; return false;"> ' . $locate->Translate("detail") . ' </a>] </td> </tr> <tr name="genderTR" id="genderTR" style="display:none"> <td nowrap align="left">' . $locate->Translate("gender") . '</td> <td align="left"> <select id="contactGender" name="contactGender"> <option value="male">' . $locate->Translate("male") . '</option> <option value="female">' . $locate->Translate("female") . '</option> <option value="unknown" selected>' . $locate->Translate("unknown") . '</option> </select> </td> </tr> <tr name="positionTR" id="positionTR" style="display:none"> <td nowrap align="left">' . $locate->Translate("position") . '</td> <td align="left"><input type="text" id="position" name="position" size="35"></td> </tr> <tr name="phoneTR" id="phoneTR" style="display:none"> <td nowrap align="left">' . $locate->Translate("phone") . '</td> <td align="left"><input type="text" id="phone" name="phone" size="35" value="' . $callerid . '">-<input type="text" id="ext" name="ext" size="8" maxlength="8" value=""></td> </tr> <tr name="phone1TR" id="phone1TR" style="display:none"> <td nowrap align="left">' . $locate->Translate("phone1") . '</td> <td align="left"><input type="text" id="phone1" name="phone1" size="35" value="">-<input type="text" id="ext1" name="ext1" size="8" maxlength="8" value=""></td> </tr> <tr name="phone2TR" id="phone2TR" style="display:none"> <td nowrap align="left">' . $locate->Translate("phone2") . '</td> <td align="left"><input type="text" id="phone2" name="phone2" size="35" value="">-<input type="text" id="ext2" name="ext2" size="8" maxlength="8" value=""></td> </tr> <tr name="mobileTR" id="mobileTR" style="display:none"> <td nowrap align="left">' . $locate->Translate("mobile") . '</td> <td align="left"><input type="text" id="mobile" name="mobile" size="35"></td> </tr> <tr name="faxTR" id="faxTR" style="display:none"> <td nowrap align="left">' . $locate->Translate("fax") . '</td> <td align="left"><input type="text" id="fax" name="fax" size="35">-<input type="text" id="fax_ext" name="fax_ext" size="8" maxlength="8" value=""></td> </tr> <tr name="emailTR" id="emailTR" style="display:none"> <td nowrap align="left">' . $locate->Translate("email") . '</td> <td align="left"><input type="text" id="email" name="email" size="35"></td> </tr> '; } else { $contact =& astercrm::getContactByID($contactid); $html .= ' <tr> <td nowrap align="left"><a href=? onclick="xajax_showContact(' . $contactid . ');return false;">' . $locate->Translate("contact") . '</a></td> <td align="left"><input type="text" id="contact" name="contact" value="' . $contact['contact'] . '" onkeyup="ajax_showOptions(this,\'getContactsByLetters\',event)" size="35" maxlength="50" autocomplete="off" readOnly><input type="button" value="' . $locate->Translate("cancel") . '" id="btnConfirmContact" name="btnConfirmContact" onclick="btnConfirmContactOnClick();"><input type="hidden" id="contactid" name="contactid" value="' . $contactid . '"></td> </tr> '; } } //add survey html //$html .= '<tr><td colspan="2">'; //$surveyHTML =& astercrm::generateSurvey(); //$html .= $surveyHTML; //$html .= '</tr></td>'; //if(!defined('HOME_DIR')) define('HOME_DIR',dirname(dirname(__FILE__))); //add note html $html .= ' <tr> <td nowrap align="left">' . $locate->Translate("note") . '(<input type="checkbox" name="sltPrivate" id="sltPrivate" value="0" onclick="if(this.checked){ document.getElementById(\'private\').value=0;}else{ document.getElementById(\'private\').value=1;}"'; if ($config['system']['default_share_note']) { $html .= 'checked>' . $locate->Translate("share") . ')<input type="hidden" value="0" name="private" id="private"></td>'; } else { $html .= '>' . $locate->Translate("share") . ')<input type="hidden" value="1" name="private" id="private"></td>'; } $html .= '<td align="left"> <textarea rows="4" cols="50" id="note" name="note" wrap="soft" style="overflow:auto;">' . $note . '</textarea> </td> </tr> <tr> <td nowrap align="left">' . $locate->Translate("note_code") . '</td> <td align="left"><select id="note_code" name="note_code">'; $getAllNoteCodes =& astercrm::getAllNoteCodes(); foreach ($getAllNoteCodes as $tmp) { $html .= '<option value="' . $tmp['code'] . '">' . $tmp['code'] . '</option>'; } $html .= '</select></td> </tr> <tr> <td nowrap align="left">' . $locate->Translate("priority") . '</td> <td align="left"> <select id="priority" name="priority"> <option value=0>0</option> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5 selected>5</option> <option value=6>6</option> <option value=7>7</option> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> </select> <input type="radio" name="attitude" value="10"/><img src="skin/default/images/10.gif" width="25px" height="25px" border="0" /> <input type="radio" name="attitude" value="5"/><img src="skin/default/images/5.gif" width="25px" height="25px" border="0" /> <input type="radio" name="attitude" value="-1"/><img src="skin/default/images/-1.gif" width="25px" height="25px" border="0" /> <input type="radio" name="attitude" value="0" checked/> <img src="skin/default/images/0.gif" width="25px" height="25px" border="0" /> </td> </tr> <tr> <td colspan="2" align="center"><button id="submitButton" onClick=\'xajax_save(xajax.getFormValues("f"));return false;\'>' . $locate->Translate("continue") . '</button></td> </tr>'; $html .= ' </table> </form> ' . $locate->Translate("ob_fields") . ' '; return $html; }
function addNote($customerLid) { global $locate, $db; $html .= ' <form method="post" name="formNote" id="formNote"> <table border="1" width="100%" class="adminlist"> <tr> <td nowrap align="left">' . $locate->Translate("note") . '</td> <td align="left"> <textarea rows="4" cols="50" id="note" name="note" wrap="soft" style="overflow:auto"></textarea> <input type="hidden" value="' . $customerLid . '" name="customerid" id="customerid"> <input type="hidden" value="0" name="contactid" id="contactid"> </td> </tr> <tr> <td nowrap align="left">' . $locate->Translate("note_code") . '</td> <td align="left"><select id="note_code" name="note_code">'; $getAllNoteCodes =& astercrm::getAllNoteCodes(); foreach ($getAllNoteCodes as $tmp) { $html .= '<option value="' . $tmp['code'] . '">' . $tmp['code'] . '</option>'; } $html .= ' </select></td> </tr> <tr> <td nowrap align="left">' . $locate->Translate("priority") . '</td> <td align="left"> <select id="priority" name="priority"> <option value=0>0</option> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5 selected>5</option> <option value=6>6</option> <option value=7>7</option> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> </select> <input type="radio" name="attitude" value="10"/><img src="skin/default/images/10.gif" width="25px" height="25px" border="0" /> <input type="radio" name="attitude" value="5"/><img src="skin/default/images/5.gif" width="25px" height="25px" border="0" /> <input type="radio" name="attitude" value="-1"/><img src="skin/default/images/-1.gif" width="25px" height="25px" border="0" /> <input type="radio" name="attitude" value="0" checked/> <img src="skin/default/images/0.gif" width="25px" height="25px" border="0" /> </td> </tr> <tr> <td nowrap colspan=2 align=right><input type="button" id="btnAddNote" name="btnAddNote" value="' . $locate->Translate("continue") . '" onclick="xajax_saveCustomerLeadNote(xajax.getFormValues(\'formNote\'));return false;"></td> </tr> '; $html .= ' </table> </form> '; return $html; }