Changeset 17941

Show
Ignore:
Timestamp:
10/06/08 01:25:29 (2 months ago)
Author:
flack
Message:

small cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/org.openpsa.sales/salesproject.php

    r17922 r17941  
    176176            } 
    177177        } 
    178         usort($sort_prev, 'org_openpsa_sales_salesproject_sort_action_by_time_reverse'); 
    179         usort($sort_next, 'org_openpsa_sales_salesproject_sort_action_by_time'); 
     178        usort($sort_prev, array('org_openpsa_sales_salesproject', '_sort_action_by_time_reverse')); 
     179        usort($sort_next, array('org_openpsa_sales_salesproject', '_sort_action_by_time')); 
    180180        debug_add("sort_next \n===\n" . sprint_r($sort_next) . "===\n"); 
    181181        debug_add("sort_prev \n===\n" . sprint_r($sort_prev) . "===\n"); 
     
    387387        } 
    388388    } 
     389 
     390        /** 
     391         * For sorting arrays in get_actions method 
     392         */ 
     393        private function _sort_action_by_time($a, $b) 
     394        { 
     395            $ap = $a['time']; 
     396            $bp = $b['time']; 
     397            if ($ap > $bp) 
     398            { 
     399                return 1; 
     400            } 
     401            if ($ap < $bp) 
     402            { 
     403                return -1; 
     404            } 
     405            return 0; 
     406        } 
     407         
     408        /** 
     409         * For sorting arrays in get_actions method 
     410         */ 
     411        private function _sort_action_by_time_reverse($a, $b) 
     412        { 
     413            $ap = $a['time']; 
     414            $bp = $b['time']; 
     415            if ($ap < $bp) 
     416            { 
     417                return 1; 
     418            } 
     419            if ($ap > $bp) 
     420            { 
     421                return -1; 
     422            } 
     423            return 0; 
     424        } 
     425 
    389426} 
    390427 
    391 /** 
    392  * For sorting arrays in get_actions method (usort doesn't like even static methods) 
    393  */ 
    394 function org_openpsa_sales_salesproject_sort_action_by_time($a, $b) 
    395 { 
    396     $ap = $a['time']; 
    397     $bp = $b['time']; 
    398     if ($ap > $bp) 
    399     { 
    400         return 1; 
    401     } 
    402     if ($ap < $bp) 
    403     { 
    404         return -1; 
    405     } 
    406     return 0; 
    407 } 
    408  
    409 /** 
    410  * For sorting arrays in get_actions method (usort doesn't like even static methods) 
    411  */ 
    412 function org_openpsa_sales_salesproject_sort_action_by_time_reverse($a, $b) 
    413 { 
    414     $ap = $a['time']; 
    415     $bp = $b['time']; 
    416     if ($ap < $bp) 
    417     { 
    418         return 1; 
    419     } 
    420     if ($ap > $bp) 
    421     { 
    422         return -1; 
    423     } 
    424     return 0; 
    425 } 
    426  
    427428?>