fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [6674] merge 6671:6673 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [6674] merge 6671:6673 from trunk
Date: Wed, 15 Dec 2010 13:01:37 +0000

Revision: 6674
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6674
Author:   sigurdne
Date:     2010-12-15 13:01:36 +0000 (Wed, 15 Dec 2010)
Log Message:
-----------
merge 6671:6673 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.socustom.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2010-12-15 12:58:04 UTC (rev 6673)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2010-12-15 13:01:36 UTC (rev 6674)
@@ -75,41 +75,42 @@
                        $status_id      = phpgw::get_var('status_id');
                        $allrows        = phpgw::get_var('allrows', 'bool');
                        $this->p_num                    = 
phpgw::get_var('p_num');
-                       if ($start)
+
+
+                       if(isset($_POST['start']) || isset($_GET['start']))
                        {
-                               $this->start=$start;
+                               $this->start = $start;
                        }
-                       else
+                       if(isset($_POST['query']) || isset($_GET['query']))
                        {
-                               $this->start=0;
-                       }
-
-                       if(isset($query))
-                       {
                                $this->query = $query;
                        }
-                       if(isset($filter))
+                       if(isset($_POST['filter']) || isset($_GET['filter']))
                        {
                                $this->filter = $filter;
                        }
-                       if(isset($sort))
+                       if(isset($_POST['sort']) || isset($_GET['sort']))
                        {
                                $this->sort = $sort;
                        }
-                       if(isset($order))
+                       if(isset($_POST['order']) || isset($_GET['order']))
                        {
                                $this->order = $order;
                        }
-                       if(isset($cat_id))
+                       if(isset($_POST['cat_id']) || isset($_GET['cat_id']))
                        {
                                $this->cat_id = $cat_id;
                        }
-                       if(isset($status_id))
+                       if(isset($_POST['status_id']) || 
isset($_GET['status_id']))
                        {
-                               $this->status_id = $status_id;
+                               $this->status_id = $district_id;
                        }
-                       if(isset($allrows))
+                       if(isset($_POST['criteria_id']) || 
isset($_GET['criteria_id']))
                        {
+                               $this->criteria_id = $criteria_id;
+                       }
+                       if($allrows)
+                       {
                                $this->allrows = $allrows;
                        }
                }
@@ -133,7 +134,6 @@
                        $this->order    = $data['order'];
                        $this->cat_id   = $data['cat_id'];
                        $this->status_id        = $data['status_id'];
-                       $this->allrows          = $data['allrows'];
                }
 
                function 
