X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fcrm_categories.php;h=a7a26af3f8c4506b451a65d309ff13601857d298;hb=630e99edecc3eabe708a9e7bda94eaa60bf16db7;hp=372faa71637995cff71b84c3f94d9658f5060d93;hpb=1571869d54be48452fdbe08f25130972ff0a7b5a;p=fa-stable.git diff --git a/admin/crm_categories.php b/admin/crm_categories.php index 372faa71..a7a26af3 100644 --- a/admin/crm_categories.php +++ b/admin/crm_categories.php @@ -52,20 +52,11 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') } } -function key_in_crm_contacts($id) // extra function for testing foreign concatenated key. Joe 02.09.2013. -{ - $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]; -} - if ($Mode == 'Delete') { $cancel_delete = 0; - if (key_in_crm_contacts($selected_id)) + if (is_crm_category_used($selected_id)) { $cancel_delete = 1; display_error(_("Cannot delete this category because there are contacts related to it.")); @@ -92,7 +83,7 @@ if ($Mode == 'RESET') $result = get_crm_categories(check_value('show_inactive')); start_form(); -start_table(TABLESTYLE, "width=70%"); +start_table(TABLESTYLE, "width='70%'"); $th = array(_("Category Type"), _("Category Subtype"), _("Short Name"), _("Description"), "", " "); inactive_control_column($th); @@ -150,7 +141,7 @@ if ($Mode == 'Edit' && $myrow['system']) { } text_row_ex(_("Category Short Name:"), 'name', 30); -textarea_row(_("Category Description:"), 'description', null, 60,4); +textarea_row(_("Category Description:"), 'description', null, 60, 4); end_table(1); @@ -159,4 +150,3 @@ submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page(); -?>