function buildTableForm($rows, $mod = '') { global $odd_bg, $even_bg; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dupFeed'><input type='hidden' name='selectedFeed' value=''>"; $form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", ''); $form .= "<table width='100%' cellpadding='0' cellspacing='0'>\t<tr class='listViewThS1'>\t<td class='listViewThS1'> </td>"; require_once 'include/formbase.php'; $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td scope='col' class='listViewThS1'>" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $bgcolor = $odd_bg; $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}' bgcolor='{$bgcolor}'>"; $form .= "<td width='1%' bgcolor='{$bgcolor}' nowrap ><a href='#' onClick=\"document.dupFeeds.selectedFeed.value='{$row['id']}';document.dupFeeds.submit() \">[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>"; $wasSet = false; foreach ($row as $key => $value) { if ($key != 'id') { if (!$wasSet) { $form .= "<td scope='row' class='{$rowColor}' bgcolor='{$bgcolor}'><a target='_blank' href='index.php?module=Feeds&action=DetailView&record={$row['id']}'>{$value}</a></td>"; $wasSet = true; } else { $form .= "<td class='{$rowColor}' bgcolor='{$bgcolor}'><a target='_blank' href='index.php?module=Feeds&action=DetailView&record={$row['id']}'>{$value}</a></td>"; } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; $bgcolor = $odd_bg; } else { $rowColor = 'evenListRowS1'; $bgcolor = $even_bg; } $form .= "</tr>"; } $form .= "<tr class='listViewThS1'><td colspan='{$cols}' class='blackline'></td></tr>"; $form .= "</table><br><input type='submit' class='button' name='ContinueFeed' value='{$app_strings['LBL_CREATE_BUTTON_LABEL']} {$mod_strings['LNK_NEW_CONTACT']}'></form>"; return $form; }
function buildTableForm($rows, $mod = 'Opportunities') { if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dupOpps'><input type='hidden' name='selectedOpportunity' value=''>"; $form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view'>"; $form .= "<tr class='pagination'><td colspan='{$cols}'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td><input type='submit' class='button' name='ContinueOpportunity' value='{$mod_strings['LNK_NEW_OPPORTUNITY']}'></td></tr></table></td></tr><tr>"; $form .= "<tr><td scope='col'> </td>"; require_once 'include/formbase.php'; $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td scope='col'>" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'>"; $form .= "<td width='1%' nowrap='nowrap'><a href='#' onclick='document.dupOpps.selectedOpportunity.value=\"{$row['id']}\";document.dupOpps.submit();'>[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>"; $wasSet = false; foreach ($row as $key => $value) { if ($key != 'id') { if (!$wasSet) { $form .= "<td scope='row'><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record={$row['id']}'>{$value}</a></td>"; $wasSet = true; } else { $form .= "<td><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record={$row['id']}'>{$value}</a></td>"; } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr class='pagination'><td colspan='{$cols}'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td><input type='submit' class='button' name='ContinueOpportunity' value='{$mod_strings['LNK_NEW_OPPORTUNITY']}'></td></tr></table></td></tr><tr>"; $form .= "</table><BR></form>"; return $form; }
function buildTableForm($rows, $mod = 'Quotes') { if (!ACLController::checkAccess('Quotes', 'edit', true)) { return ''; } if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dupOpps'><input type='hidden' name='selectedQuote' value=''>"; $form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", ''); $form .= "<table width='100%' cellpadding='0' cellspacing='0'>\t<tr >\t<td ></TD>"; require_once 'include/formbase.php'; $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td >" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'><td width='1%' nowrap='nowrap'><a href='#' onclick='document.dupOpps.selectedQuote.value=\"{$row['id']}\";document.dupOpps.submit();'>[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>"; foreach ($row as $key => $value) { if ($key != 'id') { $form .= "<td><a target='_blank' href='index.php?module=Quotes&action=DetailView&record={$row['id']}'>{$value}</a></td>"; } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr ><td colspan='{$cols}' class='blackline'></td></tr>"; $form .= "</table><BR><input type='submit' class='button' name='ContinueQuote' value='{$app_strings['LBL_CREATE_BUTTON_LABEL']} {$mod_strings['LNK_NEW_QUOTE']}'></form>"; return $form; }
function buildTableForm($rows, $mod = 'Accounts') { if (!ACLController::checkAccess('Accounts', 'edit', true)) { return ''; } global $action; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; if ($action != 'ShowDuplicates') { $form = "<form action='index.php' method='post' id='dupAccounts' name='dupAccounts'><input type='hidden' name='selectedAccount' value=''>"; $form .= '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; unset($_POST['selectedAccount']); } else { $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_SHOW_DUPLICATES'] . '</td></tr><tr><td height="20"></td></tr></table>'; } $form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view' border='0'><tr class='pagination'><td colspan='{$cols}'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>"; // handle buttons if ($action == 'ShowDuplicates') { $return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel $return_action = isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action']) ? $_REQUEST['return_action'] : $return_action; $form .= "<input type='hidden' name='selectedAccount' id='selectedAccount' value=''><input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n"; if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='" . $_REQUEST['return_module'] . "';this.form.action.value='" . $_REQUEST['return_action'] . "';this.form.record.value='" . $_REQUEST['return_id'] . "'\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { if (!empty($_POST['return_module']) && !empty($_POST['return_action'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='" . $_POST['return_module'] . "';this.form.action.value='" . $_POST['return_action'] . "';\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } } } else { $form .= "<input type='submit' class='button' name='ContinueAccount' value='{$mod_strings['LNK_NEW_ACCOUNT']}'>\n"; } $form .= "</td></tr></table></td></tr><tr>"; if ($action != 'ShowDuplicates') { $form .= "<th> </th>"; } require_once 'include/formbase.php'; if (isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer') { $_POST['return_action'] = 'DetailView'; } if (isset($_POST['return_action']) && $_POST['return_action'] == 'DetailView' && empty($_REQUEST['return_id'])) { unset($_POST['return_action']); } $form .= getPostToForm('/emailAddress(PrimaryFlag|OptOutFlag|InvalidFlag)?[0-9]*?$/', true); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<th>" . $mod_strings[$mod_strings['db_' . $key]] . "</th>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'>"; if ($action != 'ShowDuplicates') { $form .= "<td width='1%' nowrap><a href='#' onclick='document.dupAccounts.selectedAccount.value=\"{$row['id']}\"; document.dupAccounts.submit(); '>[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; } foreach ($row as $key => $value) { if ($key != 'id') { if (isset($_POST['popup']) && $_POST['popup'] == true) { $form .= "<td scope='row'><a href='#' onclick=\"window.opener.location='index.php?module=Accounts&action=DetailView&record={$row['id']}'\">{$value}</a></td>\n"; } else { $form .= "<td><a target='_blank' href='index.php?module=Accounts&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr class='pagination'><td colspan='{$cols}'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>"; // handle buttons if ($action == 'ShowDuplicates') { $return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel $return_action = isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action']) ? $_REQUEST['return_action'] : $return_action; $form .= "<input type='hidden' name='selectedAccount' id='selectedAccount' value=''><input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n"; if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value=" . $_REQUEST['return_module'] . ";this.form.action.value=" . $_REQUEST['return_action'] . ";this.form.record.value=" . $_REQUEST['return_id'] . "'\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { if (!empty($_POST['return_module']) && !empty($_POST['return_action'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value=" . $_POST['return_module'] . ";this.form.action.value=" . $_POST['return_action'] . ";'\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } } } else { $form .= "<input type='submit' class='button' name='ContinueAccount' value='{$mod_strings['LNK_NEW_ACCOUNT']}'></form>\n"; } $form .= "</td></tr></table></td></tr></table>"; return $form; }
function buildTableForm($rows, $mod = '') { global $action; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; if ($action != 'ShowDuplicates') { $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dupProspects'><input type='hidden' name='selectedProspect' value=''>"; } else { $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_SHOW_DUPLICATES'] . '</td></tr><tr><td height="20"></td></tr></table>'; } $form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", ''); $form .= "<table width='100%' cellpadding='0' cellspacing='0'>\t<tr >\t"; if ($action != 'ShowDuplicates') { $form .= "<td > </td>"; } require_once 'include/formbase.php'; $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td scope='col' >" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'>"; if ($action != 'ShowDuplicates') { $form .= "<td width='1%' nowrap='nowrap' ><a href='#' onClick=\"document.dupProspects.selectedProspect.value='{$row['id']}';document.dupProspects.submit() \">[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; } $wasSet = false; foreach ($row as $key => $value) { if ($key != 'id') { if (!$wasSet) { $form .= "<td scope='row' ><a target='_blank' href='index.php?module=Prospects&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; $wasSet = true; } else { $form .= "<td><a target='_blank' href='index.php?module=Prospects&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr ><td colspan='{$cols}' class='blackline'></td></tr>"; if ($action == 'ShowDuplicates') { $form .= "</table><br><input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '> <input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView'; this.form.module.value='Prospects';\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '></form>"; } else { $form .= "</table><br><input type='submit' class='button' name='ContinueProspect' value='{$mod_strings['LNK_NEW_PROSPECT']}'></form>"; } return $form; }
function buildTableForm($rows, $mod = '') { if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dupLeads'><input type='hidden' name='selectedLead' value=''>"; $form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", ''); $form .= "<table width='100%' cellpadding='0' cellspacing='0'>\t<tr >\t<td ></td>"; require_once 'include/formbase.php'; $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td scope='col' >" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'>"; $form .= "<td width='1%' nowrap='nowrap' align='center'><input type='checkbox' name='selectedLeads[]' value='{$row['id']}'></td>"; $wasSet = false; foreach ($row as $key => $value) { if ($key != 'id') { if (!$wasSet) { $form .= "<td scope='row'><a target='_blank' href='index.php?module=Leads&action=DetailView&record={$row['id']}'>{$value}</a></td>"; $wasSet = true; } else { $form .= "<td><a target='_blank' href='index.php?module=Leads&action=DetailView&record={$row['id']}'>{$value}</a></td>"; } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr ><td colspan='{$cols}' ></td></tr>"; $form .= "</table><br><input type='submit' class='button' name='ContinueLead' value='{$app_strings['LBL_NEXT_BUTTON_LABEL']}'></form>"; return $form; }
function getAnyToForm($ignore = '', $usePostAsAuthority = false) { $fields = getPostToForm($ignore); $fields .= getGetToForm($ignore, $usePostAsAuthority); return $fields; }
function buildTableForm($rows, $mod = 'Suppliers') { if (!ACLController::checkAccess('Suppliers', 'edit', true)) { return ''; } global $odd_bg, $even_bg, $action; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; if ($action != 'ShowDuplicates') { $form = "<form action='index.php' method='post' id='dupSuppliers' name='dupSuppliers'><input type='hidden' name='selectedSupplier' value=''>"; $form .= '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; unset($_POST['selectedSupplier']); } else { $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_SHOW_DUPLICATES'] . '</td></tr><tr><td height="20"></td></tr></table>'; } $form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", ''); $form .= "<table width='100%' cellpadding='0' cellspacing='0'>\t<tr class='listViewThS1'>\t"; if ($action != 'ShowDuplicates') { $form .= "<td class='listViewThS1'> </td>"; } require_once 'include/formbase.php'; $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td class='listViewThS1'>" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $bgcolor = $odd_bg; $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}' bgcolor='{$bgcolor}'>"; if ($action != 'ShowDuplicates') { $form .= "<td width='1%' class='{$rowColor}' nowrap><a href='#' onclick='document.dupSuppliers.selectedSupplier.value=\"{$row['id']}\"; document.dupSuppliers.submit(); '>[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; } foreach ($row as $key => $value) { if ($key != 'id') { $form .= "<td class='{$rowColor}'><a target='_blank' href='index.php?module=Suppliers&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; $bgcolor = $odd_bg; } else { $rowColor = 'evenListRowS1'; $bgcolor = $even_bg; } $form .= "</tr>"; } $form .= "<tr class='listViewThS1'><td colspan='{$cols}' class='blackline'></td></tr>"; // handle buttons if ($action == 'ShowDuplicates') { $return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel $return_action = isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action']) ? $_REQUEST['return_action'] : $return_action; $form .= "</table><br><input type='hidden' name='selectedSupplier' id='selectedSupplier' value=''><input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '>"; if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"location.href='index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id'] . "'\" type='button' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '></form>"; } else { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"location.href='index.php?module=Suppliers&action=ListView'\" type='button' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '></form>"; } } else { $form .= "</table><BR><input type='submit' class='button' name='ContinueSupplier' value='{$mod_strings['LNK_NEW_SUPPLIER']}'></form>\n"; } return $form; }
/** * buildTableForm * * This function creates a table with form data. It is used by the form base code when checking for duplicates * * @param $rows Array of duplicate row data * @return $form The HTML form data */ function buildTableForm($rows) { global $action; global $mod_strings; global $app_strings; $newLinkLabel = 'LNK_NEW_' . strtoupper($this->objectName); $cols = sizeof($rows[0]) * 2 + 1; if ($action != 'ShowDuplicates') { $duplicateLabel = string_format($app_strings['MSG_DUPLICATE'], array(strtolower($this->objectName), $this->moduleName)); $form = '<table width="100%"><tr><td>' . $duplicateLabel . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dup{$this->moduleName}'><input type='hidden' name='selected{$this->objectName}' value=''>"; $form .= getPostToForm('/emailAddress(PrimaryFlag|OptOutFlag|InvalidFlag)?[0-9]*?$/', true); } else { $duplicateLabel = string_format($app_strings['MSG_SHOW_DUPLICATES'], array(strtolower($this->objectName), $this->moduleName)); $form = '<table width="100%"><tr><td>' . $duplicateLabel . '</td></tr><tr><td height="20"></td></tr></table>'; } $form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view' border='0'><tr class='pagination'><td colspan='{$cols}'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>"; if ($action == 'ShowDuplicates') { $form .= "<input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n"; if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='" . $_REQUEST['return_module'] . "';this.form.action.value='" . $_REQUEST['return_action'] . "';this.form.record.value='" . $_REQUEST['return_id'] . "'\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { if (!empty($_POST['return_module']) && !empty($_POST['return_action'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='" . $_POST['return_module'] . "';this.form.action.value='" . $_POST['return_action'] . "';\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } } } else { $form .= "<input type='submit' class='button' name='Continue{$this->objectName}' value='{$mod_strings[$newLinkLabel]}'>"; } $form .= "</td></tr></table></td></tr><tr>"; if ($action != 'ShowDuplicates') { $form .= "<td scope='col'> </td>"; } require_once 'include/formbase.php'; if (isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer') { $_POST['return_action'] = 'DetailView'; } if (isset($_POST['return_action']) && $_POST['return_action'] == 'DetailView' && empty($_REQUEST['return_id'])) { unset($_POST['return_action']); } $form .= getPostToForm(); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td scope='col' >" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'>"; if ($action != 'ShowDuplicates') { $form .= "<td width='1%' nowrap='nowrap'><a href='#' onClick=\"document.forms['dup{$this->moduleName}'].selected{$this->objectName}.value='{$row['id']}';document.forms['dup{$this->moduleName}'].submit() \">[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; } $wasSet = false; foreach ($row as $key => $value) { if ($key != 'id') { if (isset($_POST['popup']) && $_POST['popup'] == true) { $form .= "<td scope='row'><a href='#' onclick=\"window.opener.location='index.php?module={$this->moduleName}&action=DetailView&record={$row['id']}'\">{$value}</a></td>\n"; } else { if (!$wasSet) { $form .= "<td scope='row'><a target='_blank' href='index.php?module={$this->moduleName}&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; $wasSet = true; } else { $form .= "<td><a target='_blank' href='index.php?module={$this->moduleName}&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; } } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr class='pagination'><td colspan='{$cols}'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>"; if ($action == 'ShowDuplicates') { $form .= "<input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n"; if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='" . $_REQUEST['return_module'] . "';this.form.action.value='" . $_REQUEST['return_action'] . "';this.form.record.value='" . $_REQUEST['return_id'] . "';\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { if (!empty($_POST['return_module']) && !empty($_POST['return_action'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='" . $_POST['return_module'] . "';this.form.action.value='" . $_POST['return_action'] . "';\" type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } else { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' type='submit' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '>"; } } } else { $form .= "<input type='submit' class='button' name='Continue{$this->objectName}' value='{$mod_strings[$newLinkLabel]}'></form>"; } $form .= "</td></tr></table></td></tr></table>"; return $form; }
function buildTableForm($rows, $mod = '') { global $action; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } else { global $mod_strings; } global $app_strings; $cols = sizeof($rows[0]) * 2 + 1; if ($action != 'ShowDuplicates') { $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_DUPLICATE'] . '</td></tr><tr><td height="20"></td></tr></table>'; $form .= "<form action='index.php' method='post' name='dupContacts'>\n\t\t\t\t\t<input type='hidden' name='selectedContact' value=''>"; } else { $form = '<table width="100%"><tr><td>' . $mod_strings['MSG_SHOW_DUPLICATES'] . '</td></tr><tr><td height="20"></td></tr></table>'; } $form .= get_form_header($mod_strings['LBL_DUPLICATE'], "", ''); $form .= "<table width='100%' cellpadding='0' cellspacing='0'>\t<tr >\t"; if ($action != 'ShowDuplicates') { $form .= "<td > </td>"; } require_once 'include/formbase.php'; if (isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer') { $_POST['return_action'] = 'DetailView'; } if (isset($_POST['return_action']) && $_POST['return_action'] == 'DetailView' && empty($_REQUEST['return_id'])) { unset($_POST['return_action']); } $form .= getPostToForm('/emailAddress(PrimaryFlag|OptOutFlag|InvalidFlag)?[0-9]*?$/', true); if (isset($rows[0])) { foreach ($rows[0] as $key => $value) { if ($key != 'id') { $form .= "<td scope='col' >" . $mod_strings[$mod_strings['db_' . $key]] . "</td>"; } } $form .= "</tr>"; } $rowColor = 'oddListRowS1'; foreach ($rows as $row) { $form .= "<tr class='{$rowColor}'>"; if ($action != 'ShowDuplicates') { $form .= "<td width='1%' nowrap='nowrap'><a href='#' onClick=\"document.forms['dupContacts'].selectedContact.value='{$row['id']}';document.forms['dupContacts'].submit() \">[{$app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n"; } $wasSet = false; foreach ($row as $key => $value) { if ($key != 'id') { if (isset($_POST['popup']) && $_POST['popup'] == true) { $form .= "<td scope='row'><a href='#' onclick=\"window.opener.location='index.php?module=Contacts&action=DetailView&record={$row['id']}'\">{$value}</a></td>\n"; } else { if (!$wasSet) { $form .= "<td scope='row'><a target='_blank' href='index.php?module=Contacts&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; $wasSet = true; } else { $form .= "<td><a target='_blank' href='index.php?module=Contacts&action=DetailView&record={$row['id']}'>{$value}</a></td>\n"; } } } } if ($rowColor == 'evenListRowS1') { $rowColor = 'oddListRowS1'; } else { $rowColor = 'evenListRowS1'; } $form .= "</tr>"; } $form .= "<tr ><td colspan='{$cols}' class='blackline'></td></tr>"; if ($action == 'ShowDuplicates') { $form .= "</table><br> <input title='{$app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' {$app_strings['LBL_SAVE_BUTTON_LABEL']} '> "; if (!empty($_POST['return_module']) && !empty($_POST['return_action']) && !empty($_POST['return_id'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"location.href='index.php?module=" . $_POST['return_module'] . "&action=" . $_POST['return_action'] . "&record=" . $_REQUEST['return_id'] . "'\" type='button' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '></form>"; } else { if (!empty($_POST['return_module']) && !empty($_POST['return_action'])) { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"location.href='index.php?module=" . $_POST['return_module'] . "&action=" . $_POST['return_action'] . "'\" type='button' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '></form>"; } else { $form .= "<input title='{$app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='{$app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"location.href='index.php?module=Contacts&action=ListView'\" type='button' name='button' value=' {$app_strings['LBL_CANCEL_BUTTON_LABEL']} '></form>"; } } } else { $form .= "</table><br><input type='submit' class='button' name='ContinueContact' value='{$mod_strings['LNK_NEW_CONTACT']}'></form>"; } return $form; }
function getAnyToForm($ignore = '') { $fields = getPostToForm($ignore); $fields .= getGetToForm($ignore); return $fields; }