diff -aburN --exclude='CVS*' phpgroupware.old/notes/inc/class.bo.inc.php phpgroupware/notes/inc/class.bo.inc.php --- phpgroupware.old/notes/inc/class.bo.inc.php 2002-10-21 00:00:52.000000000 +0200 +++ phpgroupware/notes/inc/class.bo.inc.php 2002-12-01 19:11:51.000000000 +0100 @@ -66,7 +66,16 @@ $filter = get_var('filter',array('POST','GET')); $cat_id = get_var('cat_id',array('POST','GET')); - $this->start = (isset($start)?$start:0); +// $this->start = (isset($start)?$start:0); + + if ($start) + { + $this->start=$start; + } + else + { + $this->start=0; + } if(isset($query)) { diff -aburN --exclude='CVS*' phpgroupware.old/notes/inc/class.so.inc.php phpgroupware/notes/inc/class.so.inc.php --- phpgroupware.old/notes/inc/class.so.inc.php 2002-10-21 00:00:52.000000000 +0200 +++ phpgroupware/notes/inc/class.so.inc.php 2002-12-02 12:51:10.000000000 +0100 @@ -27,7 +27,17 @@ { if(is_array($data)) { - $start = (isset($data['start'])?$data['start']:0); + + if ($data['start']) + { + $start=$data['start']; + } + else + { + $start=0; + } + // $start = (isset($data['start'])?$data['start']:0); + $filter = (isset($data['filter'])?$data['filter']:'none'); $query = (isset($data['query'])?$data['query']:''); $sort = (isset($data['sort'])?$data['sort']:'DESC'); diff -aburN --exclude='CVS*' phpgroupware.old/notes/inc/class.ui.inc.php phpgroupware/notes/inc/class.ui.inc.php --- phpgroupware.old/notes/inc/class.ui.inc.php 2002-11-03 02:03:06.000000000 +0100 +++ phpgroupware/notes/inc/class.ui.inc.php 2002-12-03 00:32:08.000000000 +0100 @@ -97,10 +97,12 @@ $table_header[] = array ( 'lang_content' => lang('content'), + 'sort_time_created' => $this->nextmatchs->show_sort_order_xsl($this->sort,'note_date',$this->order,'/menuaction=notes.ui.index',array(cat_id=>$this->cat_id)), 'lang_time_created' => lang('time created'), 'lang_view' => lang('view'), 'lang_edit' => lang('edit'), 'lang_delete' => lang('delete'), + 'sort_note_id' => $this->nextmatchs->show_sort_order_xsl($this->sort,'note_id',$this->order,'/menuaction=notes.ui.index',array(cat_id=>$this->cat_id)), 'lang_note_id' => lang('note id'), 'lang_owner' => lang('owner') ); @@ -122,9 +124,12 @@ 'img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi') );*/ + + $data = array ( - 'cur_record' => $this->start, + 'allow_all_rows' => True, + 'start_record' => $this->start, 'record_limit' => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'], 'num_records' => count($notes_list), 'all_records' => $this->bo->total_records, diff -aburN --exclude='CVS*' phpgroupware.old/notes/templates/default/app_data.xsl phpgroupware/notes/templates/default/app_data.xsl --- phpgroupware.old/notes/templates/default/app_data.xsl 2002-11-15 06:16:22.000000000 +0100 +++ phpgroupware/notes/templates/default/app_data.xsl 2002-12-03 00:17:04.000000000 +0100 @@ -44,15 +44,17 @@ </xsl:template> <xsl:template match="table_header"> + <xsl:variable name="sort_time_created"><xsl:value-of select="sort_time_created"/></xsl:variable> + <xsl:variable name="sort_note_id"><xsl:value-of select="sort_note_id"/></xsl:variable> <tr class="th"> <td class="th_text" width="10%" align="right"> - <xsl:value-of select="lang_note_id"/> + <a href="{$sort_note_id}"><xsl:value-of select="lang_note_id"/></a> </td> <td class="th_text" width="40%"> <xsl:value-of select="lang_content"/> </td> <td class="th_text" width="20%" align="center"> - <xsl:value-of select="lang_time_created"/> + <a href="{$sort_time_created}"><xsl:value-of select="lang_time_created"/></a> </td> <td class="th_text" width="10%" align="center"> <xsl:value-of select="lang_owner"/> diff -aburN --exclude='CVS*' phpgroupware.old/phpgwapi/inc/class.nextmatchs.inc.php phpgroupware/phpgwapi/inc/class.nextmatchs.inc.php --- phpgroupware.old/phpgwapi/inc/class.nextmatchs.inc.php 2002-12-03 00:25:43.000000000 +0100 +++ phpgroupware/phpgwapi/inc/class.nextmatchs.inc.php 2002-12-03 00:06:45.000000000 +0100 @@ -747,6 +747,35 @@ } } + function show_sort_order_xsl($sort,$var,$order,$program,$extra='') + { + list($filter,$qfield,$start,$NULL1,$NULL) = $this->get_var(); + + if(($order == $var) && ($sort == 'ASC')) + { + $sort = 'DESC'; + } + elseif(($order == $var) && ($sort == 'DESC')) + { + $sort = 'ASC'; + } + else + { + $sort = 'ASC'; + } + + if(is_array($extra)) + { + $extra = $this->extras_to_string($extra); + } + + $extravar = 'order='.$var.'&sort='.$sort.'&filter='.$filter.'&qfield='.$qfield.'&start='.$start.'&query='.urlencode(stripslashes($GLOBALS['query'])).$extra; + + $link = ($this->action?$this->page($extravar):$GLOBALS['phpgw']->link($program,$extravar)); + + return $link; + } + function show_hits($total_records='',$start=0) { if($total_records > $this->maxmatches) diff -aburN --exclude='CVS*' phpgroupware.old/phpgwapi/templates/default/nextmatchs.xsl phpgroupware/phpgwapi/templates/default/nextmatchs.xsl --- phpgroupware.old/phpgwapi/templates/default/nextmatchs.xsl 2002-12-02 11:33:03.000000000 +0100 +++ phpgroupware/phpgwapi/templates/default/nextmatchs.xsl 2002-12-02 12:43:35.000000000 +0100 @@ -1,8 +1,9 @@ <!-- $Id: nextmatchs.xsl,v 1.2 2002/10/06 02:45:21 ceb Exp $ --> <xsl:template name="nextmatchs"> -<!-- <xsl:param name="nextmatchs_params"/> --> - <xsl:variable name="cur_record"><xsl:value-of select="cur_record"/></xsl:variable> + <xsl:variable name="allow_all_rows"><xsl:value-of select="allow_all_rows"/></xsl:variable> + <xsl:variable name="start_record"><xsl:value-of select="start_record"/></xsl:variable> + <xsl:variable name="cur_record"><xsl:value-of select="number($start_record) + number(1)"/></xsl:variable> <xsl:variable name="record_limit"><xsl:value-of select="record_limit"/></xsl:variable> <xsl:variable name="num_records"><xsl:value-of select="num_records"/></xsl:variable> <xsl:variable name="all_records"><xsl:value-of select="all_records"/></xsl:variable> @@ -13,14 +14,14 @@ <tr> <xsl:choose> <xsl:when test="number($cur_record) > number(1)"> - <xsl:variable name="first"><xsl:value-of select="link_url"/>&amp;currow=1</xsl:variable> + <xsl:variable name="first"><xsl:value-of select="link_url"/>&amp;start=0</xsl:variable> <td width="25"> - <a href="{$first}"><img src="{$img_path}/first-grey.png" border="2" width="12" height="12"/></a> + <a href="{$first}"><img src="{$img_path}/first.gif" border="2" width="12" height="12"/></a> </td> </xsl:when> <xsl:otherwise> <td width="25"> - <img src="{$img_path}/first-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/first-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> @@ -33,29 +34,29 @@ <xsl:choose> <xsl:when test="number($cur_record) - number($record_limit) > number(0)"> <xsl:variable name="prev_number"><xsl:value-of select="number($cur_record) - number($record_limit)"/></xsl:variable> - <xsl:variable name="prev"><xsl:value-of select="link_url"/>&amp;currow=<xsl:value-of select="$prev_number"/></xsl:variable> + <xsl:variable name="prev"><xsl:value-of select="link_url"/>&amp;start=<xsl:value-of select="number($prev_number) - number(1)"/></xsl:variable> <td width="25"> - <a href="{$prev}"><img src="{$img_path}/left-grey.png" border="2" width="12" height="12"/></a> + <a href="{$prev}"><img src="{$img_path}/left.gif" border="2" width="12" height="12"/></a> </td> </xsl:when> <xsl:otherwise> - <xsl:variable name="prev"><xsl:value-of select="link_url"/>&amp;currow=1</xsl:variable> + <xsl:variable name="prev"><xsl:value-of select="link_url"/>&amp;start=0</xsl:variable> <td width="25"> - <a href="{$prev}"><img src="{$img_path}/left-grey.png" border="2" width="12" height="12"/></a> + <a href="{$prev}"><img src="{$img_path}/left-grey.gif" border="2" width="12" height="12"/></a> </td> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <td width="25"> - <img src="{$img_path}/left-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/left-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <td width="25"> - <img src="{$img_path}/left-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/left-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> @@ -67,15 +68,15 @@ <xsl:otherwise> <xsl:choose> <xsl:when test="number($cur_record) + number($record_limit) > number($num_records)"> - <xsl:variable name="of_num"><xsl:value-of select="$num_records"/></xsl:variable> + <xsl:variable name="of_num"><xsl:value-of select="number($cur_record)+number($num_records) - number(1)"/></xsl:variable> <td nowrap="nowrap" align="center"> - <xsl:value-of select="$cur_record"/> - <xsl:value-of select="$of_num"/> of <xsl:value-of select="$num_records"/>&#160; + <xsl:value-of select="$cur_record"/> - <xsl:value-of select="$of_num"/> of <xsl:value-of select="$all_records"/>&#160; </td> </xsl:when> <xsl:otherwise> <xsl:variable name="of_num"><xsl:value-of select="number($cur_record) + number($record_limit) - number(1)"/></xsl:variable> <td nowrap="nowrap" align="center"> - <xsl:value-of select="$cur_record"/> - <xsl:value-of select="$of_num"/> of <xsl:value-of select="$num_records"/>&#160; + <xsl:value-of select="$cur_record"/> - <xsl:value-of select="$of_num"/> of <xsl:value-of select="$all_records"/>&#160; </td> </xsl:otherwise> </xsl:choose> @@ -83,67 +84,71 @@ </xsl:choose> <xsl:choose> - <xsl:when test="number($num_records) > number($record_limit)"> + <xsl:when test="number($all_records) > (number($start_record) + number($record_limit))"> <xsl:variable name="next_num"><xsl:value-of select="number($cur_record) + number($record_limit)"/></xsl:variable> <xsl:choose> - <xsl:when test="number($num_records) > number($next_num)-number(1)"> - <xsl:variable name="next"><xsl:value-of select="link_url"/>&amp;currow=<xsl:value-of select="$next_num"/></xsl:variable> + <xsl:when test="number($all_records) > number($next_num)-number(1)"> + <xsl:variable name="next"><xsl:value-of select="link_url"/>&amp;start=<xsl:value-of select="number($next_num) - number(1)"/></xsl:variable> <td width="25" align="right"> - <a href="{$next}"><img src="{$img_path}/right-grey.png" border="2" width="12" height="12"/></a> + <a href="{$next}"><img src="{$img_path}/right.gif" border="2" width="12" height="12"/></a> </td> </xsl:when> <xsl:otherwise> <td width="25" align="right"> - <img src="{$img_path}/right-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/right-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <td width="25" align="right"> - <img src="{$img_path}/right-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/right-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> <xsl:choose> - <xsl:when test="number($num_records) > number($record_limit)"> - <xsl:variable name="last_num"><xsl:value-of select="number($num_records)-number($record_limit)+number(1)"/></xsl:variable> + <xsl:when test="number($all_records) > (number($start_record) + number($record_limit))"> + <xsl:variable name="last_num"><xsl:value-of select="number($all_records)-number($record_limit)+number(1)"/></xsl:variable> <xsl:choose> <xsl:when test="number($last_num) > number($cur_record)"> - <xsl:variable name="last"><xsl:value-of select="link_url"/>&amp;currow=<xsl:value-of select="$last_num"/></xsl:variable> + <xsl:variable name="last"><xsl:value-of select="link_url"/>&amp;start=<xsl:value-of select="number($last_num)-number(1)"/></xsl:variable> <td width="25" align="right"> - <a href="{$last}"><img src="{$img_path}/last-grey.png" border="2" width="12" height="12"/></a> + <a href="{$last}"><img src="{$img_path}/last.gif" border="2" width="12" height="12"/></a> </td> </xsl:when> <xsl:otherwise> <td width="25" align="right"> - <img src="{$img_path}/last-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/last-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <td width="25" align="right"> - <img src="{$img_path}/last-grey.png" border="2" width="12" height="12"/> + <img src="{$img_path}/last-grey.gif" border="2" width="12" height="12"/> </td> </xsl:otherwise> </xsl:choose> <xsl:choose> + <xsl:when test="$allow_all_rows=1"> + <xsl:choose> <xsl:when test="number($all_records) =1"> - <xsl:variable name="all"><xsl:value-of select="link_url"/>&amp;currow=1</xsl:variable> + <xsl:variable name="all"><xsl:value-of select="link_url"/>&amp;start=0</xsl:variable> <td width="25" align="right"> - <a href="{$all}"><img src="{$img_path}/arrow_down.png" border="2" width="12" height="12"/></a> + <a href="{$all}"><img src="{$img_path}/down.gif" border="2" width="12" height="12"/></a> </td> </xsl:when> <xsl:otherwise> <xsl:variable name="all"><xsl:value-of select="link_url"/>&amp;allrows=1</xsl:variable> <td width="25" align="right"> - <a href="{$all}"><img src="{$img_path}/arrow_down.png" border="2" width="12" height="12"/></a> + <a href="{$all}"><img src="{$img_path}/down.gif" border="2" width="12" height="12"/></a> </td> </xsl:otherwise> </xsl:choose> + </xsl:when> + </xsl:choose> </tr> </table> </xsl:template>