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

Changeset 12220


Ignore:
Timestamp:
Jul 10, 2009, 2:04:33 PM (11 years ago)
Author:
urabe
Message:

#3336 The setting of the core part is committed in my branche.

Location:
OpenPNE3/branches/urabe/3_1_x_mytrunk
Files:
1 added
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/urabe/3_1_x_mytrunk/apps/pc_frontend/i18n/form_community.ja.xml

    r11977 r12220  
    3131        <target>すべてのカテゴリ</target>
    3232      </trans-unit>
     33      <trans-unit id="8">
     34        <source>Notification of posting in community by computer E-mail.</source>
     35        <target>コミュニティ書き込みPCメール通知設定</target>
     36      </trans-unit>
     37      <trans-unit id="9">
     38        <source>Notification of posting in community by mobile E-mail.</source>
     39        <target>コミュニティ書き込み携帯メール通知設定</target>
     40      </trans-unit>
    3341    </body>
    3442  </file>
  • OpenPNE3/branches/urabe/3_1_x_mytrunk/apps/pc_frontend/i18n/messages.ja.xml

    r11953 r12220  
    9292      </trans-unit>
    9393      <trans-unit id="">
     94        <source>Community Notification</source>
     95        <target>コミュニティ書き込み通知設定</target>
     96      </trans-unit>
     97      <trans-unit id="">
     98        <source>Need posting Notification</source>
     99        <target>通知設定を使用する</target>
     100      </trans-unit>
     101      <trans-unit id="">
     102        <source>Not Need posting Notification</source>
     103        <target>通知設定を使用しない</target>
     104      </trans-unit>
     105      <trans-unit id="">
    94106        <source>Search Communities</source>
    95107        <target>コミュニティ検索</target>
  • OpenPNE3/branches/urabe/3_1_x_mytrunk/apps/pc_frontend/modules/community/templates/homeSuccess.php

    r12020 r12220  
    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><?php echo __('Community Notification') ?></h3>
     53</div>
     54<table>
     55<?php echo $form ?>
     56<tr>
     57<td colspan="2">
     58<input class="input_submit" type="submit" value="<?php echo __('Send') ?>" />
     59</td>
     60</tr>
     61</table>
     62</div>
     63</form>
     64</div>
     65<?php endif; ?>
     66
    4767<ul>
    4868<?php if ($isEditCommunity): ?>
  • OpenPNE3/branches/urabe/3_1_x_mytrunk/config/doctrine/schema.yml

    r12215 r12220  
    140140    member_id: { type: integer(4), notnull: true }
    141141    position: { type: string(32), default: "" }
     142    is_receive_mail_pc: { type: boolean, default: false, notnull: true }
     143    is_receive_mail_mobile: { type: boolean, default: false, notnull: true }
    142144  relations:
    143145    Community: { local: community_id, foreign: id, onDelete: cascade }
  • OpenPNE3/branches/urabe/3_1_x_mytrunk/lib/action/sfOpenPNECommunityAction.class.php

    r11635 r12220  
    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/branches/urabe/3_1_x_mytrunk/lib/config/sfOpenPNEApplicationConfiguration.class.php

    r12097 r12220  
    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/branches/urabe/3_1_x_mytrunk/lib/form/doctrine/CommunityMemberForm.class.php

    r11479 r12220  
    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    $isAutoGenerate = true;
     16
     17  public function __construct($defaults = array(), $options = array(), $CSRFSecret = null)
     18  {
     19    return parent::__construct($defaults, $options, false);
     20  }
     21
    1222  public function configure()
    1323  {
     24    unset(
     25      $this['community_id'],
     26      $this['member_id'],
     27      $this['position'],
     28      $this['created_at'],
     29      $this['updated_at']
     30    );
     31
     32    $this->setConfigSettings();
     33
     34    if ($this->isAutoGenerate)
     35    {
     36      $this->generateConfigWidgets();
     37    }
     38
     39    $this->widgetSchema->setNameFormat('community_member[%s]');
     40    $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('form_community');
     41
     42    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
     43
     44  }
     45
     46  public function generateConfigWidgets()
     47  {
     48    foreach ($this->configSettings as $key => $value)
     49    {
     50      $this->setConfigWidget($key);
     51    }
     52  }
     53
     54  public function setConfigWidget($name)
     55  {
     56    $config = $this->configSettings[$name];
     57    $this->widgetSchema[$name] = opFormItemGenerator::generateWidget($config);
     58    $this->widgetSchema->setLabel($name, $config['Caption']);
     59    $this->validatorSchema[$name] = opFormItemGenerator::generateValidator($config);
     60  }
     61
     62  public function setConfigSettings($category = '')
     63  {
     64    $configs = sfConfig::get('openpne_community_notification_config');
     65    $categorys = sfConfig::get('openpne_community_notification_category');
     66    if (!$category)
     67    {
     68      $this->configSettings = $configs;
     69      return true;
     70    }
     71
     72    foreach ($categories[$category] as $value)
     73    {
     74      $this->configSettings[$value] = $configs[$value];
     75    }
    1476  }
    1577}
Note: See TracChangeset for help on using the changeset viewer.