diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-06-18 07:43:06 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-06-18 07:43:06 +0000 |
| commit | 32ed2bae9bf9a967465f74e74ae3a0e83424af5b (patch) | |
| tree | 7f3226b3ce63ede58e9c7ae11e4c6a1a146ee6b6 | |
| parent | 3fd6188c47838fa1dfe5737b6aa24ccdbb89302a (diff) | |
| download | pigeonholes-32ed2bae9bf9a967465f74e74ae3a0e83424af5b.tar.gz pigeonholes-32ed2bae9bf9a967465f74e74ae3a0e83424af5b.tar.bz2 pigeonholes-32ed2bae9bf9a967465f74e74ae3a0e83424af5b.zip | |
display correct number of assignable elements and fix pagination related display limitation
| -rw-r--r-- | Pigeonholes.php | 22 | ||||
| -rw-r--r-- | assign_content.php | 5 | ||||
| -rw-r--r-- | templates/assign_content.tpl | 2 | ||||
| -rw-r--r-- | templates/section_inc.tpl | 2 | ||||
| -rw-r--r-- | templates/view_table_inc.tpl | 1 | ||||
| -rw-r--r-- | view.php | 16 |
6 files changed, 31 insertions, 17 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index 1019137..7b3fc68 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.63 2006/06/14 22:43:13 windblown Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.64 2006/06/18 07:43:06 squareing Exp $ * * +----------------------------------------------------------------------+ * | Copyright ( c ) 2004, bitweaver.org @@ -17,7 +17,7 @@ * Pigeonholes class * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.63 $ + * @version $Revision: 1.64 $ * @package pigeonholes */ @@ -163,8 +163,10 @@ class Pigeonholes extends LibertyContent { * @return array of content not in any pigeonhole yet * @access public **/ - function getAssignableContent( $pListHash ) { + function getAssignableContent( &$pListHash ) { global $gBitUser, $gLibertySystem, $gBitSystem; + LibertyContent::prepGetList( $pListHash ); + $where = ''; $bindVars = array(); @@ -185,16 +187,16 @@ class Pigeonholes extends LibertyContent { } if( !empty( $pListHash['sort_mode'] ) ) { - $where .= " ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] )." "; + $order = " ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] )." "; } else { - $where .= " ORDER BY lc.`content_type_guid`, lc.`title` ASC"; + $order = " ORDER BY lc.`content_type_guid`, lc.`title` ASC"; } $query = "SELECT pigm.`parent_id`, lc.`content_id`, lc.`user_id`, lc.`title`, lc.`content_type_guid`, uu.`login`, uu.`real_name` FROM `".BIT_DB_PREFIX."liberty_content` lc LEFT JOIN `".BIT_DB_PREFIX."pigeonhole_members` pigm ON ( pigm.`content_id` = lc.`content_id` ) LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = lc.`user_id` ) - $where"; + $where $order"; $result = $this->mDb->query( $query, $bindVars, @BitBase::verifyId( $pListHash['max_records'] ) ? $pListHash['max_records'] : NULL ); $contentTypes = $gLibertySystem->mContentTypes; @@ -225,6 +227,14 @@ class Pigeonholes extends LibertyContent { } } + $query = "SELECT COUNT( lc.`content_id` ) + FROM `".BIT_DB_PREFIX."liberty_content` lc + LEFT JOIN `".BIT_DB_PREFIX."pigeonhole_members` pigm ON ( pigm.`content_id` = lc.`content_id` ) + LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON ( uu.`user_id` = lc.`user_id` ) + $where"; + $pListHash['cant'] = $this->mDb->getOne( $query, $bindVars ); + + LibertyContent::postGetList( $pListHash ); return( !empty( $ret ) ? $ret : NULL ); } diff --git a/assign_content.php b/assign_content.php index 8c5d449..b44e3df 100644 --- a/assign_content.php +++ b/assign_content.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/assign_content.php,v 1.3 2006/04/11 13:07:41 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/assign_content.php,v 1.4 2006/06/18 07:43:06 squareing Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: assign_content.php,v 1.3 2006/04/11 13:07:41 squareing Exp $ + * $Id: assign_content.php,v 1.4 2006/06/18 07:43:06 squareing Exp $ * @package pigeonholes * @subpackage functions */ @@ -41,6 +41,7 @@ $listHash = array( 'content_type' => $contentSelect, ); $assignableContent = $gContent->getAssignableContent( $listHash ); +$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); if( !empty( $_REQUEST['insert_content'] ) && isset( $_REQUEST['pigeonhole'] ) ) { // here we need to limit all killing to the selected structure diff --git a/templates/assign_content.tpl b/templates/assign_content.tpl index 93adc28..f961b2d 100644 --- a/templates/assign_content.tpl +++ b/templates/assign_content.tpl @@ -69,7 +69,7 @@ {/if} <table class="data"> - <caption>{tr}Available Content{/tr} <span class="total">[ {$contentCount} ]</span></caption> + <caption>{tr}Available Content{/tr} <span class="total">[ {$listInfo.total_records} ]</span></caption> <tr> <th>{smartlink ititle="Title" isort=title idefault=1 max_rows=$smarty.request.max_rows content_type=$contentSelect find_objects=$find_objects include=$smarty.request.include page=$page}</th> <th>{smartlink ititle="Content Type" isort=content_type_guid max_rows=$smarty.request.max_rows content_type=$contentSelect find_objects=$find_objects include=$smarty.request.include page=$page}</th> diff --git a/templates/section_inc.tpl b/templates/section_inc.tpl index 97a2cc1..14cd4f4 100644 --- a/templates/section_inc.tpl +++ b/templates/section_inc.tpl @@ -63,7 +63,7 @@ {/if} {if $current}<strong>{/if} - <a href="{$smarty.const.PIGEONHOLES_PKG_URL}view.php?structure_id={$subtree[ix].structure_id}">{$subtree[ix].title|escape}</a> + <a href="{$smarty.const.PIGEONHOLES_PKG_URL}view.php?structure_id={$subtree[ix].structure_id}#members">{$subtree[ix].title|escape}</a> {if $current}</strong>{/if} {biticon ipackage=liberty iname=spacer} diff --git a/templates/view_table_inc.tpl b/templates/view_table_inc.tpl index f73d2f5..f2a3c15 100644 --- a/templates/view_table_inc.tpl +++ b/templates/view_table_inc.tpl @@ -1,6 +1,7 @@ {foreach from=$pigeonList item=pigeonItem} {if $pigeonItem.members} <hr /> + <a name="members"></a> <h2>{$gContent->getTitle()}</h2> <p> {$pigeonItem.data|escape} @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.13 2006/04/24 12:35:46 bitweaver Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.14 2006/06/18 07:43:06 squareing Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: view.php,v 1.13 2006/04/24 12:35:46 bitweaver Exp $ + * $Id: view.php,v 1.14 2006/06/18 07:43:06 squareing Exp $ * @package pigeonholes * @subpackage functions */ @@ -52,12 +52,14 @@ if( empty( $gStructure ) || !$gStructure->isValid() ) { $gBitSmarty->assign_by_ref( 'gStructure', $gStructure ); $gBitSmarty->assign( 'structureInfo', $gStructure->mInfo ); $gBitSmarty->assign( 'subtree', $gStructure->getSubTree( $gStructure->mStructureId ) ); -$listHash = array( - 'root_structure_id' => $gContent->mInfo['root_structure_id'], - 'structure_id' => $gContent->mInfo['structure_id'], - 'load_extras' => TRUE -); + if( $gContent->checkPathPermissions( $gContent->getField( 'path' ) ) ) { + $listHash = array( + 'root_structure_id' => $gContent->mInfo['root_structure_id'], + 'structure_id' => $gContent->mInfo['structure_id'], + 'load_extras' => TRUE, + 'max_records' => -1, + ); $pigeonList = $gContent->getList( $listHash ); $gBitSmarty->assign( 'pigeonList', $pigeonList ); } else { |
