/dev/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/trunk

« back to all changes in this revision

Viewing changes to classes/readers/couchreader.php

  • Committer: Nicholas Tan Jerome
  • Date: 2014-05-16 16:20:14 UTC
  • mto: This revision was merged to the branch mainline in revision 359.
  • Revision ID: nicholas.jerome@kit.edu-20140516162014-u8utexhp68mrlfeq
fixed bug on get_all_data query for different groups.

- previously the group is not changing in the data query url.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
 
128
128
                    $this->buffer = $data->rows;
129
129
                }
130
 
 
131
130
                $this->pointer = 0;
132
131
                if ( count($this->buffer) <= (($this->packetSize))) {
133
132
                    $this->hasNextPacket = false;
247
246
        }
248
247
 
249
248
        # build URL for queries
250
 
        $this->view_url = implode("", array($http_method."://",
 
249
        $this->base_view_url = implode("", array($http_method."://",
251
250
                                            $credential,
252
251
                                            $host.":",
253
252
                                            $port."/",
294
293
            $itemlist_id = $groups[$gid]['itemlist_id'];
295
294
            $design_view = $groups[$gid]['design_view'];
296
295
 
297
 
            $this->view_url = str_replace("%design_view%", $design_view, $this->view_url);
 
296
            $this->view_url = str_replace("%design_view%", $design_view, $this->base_view_url);
298
297
 
299
298
            $this->alldata_view = $groups[$gid]['alldata_view'];
300
299
 
459
458
        $ivl = $this->CreateInterval($grp);
460
459
        $ivl->Limit($from, $to);
461
460
 
 
461
        if ($grp) {
 
462
            $groups = array();
 
463
            $options = $this->opts;
 
464
            # Get Groups
 
465
            $groups = $options->Get('groups', false);
 
466
 
 
467
            foreach ($groups as $gid => &$group) {
 
468
                if (($grp)&&(strcmp($grp->gid, $gid))) continue;
 
469
                $design_view = $groups[$gid]['design_view'];
 
470
                $this->view_url = str_replace("%design_view%", $design_view, $this->base_view_url);
 
471
            }
 
472
        }
 
473
 
462
474
        if ($filter) {
463
475
            $mask = $filter->GetItemMask();
464
476
            $resample = $filter->GetSamplingRate();
480
492
            if (strcmp($grp->gid, $key)) continue;
481
493
            $itemList = $value;
482
494
        }
 
495
 
483
496
        $items = array();  
484
497
         
485
498
        if (($mask)&&(is_array($ids = $mask->GetIDs()))) {