00001 <?php
00002
00016
00017
00018
00022 class BaseEmailTemplate extends DataObject {
00023
00027 function BaseEmailTemplate() {
00028 parent::DataObject();
00029 }
00030
00031
00032
00033
00034
00039 function getJournalId() {
00040 return $this->getData('journalId');
00041 }
00042
00047 function setJournalId($journalId) {
00048 return $this->setData('journalId', $journalId);
00049 }
00050
00056 function isCustomTemplate() {
00057 return false;
00058 }
00059
00063 function getFromRoleId() {
00064 return $this->getData('fromRoleId');
00065 }
00066
00070 function &getFromRoleName() {
00071 $roleDao = &DAORegistry::getDAO('RoleDAO');
00072 return $roleDao->getRoleName($this->getFromRoleId());
00073 }
00074
00079 function setFromRoleId($fromRoleId) {
00080 $this->setData('fromRoleId', $fromRoleId);
00081 }
00082
00086 function getToRoleId() {
00087 return $this->getData('toRoleId');
00088 }
00089
00093 function &getToRoleName() {
00094 $roleDao = &DAORegistry::getDAO('RoleDAO');
00095 return $roleDao->getRoleName($this->getToRoleId());
00096 }
00097
00102 function setToRoleId($toRoleId) {
00103 $this->setData('toRoleId', $toRoleId);
00104 }
00105
00110 function getEmailId() {
00111 return $this->getData('emailId');
00112 }
00113
00118 function setEmailId($emailId) {
00119 return $this->setData('emailId', $emailId);
00120 }
00121
00126 function getEmailKey() {
00127 return $this->getData('emailKey');
00128 }
00129
00134 function setEmailKey($emailKey) {
00135 return $this->setData('emailKey', $emailKey);
00136 }
00137
00142 function getEnabled() {
00143 return $this->getData('enabled');
00144 }
00145
00150 function setEnabled($enabled) {
00151 return $this->setData('enabled', $enabled);
00152 }
00153
00158 function getCanDisable() {
00159 return $this->getData('canDisable');
00160 }
00161
00166 function setCanDisable($canDisable) {
00167 return $this->setData('canDisable', $canDisable);
00168 }
00169
00170 }
00171
00172
00176 class LocaleEmailTemplate extends BaseEmailTemplate {
00177
00179 var $localeData;
00180
00184 function LocaleEmailTemplate() {
00185 parent::BaseEmailTemplate();
00186 $this->localeData = array();
00187 }
00188
00192 function setCustomTemplate($isCustomTemplate) {
00193 $this->isCustomTemplate = $isCustomTemplate;
00194 }
00195
00201 function isCustomTemplate() {
00202 return $this->isCustomTemplate;
00203 }
00204
00209 function addLocale($locale) {
00210 $this->localeData[$locale] = array();
00211 }
00212
00217 function getLocales() {
00218 return array_keys($this->localeData);
00219 }
00220
00221
00222
00223
00224
00230 function getDescription($locale) {
00231 return isset($this->localeData[$locale]['description']) ? $this->localeData[$locale]['description'] : '';
00232 }
00233
00239 function setDescription($locale, $description) {
00240 $this->localeData[$locale]['description'] = $description;
00241 }
00242
00248 function getSubject($locale) {
00249 return isset($this->localeData[$locale]['subject']) ? $this->localeData[$locale]['subject'] : '';
00250 }
00251
00257 function setSubject($locale, $subject) {
00258 $this->localeData[$locale]['subject'] = $subject;
00259 }
00260
00266 function getBody($locale) {
00267 return isset($this->localeData[$locale]['body']) ? $this->localeData[$locale]['body'] : '';
00268 }
00269
00275 function setBody($locale, $body) {
00276 $this->localeData[$locale]['body'] = $body;
00277 }
00278 }
00279
00280
00284 class EmailTemplate extends BaseEmailTemplate {
00285
00289 function EmailTemplate() {
00290 parent::BaseEmailTemplate();
00291 }
00292
00296 function setCustomTemplate($isCustomTemplate) {
00297 $this->isCustomTemplate = $isCustomTemplate;
00298 }
00299
00305 function isCustomTemplate() {
00306 return $this->isCustomTemplate;
00307 }
00308
00309
00310
00311
00312
00317 function getLocale() {
00318 return $this->getData('locale');
00319 }
00320
00325 function setLocale($locale) {
00326 return $this->setData('locale', $locale);
00327 }
00328
00333 function getSubject() {
00334 return $this->getData('subject');
00335 }
00336
00341 function setSubject($subject) {
00342 return $this->setData('subject', $subject);
00343 }
00344
00349 function getBody() {
00350 return $this->getData('body');
00351 }
00352
00357 function setBody($body) {
00358 return $this->setData('body', $body);
00359 }
00360
00361 }
00362
00363 ?>