function key_in_crm_contacts($id)
{
    $row = get_crm_category($id);
    $sql = "SELECT COUNT(*) FROM " . TB_PREF . "crm_contacts WHERE type='" . $row['type'] . "' AND action='" . $row['action'] . "'";
    $result = db_query($sql, "check relations for crm_contacts failed");
    $contacts = db_fetch($result);
    return $contacts[0];
}
Example #2
0
    edit_button_cell("Edit" . $myrow["id"], _("Edit"));
    if ($myrow["system"]) {
        label_cell('');
    } else {
        delete_button_cell("Delete" . $myrow["id"], _("Delete"));
    }
    end_row();
}
inactive_control_row($th);
end_table(1);
//-------------------------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing area
        $myrow = get_crm_category($selected_id);
        $_POST['name'] = $myrow["name"];
        $_POST['type'] = $myrow["type"];
        $_POST['subtype'] = $myrow["action"];
        $_POST['description'] = $myrow["description"];
    }
    hidden("selected_id", $selected_id);
}
if ($Mode == 'Edit' && $myrow['system']) {
    label_row(_("Contact Category Type:"), $_POST['type']);
    label_row(_("Contact Category Subtype:"), $_POST['subtype']);
} else {
    //	crm_category_type_list_row(_("Contact Category Type:"), 'type', null, _('Other'));
    text_row_ex(_("Contact Category Type:"), 'type', 30);
    text_row_ex(_("Contact Category Subtype:"), 'subtype', 30);
}