Hi Burger, small comment on the code... / #2018

Please make sure all comments in the code are plain English and understandable:

from class_company.inc.php

#------------------------------------------------------------
# get companies from db --> alt
#------------------------------------------------------------
    /*public static function &getAll($order_str=NULL, $has_id=NULL, $search=NULL)

This comment is probably not useful for non german speakers. Something like "obsolete" would be more appropriate. Since your English is much better, than mine, I hope you do not take this too personal ;-)

 

SQL-Comments

Are the "##" comment in the SQL-Statement valid? I never have seen this syntax before and just want to be sure we do not break compatibility:

from class_company.inc.php

               $str= "SELECT DISTINCT c.*, ic.* from {$prefix}company c, {$prefix}project p, {$prefix}projectperson upp, {$prefix}item ic
                 WHERE
                        upp.person = {$auth->cur_user->id}
                    AND upp.state = 1         ## upp all user projectpersons 

                    AND  upp.project = p.id  ## all user projects 
                       AND  p.company = c.id    ## all companies 
                       AND  c.state = 1
                       $str_has_id
                         AND c.id = ic.id


                      $AND_match

                ". getOrderByString($order_str, 'c.name');


getSum()?

What excactly is the getSum()-function for? I think that the function name does not explain this too good and I don't really understand the code. Wouldn't it be better to use the Effort::getAll() function for querying the SQL-database and then sum up the results? I have the feeling that SQL-code is very error prone should be be use as rarely as possible...