From: <dts...@us...> - 2003-06-01 19:38:39
|
Update of /cvsroot/phpwebsite-comm/modules/contacts/class In directory sc8-pr-cvs1:/tmp/cvs-serv24378/class Modified Files: Contact.php Manager.php Log Message: Updates for post-save view and printable view Index: Contact.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/contacts/class/Contact.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Contact.php 1 Jun 2003 18:25:22 -0000 1.8 --- Contact.php 1 Jun 2003 19:38:30 -0000 1.9 *************** *** 179,189 **** $links = array(); if(!is_null($this->getId())) { if($editmode) { ! $links[] = "<a href=\"index.php?module=contacts&CONTACTS_MAN_OP=edit&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("Edit Basic Info") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=editphones&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("Edit Phone Numbers") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=editaddresses&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("Edit Addresses") . "</a>"; } else { ! $links[] = "<a href=\"index.php?module=contacts&CONTACTS_MAN_OP=view&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Basic Info") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=viewphones&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Phone Numbers") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=viewaddresses&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Addresses") . "</a>"; --- 179,192 ---- $links = array(); + $links[] = "<a href=\"index.php?module=contacts&CONTACTS_MAN_OP=list\">" . $_SESSION["translate"]->it("List Contacts") . "</a>"; + $links[] = "<a href=\"index.php?module=contacts&CONTACTS_MAN_OP=viewprintable&PHPWS_MAN_ITEMS[]=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Printable") . "</a>"; + if(!is_null($this->getId())) { if($editmode) { ! $links[] = "<a href=\"index.php?module=contacts&CONTACTS_MAN_OP=edit&PHPWS_MAN_ITEMS[]=" . $this->getId() . "\">" . $_SESSION["translate"]->it("Edit Basic Info") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=editphones&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("Edit Phone Numbers") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=editaddresses&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("Edit Addresses") . "</a>"; } else { ! $links[] = "<a href=\"index.php?module=contacts&CONTACTS_MAN_OP=view&PHPWS_MAN_ITEMS[]=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Basic Info") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=viewphones&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Phone Numbers") . "</a>"; $links[] = "<a href=\"index.php?module=contacts&CONTACTS_Contact_OP=viewaddresses&CONTACTS_contact_id=" . $this->getId() . "\">" . $_SESSION["translate"]->it("View Addresses") . "</a>"; *************** *** 380,386 **** return; } else { ! $GLOBALS["CNT_contacts"]["content"] .= $_SESSION["translate"]->it("The contact was successfully saved.") . "<br />\n"; ! $_REQUEST["CONTACTS_MAN_OP"] = "list"; ! $_SESSION["CONTACTS_Manager"]->managerAction(); } }// END FUNC _save --- 383,395 ---- return; } else { ! $message = $_SESSION["translate"]->it("The contact was successfully saved."); ! /* ! $_SESSION["CONTACTS_Manager"]->message = new PHPWS_Message($message, "CNT_contacts"); ! $_SESSION["CONTACTS_Manager"]->action(); ! ! $this->action(); ! */ ! return $message . $this->_showtabs() . $this->_view(); ! } }// END FUNC _save *************** *** 437,443 **** $sql = "SELECT id FROM " . $GLOBALS["core"]->tbl_prefix . "mod_contacts_phones WHERE contact_id=" . $this->getId(); $results = $GLOBALS["core"]->getCol($sql); ! foreach ($results as $phoneid) { ! $phone = new CONTACTS_Phone($phoneid); ! $content .= $phone->_view($editmode) . "<br />"; } --- 446,456 ---- $sql = "SELECT id FROM " . $GLOBALS["core"]->tbl_prefix . "mod_contacts_phones WHERE contact_id=" . $this->getId(); $results = $GLOBALS["core"]->getCol($sql); ! if(sizeof($results) == 0) ! $content .= $_SESSION["translate"]->it("No telephone information found.") . "<br />"; ! else { ! foreach ($results as $phoneid) { ! $phone = new CONTACTS_Phone($phoneid); ! $content .= $phone->_view($editmode) . "<br />"; ! } } *************** *** 454,460 **** $sql = "SELECT id FROM " . $GLOBALS["core"]->tbl_prefix . "mod_contacts_addresses WHERE contact_id=" . $this->getId(); $results = $GLOBALS["core"]->getCol($sql); ! foreach ($results as $addressid) { ! $address = new CONTACTS_Address($addressid); ! $content .= $address->_view($editmode) . "<br />"; } --- 467,477 ---- $sql = "SELECT id FROM " . $GLOBALS["core"]->tbl_prefix . "mod_contacts_addresses WHERE contact_id=" . $this->getId(); $results = $GLOBALS["core"]->getCol($sql); ! if(sizeof($results) == 0) ! $content .= $_SESSION["translate"]->it("No address information found.") . "<br />"; ! else { ! foreach ($results as $addressid) { ! $address = new CONTACTS_Address($addressid); ! $content .= $address->_view($editmode) . "<br />"; ! } } *************** *** 467,471 **** case "view": $title = $_SESSION["translate"]->it("View Contact Information"); ! $content = $this->_showtabs() . $this->_view() . $this->_viewphones() . $this->_viewaddresses(); break; --- 484,493 ---- case "view": $title = $_SESSION["translate"]->it("View Contact Information"); ! $content = $this->_showtabs() . $this->_view(); ! break; ! ! case "viewprintable": ! $title = NULL; ! $content = $this->_view() . $this->_viewphones() . $this->_viewaddresses(); break; *************** *** 476,480 **** case "save": ! $this->_save(); break; --- 498,503 ---- case "save": ! $title = $_SESSION["translate"]->it("Edit Contact Information"); ! $content = $this->_save(); break; Index: Manager.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/contacts/class/Manager.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Manager.php 1 Jun 2003 18:25:22 -0000 1.8 --- Manager.php 1 Jun 2003 19:38:31 -0000 1.9 *************** *** 77,83 **** ! function _view() { $this->contact = new CONTACTS_Contact($_REQUEST["PHPWS_MAN_ITEMS"][0]); ! $_REQUEST["CONTACTS_Contact_OP"] = "view"; }// END FUNC _view --- 77,86 ---- ! function _view($printable = FALSE) { $this->contact = new CONTACTS_Contact($_REQUEST["PHPWS_MAN_ITEMS"][0]); ! if($printable) ! $_REQUEST["CONTACTS_Contact_OP"] = "viewprintable"; ! else ! $_REQUEST["CONTACTS_Contact_OP"] = "view"; }// END FUNC _view *************** *** 190,193 **** --- 193,200 ---- case "view": $this->_view(); + break; + + case "viewprintable": + $this->_view(TRUE); break; |