- alt_table_row_color($k);
- label_cell($myrow["description"]);
- label_cell($myrow["ref"]);
- label_cell($myrow["name"].' '.$myrow["name2"]);
- label_cell($myrow["phone"]);
- label_cell($myrow["phone2"]);
- label_cell($myrow["fax"]);
- email_cell($myrow["email"]);
-
- // inactive_control_cell($myrow["id"], $myrow["inactive"], 'crm_contacts', 'id');
-
- edit_button_cell("{$this->name}Edit[{$myrow['id']}]", _("Edit"));
-
- // delete button removes only category unless this is the last contact for this person
- delete_button_cell("{$this->name}Delete[{$myrow['contact_id']}]", _("Delete"));
- end_row();
+
+ if ($myrow['id'] != $last['id']) {
+ alt_table_row_color($k);
+ label_cell(implode('<br>',$description));
+ label_cell($last["ref"]);
+ label_cell($last["name"].' '.$last["name2"]);
+ label_cell($last["phone"]);
+ label_cell($last["phone2"]);
+ label_cell($last["fax"]);
+ email_cell($last["email"]);
+
+ edit_button_cell("{$this->name}Edit[{$last['id']}]", _("Edit"));
+
+ // delete button removes only category unless this is the last contact for this person
+ delete_button_cell("{$this->name}Delete[{$last['id']}]", _("Delete"));
+ end_row();
+ $description = array();
+ $last = $myrow;
+ }
+
+ if ($myrow) {
+ $description[] = $myrow['description'];
+ $myrow = db_fetch($contacts);
+ }