/**
  * function __construct
  * <pre>
  * Initialize the Class ...
  * </pre>
  * @param $template_id [INTEGER] value used to initialize the list.
  * @param $sortBy [STRING] the field name to sort list by
  * @return [void]
  */
 function __construct($template_id = -1, $sortBy = '')
 {
     //print (moduleEmailTemplates::MULTILINGUAL_SERIES_KEY);
     $searchManager = new RowManager_EmailTemplateManager($template_id);
     $searchManager->setAppID(moduleEmailTemplates::MULTILINGUAL_SERIES_KEY);
     // NOTE: if you need to narrow the field of the search then uncommnet
     // the following and set the proper search criteria.
     $searchManager->setValueByFieldName("template_id", $template_id);
     //$searchManager->setValueByFieldName('module_isCommonLook', '1' );
     $searchManager->setSortOrder($sortBy);
     parent::__construct($searchManager);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to this module's root directory
  * @param $viewer [OBJECT] The viewer object.
  * @param $formAction [STRING] The action on a form submit
  * @param $template_id [INTEGER] Value used to initialize the dataManager
  * @param $app_id [INTEGER] The foreign key data for the data Manager
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $formAction, $template_id, $app_id = '')
 {
     // NOTE: be sure to call the parent constructor before trying to
     //       use the ->formXXX arrays...
     $fieldList = FormProcessor_EditTemplate::FORM_FIELDS;
     $fieldDisplayTypes = FormProcessor_EditTemplate::FORM_FIELD_TYPES;
     parent::__construct($formAction, $fieldList, $fieldDisplayTypes);
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->template_id = $template_id;
     $this->app_id = $app_id;
     // figure out the important fields for the dataManager
     $fieldsOfInterest = implode(',', $this->formFields);
     // 1) Create the RowManager for the table we are editing
     $emailManager = new RowManager_EmailTemplateManager($template_id);
     $emailManager->setAppID($this->app_id);
     // set the current application ID
     // 2) Now create a Multilintual Context for the labels
     $seriesKey = $emailManager->getSeriesKey();
     $pageKey = $emailManager->getXMLNodeName();
     $this->bridgeMultiLingualManager = new MultilingualManager($viewer->getLanguageID(), $seriesKey, $pageKey);
     $this->dataManager = new RowLabelBridge($emailManager, $this->bridgeMultiLingualManager);
     $this->dataManager->setFieldsOfInterest($fieldsOfInterest);
     $this->formValues = $this->dataManager->getArrayOfValues();
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = moduleEmailTemplates::MULTILINGUAL_SERIES_KEY;
     $pageKey = moduleEmailTemplates::MULTILINGUAL_PAGE_FIELDS;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     // then load the page specific labels for this page
     $pageKey = FormProcessor_EditTemplate::MULTILINGUAL_PAGE_KEY;
     $this->labels->loadPageLabels($pageKey);
     // load the site default form link labels
     $this->labels->setSeriesKey(SITE_LABEL_SERIES_SITE);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORM_LINKS);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORMERRORS);
 }
Example #3
0
// check to see if the parameter 'skipTables' was provided
$skipTables = isset($_REQUEST['skipTables']);
// if NOT then reset the tables...
if (!$skipTables) {
    /*
     * EmailTemplate Table
     *
     * row manager for templates
     *
     * template_id [INTEGER]  The primary key for templates
     * app_id [INTEGER]  Describes which app this template belongs to
     * template_key [STRING]  key for template
     * template_isactive [BOOL]  is the template active or not?
     * label_key [STRING]  key for the label
     */
    $EmailTemplate = new RowManager_EmailTemplateManager();
    $EmailTemplate->dropTable();
    $EmailTemplate->createTable();
    /*[RAD_DAOBJ_TABLE]*/
    $EmailTemplate->setAppID('moduleEmailTemplates');
    $EmailTemplate->setTemplateKey(ADJUSTMENT_RESPONSE_TEMPLATE);
    $EmailTemplate->setIsActive(1);
    $EmailTemplate->setLabelKey('[adjustment_response]');
    $EmailTemplate->createNewEntry();
    $EmailTemplate->clearValues();
    $EmailTemplate->setAppID('moduleEmailTemplates');
    $EmailTemplate->setTemplateKey(UPDATE_RESPONSE_TEMPLATE);
    $EmailTemplate->setIsActive(1);
    $EmailTemplate->setLabelKey('[update_response]');
    $EmailTemplate->createNewEntry();
    $EmailTemplate->clearValues();