Exemple #1
0
 function _savePublicPageData($name, $title, $body, $linkpage = false)
 {
     require_once 'AMP/System/IntroText.inc.php';
     $page = new AMPSystem_IntroText(AMP_Registry::getDbcon());
     $page->setDefaults();
     $page_data = array('title' => $title, 'body' => $body, 'name' => $name, 'modid' => $this->_saved_tool_id, 'searchtype' => $linkpage);
     $page->setDefaults();
     $page->setData($page_data);
     $result = $page->save();
     if ($result) {
         return $page->id;
     }
     return false;
 }
Exemple #2
0
     	print "Success!";
 		} else {
     	print "Failure!";
 		}
 	}
 */
 if ($_POST["Send_Fax"]) {
     mail($faxemail, $faxsubject, $finalemail, $faxheaders);
 }
 if ($actiondetails->Fields("bcc")) {
     mail($actiondetails->Fields("bcc"), $_POST['subjectText'], $finalemail, $temailheaders);
 }
 mail($Email, "Thank you for Taking Action", $finalemail, $temailheaders);
 #go to tell a friend
 require_once 'AMP/System/IntroText.inc.php';
 $page = new AMPSystem_IntroText(AMP_Registry::getDbcon(), AMP_CONTENT_PUBLICPAGE_ID_SHARE_RESPONSE);
 $page_display = $page->getDisplay();
 print $page_display->execute();
 echo "<p class=title>" . $actiondetails->Fields("thankyou_title") . "</p>";
 echo "<p class=text>" . converttext($actiondetails->Fields("thankyou_text")) . "</p>";
 echo "<br><br><p class=title>Tell A Friend</p><br>";
 if ($actiondetails->Fields("tellfriend")) {
     #tellfriend($_REQUEST['First_Name'],$_REQUEST['Last_Name'],$_REQUEST['Email'],$actiondetails->Fields("tf_subject"),$actiondetails->Fields("tf_text"));
     require_once 'Modules/Share/Public/ComponentMap.inc.php';
     $map = new ComponentMap_Share_Public();
     $controller = $map->get_controller();
     $controller->_init_form();
     $controller->_form->applyDefaults();
     $controller->_form->setValues(array('sender_name' => $_REQUEST['First_Name'] . ' ' . $_REQUEST['Last_Name'], 'sender_email' => $_REQUEST['Email'], 'message' => $actiondetails->Fields('tf_text'), 'subject' => $actiondetails->Fields('tf_subject')));
     print $controller->_form->execute();
 }
Exemple #3
0
 function save($data)
 {
     $options = $this->getOptions();
     if (!isset($this->udm->uid)) {
         $this->udm->errorMessage("Invalid Contact Info");
         return false;
     }
     if (!(isset($data['action_id']) && $data['action_id'])) {
         $this->udm->errorMessage("No Appointment Selected");
         return;
     }
     $schedule = new Schedule($this->dbcon, $options['schedule_id']);
     if (!$schedule->makeAppointment($this->udm->uid, $data['action_id'])) {
         $this->udm->errorMessage("The requested schedule time is not avaiable");
         return false;
     }
     $item =& $schedule->getScheduleItem($data['action_id']);
     $appt_contact_data = $this->udm->getData();
     $recipients = array();
     if (isset($options['email_contact_schedule']) && $options['email_contact_schedule']) {
         $recipients['schedule'] = $item->getOwnerEmail();
     }
     if (isset($options['email_contact_appointment']) && $options['email_contact_appointment']) {
         $recipients['appointment'] = $appt_contact_data['Email'];
     }
     if (empty($recipients)) {
         return true;
     }
     $item_data = $item->getData();
     $item_data['schedule_contact_name'] = $item->getOwnerName();
     $item_data['schedule_contact_email'] = $item->getOwnerEmail();
     $item_data['schedule_start_time_text'] = $item->getTimeText();
     $item_data = array_merge($item_data, $this->getAppointmentContactData());
     foreach ($recipients as $which_contact => $email) {
         $text_id = $options['email_contact_' . $which_contact];
         $text = new AMPSystem_IntroText($this->dbcon, $text_id);
         $sch_email = new AMPSystem_Email();
         $sch_email->setSubject($text->getTitle());
         $sch_email->setRecipient($email);
         $sch_email->setMessage($text->mergeBodyFields($item_data));
         if (!$sch_email->execute()) {
             trigger_error(sprintf(AMP_ERROR_SCHEDULE_APPOINTMENT_EMAIL_NOT_SENT, $email));
         }
     }
     return true;
 }
 function findIntroText($introtext_id)
 {
     $location = new AMPSystem_IntroText($this->dbcon, $introtext_id);
     $this->current_element = $this->_trimText($location->getData('title'));
     $this->current_section = $location->getSection();
     $this->content_type = AMP_CONTENT_PAGETYPE_TOOL;
 }
