コード例 #1
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('url'), 'rules' => array(array('url', 'required'), array('url', 'url')), 'relations' => array('emailMessageActivity' => array(static::HAS_ONE, 'EmailMessageActivity', static::NOT_OWNED)), 'defaultSortAttribute' => 'url');
     return $metadata;
 }
コード例 #2
0
 protected static function translatedAttributeLabels($language)
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     return array_merge(parent::translatedAttributeLabels($language), array('personsOrAccounts' => Zurmo::t('ZurmoModule', 'Person Or AccountsModulePluralLabel', $params, null, $language), 'toAddress' => Zurmo::t('EmailMessagesModule', 'To Address', array(), null, $language), 'toName' => Zurmo::t('EmailMessagesModule', 'To Name', array(), null, $language), 'type' => Zurmo::t('Core', 'Type', array(), null, $language)));
 }
コード例 #3
0
 protected static function translatedAttributeLabels($language)
 {
     return array_merge(parent::translatedAttributeLabels($language), array('createdDateTime' => Zurmo::t('ZurmoModule', 'Created Date Time', array(), null, $language)));
 }
コード例 #4
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('member'), 'rules' => array(array('member', 'type', 'type' => 'string')));
     return $metadata;
 }
コード例 #5
0
ファイル: Policy.php プロジェクト: RamaKavanan/InitialVersion
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('moduleName', 'name', 'value'), 'relations' => array('permitable' => array(static::HAS_MANY_BELONGS_TO, 'Permitable')), 'rules' => array(array('moduleName', 'required'), array('moduleName', 'type', 'type' => 'string'), array('moduleName', 'length', 'min' => 1, 'max' => 64), array('name', 'required'), array('name', 'type', 'type' => 'string'), array('name', 'length', 'min' => 1, 'max' => 64), array('value', 'type', 'type' => 'string'), array('value', 'length', 'max' => 64)));
     return $metadata;
 }
コード例 #6
0
ファイル: AutoresponderItem.php プロジェクト: youprofit/Zurmo
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('processDateTime', 'processed'), 'relations' => array('contact' => array(RedBeanModel::HAS_ONE, 'Contact'), 'emailMessage' => array(RedBeanModel::HAS_ONE, 'EmailMessage'), 'autoresponderItemActivities' => array(RedBeanModel::HAS_MANY, 'AutoresponderItemActivity'), 'autoresponder' => array(RedBeanModel::HAS_ONE, 'Autoresponder')), 'rules' => array(array('processDateTime', 'required'), array('processDateTime', 'type', 'type' => 'datetime'), array('processed', 'type', 'type' => 'integer'), array('processed', 'default', 'value' => static::NOT_PROCESSED), array('processed', 'numerical', 'min' => static::NOT_PROCESSED, 'max' => static::PROCESSED)), 'elements' => array(), 'defaultSortAttribute' => 'processDateTime');
     return $metadata;
 }
コード例 #7
0
 public function unrestrictedSave($runValidation = true, array $attributeNames = null)
 {
     // enforce validation to ensure record:
     // a- does not already exist
     // b- is not an illegal state change
     return parent::unrestrictedSave(true, $attributeNames);
 }
コード例 #8
0
 /**
  * @return array
  */
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('name', 'sortOrder', 'completed'), 'relations' => array('task' => array(static::HAS_ONE, 'Task', static::NOT_OWNED)), 'rules' => array(array('name', 'required'), array('name', 'type', 'type' => 'string'), array('sortOrder', 'type', 'type' => 'integer'), array('completed', 'type', 'type' => 'boolean')), 'defaultSortAttribute' => 'name', 'customFields' => array());
     return $metadata;
 }