select_degree_list($degree_value='',$degreedefault_type='')
@@ -278,7 +278,7 @@
                        for ($i=0; $i<count($request); $i++)
                        {
                                $request[$i]['coordinator'] = 
$GLOBALS['phpgw']->accounts->id2name($request[$i]['coordinator']);
-                               $request[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($request[$i]['entry_date'],$dateformat);
+                               $request[$i]['start_date'] = 
$GLOBALS['phpgw']->common->show_date($request[$i]['start_date'],$dateformat);
                                if($cols_extra)
                                {
                                        
$location_data=$this->solocation->read_single($request[$i]['location_code']);

Modified: branches/Version-1_0-branch/property/inc/class.socustom.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.socustom.inc.php     
2010-12-15 12:58:04 UTC (rev 6673)
+++ branches/Version-1_0-branch/property/inc/class.socustom.inc.php     
2010-12-15 13:01:36 UTC (rev 6674)
@@ -284,16 +284,13 @@
 
                function read_custom($data)
                {
-                       if(is_array($data))
-                       {
-                               $start          = isset($data['start']) && 
$data['start'] ? $data['start'] : 0;
-                               $filter         = isset($data['filter']) && 
$data['filter'] ? $data['filter'] : 'none';
-                               $query          = isset($data['query']) ? 
$data['query'] : '';
-                               $sort           = isset($data['sort']) && 
$data['sort'] ? $data['sort'] : 'DESC';
-                               $order          = isset($data['order']) ? 
$data['order'] : '';
-                               $allrows        = isset($data['allrows']) ? 
$data['allrows'] : '';
-                               $custom_id      = isset($data['custom_id']) && 
$data['custom_id'] ? (int)$data['custom_id'] : 0;
-                       }
+                       $start          = isset($data['start']) && 
$data['start'] ? $data['start'] : 0;
+                       $filter         = isset($data['filter']) && 
$data['filter'] ? $data['filter'] : 'none';
+                       $query          = isset($data['query']) ? 
$data['query'] : '';
+                       $sort           = isset($data['sort']) && $data['sort'] 
? $data['sort'] : 'DESC';
+                       $order          = isset($data['order']) ? 
$data['order'] : '';
+                       $allrows        = isset($data['allrows']) ? 
$data['allrows'] : '';
+                       $custom_id      = isset($data['custom_id']) && 
$data['custom_id'] ? (int)$data['custom_id'] : 0;
 
                        $this->db->query("SELECT sql_text FROM fm_custom where 
id={$custom_id}",__LINE__,__FILE__);
                        $this->db->next_record();
@@ -326,7 +323,7 @@
                                        $custom[$j][$uicols[$i]['name']] = 
$this->db->f($uicols[$i]['name']);
                                        $custom[$j]['grants'] = 
(int)$grants[$this->db->f('user_id')];
                                }
-                       $j++;
+                               $j++;
                        }
 
 //_debug_array($custom);

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2010-12-15 12:58:04 UTC (rev 6673)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2010-12-15 13:01:36 UTC (rev 6674)
@@ -193,12 +193,12 @@
                        $uicols['descr'][]              = lang('Request');
                        $uicols['statustext'][]         = lang('Request ID');
 
-                       $cols.= ",$entity_table.entry_date";
-                       $cols_return[]                  = 'entry_date';
+                       $cols.= ",$entity_table.start_date";
+                       $cols_return[]                  = 'start_date';
                        $uicols['input_type'][]         = 'text';
-                       $uicols['name'][]               = 'entry_date';
-                       $uicols['descr'][]              = lang('entry date');
-                       $uicols['statustext'][]         = lang('Request entry 
date');
+                       $uicols['name'][]               = 'start_date';
+                       $uicols['descr'][]              = lang('start date');
+                       $uicols['statustext'][]         = lang('Request start 
date');
 
                        $cols.= ",$entity_table.title as title";
                        $cols_return[]                  = 'title';
@@ -249,7 +249,7 @@
                        }
                        else
                        {
-                               $ordermethod = ' order by fm_request.id ASC';
+                               $ordermethod = ' order by fm_request.id DESC';
                        }
 
                        $where = 'WHERE';
@@ -570,18 +570,17 @@
                                $address = 
$this->db->db_addslashes($request['location_name']);
                        }
 
-                       $request['descr'] = 
$this->db->db_addslashes($request['descr']);
-                       $request['name'] = 
$this->db->db_addslashes($request['name']);
-                       $request['title'] = 
$this->db->db_addslashes($request['title']);
+//                     $request['name'] = 
$this->db->db_addslashes($request['name']);
 
                        $value_set = array
                        (
+                               'title'                                 => 
$this->db->db_addslashes($request['title']),
                                'status'                                => 
$request['status'],
                                'category'                              => 
$request['cat_id'],
                                'start_date'                    => 
$request['start_date'],
                                'end_date'                              => 
$request['end_date'],
                                'coordinator'                   => 
$request['coordinator'],
-                               'descr'                                 => 
$request['descr'],
+                               'descr'                                 => 
$this->db->db_addslashes($request['descr']),
                                'budget'                                => 
(int)$request['budget'],
                                'location_code'                 => 
$request['location_code'],
                                'address'                               => 
$address,

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2010-12-15 12:58:04 UTC (rev 6673)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2010-12-15 13:01:36 UTC (rev 6674)
@@ -145,8 +145,12 @@
                                $lookup = true;
                        }
 
+                       $this->save_sessiondata();
+
+                       $dry_run = false;
+
                        if( phpgw::get_var('phpgw_return_as') != 'json' )
-                        {
+                       {
 
                                if(!$lookup)
                                {
@@ -157,11 +161,11 @@
                                        (
                                                'menuaction'                    
=> 'property.uirequest.index',
                                                                        
'lookup'    => $lookup,
-                                                                       
'cat_id'        => $this->cat_id,
-                                                                       
'filter'        => $this->filter,
-                                                                       
'status_id'     => $this->status_id,
+                                       //                              
'cat_id'        => $this->cat_id,
+                                       //                              
'filter'        => $this->filter,
+                                       //                              
'status_id'     => $this->status_id,
                                                                        
'project_id'    => $project_id,
-                                                                       'query' 
        => $this->query,
+                                       //                              'query' 
        => $this->query,
                                                                        'p_num' 
        => $this->p_num,
                                        ));
                                $datatable['config']['allow_allrows'] = true;
@@ -170,10 +174,10 @@
                                                                                
."p_num: '{$this->p_num}',"
                                                                                
                ."query:'{$this->query}',"
                                                                                
."lookup:'{$lookup}',"
-                                                                               
                        ."project_id:'{$project_id}',"
-                                                                               
."filter:'{$this->filter}',"
-                                                                               
."status_id:'{$this->status_id}',"
-                                                                               
."cat_id:'{$this->cat_id}'";
+                                                                               
                        ."project_id:'{$project_id}'";
+                                                       //                      
  ."filter:'{$this->filter}',"
+                                                       //                      
  ."status_id:'{$this->status_id}',"
+                                                       //                      
  ."cat_id:'{$this->cat_id}'";
 
                                $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('select_name' => 'cat_id','selected' => 
$this->cat_id,'globals' => True));
                                $default_value = array ('cat_id'=>'','name'=> 
lang('no category'));
@@ -192,12 +196,12 @@
                                                'action'        => 
$GLOBALS['phpgw']->link('/index.php',
                                                                array(
                                                                        
'menuaction'            => 'property.uirequest.index',
-                                                                       
'lookup'                        => $lookup,
-                                                                       
'cat_id'        => $this->cat_id,
-                                                                       
'filter'        => $this->filter,
-                                                                       
'status_id'     => $this->status_id,
-                                                                       
'project_id'    => $project_id,
-                                                                       'query' 
        => $this->query
+                                                                       
'lookup'                => $lookup,
+                                                                       
'cat_id'                        => $this->cat_id,
+                                                                       
'filter'                        => $this->filter,
+                                                                       
'status_id'                     => $this->status_id,
+                                                                       
'project_id'            => $project_id,
+                                                                       'query' 
                        => $this->query
                                                                )
                                                        ),
                                                'fields'        => array(
@@ -310,10 +314,11 @@
                                {
                                        
unset($datatable['actions']['form'][0]['fields']['field'][4]);
                                }
+                               $dry_run = true;
                        }
 
                        $request_list = array();
-                       $request_list = $this->bo->read(array('project_id' => 
1,'allrows'=>$this->allrows));
+                       $request_list = $this->bo->read(array('project_id' => 
1,'allrows'=>$this->allrows, 'dry_run' => $dry_run));
                        $uicols = $this->bo->uicols;
 
                        $j=0;
@@ -499,7 +504,7 @@
                                        
$datatable['headers']['header'][$i]['format']                   = 
$this->bocommon->translate_datatype_format($uicols['datatype'][$i]);
                                        
$datatable['headers']['header'][$i]['sortable']                 = false;
 
-                                       if($uicols['name'][$i]=='request_id' || 
$uicols['name'][$i]=='budget' ||  $uicols['name'][$i]=='score')
+                                       if($uicols['name'][$i]=='request_id' || 
$uicols['name'][$i]=='budget' ||  $uicols['name'][$i]=='score' ||  
$uicols['name'][$i]=='start_date')
                                        {
                                                
$datatable['headers']['header'][$i]['sortable']         = true;
                                                
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
@@ -544,21 +549,22 @@
                        $datatable['pagination']['records_total']       = 
$this->bo->total_records;
 
 
+                       if($dry_run)
+                       {
+                                       
$datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];           
         
+                       }
+                       else
+                       {
+                               $datatable['pagination']['records_returned']= 
count($entity_list);
+                       }
+
+
+
                        $appname                                        = 
lang('request');
                        $function_msg                           = lang('list 
request');
 
                        if ( (phpgw::get_var("start")== "") && 
(phpgw::get_var("order",'string')== ""))
                        {
-                           //avoid ,in the last page, reformate paginator when 
records are lower than records_returned
-                               if(count($request_list) <= 
$datatable['pagination']['records_limit'])
-                               {
-                                       
$datatable['pagination']['records_returned']= count($request_list);
-                               }
-                               else
-                               {
-                                       
$datatable['pagination']['records_returned']= 
$datatable['pagination']['records_limit'];
-                               }
-
                            $datatable['sorting']['currentPage']        = 1;
                            $datatable['sorting']['order']      = 'request_id'; 
// name key Column in myColumnDef
                            $datatable['sorting']['sort']       = 'asc'; // ASC 
/ DESC
@@ -566,24 +572,11 @@
                    else
                    {
                                $datatable['sorting']['currentPage']    = 
phpgw::get_var('currentPage');
-                           $datatable['pagination']['records_returned']= 
phpgw::get_var('recordsReturned', 'int');
                            $datatable['sorting']['order']  = 
phpgw::get_var('order', 'string'); // name of column of Database
                            $datatable['sorting']['sort']       = 
phpgw::get_var('sort', 'string'); // ASC / DESC
                    }
 
-                       phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       //// cramirez: necesary for include a partucular js
-                       phpgwapi_yui::load_widget('loader');
-                       //cramirez: necesary for use opener . Avoid error JS
-                       phpgwapi_yui::load_widget('tabview');
-                       phpgwapi_yui::load_widget('paginator');
-                       //FIXME this one is only needed when $lookup==true - so 
there is probably an error
-                       phpgwapi_yui::load_widget('animation');
 
-
 //-- BEGIN----------------------------- JSON CODE 
------------------------------
 
                //values for Pagination
@@ -599,20 +592,23 @@
                        );
 
                                // values for datatable
-                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row'])){
+                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
+                       {
                                foreach( $datatable['rows']['row'] as $row )
                                {
                                        $json_row = array();
                                        foreach( $row['column'] as $column)
                                        {
+
                                                if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
                                                {
                                                        
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
                                                }
-                                               elseif(isset($column['format']) 
&& $column['format']== "link")
+                                               else 
if(isset($column['format']) && $column['format']== "link")
                                                {
                                                  $json_row[$column['name']] = 
"<a href='".$column['link']."'>" .$column['value']."</a>";
-                                               }else
+                                               }
+                                               else
                                                {
                                                  $json_row[$column['name']] = 
$column['value'];
                                                }
@@ -636,6 +632,17 @@
                        $datatable['json_data'] = json_encode($json);
 //-------------------- JSON CODE ----------------------
 
+                       phpgwapi_yui::load_widget('dragdrop');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       //// cramirez: necesary for include a partucular js
+                       phpgwapi_yui::load_widget('loader');
+                       //cramirez: necesary for use opener . Avoid error JS
+                       phpgwapi_yui::load_widget('tabview');
+                       phpgwapi_yui::load_widget('paginator');
+                       //FIXME this one is only needed when $lookup==true - so 
there is probably an error
+                       phpgwapi_yui::load_widget('animation');
 
                        // Prepare template variables and process XSLT
                        $template_vars = array();
@@ -660,9 +667,6 @@
 
                        // Prepare YUI Library
                        $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'request.index', 'property' );
-
-                       //$this->save_sessiondata();
-
                }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]