/**
  * 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);
 }
示例#2
0
    $labelManager->addLabel("[title_template_id]", "TemplateID", "en");
    $labelManager->addLabel("[title_app_id]", "App", "en");
    $labelManager->addLabel("[title_template_key]", "Key", "en");
    $labelManager->addLabel("[title_template_isactive]", "IsActive", "en");
    $labelManager->addLabel("[title_label_key]", "LabelKey", "en");
    /*[RAD_FIELDS_LABEL]*/
    // Create TemplateAdminPage labels
    $labelManager->addPage(page_TemplateAdminPage::MULTILINGUAL_PAGE_KEY);
    /*[RAD_PAGE(TemplateAdminPage)_LABELS]*/
    // Create EditTemplate labels
    $labelManager->addPage(FormProcessor_EditTemplate::MULTILINGUAL_PAGE_KEY);
    /*[RAD_PAGE(EditTemplate)_LABELS]*/
    $labelManager->addLabel("[Title]", "Template Editor", "en");
    $labelManager->addLabel("[Instr]", "This page allows you to modify the template of the emails that get sent by the NSS Payroll system.  The words in brackets are variables that change depending on the person.", "en");
    //$labelManager->addSeries($EmailTemplate->getSeriesKey());
    $labelManager->addPage($EmailTemplate->getXMLNodeName());
    //$languageManager = new RowManager_LanguageManager();
    //$languageList = $languageManager->getListIterator();
    $languageList = new LanguageList();
    $languageList->setFirst();
    while ($language = $languageList->getNext()) {
        $languageKey = $language->getCode();
        echo 'processing [' . $languageKey . ']<br>';
        $labelManager->addLabel("[adjustment_response]", "[" . $languageKey . "]NSS: Salary Adjustment Response: [adjustmentreason]\n\nDear [name],\n\nYour request for a salary adjustment of \$[amount] has been [status].\n\n\n\nReason: [reason]\n\n\nAdjustment Description: [adjustmentdescription]\n\n\nThanks,\n\n[admin]\n\nNSS Team", $languageKey);
        $labelManager->addLabel("[update_response]", "[" . $languageKey . "]Salary Update Response\n\nDear [name],\n\nYour request for a salary adjustment has been [status].\n\n\n[reason]\n\n\nDetails:\n\n\n\nConsumables: [salarycalcreq_field1]  \t \n\nHousing and Utilities: [salarycalcreq_field2] \t\n\nPreventative Care Costs: [salarycalcreq_field3]\n\nOn-going Responsibilities: [salarycalcreq_field4]\n\nMiscellaneous Other: [salarycalcreq_field5]\n\nBenefits: [salarycalcreq_field6]\n\nTaxes: [salarycalcreq_field7]\n\n\n\nTotal: [total]\n\n\n\n\n\nThank you,\n\n[admin]\n\nNSS Team", $languageKey);
        $labelManager->addLabel("[update_request]", "[" . $languageKey . "]Request For Salary Update Submitted\n\nDear [name],\n\nYour request for a salary update has been submitted.\n\n\n\nDetails:\n\n\n\nConsumables: [salarycalcreq_field1]  \t \n\nHousing and Utilities: [salarycalcreq_field2] \t\n\nPreventative Care Costs: [salarycalcreq_field3]\n\nOn-going Responsibilities: [salarycalcreq_field4]\n\nMiscellaneous Other: [salarycalcreq_field5]\n\nBenefits: [salarycalcreq_field6]\n\nTaxes: [salarycalcreq_field7]\n\n\n\nTotal: [total]\n\n\n\n\n\nThank you,\n\n[admin]\n\nNSS Team", $languageKey);
        $labelManager->addLabel("[adjustment_request]", "[" . $languageKey . "]Request For Salary Adjustment: [adjustmentreason] Submitted\n\nDear [name],\n\nYour request for a salary adjustment of \$[amount] has been submitted.\n\n\nDescription: [adjustmentdescription]\n\n\nThank you,\n\n[admin]\n\nNSS Team", $languageKey);
    }
    /*[RAD_PAGE_LABEL]*/
} else {
    echo 'Skipping Labels ... <br>';