UI > personView > Feature (closed)

Add dropdown list with tags like (customer, employee, etc) / #1424

Summary

v0.08
closed
Jul 19, 2006
30 min ... 2 hours
100%
Jul 19, 2006 / pixtur
Oct 18, 2006 / pixtur
burger, pixtur
 

Attached files

No files uploaded

20 Comments

burger

Aug 16, 2006
version 6
Question
Hello Tom,

Thomas and me, we would like to start programming (when we get our svn login ;) ).
In that context, I would like to know if it's okay to add the dropdown menus and the tabs like described below?

Person:

employee (Mitarbeiter)
  • staff (fester Mitarbeiter)
  • freelancer (freier Mitarbeiter)
  • working student (Werkstudent)
  • apprentice (Auszubildender)
  • intern (Praktikant)
  • ex-employee (ehemaliger Mitarbeiter)
contact person
  • customer (Kunde)
  • prospective customer (Interessent)
  • supplier (Lieferant)
  • partner (Partner)
=> 2 additional tabs to differ employees and contact persons (subtabs of 'Person')

=> new database field 'ptype' --> tinyint(4)

Company:
  • customer (Kunde)
  • prospective customer (Interessent)
  • supplier (Lieferant)
  • partner (Partner)
=> 4 additional tabs to differ the different company types (subtabs of 'Company')

=> new database field 'ctype' --> tinyint(4)

burger

pixtur

Sep 7, 2006
The code works as espected, but...

tune Labeling...

... the options at "Person"-section now look a little bit awkward:
  • Mit Benutzerkonto
  • Andere Personen
  • Mitarbeiter
  • Ansprechpartner
  • Gelöscht
  • Those labels do not make clear, that the lists might display overlapping content. I am not sure how we can fix this.

avoid magic numbers

from db/class_person.inc.php

			{
				$str_perscat = "AND (pers.category BETWEEN 0 AND 5)";
			}
			else if($perscat == PCATEGORY_CONTACT) 
			{
				$str_perscat = "AND (pers.category BETWEEN 6 AND 9)";
			}

Should be written as...

$str_perscat = "AND (pers.category BETWEEN " . PCATEGORY_EMPLOYEE . " AND ". PCATEGORY_EXEMPLOYEE

Counting

  • I do not think we should could those categories steadily. I would suggest...
    • 0 - "undefined" (or "member"?)
    • 10 .. 19 employees
    • 20 .. 30 client staff
  • This would make it easier to add in things we forgott later. Also it's no additional effort in implementation.



burger

Sep 7, 2006
version 3
Changes
Thanks for your comments / tests.

I will adjust the code as recommended.

And what do you think about a different colour (e.g. dark grey) for the "client", "supplier" etc. tabs to differentiate them from the "companies" tab?

burger

Sep 7, 2006
Done
I changed the code as you recommended.

Maybe the idea with the different colours for the tabs is to complicated to realise. So we will think about some other possibilities.

pixtur

Sep 8, 2006
Excellent...
I have to think about this problem and probably do a paint over. Please add a comment, if I do not touch this task for longer than a week. (In later versions we will have the monitor-functions for this...) ;-)

tom


madlyr

Sep 8, 2006
version 2
what about outsorcing?
We sometimes outsource some part of project to other firm.
I'd like to see this kind of company: Outsourcer or Outsourced Company.

pixtur

Sep 8, 2006

binder

Sep 8, 2006
outsourcing == partner?
could outsourcing be subsumized under partner?

madlyr

Sep 8, 2006
outsourcer <> partner :-)
  • partner is a firm with which my firm have some written some business agreement, sometimes just trade discounts, etc.
  • outsourcer is a firm which was employed by my firm

binder

Sep 8, 2006
Reply to outsourcer <> partner :-)
ok. just wanted to be sure not to insert doubles! *G*

pixtur

Sep 15, 2006
version 2
Hi Burger, small comment on the code...
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...







burger

Sep 15, 2006
Comment
  • Sorry for my German comments. This wasn't on purpose and I changed it.
  • Sorry for the '##' comments, too. I also changed it.
  • I need the function getSum() to get the minimum and maximum date of all shown efforts (for the summary). But I should rename it, because the name isn't very significant and suitable. I don't know if it's good to integrate the select-statement in the getEfforts function. Or?

pixtur

Sep 15, 2006
Select statement?
I don't know if it's good to integrate the select-statement in the getEfforts function. Or?


I did not get this one... I think that the XXXX:getAll() / XXX:getXXX() functions are just the perfect places for select statements...

burger

Sep 15, 2006
hmm ...
Maybe I didn't get it?!

So I should (in the function Effort::getEfforts()):
  1. add a new variable like $get_time
  2. make an if-statement like
if($get_time) {
 $str = "SELECT MIN(e.time_start), MAX(e.time_end) FROM {$prefix}effort e
					WHERE e.id = " . intval($effort_ids[0]);
		
			$num = count($effort_ids);
			if($num > 1)
			{
				for($i = 1; $i < $num; $i++)
				{
					$str .= " OR e.id = " . intval($effort_ids[$i]);
				} 
			}
			
			$str .= ";";
}

Or?

pixtur

Sep 18, 2006
why not first query objects?
Although the SQL-statement is excellent and probably extremely fast, just meant to use getEfforts for getting the effort-objects and then sum up the values:

e.g.:
Effort::getEffortSum(&$args) 
{
  $sum=0;
  if($efforts= Effort::getEfforts(&$args))) {
    foreach($efforts as $e) {
      $sum+= strToGMTime($e->time_end) - strToGMTime($e->time_start);
    }
  }
  return $sum;
}

echo "sum=" + Effort::getEffortsSum(array('project')=> $project->id));

Or would this method be too slow?

burger

Sep 19, 2006
Sorry for confusion
I changed the name of the function getSum() to getMinMaxTime().

Originally I liked to use the function getSum() to get the sum of all efforts (like you described at the previous comment), but I found another solution (see effort.inc.php; I hope it's okay like this?).

But I needed another function to get the minimum and the maximum date of all selected efforts. Therefore I changed the code of the function getSum(), but I forgot to rename it.

I hope it's okay for you now?!

(Function getMinMaxTime() is related to the topic Show effort description.)



pixtur

Oct 16, 2006

binder

Oct 16, 2006

pixtur

Oct 16, 2006
ok...
Just cleaning up tickets... ;-)

 

Comment / Update