if ($adb->dbType == "pgsql") { $list_result = $adb->pquery($query . " OFFSET {$limit_start_rec} LIMIT {$list_max_entries_per_page}", array()); } else { $list_result = $adb->pquery($query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array()); } $recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec); $smarty->assign('recordListRange', $recordListRangeMsg); //mass merge for word templates -- *Raj*17/11 while ($row = $adb->fetch_array($list_result)) { $ids[] = $row["crmid"]; } if (isset($ids)) { $smarty->assign("ALLIDS", implode($ids, ";")); } if (isPermitted("Accounts", "Merge") == 'yes') { $wordTemplateResult = fetchWordTemplateList("Accounts"); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $optionString .= "<option value=\"" . $tempVal["templateid"] . "\">" . $tempVal["filename"] . "</option>"; $tempVal = $adb->fetch_array($wordTemplateResult); } if ($tempCount > 0) { $smarty->assign("WORDTEMPLATEOPTIONS", "<td>" . $app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'] . "</td><td style=\"padding-left:5px;padding-right:5px\"><select class=\"small\" name=\"mergefile\">" . $optionString . "</select></td>"); $smarty->assign("MERGEBUTTON", "<td><input title=\"{$app_strings['LBL_MERGE_BUTTON_TITLE']}\" accessKey=\"{$app_strings['LBL_MERGE_BUTTON_KEY']}\" class=\"crmbutton small create\" onclick=\"return massMerge('Accounts')\" type=\"submit\" name=\"Merge\" value=\" {$app_strings['LBL_MERGE_BUTTON_LABEL']}\"></td>"); } else { global $current_user; require "user_privileges/user_privileges_" . $current_user->id . ".php"; if ($is_admin == true) { $smarty->assign("MERGEBUTTON", '<td><a href=index.php?module=Settings&action=upload&tempModule=' . $currentModule . '&parenttab=Settings>' . $app_strings["LBL_CREATE_MERGE_TEMPLATE"] . '</td>'); }
if ($adb->dbType == "pgsql") { $list_result = $adb->pquery($list_query . " OFFSET {$limit_start_rec} LIMIT {$list_max_entries_per_page}", array()); } else { $list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array()); } $recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec); $smarty->assign('recordListRange', $recordListRangeMsg); //mass merge for word templates -- *Raj*17/11 while ($row = $adb->fetch_array($list_result)) { $ids[] = $row["crmid"]; } if (isset($ids)) { $smarty->assign("ALLIDS", implode($ids, ";")); } if (isPermitted("Contacts", "Merge") == 'yes') { $wordTemplateResult = fetchWordTemplateList("Contacts"); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $optionString .= "<option value=\"" . $tempVal["templateid"] . "\">" . $tempVal["filename"] . "</option>"; $tempVal = $adb->fetch_array($wordTemplateResult); } if ($tempCount > 0) { $smarty->assign("WORDTEMPLATEOPTIONS", "<td>" . $app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'] . "</td><td style=\"padding-left:5px;padding-right:5px\"><select class=\"small\" name=\"mergefile\">" . $optionString . "</select></td>"); $smarty->assign("MERGEBUTTON", "<td><input title=\"{$app_strings['LBL_MERGE_BUTTON_TITLE']}\" accessKey=\"{$app_strings['LBL_MERGE_BUTTON_KEY']}\" class=\"crmbutton small create\" onclick=\"return massMerge('Contacts')\" type=\"submit\" name=\"Merge\" value=\" {$app_strings['LBL_MERGE_BUTTON_LABEL']}\"></td>"); } else { global $current_user; require "user_privileges/user_privileges_" . $current_user->id . ".php"; if ($is_admin == true) { $smarty->assign("MERGEBUTTON", "<td><a href=index.php?module=Settings&action=upload&tempModule=" . $currentModule . "&parenttab=Settings>" . $app_strings['LBL_CREATE_MERGE_TEMPLATE'] . "</td>"); }
$emails[] = $value; } $smarty->assign("EMAILS", $emails); $cond = "LTrim('%s') !=''"; $condition = array(); foreach ($emails as $key => $value) { $condition[] = sprintf($cond, $value); } $condition_str = implode("||", $condition); $js = "if(" . $condition_str . "){fnvshobj(this,'sendmail_cont');sendmail('" . $currentModule . "'," . $_REQUEST['record'] . ");}else{OpenCompose('','create');}"; $smarty->assign('JS', $js); } if (isPermitted("Leads", "Merge", '') == 'yes') { global $current_user; require "user_privileges/user_privileges_" . $current_user->id . ".php"; $wordTemplateResult = fetchWordTemplateList("Leads"); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $optionString[$tempVal["templateid"]] = $tempVal["filename"]; $tempVal = $adb->fetch_array($wordTemplateResult); } if ($is_admin) { $smarty->assign("MERGEBUTTON", "permitted"); } elseif ($tempCount > 0) { $smarty->assign("MERGEBUTTON", "permitted"); } $smarty->assign("TEMPLATECOUNT", $tempCount); $smarty->assign("WORDTEMPLATEOPTIONS", $app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); $smarty->assign("TOPTIONS", $optionString); }
$smarty->assign("CRITERIA", $criteria); $smarty->assign("AVALABLE_FIELDS", getMergeFields($currentModule, "available_fields")); $smarty->assign("FIELDS_TO_MERGE", getMergeFields($currentModule, "fileds_to_merge")); //Added to select Multiple records in multiple pages $smarty->assign("SELECTEDIDS", vtlib_purify($_REQUEST['selobjs'])); $smarty->assign("ALLSELECTEDIDS", vtlib_purify($_REQUEST['allselobjs'])); $smarty->assign("CURRENT_PAGE_BOXES", implode(array_keys($listview_entries), ";")); ListViewSession::setSessionQuery($currentModule, $list_query, $viewid); // Gather the custom link information to display include_once 'vtlib/Vtiger/Link.php'; $customlink_params = array('MODULE' => $currentModule, 'ACTION' => vtlib_purify($_REQUEST['action']), 'CATEGORY' => $category); $smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), array('LISTVIEWBASIC', 'LISTVIEW'), $customlink_params)); // END if (isPermitted($currentModule, "Merge") == 'yes' && file_exists("modules/{$currentModule}/Merge.php")) { $wordTemplates = array(); $wordTemplateResult = fetchWordTemplateList($currentModule); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $wordTemplates[$tempVal["templateid"]] = $tempVal["filename"]; $tempVal = $adb->fetch_array($wordTemplateResult); } $smarty->assign('WORDTEMPLATES', $wordTemplates); } } $smarty->assign('IS_ADMIN', is_admin($current_user)); if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '') { $smarty->display("ListViewEntries.tpl"); } else { $smarty->display('ListView.tpl'); }
$smarty->assign("PRINT_URL", "phprint.php?jt=" . session_id() . $GLOBALS['request_string']); // Module Sequence Numbering $mod_seq_field = getModuleSequenceField($currentModule); if ($mod_seq_field != null) { $mod_seq_id = $focus->column_fields[$mod_seq_field['name']]; } else { $mod_seq_id = $focus->id; } $smarty->assign('MOD_SEQ_ID', $mod_seq_id); // END $smarty->assign("ID", vtlib_purify($_REQUEST['record'])); if (isPermitted("HelpDesk", "Merge", '') == 'yes') { global $current_user; require "user_privileges/user_privileges_" . $current_user->id . ".php"; require_once 'include/utils/UserInfoUtil.php'; $wordTemplateResult = fetchWordTemplateList("HelpDesk"); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $optionString[$tempVal["templateid"]] = $tempVal["filename"]; $tempVal = $adb->fetch_array($wordTemplateResult); } if ($is_admin) { $smarty->assign("MERGEBUTTON", "permitted"); } elseif ($tempCount > 0) { $smarty->assign("MERGEBUTTON", "permitted"); } $smarty->assign("TEMPLATECOUNT", $tempCount); $smarty->assign("WORDTEMPLATEOPTIONS", $app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); $smarty->assign("TOPTIONS", $optionString); }
$emails[] = $value; } $smarty->assign('EMAILS', $emails); $cond = "LTrim('%s') !=''"; $condition = array(); foreach ($emails as $key => $value) { $condition[] = sprintf($cond, $value); } $condition_str = implode('||', $condition); $js = "if(" . $condition_str . "){fnvshobj(this,'sendmail_cont');sendmail('" . $currentModule . "'," . $_REQUEST['record'] . ");}else{OpenCompose('','create');}"; $smarty->assign('JS', $js); } if (isPermitted('Leads', 'Merge', '') == 'yes') { global $current_user; require 'user_privileges/user_privileges_' . $current_user->id . ".php"; $wordTemplateResult = fetchWordTemplateList('Leads'); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $optionString[$tempVal['templateid']] = $tempVal['filename']; $tempVal = $adb->fetch_array($wordTemplateResult); } if ($is_admin) { $smarty->assign('MERGEBUTTON', 'permitted'); } elseif ($tempCount > 0) { $smarty->assign('MERGEBUTTON', 'permitted'); } $smarty->assign('TEMPLATECOUNT', $tempCount); $smarty->assign('WORDTEMPLATEOPTIONS', $app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); $smarty->assign('TOPTIONS', $optionString); }
$emails[] = $value; } $smarty->assign('EMAILS', $emails); $cond = "LTrim('%s') !=''"; $condition = array(); foreach ($emails as $key => $value) { $condition[] = sprintf($cond, $value); } $condition_str = implode('||', $condition); $js = "if(" . $condition_str . "){fnvshobj(this,'sendmail_cont');sendmail('" . $currentModule . "'," . $_REQUEST['record'] . ");}else{OpenCompose('','create');}"; $smarty->assign('JS', $js); } if (isPermitted('Accounts', 'Merge', '') == 'yes') { require "user_privileges/user_privileges_" . $current_user->id . ".php"; require_once 'include/utils/UserInfoUtil.php'; $wordTemplateResult = fetchWordTemplateList('Accounts'); $tempCount = $adb->num_rows($wordTemplateResult); $tempVal = $adb->fetch_array($wordTemplateResult); for ($templateCount = 0; $templateCount < $tempCount; $templateCount++) { $optionString[$tempVal['templateid']] = $tempVal['filename']; $tempVal = $adb->fetch_array($wordTemplateResult); } if ($is_admin) { $smarty->assign('MERGEBUTTON', 'permitted'); } elseif ($tempCount > 0) { $smarty->assign('MERGEBUTTON', 'permitted'); } $smarty->assign('TEMPLATECOUNT', $tempCount); $smarty->assign('WORDTEMPLATEOPTIONS', $app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']); $smarty->assign('TOPTIONS', $optionString); }