$gBitSystem->verifyPackage('contacts'); $gBitSystem->verifyPermission('p_contacts_view'); $gContent = new Contacts(); /* if($feature_listContacts != 'y') { $gBitSmarty->assign('msg',tra("This feature is disabled")); $gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'list' )); die; } */ /* // Now check permissions to access this page if(!$gBitUser->( 'contact_p_view' )) { $gBitSmarty->assign('msg',tra("Permission denied you cannot view contacts")); $gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'list' )); die; } */ if (empty($_REQUEST["sort_mode"])) { $_REQUEST["sort_mode"] = 'surname_asc'; } $contact_type = $gContent->getContactsTypeList(); $gBitSmarty->assign_by_ref('contact_type', $contact_type); $listHash = $_REQUEST; // Get a list of matching contact entries $listcontacts = $gContent->getList($listHash); $gBitSmarty->assign_by_ref('listcontacts', $listcontacts); $gBitSmarty->assign_by_ref('listInfo', $listHash['listInfo']); $gBitSystem->setBrowserTitle("View Contacts List"); // Display the template $gBitSystem->display('bitpackage:contacts/list.tpl', NULL, array('display_mode' => 'list'));
} else { header("Location: " . CONTACTS_PKG_URL); } die; } elseif (isset($_REQUEST["fSaveContact"])) { if ($gContent->store($_REQUEST)) { if ($gBitSystem->isFeatureActive('contact_watch_author')) { $gBitUser->storeWatch("contact_entry_changed", $gContent->mContentId, $gContent->mContentTypeGuid, $_REQUEST['title'], $gContent->getDisplayUrl()); } header("Location: " . $gContent->getDisplayUrl()); } else { $formInfo = $_REQUEST; $formInfo['data'] =& $_REQUEST['edit']; } } // Configure quicktags list if ($gBitSystem->isPackageActive('quicktags')) { include_once QUICKTAGS_PKG_PATH . 'quicktags_inc.php'; } // WYSIWYG and Quicktag variable $gBitSmarty->assign('textarea_id', 'editwiki'); // formInfo might be set due to a error on submit if (empty($formInfo)) { $formInfo =& $gContent->mInfo; } $formInfo['contact_type_list'] = $gContent->getContactsTypeList(); $gBitSmarty->assign_by_ref('contactInfo', $formInfo); $gBitSmarty->assign_by_ref('errors', $gContent->mErrors); $gBitSmarty->assign((!empty($_REQUEST['tab']) ? $_REQUEST['tab'] : 'body') . 'TabSelect', 'tdefault'); $gBitSmarty->assign('show_page_bar', 'y'); $gBitSystem->display('bitpackage:contacts/edit.tpl', 'Edit: ', array('display_mode' => 'edit'));