include_once 'config.php'; include_once 'includes/ofuz_check_access.script.inc.php'; include_once 'includes/i_header.inc.php'; $thistab = 'Contacts'; include_once 'i_ofuz_navtabs.php'; ?> <div class="mobile_main"> <div class="mainheader"> <div class="mobile_head_pad5"> <h1>Add a new contact</h1> </div> </div> <div class="mobile_head_pad5"> <?php $ContactEdit = new Contact($GLOBALS['conx']); $ContactEdit->sessionPersistent("ContactEditSave", "index.php", 3600); $contact_edit_page = "i_contact_edit.php"; $contactAddForm = $_SESSION['ContactEditSave']->prepareSavedForm("i_ofuz_add_contact"); $contactAddForm->setFormEvent("ContactEditSave->eventAdd", 300); //$contactAddForm->setFormEvent("ContactEditSave->eventSetCompany",120); $contactAddForm->addEventAction("mydb.gotoPage", 453); $contactAddForm->addParam("goto", $contact_edit_page); $contactAddForm->setRegistry("i_ofuz_add_contact"); $contactAddForm->setTable("contact"); $contactAddForm->setAddRecord(); $contactAddForm->setUrlNext($contact_edit_page); $contactAddForm->setForm(); $contactAddForm->execute(); ?> </div> <div class="bottompad40"></div>
<?php /** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/ // Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com /** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/ include_once 'config.php'; include_once 'includes/ofuz_check_access.script.inc.php'; //include_once('includes/header.inc.php'); //the browser_search.php will instantiate an EventControler object, set the search param, goto and pass it to the $_SESSION['do_contact']->eventSetSearch($eventcontroler); $do_Contacts = new Contact(); $do_Contacts->sessionPersistent("do_Contacts", "index.php", 36000); $ec_search = new EventControler($conx); $ec_search->addParam("goto", "contacts.php"); $ec_search->addParam("contacts_search", $_GET['s']); $_SESSION['do_Contacts']->search_keyword = $_GET['s']; $_SESSION['do_Contacts']->eventSetSearch($ec_search); $ec_search->doForward();
$do_merge = false; } } if (!$do_merge) { $error_txt .= '<br /><a href="/contacts.php">Click To Back</a>'; echo '<div class="messageshadow_unauthorized">'; echo '<div class="messages_unauthorized">'; echo $error_txt; echo '</div></div><br /><br />'; exit; } $idcontact = $_SESSION['do_contact']->MergeContactsAutomated($contact_ids); if ($idcontact) { $do_contact_edit = new Contact(); $do_contact_edit->getContactDetails($idcontact); $do_contact_edit->sessionPersistent("ContactEditSave", "contact.php", 3600); echo _('Contacts are merged successfully.'); $_SESSION['edit_from_page'] = 'contacts.php'; echo '<br />'; echo _('Please wait page will be redirected in 5 seconds.'); ?> <script type="text/javascript"> //<![CDATA[ setTimeout("location.href='/contact_edit.php'", 5000); //]]> </script> <?php } else { echo _('An Error ocured while merging. Please try again'); echo '<br /><a href="/contacts.php">' . _('Click To Back') . '</a>'; }
include_once 'config.php'; //include_once('includes/ofuz_check_access.script.inc.php'); include_once 'includes/header.inc.php'; if ($_GET['pc']) { $obj = new Contact(); $idcontact = $obj->getContactIdByPortal($_GET['pc']); if (!$idcontact) { echo "The shared access as been stopped."; exit; } $obj->sessionPersistent("do_contact", "index.php", OFUZ_TTL); } elseif (isset($_SESSION['portal_idcontact'])) { $obj = new Contact(); $idcontact = $_SESSION['portal_idcontact']; $obj->getContactDetails($idcontact); $obj->sessionPersistent("do_contact", "index.php", OFUZ_TTL); } //print_r($_SESSION['do_contact']); if (!is_object($_SESSION['do_contact'])) { exit; //$do_contact = new Contact(); //$do_contact->sessionPersistent("do_contact", "index.php", 36000); } $ContactNoteExpend = new ContactNotes($GLOBALS['conx']); $ContactNoteExpend->sessionPersistent("ContactNoteExpend", "contacts.php", OFUZ_TTL); $do_notes = new ContactNotes($GLOBALS['conx']); $do_user = $_SESSION['do_contact']->getParentUser(); $do_user->sessionPersistent("portalUser", "contact_portal.php", OFUZ_TTL_SHORT); $_SESSION['portal_idcontact'] = $idcontact; if ($_SESSION['do_User']->iduser != '' && !empty($_SESSION['do_User']->iduser)) { $iduser_for_feed = $_SESSION['do_User']->iduser;
</span> <div class="solidline"></div> </div> </div> <div class="contentfull"> <?php if (isset($_POST['ck'])) { $contact_ids = $_POST['ck']; } if (count($contact_ids) < 2) { echo _('You should have atleat 2 Contacts to be merged'); echo '<br /><a href="contacts.php">' . _('Click To Back') . '</a>'; } else { if (!is_object($_SESSION['do_contact'])) { $do_contact = new Contact(); $do_contact->sessionPersistent("do_contact", "index.php", 36000); } $e_marge = new Event("do_contact->eventMergeContacts"); $e_marge->addEventAction("mydb.gotoPage", 304); $e_marge->addParam("goto", "contacts.php"); $e_marge->addParam("contact_ids", $contact_ids); echo $e_marge->getFormHeader(); echo $e_marge->getFormEvent(); foreach ($contact_ids as $contact) { echo '<div class="contact">'; $_SESSION['do_contact']->getContactDetails($contact); echo '<span style="color:orange;">Keep <input type="radio" name = "cont_id[]" value ="' . $contact . '"></span>'; echo '<b>' . $_SESSION['do_contact']->firstname . ' ' . $_SESSION['do_contact']->lastname . '</b><br />'; echo '<b>Contact Information:</b><br />'; $ContactPhone = $_SESSION['do_contact']->getChildContactPhone(); if ($ContactPhone->getNumRows()) {
// Add a new contact and update the idcontact to the user table for the user $do_contact->addNew(); $do_contact->firstname = $_SESSION['do_User']->firstname; $do_contact->lastname = $_SESSION['do_User']->lastname; $do_contact->iduser = $_SESSION['do_User']->iduser; $do_contact->add(); $idcontact_inserted = $do_contact->getPrimaryKeyValue(); $do_contact_view = new ContactView(); $_SESSION['do_User']->idcontact = $idcontact_inserted; $do_contact->getId($idcontact_inserted); } $_SESSION['edit_from_page'] = 'settings_myinfo.php'; $do_contact->sessionPersistent("ContactEditSave", "contact.php", OFUZ_TTL); //$do_contact->sessionPersistent("ContactEditSave", "index.php", 120); //$do_np_contact->sessionPersistent("ContactPictureSave", "index.php", 120); $do_np_contact->sessionPersistent("ContactPictureSave", "index.php", OFUZ_TTL); $_SESSION['ContactPictureSave']->getId($idcontact); $e_fullContact = new Event("ContactPictureSave->eventValuesFromForm"); $e_fullContact->setLevel(1999); $e_fullContact->setGotFile(true); $e_fullContact->addEventAction("ContactPictureSave->update", 2000); echo $e_fullContact->getFormHeader(); echo $e_fullContact->getFormEvent(); $_SESSION['ContactPictureSave']->setFields("contact_my_info"); $_SESSION['ContactPictureSave']->setApplyRegistry(true, "Form"); ?> <div class="profile_subject_line"> <div class="my_profile">My Profile <span class="edit_profile">
/** * retrieves all the contacts from Ofuz Database which are not yet exported (to Gmail contacts). * @return array : contact details */ function getOfuzContactsNotInGmail() { $sql_sel = "SELECT c.* \n FROM contact c \n LEFT JOIN company co ON c.idcompany = co.idcompany \n LEFT JOIN contact_email ce ON ce.idcontact = c.idcontact\n LEFT JOIN google_contact_info gci ON c.idcontact = gci.idcontact \n WHERE c.iduser="******"\n AND ce.email_address != ''\n AND gci.idcontact IS NULL\n GROUP BY c.idcontact\n "; $this->query($sql_sel); if ($this->getNumRows()) { $Contact = new Contact(); $Contact->sessionPersistent("ContactEditSave", "index.php", OFUZ_TTL); while ($this->next()) { //$Contact->getId($this->idcontact); $_SESSION['ContactEditSave']->getId($this->idcontact); $data = array(); $data['name'] = $this->firstname . " " . $this->lastname; if ($this->company != "" || $this->company != NULL) { $data['company'] = $this->company; } else { $data['company'] = "Company"; } if ($this->position != "" || $this->position != NULL) { $data['position'] = $this->position; } else { $data['position'] = "Position"; } //$data['company'] = $this->company; $data['idcontact'] = $this->idcontact; $ContactPhone = $_SESSION['ContactEditSave']->getChildContactPhone(); while ($ContactPhone->next()) { if ($ContactPhone->phone_type == "Home") { $data['phone_Home'] = $ContactPhone->phone_number; } if ($ContactPhone->phone_type == "Mobile") { $data['phone_Mobile'] = $ContactPhone->phone_number; } if ($ContactPhone->phone_type == "Work") { $data['phone_Work'] = $ContactPhone->phone_number; } } $ContactEmail = $_SESSION['ContactEditSave']->getChildContactEmail(); while ($ContactEmail->next()) { if ($ContactEmail->email_type == "Home") { $data['email_Home'] = $ContactEmail->email_address; } if ($ContactEmail->email_type == "Other") { $data['email_Other'] = $ContactEmail->email_address; } if ($ContactEmail->email_type == "Work") { $data['email_Work'] = $ContactEmail->email_address; } } $ContactAddr = $_SESSION['ContactEditSave']->getChildContactAddress(); while ($ContactAddr->next()) { if ($ContactAddr->address_type == "Home") { $data['addr_Home'] = $ContactAddr->address; } if ($ContactAddr->address_type == "Other") { $data['addr_Other'] = $ContactAddr->address; } if ($ContactAddr->address_type == "Work") { $data['addr_Work'] = $ContactAddr->address; } } $contacts[] = $data; } //frees connexion object $this->free(); return $contacts; } }