Esempio n. 1
0
 /**
  * @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);
 }
Esempio n. 2
0
<?php

/**
 * @version $Header$
 * @package address
 */
require_once ADDRESS_PKG_PATH . 'BitAddress.php';
$pkgname = ADDRESS_PKG_NAME;
$grpname = $pkgname . '_admin';
$gBitSmarty->assign('grpname', $grpname);
$list_grpname = $grpname . '_list';
$gBitSmarty->assign('list_grpname', $list_grpname);
$country_grpname = $grpname . '_country';
$gBitSmarty->assign('country_grpname', $country_grpname);
// Process the form if we've made some changes
if (isset($_REQUEST[$grpname . '_submit'])) {
    LibertyForm::storeConfigs($_REQUEST[$list_grpname], $pkgname);
    @BitAddressCountry::setDefault($_REQUEST[$country_grpname]['country_def']);
    @BitAddressCountry::setActive($_REQUEST[$country_grpname]['countries']);
}
$list_fields = array("list_country" => array('description' => 'Country', 'helptext' => 'Display the country.', 'type' => 'checkbox', 'value' => $gBitSystem->getConfig($pkgname . '_list_country')), "list_description" => array('description' => 'Description', 'helptext' => 'Display the address description field.', 'type' => 'checkbox', 'value' => $gBitSystem->getConfig($pkgname . '_list_description')));
$gBitSmarty->assign('list_fields', $list_fields);
$countries = @BitAddressCountry::getPossibles('country_name');
$country_fields = array("country_def" => array("description" => "Default Country", "type" => "options", "options" => $countries, "value" => @BitAddressCountry::getDefault(), "required" => TRUE, "helptext" => "This selects the country that is selected by default when a new address is created."), "countries" => array("description" => "Available Countries", "type" => "options", "typopt" => "multiple", "options" => $countries, "value" => array_keys(BitAddressCountry::getPossibles('isocode2', TRUE)), "required" => TRUE, "helptext" => "Select the multiple countries available by holding down Shift/Ctrl."));
$gBitSmarty->assign_by_ref('country_fields', $country_fields);