summaryrefslogtreecommitdiff
path: root/add_person.php
diff options
context:
space:
mode:
Diffstat (limited to 'add_person.php')
-rw-r--r--add_person.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/add_person.php b/add_person.php
new file mode 100644
index 0000000..eda69c7
--- /dev/null
+++ b/add_person.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @package contact
+ * @subpackage functions
+ */
+
+use Bitweaver\Contact\Contact;
+use Bitweaver\KernelTools;
+
+require_once '../kernel/includes/setup_inc.php';
+
+global $gBitSystem, $gBitSmarty, $gBitUser;
+
+$gBitSystem->verifyPackage( 'contact' );
+$gBitSystem->verifyPermission( 'p_contact_update' );
+
+$gContent = new Contact();
+
+if( !empty( $_REQUEST['fCancel'] ) ) {
+ KernelTools::bit_redirect( CONTACT_PKG_URL );
+ die;
+}
+
+if( !empty( $_REQUEST['fSaveContact'] ) ) {
+ $_REQUEST['contact_types'] = [ '$00' ];
+ if( $gContent->store( $_REQUEST ) ) {
+ KernelTools::bit_redirect( CONTACT_PKG_URL.'edit.php?content_id='.$gContent->mContentId );
+ die;
+ }
+}
+
+$gBitSmarty->assign( 'gContent', $gContent );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
+
+$gBitSystem->display( 'bitpackage:contact/add_person.tpl', KernelTools::tra( 'Add Person' ), [ 'display_mode' => 'edit' ] );