![]() |
Xataface Email Module 0.3
Email/Mailmerge Module for Xataface
|
00001 <?php 00002 class tables_xataface__email_templates { 00003 00004 00005 00006 public function getPermissions($record){ 00007 $dummy = new Dataface_Record('dataface__version', array()); 00008 if ( $dummy->checkPermission('email') ){ 00009 return array( 00010 'view' => 1, 00011 'list' => 1, 00012 'find' => 1, 00013 '__partial__' => 1, 00014 'edit'=> 1, 00015 'new' => 1, 00016 'delete' => 1 00017 ); 00018 } else { 00019 return Dataface_PermissionsTool::NO_ACCESS(); 00020 } 00021 00022 } 00023 00024 00025 public function block__before_main_column(){ 00026 echo "<h1>Manage Email Templates</h1>"; 00027 echo "<div class=\"portalHelp\">This section allows you to manage your email templates. An email template can be used when sending email to found sets to import a pre-formatted email message, subject, and from heading.</div>"; 00028 echo '<div>[<a href="'.DATAFACE_SITE_HREF.'?-action=email_manage">Back to Email Management</a>]</div>'; 00029 } 00030 00031 public function block__before_email_body_widget(){ 00032 Dataface_JavascriptTool::getInstance()->import('xataface/modules/ckeditor/plugins/SchemaBrowser.js'); 00033 Dataface_ModuleTool::getInstance()->loadModule('modules_Email')->addPaths(); 00034 Dataface_JavascriptTool::getInstance()->import('xataface/modules/Email/email_template_form.js'); 00035 } 00036 00037 00038 00039 private $tablenames; 00040 public function valuelist__tablenames(){ 00041 if ( !isset($this->tablenames) ){ 00042 $this->tablenames = array(); 00043 $app = Dataface_Application::getInstance(); 00044 00045 00046 if ( isset($app->_conf['_email_tables']) ){ 00047 foreach ($app->_conf['_email_tables'] as $k=>$v){ 00048 $this->tablenames[$k] = $v; 00049 } 00050 } else { 00051 foreach ($app->_conf['_tables'] as $k=>$v){ 00052 $this->tablenames[$k] = $v; 00053 } 00054 } 00055 } 00056 return $this->tablenames; 00057 } 00058 00059 00060 00061 public function getTitle($record){ 00062 return $record->val('template_name'); 00063 } 00064 00065 public function titleColumn(){ 00066 return 'template_name'; 00067 } 00068 00069 00070 00071 }