ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 12556


Ignore:
Timestamp:
Aug 7, 2009, 8:17:27 AM (10 years ago)
Author:
urabe
Message:

#3336 The mail notification function of the community was added.

Location:
OpenPNE3/trunk
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/i18n/form_community.ja.xml

    r12301 r12556  
    3131        <target>すべてのカテゴリ</target>
    3232      </trans-unit>
    33       <trans-unit id="">
     33      <trans-unit id="8">
    3434        <source>An object with the same "name" already exist.</source>
    3535        <target>そのコミュニティ名は既に使われています。</target>
     36      </trans-unit>
     37      <trans-unit id="9">
     38        <source>Notification of posting in community by computer E-mail.</source>
     39        <target>コミュニティ書き込みPCメール通知設定</target>
     40      </trans-unit>
     41      <trans-unit id="10">
     42        <source>Notification of posting in community by mobile E-mail.</source>
     43        <target>コミュニティ書き込み携帯メール通知設定</target>
    3644      </trans-unit>
    3745    </body>
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/homeSuccess.php

    r12372 r12556  
    4545?>
    4646
     47<?php if ($isCommunityMember): ?>
     48<div id="communityNotification" class="dparts listBox">
     49<?php echo $form->renderFormTag(url_for('community/home?id=' . $community->getId())) ?>
     50<div class="parts">
     51<div class="partsHeading">
     52<h3>Community Notification</h3>
     53</div>
     54<table>
     55<?php echo $form ?>
     56<tr>
     57<td colspan="2">
     58<input type="submit" />
     59</td>
     60</tr>
     61</table>
     62</div>
     63</form>
     64</div>
     65<?php endif; ?>
     66
    4767<ul>
    4868<?php if ($isEditCommunity): ?>
  • OpenPNE3/trunk/config/doctrine/schema.yml

    r12547 r12556  
    188188    member_id: { type: integer(4), notnull: true, comment: "Member id" }
    189189    position: { type: string(32), default: "", comment: "Member\'s position in this community" }
     190    is_receive_mail_pc: { type: boolean, default: false, notnull: true }
     191    is_receive_mail_mobile: { type: boolean, default: false, notnull: true }
    190192  relations:
    191193    Community: { local: community_id, foreign: id, onDelete: cascade }
  • OpenPNE3/trunk/lib/action/sfOpenPNECommunityAction.class.php

    r12533 r12556  
    4646    }
    4747    $this->members = $this->community->getMembers($this->membersSize, true);
     48
     49    $this->community_member = Doctrine::getTable('CommunityMember')
     50      ->retrieveByMemberIdAndCommunityId(
     51        $this->getUser()->getMemberId(),
     52        $this->id
     53      );
     54    $this->form = new CommunityMemberForm($this->community_member);
     55    if ($request->isMethod('put'))
     56    {
     57      $params = $request->getParameter('community_member');
     58      $this->form->bind($params);
     59      if ($this->form->isValid())
     60      {
     61        $this->form->save();
     62      }
     63    }
    4864  }
    4965
  • OpenPNE3/trunk/lib/config/sfOpenPNEApplicationConfiguration.class.php

    r12097 r12556  
    333333    $this->getConfigCache()->registerConfigHandler('config/community_config.yml', 'opConfigConfigHandler', array('prefix' => 'openpne_community_'));
    334334    include($this->getConfigCache()->checkConfig('config/community_config.yml'));
     335
     336    $this->getConfigCache()->registerConfigHandler('config/community_notification.yml', 'opConfigConfigHandler', array('prefix' => 'openpne_community_notification_'));
     337    include($this->getConfigCache()->checkConfig('config/community_notification.yml'));
    335338  }
    336339
  • OpenPNE3/trunk/lib/form/doctrine/CommunityMemberForm.class.php

    r11479 r12556  
    77 * @subpackage CommunityMember
    88 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
     9 * @auther     Shinichi Urabe <urabe@tejimaya.net>
    910 */
    1011class CommunityMemberForm extends BaseCommunityMemberForm
    1112{
     13  protected
     14    $configSettings = array(),
     15    $communityMember,
     16    $isNew = false,
     17    $isAutoGenerate = true;
     18
     19  public function __construct($defaults = array(), $options = array(), $CSRFSecret = null)
     20  {
     21    return parent::__construct($defaults, $options, false);
     22  }
     23
    1224  public function configure()
    1325  {
     26    unset(
     27      $this['community_id'],
     28      $this['member_id'],
     29      $this['position'],
     30      $this['created_at'],
     31      $this['updated_at']
     32    );
     33
     34    $this->setConfigSettings();
     35
     36    if ($this->isAutoGenerate)
     37    {
     38      $this->generateConfigWidgets();
     39    }
     40
     41    $this->widgetSchema->setNameFormat('community_member[%s]');
     42    $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('form_community');
     43
     44    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     45
     46  }
     47
     48  public function generateConfigWidgets()
     49  {
     50    foreach ($this->configSettings as $key => $value)
     51    {
     52      $this->setConfigWidget($key);
     53    }
     54  }
     55
     56  public function setConfigWidget($name)
     57  {
     58    $config = $this->configSettings[$name];
     59    $this->widgetSchema[$name] = opFormItemGenerator::generateWidget($config);
     60    $this->widgetSchema->setLabel($name, $config['Caption']);
     61    $this->validatorSchema[$name] = opFormItemGenerator::generateValidator($config);
     62  }
     63
     64  public function setConfigSettings($category = '')
     65  {
     66    $configs = sfConfig::get('openpne_community_notification_config');
     67    $categorys = sfConfig::get('openpne_community_notification_category');
     68    if (!$category)
     69    {
     70      $this->configSettings = $configs;
     71      return true;
     72    }
     73
     74    foreach ($categories[$category] as $value)
     75    {
     76      $this->configSettings[$value] = $configs[$value];
     77    }
    1478  }
    1579}
Note: See TracChangeset for help on using the changeset viewer.