コード例 #9
0
ファイル: Autoresponder.php プロジェクト: youprofit/Zurmo
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('name', 'subject', 'htmlContent', 'textContent', 'secondsFromOperation', 'operationType'), 'rules' => array(array('name', 'required'), array('name', 'type', 'type' => 'string'), array('name', 'length', 'min' => 3, 'max' => 64), array('subject', 'required'), array('subject', 'type', 'type' => 'string'), array('subject', 'length', 'min' => 3, 'max' => 64), array('htmlContent', 'type', 'type' => 'string'), array('textContent', 'type', 'type' => 'string'), array('htmlContent', 'AtLeastOneContentAreaRequiredValidator'), array('textContent', 'AtLeastOneContentAreaRequiredValidator'), array('htmlContent', 'AutoresponderMergeTagsValidator', 'except' => 'autoBuildDatabase'), array('textContent', 'AutoresponderMergeTagsValidator', 'except' => 'autoBuildDatabase'), array('secondsFromOperation', 'required'), array('secondsFromOperation', 'type', 'type' => 'integer'), array('operationType', 'required'), array('operationType', 'type', 'type' => 'integer')), 'relations' => array('autoresponderItems' => array(RedBeanModel::HAS_MANY, 'AutoresponderItem'), 'marketingList' => array(RedBeanModel::HAS_ONE, 'MarketingList')), 'elements' => array('htmlContent' => 'TextArea', 'textContent' => 'TextArea'), 'defaultSortAttribute' => 'name');
     return $metadata;
 }
コード例 #10
0
ファイル: Permission.php プロジェクト: youprofit/Zurmo
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('permissions', 'type'), 'relations' => array('permitable' => array(RedBeanModel::HAS_ONE, 'Permitable'), 'securableItem' => array(RedBeanModel::HAS_MANY_BELONGS_TO, 'SecurableItem')), 'rules' => array(array('permissions', 'required'), array('permissions', 'type', 'type' => 'integer'), array('permissions', 'numerical', 'min' => 0, 'max' => 31), array('permitable', 'required'), array('type', 'required'), array('type', 'type', 'type' => 'integer'), array('type', 'numerical', 'min' => 1, 'max' => 2)));
     return $metadata;
 }
コード例 #11
0
 public function beforeSave()
 {
     if (!parent::beforeSave()) {
         return false;
     }
     if ($this->id < 0 || isset($this->originalAttributeValues['unsubscribed']) && $this->originalAttributeValues['unsubscribed'] != $this->unsubscribed) {
         $operation = Autoresponder::OPERATION_SUBSCRIBE;
         if ($this->unsubscribed) {
             $operation = Autoresponder::OPERATION_UNSUBSCRIBE;
         }
         AutoresponderItem::registerAutoresponderItemsByAutoresponderOperation($operation, $this->marketingList->id, $this->contact);
     }
     $this->modifiedDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time());
     return true;
 }
コード例 #12
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('quantity', 'redemptionDateTime'), 'relations' => array('person' => array(RedBeanModel::HAS_ONE, 'Item', RedBeanModel::NOT_OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'person'), 'reward' => array(RedBeanModel::HAS_ONE, 'GameReward', RedBeanModel::NOT_OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'transactions')), 'rules' => array(array('redemptionDateTime', 'required'), array('redemptionDateTime', 'readOnly'), array('redemptionDateTime', 'type', 'type' => 'datetime'), array('person', 'required'), array('quantity', 'type', 'type' => 'integer'), array('quantity', 'default', 'value' => 0)), 'elements' => array('redemptionDateTime' => 'DateTime', 'person' => 'Person'), 'defaultSortAttribute' => 'redemptionDateTime', 'noAudit' => array('redemptionDateTime', 'person', 'quantity'));
     return $metadata;
 }
コード例 #13
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('relations' => array('person' => array(RedBeanModel::HAS_ONE, 'Item', RedBeanModel::NOT_OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'person')));
     return $metadata;
 }
コード例 #14
0
 /**
  * @return array
  */
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('type', 'discountOrMarkupPercentage'), 'relations' => array('productTemplate' => array(RedBeanModel::HAS_ONE, 'ProductTemplate')), 'rules' => array(array('type', 'required'), array('type', 'type', 'type' => 'integer'), array('discountOrMarkupPercentage', 'type', 'type' => 'float')), 'elements' => array('type' => 'SellPriceFormulaTypeDropDown'), 'defaultSortAttribute' => 'type', 'customFields' => array());
     return $metadata;
 }
