• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Several new emails for calculation form - decided

Several new emails for calculation form - decided 11 years 6 months ago #25403

I did amendments to the component, and made several important new introductions
Can be used as an addition to your already working component.
Can use to colculation form , to calculate the price of the letter.

mysql update
Warning: Spoiler! [ Click to expand ]

administrator\components\com_rsform\models\forms.php
  unset($form->Thankyou);
  unset($form->UserEmailText_1);
  unset($form->UserEmailText_2);
  unset($form->UserEmailText_3);
  unset($form->AdminEmailText);
  unset($form->ErrorMessage);
administrator\components\com_rsform\views\forms\tmpl\edit_user.php
line 91 </tr>
 </tr> 
 
    <tr>
                <td width="25%" align="right" nowrap="nowrap" class="key">
                    message limiter 1
                </td>
                <td>
                    <input name="limiterTotal_1" class="rs_inp rs_30" id="limiterTotal_1" value="<?php echo $this->escape($this->form->limiterTotal_1); ?>" />
                </td>
            </tr>
 
            <tr>
                <td width="25%" align="right" nowrap="nowrap" class="key"><?php echo RSFormProHelper::translateIcon(); ?>  <span style="color: red"><?php echo JText::_('RSFP_EMAILS_TEXT'); ?></span></td>
                <td>
                    <button class="rs_button rs_left" id="rsform_edit_user_email" onclick="openRSModal('<?php echo JRoute::_('index.php?option=com_rsform&task=richtext.show&opener=UserEmailText_2&formId='.$this->form->FormId.'&tmpl=component'.(!$this->form->UserEmailMode ? '&noEditor=1' : '')); ?>')" type="button"><span class="rsform_edit"><?php echo JText::_('RSFP_EMAILS_EDIT_TEXT')." 2"; ?></span></button>
                    <button class="rs_button rs_left" onclick="openRSModal('<?php echo JRoute::_('index.php?option=com_rsform&task=richtext.preview&opener=UserEmailText_2&formId='.$this->form->FormId.'&tmpl=component'); ?>', 'RichtextPreview')" type="button"><span class="rsform_preview"><?php echo JText::_('PREVIEW'); ?></span></button>
                </td>
            </tr>
            <tr>
                <td width="25%" align="right" nowrap="nowrap" class="key">
                    message limiter 2
                </td>
                <td>
                    <input name="limiterTotal_2" class="rs_inp rs_30" id="limiterTotal_2" value="<?php echo $this->escape($this->form->limiterTotal_2); ?>" />
                </td>
            </tr>
 
            <tr>
                <td width="25%" align="right" nowrap="nowrap" class="key"><?php echo RSFormProHelper::translateIcon(); ?>  <span style="color: red"><?php echo JText::_('RSFP_EMAILS_TEXT'); ?></span></td>
                <td>
                    <button class="rs_button rs_left" id="rsform_edit_user_email" onclick="openRSModal('<?php echo JRoute::_('index.php?option=com_rsform&task=richtext.show&opener=UserEmailText_3&formId='.$this->form->FormId.'&tmpl=component'.(!$this->form->UserEmailMode ? '&noEditor=1' : '')); ?>')" type="button"><span class="rsform_edit"><?php echo JText::_('RSFP_EMAILS_EDIT_TEXT')." 3"; ?></span></button>
                    <button class="rs_button rs_left" onclick="openRSModal('<?php echo JRoute::_('index.php?option=com_rsform&task=richtext.preview&opener=UserEmailText_3&formId='.$this->form->FormId.'&tmpl=component'); ?>', 'RichtextPreview')" type="button"><span class="rsform_preview"><?php echo JText::_('PREVIEW'); ?></span></button>
                </td>
            </tr>
            <tr>
                <td width="25%" align="right" nowrap="nowrap" class="key">
                    message limiter 3
                </td>
                <td>
                    <input name="limiterTotal_3" class="rs_inp rs_30" id="limiterTotal_3" value="<?php echo $this->escape($this->form->limiterTotal_3); ?>" />
                </td>
            </tr>
administrator\components\com_rsform\helpers\rsform.php
1042 $form->MultipleSeparator.......
 
        $db->setQuery("SELECT limiterTotal_1,limiterTotal_2,limiterTotal_3 FROM #__rsform_forms WHERE FormId='".$formId."'");
        $limiterTotal = $db->loadObject();
тот же файл , но строки могут уже чуть отличаться:
1277   if ($only_return_replacements)
1278   return array($placeholders, $values);
после вставляем:
        foreach($placeholders as $k => $place)
        {
            if ($place == "{Total:value}")  break;
        }
 
        $values[$k] = preg_replace('/\,/','',$values[$k]);
        $flagNoMail = true;
        if ( $values[$k] < $limiterTotal->limiterTotal_1 ) $flagNoMail = false;
        if ( $values[$k] >= $limiterTotal->limiterTotal_1 && $values[$k] < $limiterTotal->limiterTotal_2 ) {
            $UserEmailText = $form->UserEmailText_1;
        }else if ( $values[$k] >= $limiterTotal->limiterTotal_2 && $values[$k] < $limiterTotal->limiterTotal_3 ) {
            $UserEmailText = $form->UserEmailText_2;
        }else if ( $values[$k] >= $limiterTotal->limiterTotal_3 ) {
            $UserEmailText = $form->UserEmailText_3;
        }
Если всё вставили как написал то где то будет
1297   // RSForm! Pro Scripting - User Email Text
1298  // performance check
1299 if (strpos($form->UserEmailText....
будет как то так, нужно заменить от 1299 $form->UserEmailText...
заменить на $UserEmailText
[24.10.2013 0:37:35] CGS: 1311 у вас    'text' => str_replace($placeholders, $values, $form-UserEmailText),
нужно вместо этой строчки вот эту    'text' => str_replace($placeholders, $values, $UserEmailText),
[24.10.2013 0:42:13] CGS: 1377   // Script called before the User Email is sent.
1378  eval($form->UserEmailScript);
:
 if ( $flagNoMail ){
 
// mail users
 $recipients = explode(',',$userEmail['to']);
.......
 
                        RSFormProHelper::sendMail($userEmail['from'], $userEmail['fromName'], $recipient, $userEmail['subject'], $userEmail['text'], $userEmail['mode'], !empty($userEmail['cc']) ? $userEmail['cc'] : null, !empty($userEmail['bcc']) ? $userEmail['bcc'] : null, $userEmail['files'], !empty($userEmail['replyto']) ? $userEmail['replyto'] : '');
ставим 1387 }
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!