fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12572] fix link to workorder


From: Sigurd Nes
Subject: [Fmsystem-commits] [12572] fix link to workorder
Date: Fri, 09 Jan 2015 14:10:14 +0000

Revision: 12572
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12572
Author:   sigurdne
Date:     2015-01-09 14:10:13 +0000 (Fri, 09 Jan 2015)
Log Message:
-----------
fix link to workorder

Modified Paths:
--------------
    branches/dev-syncromind/property/inc/class.uiworkorder.inc.php

Added Paths:
-----------
    branches/dev-syncromind/property/js/portico/workorder.index.js

Modified: branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiworkorder.inc.php      
2015-01-09 10:35:55 UTC (rev 12571)
+++ branches/dev-syncromind/property/inc/class.uiworkorder.inc.php      
2015-01-09 14:10:13 UTC (rev 12572)
@@ -348,13 +348,7 @@
                     $result_data    =   array('results' =>  $values);
                     $result_data['total_records']   = $this->bo->total_records;
                     $result_data['draw']    = $draw;
-                    
-                     $variable = array(
-                                        'menuaction'=> 
'property.uiproject.edit'
-                                        
-                                      );
-                                 array_walk($result_data['results'], 
array($this, '_add_links'), $variable);
-                    
+ 
                     return $this->jquery_results($result_data);
                 }
                function index()
@@ -390,7 +384,8 @@
                         
                         self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.jeditable.js');
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.dataTables.editable.js');
-                       
+                       self::add_javascript('property', 'portico', 
'workorder.index.js');
+
                        
$GLOBALS['phpgw']->jqcal->add_listener('filter_start_date');
                        
$GLOBALS['phpgw']->jqcal->add_listener('filter_end_date');
                        phpgwapi_jquery::load_widget('datepicker');
@@ -500,16 +495,21 @@
                             #    $params['formatter'] = 
$uicols['formatter'][$k];
                             #}
                             
-                            if($uicols['name'][$k] == 'project_id' || 
$uicols['name'][$k] == 'workorder_id' )
-                            {
-                               $params['formatter'] =  
'JqueryPortico.formatLinktwo';
-                            }
+                            switch($uicols['name'][$k])
+                                                       {
+                                                               case 
'project_id':
+                                                                       
$params['formatter'] =  'linktToProject';
+                                                                       break;
+                                                               case 
'workorder_id':
+                                                                       
$params['formatter'] =  'linktToOrder';
+                                                                       break;
+                                                               case 'loc1':
+                                                                       
$params['formatter'] =  'JqueryPortico.searchLink';
+                                                                       break;
+                                                               default:
+                                                                       break;
+                                                       }
                             
-                            if($uicols['name'][$k] == 'loc1')
-                            {
-                                $params['formatter'] = 
'JqueryPortico.searchLink';
-                            }
-                            
                             array_push($data['datatable']['field'], $params);
                         }
                         
@@ -634,7 +634,7 @@
                             }
                                unset($parameters);
                        }
-                        ;
+
                         self::render_template_xsl('datatable_jquery', $data);
                }
         public function save()

Added: branches/dev-syncromind/property/js/portico/workorder.index.js
===================================================================
--- branches/dev-syncromind/property/js/portico/workorder.index.js              
                (rev 0)
+++ branches/dev-syncromind/property/js/portico/workorder.index.js      
2015-01-09 14:10:13 UTC (rev 12572)
@@ -0,0 +1,18 @@
+
+var oArgs_project = {menuaction: 'property.uiproject.edit'};
+var sUrl_project = phpGWLink('index.php', oArgs_project);
+
+var oArgs_order = {menuaction: 'property.uiworkorder.edit'};
+var sUrl_order = phpGWLink('index.php', oArgs_order);
+
+linktToProject = function(key, oData)
+{
+       var id = oData[key];
+       return '<a href="' + sUrl_project + '&id=' + id + '">' + id + '</a>';
+};
+
+linktToOrder = function(key, oData)
+{
+       var id = oData[key];
+       return '<a href="' + sUrl_order + '&id=' + id + '">' + id + '</a>';
+};
\ No newline at end of file




reply via email to

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