|
From: <dts...@us...> - 2003-05-29 17:47:02
|
Update of /cvsroot/phpwebsite-comm/modules/contacts/class
In directory sc8-pr-cvs1:/tmp/cvs-serv7363/class
Modified Files:
Manager.php Contact.php
Log Message:
Progress on contact class
Index: Manager.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/contacts/class/Manager.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Manager.php 29 May 2003 16:56:23 -0000 1.5
--- Manager.php 29 May 2003 17:46:55 -0000 1.6
***************
*** 154,159 ****
switch($_REQUEST["CONTACTS_MAN_OP"]) {
! case "new":
! $this->_new();
break;
--- 154,159 ----
switch($_REQUEST["CONTACTS_MAN_OP"]) {
! case "edit":
! $this->_edit();
break;
Index: Contact.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/contacts/class/Contact.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Contact.php 29 May 2003 16:56:23 -0000 1.2
--- Contact.php 29 May 2003 17:46:55 -0000 1.3
***************
*** 31,35 ****
* @access private
*/
! var $_familyname = NULL;
--- 31,35 ----
* @access private
*/
! var $_surname = NULL;
***************
*** 80,83 ****
--- 80,92 ----
/**
+ * The anniversary of the contact
+ *
+ * @var string
+ * @access private
+ */
+ var $_anniversary = NULL;
+
+
+ /**
* The organization (workplace) of the contact
*
***************
*** 118,121 ****
--- 127,134 ----
$this->setId($CONTACT_ID);
$this->init();
+ } else {
+ // Find user ID and create quick contact?
+ $this->setLabel($_SESSION["OBJ_user"]->username);
+ $this->setOwner($_SESSION["OBJ_user"]->username);
}
}// END FUNC CONTACTS_Contact
***************
*** 124,130 ****
function _edit() {
// Need to see if the userid matches the object owner
! if(($_SESSION["OBJ_user"]->username != $this->getOwner()) || !$_SESSION["OBJ_user"]->allow_access("contacts","edit_contacts")) {
$message = $_SESSION["translate"]->it("Access to edit contact was denied due to lack of proper permissions.");
! $error = new PHWPS_Error("contacts", "CONTACTS_Contact::_edit()", $message, "exit", 1);
$error->message();
return FALSE;
--- 137,146 ----
function _edit() {
// Need to see if the userid matches the object owner
! //echo "<h1>You are " . $_SESSION["OBJ_user"]->username . "</h1>";
! //echo "<h1>Owner is " . $this->getOwner() . "</h1>";
!
! if(($_SESSION["OBJ_user"]->username != $this->getOwner()) && !$_SESSION["OBJ_user"]->allow_access("contacts","edit_contacts")) {
$message = $_SESSION["translate"]->it("Access to edit contact was denied due to lack of proper permissions.");
! $error = new PHPWS_Error("contacts", "CONTACTS_Contact::_edit()", $message, "exit", 1);
$error->message();
return FALSE;
***************
*** 135,151 ****
$form = new EZform("CONTACTS_Contact_edit");
! /* Contact Name */
! $form->add("Contact_contact", "text", $this->_contact);
! $form->setSize("Contact_contact", 33);
! $form->setTab("Contact_contact", 1);
! /* Contact Abbreviation */
! $form->add("Contact_code", "text", $this->_code);
! $form->setSize("Contact_code", 5);
! $form->setTab("Contact_code", 2);
/* Save Button */
$form->add("Contact_save", "submit", $_SESSION["translate"]->it("Save"));
! $form->setTab("Contact_save", 3);
/* Module Information */
--- 151,217 ----
$form = new EZform("CONTACTS_Contact_edit");
! /* Contact Prefix */
! $form->add("Contact_prefix", "text", $this->_prefix);
! $form->setSize("Contact_prefix", 5);
! $form->setTab("Contact_prefix", 1);
! /* Contact Given Name */
! $form->add("Contact_givenname", "text", $this->_givenname);
! $form->setSize("Contact_givenname", 33);
! $form->setTab("Contact_givenname", 2);
!
! /* Contact Middle Name */
! $form->add("Contact_middlename", "text", $this->_middlename);
! $form->setSize("Contact_middlename", 33);
! $form->setTab("Contact_middlename", 3);
!
! /* Contact Family Name */
! $form->add("Contact_surname", "text", $this->_surname);
! $form->setSize("Contact_surname", 33);
! $form->setTab("Contact_surname", 4);
!
! /* Contact Suffix */
! $form->add("Contact_suffix", "text", $this->_suffix);
! $form->setSize("Contact_suffix", 5);
! $form->setTab("Contact_suffix", 5);
!
! /* Contact Email */
! $form->add("Contact_email", "text", $this->_email);
! $form->setSize("Contact_email", 33);
! $form->setTab("Contact_email", 6);
!
! /* Contact Website */
! $form->add("Contact_website", "text", $this->_website);
! $form->setSize("Contact_website", 33);
! $form->setTab("Contact_website", 7);
!
! /* Contact Birthday */
! $form->add("Contact_birthday", "text", $this->_birthday);
! $form->setSize("Contact_birthday", 5);
! $form->setTab("Contact_birthday", 8);
!
! /* Contact Anniversary */
! $form->add("Contact_anniversary", "text", $this->_anniversary);
! $form->setSize("Contact_anniversary", 5);
! $form->setTab("Contact_anniversary", 9);
!
! /* Contact Organization */
! $form->add("Contact_organization", "text", $this->_organization);
! $form->setSize("Contact_organization", 33);
! $form->setTab("Contact_organization", 10);
!
! /* Contact Organization Unit */
! $form->add("Contact_orgunit", "text", $this->_orgunit);
! $form->setSize("Contact_orgunit", 33);
! $form->setTab("Contact_orgunit", 11);
!
! /* Contact Organization Title */
! $form->add("Contact_title", "text", $this->_title);
! $form->setSize("Contact_title", 33);
! $form->setTab("Contact_title", 12);
/* Save Button */
$form->add("Contact_save", "submit", $_SESSION["translate"]->it("Save"));
! $form->setTab("Contact_save", 13);
/* Module Information */
***************
*** 156,161 ****
$tags = $form->getTemplate();
! $tags["CONTACT_TEXT"] = $_SESSION["translate"]->it("Contact");
! $tags["CODE_TEXT"] = $_SESSION["translate"]->it("Abbreviation");
return $GLOBALS["core"]->processTemplate($tags, "contacts", "edit_contacts.tpl");
--- 222,237 ----
$tags = $form->getTemplate();
! $tags["PREFIX_TEXT"] = $_SESSION["translate"]->it("Prefix");
! $tags["GIVENNAME_TEXT"] = $_SESSION["translate"]->it("Given Name");
! $tags["MIDDLENAME_TEXT"] = $_SESSION["translate"]->it("Middle Name");
! $tags["SURNAME_TEXT"] = $_SESSION["translate"]->it("Surname");
! $tags["SUFFIX_TEXT"] = $_SESSION["translate"]->it("Suffix");
! $tags["EMAIL_TEXT"] = $_SESSION["translate"]->it("Email");
! $tags["WEBSITE_TEXT"] = $_SESSION["translate"]->it("Website");
! $tags["BIRTHDAY_TEXT"] = $_SESSION["translate"]->it("Birthday");
! $tags["ANNIVERSARY_TEXT"] = $_SESSION["translate"]->it("Anniversary");
! $tags["ORGANIZATION_TEXT"] = $_SESSION["translate"]->it("Organization");
! $tags["ORGUNIT_TEXT"] = $_SESSION["translate"]->it("Organization Unit");
! $tags["TITLE_TEXT"] = $_SESSION["translate"]->it("Title");
return $GLOBALS["core"]->processTemplate($tags, "contacts", "edit_contacts.tpl");
***************
*** 165,182 ****
function _save() {
! if(!$_SESSION["OBJ_user"]->allow_access("contacts", "edit_contacts")) {
$message = $_SESSION["translate"]->it("Access to save contact was denied due to lack of proper permissions.");
! $error = new PHWPS_Error("contacts", "CONTACTS_Contact::_save()", $message, "exit", 1);
$error->message();
return FALSE;
}
! if(isset($_REQUEST["Contact_contact"]))
! $this->_contact = $_REQUEST["Contact_contact"];
! $this->setLabel($this->_contact);
! if(isset($_REQUEST["Contact_code"]))
! $this->_code = $_REQUEST["Contact_code"];
$error = $this->commit();
--- 241,279 ----
function _save() {
! if(($_SESSION["OBJ_user"]->username != $this->getOwner()) && !$_SESSION["OBJ_user"]->allow_access("contacts","edit_contacts")) {
$message = $_SESSION["translate"]->it("Access to save contact was denied due to lack of proper permissions.");
! $error = new PHPWS_Error("contacts", "CONTACTS_Contact::_save()", $message, "exit", 1);
$error->message();
return FALSE;
}
! if(isset($_REQUEST["Contact_surname"]))
! $this->_surname = $_REQUEST["Contact_surname"];
! if(isset($_REQUEST["Contact_middlename"]))
! $this->_middlename = $_REQUEST["Contact_middlename"];
! if(isset($_REQUEST["Contact_firstname"]))
! $this->_firstname = $_REQUEST["Contact_firstname"];
! $this->setLabel($this->_surname . ", " . $this->_firstname . " " $this->_middlename);
! if(isset($_REQUEST["Contact_prefix"]))
! $this->_prefix = $_REQUEST["Contact_prefix"];
! if(isset($_REQUEST["Contact_suffix"]))
! $this->_suffix = $_REQUEST["Contact_suffix"];
!
! if(isset($_REQUEST["Contact_email"]))
! $this->_email = $_REQUEST["Contact_email"];
! if(isset($_REQUEST["Contact_website"]))
! $this->_website = $_REQUEST["Contact_website"];
! if(isset($_REQUEST["Contact_birthday"]))
! $this->_birthday = $_REQUEST["Contact_birthday"];
! if(isset($_REQUEST["Contact_anniversary"]))
! $this->_anniversary = $_REQUEST["Contact_anniversary"];
! if(isset($_REQUEST["Contact_organization"]))
! $this->_organization = $_REQUEST["Contact_organization"];
! if(isset($_REQUEST["Contact_orgunit"]))
! $this->_orgunit = $_REQUEST["Contact_orgunit"];
! if(isset($_REQUEST["Contact_title"]))
! $this->_title = $_REQUEST["Contact_title"];
$error = $this->commit();
***************
*** 201,205 ****
if(!$_SESSION["OBJ_user"]->allow_access("contacts", "delete_contacts")) {
$message = $_SESSION["translate"]->it("Access to delete contact was denied due to lack of proper permissions.");
! $error = new PHWPS_Error("contacts", "CONTACTS_Contact::_delete()", $message, "exit", 1);
$error->message();
return FALSE;
--- 298,302 ----
if(!$_SESSION["OBJ_user"]->allow_access("contacts", "delete_contacts")) {
$message = $_SESSION["translate"]->it("Access to delete contact was denied due to lack of proper permissions.");
! $error = new PHPWS_Error("contacts", "CONTACTS_Contact::_delete()", $message, "exit", 1);
$error->message();
return FALSE;
|