From db58efe00f07ba39064cb127322e4f65b14567b1 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 24 Nov 2016 11:17:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3=20http?= =?UTF-8?q?s://github.com/NetCommons3/NetCommons3/issues/762?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/BbsArticle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/BbsArticle.php b/Model/BbsArticle.php index fabb2ac..43580f0 100644 --- a/Model/BbsArticle.php +++ b/Model/BbsArticle.php @@ -123,7 +123,7 @@ public function __construct($id = false, $table = null, $ds = null) { $this->bindModel(array( 'belongsTo' => array( 'BbsArticleTree' => array( - 'type' => 'INNER', + 'type' => 'LEFT', 'className' => 'Bbses.BbsArticleTree', 'foreignKey' => false, 'conditions' => array( From b5a7ea063657b185e9d9e5daac81eab846f731c6 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 24 Nov 2016 11:52:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E5=87=A6=E7=90=86?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Helper/BbsesFormHelper.php | 162 -------------------------------- 1 file changed, 162 deletions(-) diff --git a/View/Helper/BbsesFormHelper.php b/View/Helper/BbsesFormHelper.php index 2b6633f..c78f0ad 100644 --- a/View/Helper/BbsesFormHelper.php +++ b/View/Helper/BbsesFormHelper.php @@ -92,166 +92,4 @@ public function replyEditButtons($statusFieldName) { return $output; } -/** - * Output workflow input comment - * - * @param string $statusFieldName ステータスのフィールド名 - * @param bool $displayBlockKey block_keyを含めるかどうか - * @return string Html - * @SuppressWarnings(PHPMD.BooleanArgumentFlag) - */ - public function inputComment($statusFieldName, $displayBlockKey = true) { - $status = Hash::get($this->_View->data, $statusFieldName); - - $output = $this->_View->element('Workflow.form', array( - 'contentPublishable' => Current::permission('content_publishable'), - 'contentStatus' => $status, - )); - - if ($displayBlockKey) { - $output .= $this->NetCommonsForm->hidden('Block.key', ['value' => Current::read('Block.key')]); - } - return $output; - } - -/** - * Output workflow input comment - * - * @return string Cancel url - */ - public function comments() { - if (! isset($this->_View->viewVars['comments'])) { - $this->_View->viewVars['comments'] = array(); - } - - return $this->_View->element('Workflow.index', array( - 'comments' => $this->_View->viewVars['comments'] - )); - } - -/** - * Check editable permission - * - * @param string $model This should be "Pluginname.Modelname" - * @param array $data Model data - * @return bool True is editable data - */ - public function canEdit($model, $data) { - list($plugin, $model) = pluginSplit($model); - if (! $plugin) { - $plugin = Inflector::pluralize(Inflector::classify($this->request->params['plugin'])); - } - ${$model} = ClassRegistry::init($plugin . '.' . $model); - - return ${$model}->canEditWorkflowContent($data); - } - -/** - * Check deletable permission - * - * @param string $model This should be "Pluginname.Modelname" - * @param array $data Model data - * @return bool True is editable data - */ - public function canDelete($model, $data) { - list($plugin, $model) = pluginSplit($model); - if (! $plugin) { - $plugin = Inflector::pluralize(Inflector::classify($this->request->params['plugin'])); - } - ${$model} = ClassRegistry::init($plugin . '.' . $model); - - return ${$model}->canDeleteWorkflowContent($data); - } - -/** - * Creates a `` tag for publish link link. The type attribute defaults - * - * @param string $title The button's caption. Not automatically HTML encoded - * @param array $options Array of options and HTML attributes. - * @return string A HTML button tag. - * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::button - */ - public function publishLinkButton($title = '', $options = array()) { - $output = ''; - - //ボタンサイズ - $sizeAttr = Hash::get($options, 'iconSize', ''); - if ($sizeAttr) { - $sizeAttr = ' ' . $sizeAttr; - } - $options = Hash::remove($options, 'iconSize'); - - //Linkオプションの設定 - $inputOptions = Hash::merge( - array( - 'icon' => 'ok', - 'name' => 'save_' . WorkflowComponent::STATUS_PUBLISHED, - 'class' => 'btn btn-warning' . $sizeAttr - ), - $options, - array( - 'escapeTitle' => false, - ) - ); - if (Hash::get($options, 'escapeTitle', true)) { - $title = h($title); - } - - //iconの有無 - $iconElement = ' '; - unset($options['icon']); - - //span tooltipタグの出力 - if (isset($options['tooltip']) && $options['tooltip']) { - if (is_string($options['tooltip'])) { - $tooltip = $options['tooltip']; - } else { - $tooltip = __d('net_commons', 'Accept'); - } - $output .= ''; - unset($inputOptions['tooltip']); - } - $output .= $this->Form->button($iconElement . $title, $inputOptions); - if (isset($options['tooltip']) && $options['tooltip']) { - $output .= ''; - } - return $output; - } - -/** - * Creates a `` tag for add link. The type attribute defaults - * - * @param string $title The button's caption. Not automatically HTML encoded - * @param mixed $url Link url - * @param array $options Array of options and HTML attributes. - * @return string A HTML button tag. - */ - public function addLinkButton($title = '', $url = null, $options = array()) { - $output = ''; - - if (! Current::permission('content_creatable')) { - return $output; - } - - //URLの設定 - $defaultUrl = array( - 'plugin' => $this->_View->request->params['plugin'], - 'controller' => $this->_View->request->params['controller'], - ); - if (! isset($url)) { - $url = array( - 'action' => 'add', - 'block_id' => Current::read('Block.id'), - 'frame_id' => Current::read('Frame.id'), - ); - if (isset($this->_View->viewVars['addActionController'])) { - $url['controller'] = $this->_View->viewVars['addActionController']; - } - } - $url = Hash::merge($defaultUrl, $url); - - $output = $this->LinkButton->add($title, $url, $options); - return $output; - } - }