Exemple #5
0
 /**
  * Sets global values for intro_id, MM_title, MM_type 
  * 
  * @param   AMPSystem_IntroText    $introtext   The IntroText whose values will be globalized
  */
 function _globalizeIntroVars(&$introtext)
 {
     $GLOBALS['intro_id'] = $introtext->id;
     $this->_registry->setEntry(AMP_REGISTRY_CONTENT_INTRO_ID, $introtext->id);
     if ($title = $introtext->getTitle()) {
         $GLOBALS['MM_title'] = $GLOBALS['mod_name'] = $title;
     }
     if ($section_id = $introtext->getSection()) {
         $GLOBALS['MM_type'] = $section_id;
     }
 }
Exemple #6
0
 function _readTemplates()
 {
     require_once 'AMP/System/IntroText.inc.php';
     require_once 'AMP/Content/Config.inc.php';
     $frontpage = new AMPSystem_IntroText($this->dbcon, AMP_CONTENT_INTRO_ID_FRONTPAGE);
     $this->setTemplateIdFrontpage($frontpage->getTemplate());
 }
Exemple #7
0
 function password_reset_message($account)
 {
     $message = new AMPSystem_IntroText(AMP_dbcon(), AMP_CONTENT_PUBLICPAGE_ID_PASSWORD_RESET_EMAIL);
     return $message->mergeBodyFields(array('reset_link' => $this->password_reset_link($account)));
 }
Exemple #8
0
 function _saveIntroText($data, $fieldname)
 {
     $start_id = isset($data[$fieldname]) ? $data[$fieldname] : false;
     if (!(isset($data[$fieldname . '_title']) && $data[$fieldname . '_title'])) {
         return $start_id;
     }
     require_once 'AMP/System/Introtext.inc.php';
     $text_data = array('title' => $data[$fieldname . '_title'], 'body' => $data[$fieldname . '_text']);
     $tools_lookup = AMPSystem_Lookup::instance('toolsbyForm');
     if (!isset($tools_lookup[$data['modin']])) {
         return $data;
     }
     $text_data['modid'] = $tools_lookup[$data['modin']];
     if (!$start_id) {
         $text_data['name'] = $this->_makeIntroTextName($data, $fieldname);
     } else {
         $text_data['id'] = $start_id;
     }
     $textItem = new AMPSystem_IntroText(AMP_Registry::getDbcon());
     $textItem->setData($text_data);
     $textItem->save();
     return $textItem->id;
 }
 function &getPublicPage($action = 'input')
 {
     $empty_value = false;
     if (!($id = $this->getPublicPageId($action))) {
         return $empty_value;
     }
     require_once 'AMP/System/IntroText.inc.php';
     $page = new AMPSystem_IntroText(AMP_Registry::getDbcon(), $id);
     if (!$page->hasData()) {
         return false;
     }
     return $page;
 }
Exemple #10
0
 function _readIntroText($id, $merge_fields = false)
 {
     $system_texts = AMPSystem_Lookup::instance('introTexts');
     if (!isset($system_texts[$id])) {
         return $id;
     }
     $textdata = new AMPSystem_IntroText($this->dbcon, $id);
     if ($textdata->isHtml()) {
         $this->containsHTML(true);
     }
     if ($merge_fields) {
         $merged_text = $textdata->mergeBodyFields($merge_fields);
     } else {
         $merged_text = $textdata->getBody();
     }
     return AMPDisplay_HTML::_activateIncludes($merged_text) . "\n\n";
 }