コード例 #15
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('value', 'createdDateTime'), 'relations' => array('gamepoint' => array(static::HAS_ONE, 'GamePoint', static::NOT_OWNED)), 'rules' => array(array('value', 'type', 'type' => 'integer'), array('value', 'default', 'value' => 0), array('createdDateTime', 'required'), array('createdDateTime', 'readOnly'), array('createdDateTime', 'type', 'type' => 'datetime')), 'elements' => array('createdDateTime' => 'DateTime'), 'defaultSortAttribute' => 'value', 'noAudit' => array('value', 'createdDateTime'), 'indexes' => array('gamepoint_id' => array('members' => array('gamepoint_id'), 'unique' => false)));
     return $metadata;
 }
コード例 #16
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('value', 'createdDateTime'), 'relations' => array(), 'rules' => array(array('value', 'type', 'type' => 'integer'), array('value', 'default', 'value' => 0), array('createdDateTime', 'required'), array('createdDateTime', 'readOnly'), array('createdDateTime', 'type', 'type' => 'datetime')), 'elements' => array('createdDateTime' => 'DateTime'), 'defaultSortAttribute' => 'value', 'noAudit' => array('value', 'createdDateTime'));
     return $metadata;
 }
コード例 #17
0
ファイル: CurrencyValue.php プロジェクト: sandeep1027/zurmo_
 protected static function translatedAttributeLabels($language)
 {
     return array_merge(parent::translatedAttributeLabels($language), array('currency' => Zurmo::t('ZurmoModule', 'Currency', array(), null, $language), 'rateToBase' => Zurmo::t('ZurmoModule', 'Rate To Base', array(), null, $language), 'value' => Zurmo::t('ZurmoModule', 'Value', array(), null, $language)));
 }
コード例 #18
0
ファイル: Right.php プロジェクト: sandeep1027/zurmo_
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('moduleName', 'name', 'type'), 'relations' => array('permitable' => array(RedBeanModel::HAS_MANY_BELONGS_TO, 'Permitable')), 'rules' => array(array('moduleName', 'required'), array('moduleName', 'type', 'type' => 'string'), array('moduleName', 'length', 'min' => 3, 'max' => 64), array('name', 'required'), array('name', 'type', 'type' => 'string'), array('name', 'length', 'min' => 3, 'max' => 64), array('type', 'required'), array('type', 'type', 'type' => 'integer'), array('type', 'numerical', 'min' => 0, 'max' => 2)));
     return $metadata;
 }
コード例 #19
0
ファイル: Address.php プロジェクト: maruthisivaprasad/zurmo
 protected static function translatedAttributeLabels($language)
 {
     return array_merge(parent::translatedAttributeLabels($language), array('city' => Zurmo::t('ZurmoModule', 'City', array(), null, $language), 'country' => Zurmo::t('ZurmoModule', 'Country', array(), null, $language), 'invalid' => Zurmo::t('Core', 'Invalid', array(), null, $language), 'latitude' => Zurmo::t('ZurmoModule', 'Latitude', array(), null, $language), 'longitude' => Zurmo::t('ZurmoModule', 'Longitude', array(), null, $language), 'postalCode' => Zurmo::t('ZurmoModule', 'Postal Code', array(), null, $language), 'street1' => Zurmo::t('ZurmoModule', 'Street 1', array(), null, $language), 'street2' => Zurmo::t('ZurmoModule', 'Street 2', array(), null, $language), 'state' => Zurmo::t('ZurmoModule', 'State', array(), null, $language)));
 }
コード例 #20
0
 protected static function translatedAttributeLabels($language)
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     return array_merge(parent::translatedAttributeLabels($language), array('fromAddress' => Zurmo::t('EmailMessagesModule', 'From Address', array(), null, $language), 'fromName' => Zurmo::t('EmailMessagesModule', 'From Name', array(), null, $language), 'personOrAccount' => Zurmo::t('ZurmoModule', 'Person Or AccountsModuleSingularLabel', $params, null, $language)));
 }
