Code Monkey home page Code Monkey logo

circularnotices's Introduction

CircularNotices

Tests Status Coverage Status Stable Version

circularnotices's People

Contributors

akagane99 avatar butackle avatar clumsysmile avatar go-to avatar kitatsuw avatar kteraguchi avatar netcommons avatar ohga21 avatar rikafujiwara avatar ryu818 avatar ryujiamano avatar s-nakajima avatar takashi-fukunaga avatar withone avatar wo-yamada-kazutaka avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circularnotices's Issues

viewVars['userId']の削除

詳しくは、見てないのですが、下記の$userIdですが、viewVarsの中の$userIdを参照しているのでしたら、Current::read('User.id')に変えてください。

https://github.com/NetCommons3/CircularNotices/blob/master/View/CircularNotices/index.ctp#L111
https://github.com/NetCommons3/CircularNotices/blob/master/View/CircularNotices/view.ctp#L45

ちなみに、セットしているところは、下記です。
https://github.com/NetCommons3/NetCommons/blob/master/Controller/NetCommonsAppController.php#L158

回答内容登録処理について

CircularNoticesController::Viewアクションに登録処理がありますが、
コントローラー分けたほうが良い気がしています。
CircularNoticesAnswerController::editアクションがCakePHPっぽいと思います。

'Pages.PageLayout'コンポーネントの定義を追加してください。

左右おかずつける方法は、'Pages.PageLayout'コンポーネントの定義を一行追加してください。
https://github.com/NetCommons3/Announcements/blob/master/Controller/AnnouncementsAppController.php#L29

また、テストについては、この辺を参考に設定してください。
https://github.com/NetCommons3/Announcements/blob/master/Test/Case/Controller/AnnouncementsControllerTestBase.php

CircularNoticeBlockRolePermissionsControllerでFatal Error

3a7111d#diff-71854a4e65ad3ba541f79469c6b80e27

でFrameモデルを使用するように修正しています。
usesにないので、
Call to a member function findById() on a non-object
のエラーが出ます。
そもそも、この処理いらない気がします。

if (! $frame = $this->Frame->findById($this->viewVars['frameId'])) {
$this->throwBadRequest();
return false;
}
if (! $frame['Block'] || ! $frame['Block']['id']) {
$this->throwBadRequest();
return false;
}
$this->set('blockId', $frame['Block']['id']);
$this->set('blockKey', $frame['Block']['key']);

削除しても動いています。

無駄なHelperの定義ある

無駄なHelperの定義があります。
NetCommons3/NetCommons3#221

Issueのほか、このHelperも使ってますか?
https://github.com/NetCommons3/CircularNotices/blob/master/Controller/CircularNoticesController.php#L55

一度、見直してください。

また、ログインしているユーザIDを使う場合は、AuthではなくCurrentを使ってください。
https://github.com/NetCommons3/CircularNotices/blob/master/Controller/CircularNoticesController.php#L299

CircularNoticeTargetUserのuser_status

virtualFieldsとして保持してますが、実態を持った方が分かりやすい気がします。
登録時に更新するようなイメージです。

多言語対応について

CircularNoticeContentにlanguage_idがないので、多言語化できない感じですが、
回覧板は多言語化ないのでしょうか?
後々追加予定?

あと、回答データ(CircularNoticeTargetUser)は、多言語化するのでしょうかね。。。
これは、アンケートも同じですよね。
もくもく会で確認させてください。

初期データ登録処理

CircularNoticesAppController::beforeFilterで初期データ登録処理を呼んでいます。
CircularNoticeSetting::prepareCircularNoticeSettingと
CircularNoticeFrameSetting::prepareCircularNoticeFrameSettingです。

CircularNoticeBlockRolePermissionsController::editアクションの時だけ呼び出すのが良いように思います。

閲覧件数、回答件数、未読件数処理について

コメントに書いてありますが、issueにもあげときます。

foreach ($contents as $i => $content) {

ContentCommentsプラグインにもあげたのですが、件数の取得処理が厄介な感じです。
NetCommons3/ContentComments#2

CakePHPだと、counterCacheという仕組みが提供されています。
http://book.cakephp.org/2.0/ja/models/associations-linking-models-together.html#countercache-count
これだと、テーブルにフィールド追加になります。

状態ごとに件数を取得することを考えると、counterCacheはきびしいと思ったのですが、
状態ごとの件数をフィールドにもつと行けそうです。
案としてあげときます。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.