diff --git a/ChangeLog b/ChangeLog index 294c09a6997..68452e0ca4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ For users: - New: Some performance enhancements. - New: Can attach files onto trip and expenses modules. - New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR +- New: Can define a hierarchical responsible on user For developers: - System of menu managers has been rewritten to reduce code to do same things. diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dc48f407c03..cbf8ef0840e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -941,7 +941,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '
'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); print ''; - print ''; - print '
'; + print '
'; print ''; } print '
'; + print '
'; //$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); @@ -1004,8 +1004,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show rect of event print '
'; - print ''; - print '"; - print ''; - - // Status - print ''; - print ''; + if ($object->client == 2 || $object->client == 3) + { + print '"; + print ''; + + // Status + print ''; + print ''; + } // Sales representative include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 28dee6f9383..dcf70443fd8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -994,7 +994,7 @@ class Form global $conf,$user,$langs; // If no preselected user defined, we take current user - if ($selected < -1 && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected=$user->id; + if ((is_numeric($selected) && ($selected < -1 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected=$user->id; // Permettre l'exclusion d'utilisateurs if (is_array($exclude)) $excludeUsers = implode("','",$exclude); @@ -1043,7 +1043,7 @@ class Form if ($num) { $out.= '".''; - print ''; - } - - // Module Phenix - // TODO external module - if (! empty($conf->phenix->enabled)) - { - print "".''; - print ''; - print "".''; - print ''; - } print "
'; + print '
  • '; + print ''; + print '
    '; if ($event->type_code == 'BIRTHDAY') // It's a birthday { print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); @@ -1130,6 +1131,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1); else print ' '; print '
    '; + print '
'; print ''; $i++; } @@ -1174,4 +1176,13 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''."\n"; } +function dol_color_minus($color, $minus) +{ + $newcolor=$color; + $newcolor[0]=((hexdec($newcolor[0])-$minus)<0)?0:dechex((hexdec($newcolor[0])-$minus)); + $newcolor[2]=((hexdec($newcolor[2])-$minus)<0)?0:dechex((hexdec($newcolor[2])-$minus)); + $newcolor[4]=((hexdec($newcolor[4])-$minus)<0)?0:dechex((hexdec($newcolor[4])-$minus)); + return $newcolor; +} + ?> diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 397fb9da835..fcecbf0a552 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -386,29 +386,32 @@ if ($id > 0) } // Level of prospect - print '
'; - print ''; - print '
'; - print $langs->trans('ProspectLevelShort'); - print ''; - if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; - print '
'; - if ($action == 'editlevel') - $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); - else - print $object->getLibProspLevel(); - print "
'.$langs->trans("StatusProsp").''.$object->getLibProspCommStatut(4).''; - if ($object->stcomm_id != -1) print ''.img_action(0,-1).''; - if ($object->stcomm_id != 0) print ''.img_action(0,0).''; - if ($object->stcomm_id != 1) print ''.img_action(0,1).''; - if ($object->stcomm_id != 2) print ''.img_action(0,2).''; - if ($object->stcomm_id != 3) print ''.img_action(0,3).''; - print '
'; + print ''; + print '
'; + print $langs->trans('ProspectLevel'); + print ''; + if ($action != 'editlevel' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Modify'),1).'
'; + print '
'; + if ($action == 'editlevel') + $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); + else + print $object->getLibProspLevel(); + print "
'.$langs->trans("StatusProsp").''.$object->getLibProspCommStatut(4).''; + if ($object->stcomm_id != -1) print ''.img_action(0,-1).''; + if ($object->stcomm_id != 0) print ''.img_action(0,0).''; + if ($object->stcomm_id != 1) print ''.img_action(0,1).''; + if ($object->stcomm_id != 2) print ''.img_action(0,2).''; + if ($object->stcomm_id != 3) print ''.img_action(0,3).''; + print '
'.$langs->trans("LoginWebcal").'
'.$langs->trans("LoginPenix").'
'.$langs->trans("PassPenix").'
\n"; print '