コード例 #21
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('relations' => array('person' => array(static::HAS_ONE, 'Item', static::NOT_OWNED, static::LINK_TYPE_SPECIFIC, 'person'), 'mission' => array(static::HAS_ONE, 'Mission', static::NOT_OWNED)));
     return $metadata;
 }
コード例 #22
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('date', 'integer'), 'relations' => array('amount' => array(RedBeanModel::HAS_ONE, 'CurrencyValue', RedBeanModel::OWNED, RedBeanModel::LINK_TYPE_SPECIFIC, 'amount')), 'rules' => array(array('date', 'type', 'type' => 'date'), array('integer', 'type', 'type' => 'integer')), 'elements' => array('date' => 'Date', 'amount' => 'CurrencyValue'));
     return $metadata;
 }
コード例 #23
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('processed'), 'relations' => array('contact' => array(static::HAS_ONE, 'Contact', static::NOT_OWNED), 'emailMessage' => array(static::HAS_ONE, 'EmailMessage'), 'campaignItemActivities' => array(static::HAS_MANY, 'CampaignItemActivity'), 'campaign' => array(static::HAS_ONE, 'Campaign', static::NOT_OWNED)), 'rules' => array(array('processed', 'boolean'), array('processed', 'default', 'value' => false)), 'elements' => array(), 'indexes' => array('campaign_id' => array('members' => array('campaign_id'), 'unique' => false), 'contact_id' => array('members' => array('contact_id'), 'unique' => false)));
     return $metadata;
 }
コード例 #24
0
ファイル: EmailSignature.php プロジェクト: youprofit/Zurmo
 protected static function translatedAttributeLabels($language)
 {
     return array_merge(parent::translatedAttributeLabels($language), array('htmlContent' => Zurmo::t('EmailMessagesModule', 'Html Content', array(), null, $language), 'textContent' => Zurmo::t('EmailMessagesModule', 'Text Content', array(), null, $language)));
 }
コード例 #25
0
 protected static function translatedAttributeLabels($language)
 {
     return array_merge(parent::translatedAttributeLabels($language), array('hasReadLatest' => Zurmo::t('NotificationsModule', 'Has Read Latest', array(), null, $language), 'person' => Zurmo::t('NotificationsModule', 'Subscriber', array(), null, $language)));
 }
コード例 #26
0
 protected static function translatedAttributeLabels($language)
 {
     return array_merge(parent::translatedAttributeLabels($language), array('emailAddress' => Zurmo::t('ZurmoModule', 'Email Address', array(), null, $language), 'isInvalid' => Zurmo::t('ZurmoModule', 'Is Invalid', array(), null, $language), 'OptOut' => Zurmo::t('ZurmoModule', 'Opt Out', array(), null, $language)));
 }
コード例 #27
0
 protected function afterDelete()
 {
     $this->emailMessage->delete();
     foreach ($this->campaignItemActivities as $activity) {
         $activity->delete();
     }
     return parent::afterDelete();
 }
コード例 #28
0
 public static function getDefaultMetadata()
 {
     $metadata = parent::getDefaultMetadata();
     $metadata[__CLASS__] = array('members' => array('hasReadLatest'), 'relations' => array('person' => array(static::HAS_ONE, 'Item', static::NOT_OWNED, static::LINK_TYPE_SPECIFIC, 'person'), 'conversation' => array(static::HAS_ONE, 'Conversation', static::NOT_OWNED)), 'rules' => array(array('hasReadLatest', 'boolean')));
     return $metadata;
 }
コード例 #29
0
 protected function afterSave()
 {
     Yii::app()->jobQueue->resolveToAddJobTypeByModelByDateTimeAttribute($this, 'processDateTime', 'AutoresponderQueueMessagesInOutbox');
     parent::afterSave();
     $this->originalAttributeValues = array();
     $this->isNewModel = false;
     //reset.
 }