/** * @param int $pId database Id of exiting object of this type * @param int $pContentId database Id of existing LibertyContent object */ function __construct($pId = NULL, $pContentId = NULL) { $this->mContentTypeGuid = self::CONTENT_TYPE_GUID; $this->registerContentType(self::CONTENT_TYPE_GUID, array('content_type_guid' => self::CONTENT_TYPE_GUID, 'content_name' => 'Street Address data', 'handler_class' => 'BitAddress', 'handler_package' => 'address', 'handler_file' => 'BitAddress.php', 'maintainer_url' => 'http://www.lrcnh.com/')); // Permission setup $this->mViewContentPerm = 'p_address_view'; $this->mCreateContentPerm = 'p_address_create'; $this->mUpdateContentPerm = 'p_address_update'; $this->mAdminContentPerm = 'p_address_admin'; $this->mExpungeContentPerm = 'p_address_expunge'; $this->mFields = BitAddress::setupFields(); parent::__construct($pId, $pContentId, 'address', self::DATA_TBL, self::DATA_TBL_SEQ); }
/** * @param int $pId database Id of exiting object of this type * @param int $pContentId database Id of existing LibertyContent object */ function __construct($pId = NULL, $pContentId = NULL) { $this->mContentTypeGuid = self::CONTENT_TYPE_GUID; $this->registerContentType(self::CONTENT_TYPE_GUID, array('content_type_guid' => self::CONTENT_TYPE_GUID, 'content_name' => 'Bitweaver person data', 'content_name_plural' => 'Bitweaver persons data', 'handler_class' => 'BitPerson', 'handler_package' => 'person', 'handler_file' => 'BitPerson.php', 'maintainer_url' => 'http://www.lrcnh.com/')); // Permission setup $this->mViewContentPerm = 'p_person_view'; $this->mCreateContentPerm = 'p_person_create'; $this->mUpdateContentPerm = 'p_person_update'; $this->mAdminContentPerm = 'p_person_admin'; $this->mExpungeContentPerm = 'p_person_expunge'; // Selectable Citizenship/Country from defined list $country_options = @BitAddressCountry::getPossibles('country_name', TRUE); $country_options[0] = "Unknown"; // Unknown entry is not stored in the DB ksort($country_options); $altname_fields = array("type" => array("description" => "Type", "type" => "options", "options" => NULL, "required" => TRUE, "maxlen" => 16), "text" => array("description" => "Name", "type" => "text", "required" => TRUE, "maxlen" => 32), "note" => array("description" => "Notes", "type" => "text", "maxlen" => 32), "altname_1_id" => array("description" => "Preferred", "type" => "radio"), "remove" => array("description" => "Remove", "type" => "remove"), "altname_id" => array("type" => "hidden")); $email_fields = array("type" => array("description" => "Type", "type" => "options", "options" => NULL, "required" => TRUE, "maxlen" => 16), "text" => array("description" => "Email address", "type" => "text", "required" => TRUE, "maxlen" => 32), "note" => array("description" => "Notes", "type" => "text", "maxlen" => 32), "email_1_id" => array("description" => "Preferred", "type" => "radio", "required" => TRUE), "remove" => array("description" => "Remove", "type" => "remove"), "email_id" => array("type" => "hidden")); $phone_fields = array("type" => array("description" => "Type", "type" => "options", "options" => NULL, "required" => TRUE, "maxlen" => 16), "text" => array("description" => "Phone Number", "type" => "text", "required" => TRUE, "maxlen" => 32), "note" => array("description" => "Notes", "type" => "text", "maxlen" => 32), "phone_1_id" => array("description" => "Preferred", "type" => "radio", "required" => TRUE), "remove" => array("description" => "Remove", "type" => "remove"), "phone_id" => array("type" => "hidden")); $address_fields = array("address_id" => array("description" => "Address", "type" => "options", "options" => NULL, "required" => TRUE, "shownullopt" => TRUE, "createonly" => TRUE), "active" => array("description" => "Active", "type" => "checkbox", "defval" => "y"), "address_1_id" => array("description" => "Preferred", "type" => "radio", "required" => TRUE), "remove" => array("description" => "Remove", "type" => "remove")); $this->mFields = array("name_title" => array("description" => "Title", "type" => "options", "options" => array("" => "<none>", "Mr" => "Mr", "Mrs" => "Mrs", "Ms" => "Ms", "Miss" => "Miss")), "name_1sts" => array("description" => "First Names", "type" => "text", "maxlen" => 72, "required" => TRUE, "helptext" => "Persons legal first or forenames, used on passport, birth certificate, etc."), "name_last" => array("description" => "Last Name", "type" => "text", "maxlen" => 64, "required" => TRUE, "helptext" => "Persons legal last or surname, used on passport, birth certificate, etc."), "name_suffix" => array("description" => "Name Suffix", "type" => "text", "maxlen" => 32, "helptext" => "Any suffix text a person may have to there name, eg. Jr/Sr/II/III."), self::ALTNAME_TBL => array("description" => "Alternate names", "type" => "multiple", "fields" => $altname_fields, "idfield" => "altname_id", "sequence" => self::ALTNAME_TBL_SEQ, "helptext" => "Other names the person might be known as, or have been known as."), "gender" => array("description" => "Gender", "type" => "radios", "required" => TRUE, "options" => array("M" => "Male", "F" => "Female"), "helptext" => "Sex of the person."), "date_born" => array("description" => "Birth Date", "type" => "date", "typopt" => "past", "defval" => strtotime("-30 years"), "required" => TRUE, "helptext" => "Date the person was born."), "citizenship" => array("description" => "Citizenship", "type" => "options", "options" => &$country_options, "helptext" => "Country the person is a citizen of, for Visa purposes."), self::EMAIL_TBL => array("description" => "Email Addresses", "type" => "multiple", "fields" => $email_fields, "idfield" => "email_id", "sequence" => self::EMAIL_TBL_SEQ, "helptext" => "Internet email addresses the person can be reached at"), self::PHONE_TBL => array("description" => "Telephone Numbers", "type" => "multiple", "fields" => $phone_fields, "idfield" => "phone_id", "sequence" => self::PHONE_TBL_SEQ, "helptext" => "Numbers that can be used to reach this person"), self::ADDRESS_TBL => array("description" => "Addresses", "type" => "multiple", "fields" => $address_fields, "idfield" => "address_id", "helptext" => "Addresses for this person")); parent::__construct($pId, $pContentId, 'person', self::DATA_TBL, self::DATA_TBL_SEQ); }