'; @@ -1076,6 +1050,8 @@ else */ if ($action != 'edit') { + $rowspan=16; + print ''; // Ref @@ -1085,13 +1061,9 @@ else print ''; print ''."\n"; - $rowspan=15; if (isset($conf->authmode) && preg_match('/myopenid/',$conf->authmode)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; - if (! empty($conf->webcalendar->enabled)) $rowspan++; // TODO external module - if (! empty($conf->phenix->enabled)) $rowspan+=2; // TODO external module - // Lastname print ''; @@ -1176,22 +1148,6 @@ else } print ''."\n"; - // Multicompany - if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) - { - print '\n"; - } - // Type print ''."\n"; - // ldap sid + // Ldap sid if ($object->ldap_sid) { print '\n"; - + + // Hierarchy + print ''; + print ''; + print "\n"; + // Statut print ''; print ''; print "\n"; } - - // Module Webcalendar - // TODO external module - if (! empty($conf->webcalendar->enabled)) - { - $langs->load("other"); - print ''; - print ''; - print ''."\n"; - } - - // Module Phenix - // TODO external module - if (! empty($conf->phenix->enabled)) - { - $langs->load("other"); - print ''; - print ''; - print "\n"; - print ''; - print ''; - print ''."\n"; - } - + // Company / Contact if (! empty($conf->societe->enabled)) { @@ -1327,6 +1272,22 @@ else print ''."\n"; } + // Multicompany + if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print '\n"; + } + // Other attributes $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1565,18 +1526,16 @@ else if ($action == 'edit' && ($canedituser || ($user->id == $object->id))) { - print ''; + $rowspan=14; + + print ''; print ''; print ''; print ''; print '
'.$langs->trans("Lastname").'
'.$langs->trans("Entity").''; - if ($object->admin && ! $object->entity) - { - print $langs->trans("AllEntities"); - } - else - { - $mc->getInfo($object->entity); - print $mc->label; - } - print "
'.$langs->trans("Type").''; $type=$langs->trans("Internal"); @@ -1200,7 +1156,7 @@ else if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; print '
'.$langs->trans("Type").''; @@ -1232,7 +1188,19 @@ else print '
'.$langs->trans('Signature').''; print dol_textishtml($object->signature)?$object->signature:dol_nl2br($object->signature,1,false); print "
'.$langs->trans("HierarchicalResponsible").''; + if (empty($object->fk_user)) print $langs->trans("None"); + else { + $huser=new User($db); + $huser->fetch($object->fk_user); + print $huser->getNomUrl(1); + } + print '
'.$langs->trans("Status").''; @@ -1255,30 +1223,7 @@ else print ''.$object->openid.'
'.$langs->trans("LoginWebcal").''.$object->webcal_login.' 
'.$langs->trans("LoginPhenix").''.$object->phenix_login.' 
'.$langs->trans("PassPhenix").''.preg_replace('/./i','*',$object->phenix_pass_crypted).' 
'.$langs->trans("Entity").''; + if ($object->admin && ! $object->entity) + { + print $langs->trans("AllEntities"); + } + else + { + $mc->getInfo($object->entity); + print $mc->label; + } + print "
'; - $rowspan=13; - if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; - if (! empty($conf->webcalendar->enabled)) $rowspan++; // TODO external module - if (! empty($conf->phenix->enabled)) $rowspan+=2; // TODO external module print ''; print ''; } - // Multicompany - if (! empty($conf->multicompany->enabled)) - { - if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) - { - print "".''; - print "\n"; - } - else - { - print ''; - } - } - // Type print ''; print ''; - + // openid if (isset($conf->authmode) && preg_match('/myopenid/',$conf->authmode)) { @@ -1861,41 +1805,34 @@ else print ''; } + // Hierarchy + print ''; + print ''; + print "\n"; + // Statut print ''; print ''; - - // Module Webcalendar - // TODO external module - if (! empty($conf->webcalendar->enabled)) - { - $langs->load("other"); - print "".''; - print ''; - } - - // Module Phenix - // TODO external module - if (! empty($conf->phenix->enabled)) - { - $langs->load("other"); - print "".''; - print ''; - print "".''; - print ''; - } - + + // Multicompany + if (! empty($conf->multicompany->enabled)) + { + if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print "".''; + print "\n"; + } + else + { + print ''; + } + } + // Company / Contact if (! empty($conf->societe->enabled)) {
'.$langs->trans("Ref").''; @@ -1748,21 +1707,6 @@ else print '
'.$langs->trans("Entity").'".$mc->select_entities($object->entity); - print "
'.$langs->trans("Type").''; @@ -1843,7 +1787,7 @@ else print ''; print ''; print '
'.$langs->trans("HierarchicalResponsible").''; + print $form->select_dolusers($object->fk_user,'fk_user',1,array($object->id)); + print '
'.$langs->trans("Status").''; print $object->getLibStatut(4); print '
'.$langs->trans("LoginWebcal").''; - if ($caneditfield) print ''; - else print $object->webcal_login; - print '
'.$langs->trans("LoginPhenix").''; - if ($caneditfield) print ''; - else print $object->phenix_login; - print '
'.$langs->trans("PassPhenix").''; - if ($caneditfield) print ''; - else print preg_replace('/./i','*',$object->phenix_pass_crypted); - print '
'.$langs->trans("Entity").'".$mc->select_entities($object->entity); + print "