';
//$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 '';
+ 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 ' ';
- 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 " ";
- print ' ';
-
- // Status
- print ''.$langs->trans("StatusProsp").' '.$object->getLibProspCommStatut(4).' ';
- print '';
- 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 ' ';
+ if ($object->client == 2 || $object->client == 3)
+ {
+ print '';
+ print '';
+ 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 " ";
+ print ' ';
+
+ // Status
+ print ''.$langs->trans("StatusProsp").' '.$object->getLibProspCommStatut(4).' ';
+ print '';
+ 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 ' ';
+ }
// 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.= '';
- if ($show_empty) $out.= ' '."\n";
+ if ($show_empty) $out.= ' '."\n";
$userstatic=new User($this->db);
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 4fb851ce4d3..afd9522801a 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -45,7 +45,9 @@ function societe_prepare_head($object)
if ($object->client==1 || $object->client==2 || $object->client==3 || (isset($object->object) && $object->object->client==1) || (isset($object->object) && $object->object->client==3))
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id;
- $head[$h][1] = $langs->trans("Customer");
+ if ($object->client==2 || $object->client==3) $head[$h][1] = $langs->trans("Prospect");
+ if ($object->client==3) $head[$h][1] .= '/';
+ if ($object->client==1 || $object->client==3) $head[$h][1] .= $langs->trans("Customer");
$head[$h][2] = 'customer';
$h++;
}
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 0ad0ecc0e7e..fff62466958 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -97,7 +97,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
global $conf;
- return array(
+ $resarray=array(
'object_id'=>$object->id,
'object_ref'=>$object->ref,
'object_ref_ext'=>$object->ref_ext,
@@ -120,6 +120,15 @@ class doc_generic_order_odt extends ModelePDFCommandes
'object_note_private'=>$object->note,
'object_note'=>$object->note_public,
);
+
+ // Add vat by rates
+ foreach ($object->lines as $line)
+ {
+ if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0;
+ $resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
+ }
+
+ return $resarray;
}
/**
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index dcf8436636d..37e2b7e32b6 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -105,7 +105,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$sumpayed = $object->getSommePaiement();
$alreadypayed=price($sumpayed,0,$outputlangs);
- return array(
+ $resarray=array(
'object_id'=>$object->id,
'object_ref'=>$object->ref,
'object_ref_ext'=>$object->ref_ext,
@@ -132,6 +132,15 @@ class doc_generic_invoice_odt extends ModelePDFFactures
'object_already_payed'=>$alreadypayed,
'object_remain_to_pay'=>price($object->total_ttc - $sumpayed,0,$outputlangs)
);
+
+ // Add vat by rates
+ foreach ($object->lines as $line)
+ {
+ if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0;
+ $resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
+ }
+
+ return $resarray;
}
/**
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index be0ac3f7d3f..d18c17735ae 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -97,7 +97,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
{
global $conf;
- return array(
+ $resarray=array(
'object_id'=>$object->id,
'object_ref'=>$object->ref,
'object_ref_ext'=>$object->ref_ext,
@@ -119,6 +119,15 @@ class doc_generic_proposal_odt extends ModelePDFPropales
'object_note_private'=>$object->note,
'object_note'=>$object->note_public,
);
+
+ // Add vat by rates
+ foreach ($object->lines as $line)
+ {
+ if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0;
+ $resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
+ }
+
+ return $resarray;
}
/**
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index c6f9ba97874..e9a49faebea 100644
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -113,4 +113,5 @@ NameToCreate=Name of third party to create
YourRole=Your roles
YourQuotaOfUsersIsReached=Your quota of active users is reached !
NbOfUsers=Nb of users
-DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin
\ No newline at end of file
+DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin
+HierarchicalResponsible=Hierarchical responsible
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang
index 40a6f7fb1fe..95ff8a405fc 100644
--- a/htdocs/langs/fr_FR/users.lang
+++ b/htdocs/langs/fr_FR/users.lang
@@ -113,4 +113,5 @@ NameToCreate=Nom du tiers à créer
YourRole=Vos rôles
YourQuotaOfUsersIsReached=Votre quota d'utilisateurs actifs est atteint !
NbOfUsers=Nb d'utilisateurs
-DontDowngradeSuperAdmin=Seul un superadmin peut rétrograder un superadmin
\ No newline at end of file
+DontDowngradeSuperAdmin=Seul un superadmin peut rétrograder un superadmin
+HierarchicalResponsible=Responsable hierarchique
\ No newline at end of file
diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php
index 115a63d7e66..71a1c47b375 100755
--- a/htdocs/theme/amarok/style.css.php
+++ b/htdocs/theme/amarok/style.css.php
@@ -1168,7 +1168,7 @@ div.error {
.product_line_stock_ok { color: #002200; }
.product_line_stock_too_low { color: #664400; }
-
+
.fieldrequired {
font-weight:bold;
color:#333333;
@@ -1469,6 +1469,9 @@ table.cal_event {
margin-bottom:1px;
}
+ul.cal_event { padding-right: 2px; padding-top: 1px; border: none; list-style-type: none; margin: 0 auto; -webkit-padding-start: 2px !important; }
+li.cal_event { border: none; list-style-type: none; }
+
.cal_event a:link {
color:#232323;
font-size:11px;
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 0225c9d6cb8..6e51e2d257e 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2059,12 +2059,19 @@ td.hidden {
.cal_current_month { background: #FFFFFF; border: solid 1px #C0C0C0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today { background: #FFFFFF; border: solid 2px #6C7C7B; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_past { }
-table.cal_event { border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px; }
-table.cal_event td { border: 0px; padding-: 0px; padding-: 2px; padding-top: 0px; padding-bottom: 0px; }
+table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
+ moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
+ background: -webkit-gradient(linear, left top, left bottom, from(#006aac), to(#00438d));
+ }
+table.cal_event td { border: none; padding-: 2px; padding-: 2px; padding-top: 0px; padding-bottom: 0px; }
+ul.cal_event { padding-right: 2px; padding-top: 1px; border: none; list-style-type: none; margin: 0 auto; -webkit-padding-start: 2px !important; }
+li.cal_event { border: none; list-style-type: none; }
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
-.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; }
+.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
/* ============================================================================== */
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 5d0fd96f4bc..6b144c79a08 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1140,6 +1140,7 @@ class User extends CommonObject
$sql.= ", note = '".$this->db->escape($this->note)."'";
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
+ $sql.= ", fk_user = ".($this->fk_user > 0?"'".$this->db->escape($this->fk_user)."'":"null");
$sql.= ", entity = '".$this->entity."'";
$sql.= " WHERE rowid = ".$this->id;
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index cf0e0170c94..7988b68dfd2 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -196,11 +196,6 @@ if ($action == 'add' && $canadduser)
}
}
- // FIXME external module
- $object->webcal_login = $_POST["webcal_login"];
- $object->phenix_login = $_POST["phenix_login"];
- $object->phenix_pass = $_POST["phenix_pass"];
-
// If multicompany is off, admin users must all be on entity 0.
if (! empty($conf->multicompany->enabled))
{
@@ -332,6 +327,7 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->job = GETPOST("job");
$object->signature = GETPOST("signature");
$object->openid = GETPOST("openid");
+ $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
// Get extra fields
foreach($_POST as $key => $value)
@@ -342,11 +338,6 @@ if ($action == 'update' && ! $_POST["cancel"])
}
}
- // FIXME external module
- $object->webcal_login = $_POST["webcal_login"];
- $object->phenix_login = $_POST["phenix_login"];
- $object->phenix_pass = $_POST["phenix_pass"];
-
if (! empty($conf->multicompany->enabled))
{
if (! empty($_POST["superadmin"]))
@@ -936,23 +927,6 @@ if (($action == 'create') || ($action == 'adduserldap'))
}
}
- // Module Webcalendar
- // TODO external module
- if (! empty($conf->webcalendar->enabled))
- {
- print "".''.$langs->trans("LoginWebcal").' ';
- print ' ';
- }
-
- // Module Phenix
- // TODO external module
- if (! empty($conf->phenix->enabled))
- {
- print "".''.$langs->trans("LoginPenix").' ';
- print ' ';
- print "".''.$langs->trans("PassPenix").' ';
- print ' ';
- }
print "
\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 ''.$langs->trans("Lastname").' ';
@@ -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 ''.$langs->trans("Entity").' ';
- if ($object->admin && ! $object->entity)
- {
- print $langs->trans("AllEntities");
- }
- else
- {
- $mc->getInfo($object->entity);
- print $mc->label;
- }
- print " \n";
- }
-
// Type
print ''.$langs->trans("Type").' ';
$type=$langs->trans("Internal");
@@ -1200,7 +1156,7 @@ else
if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
print ' '."\n";
- // ldap sid
+ // Ldap sid
if ($object->ldap_sid)
{
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 " \n";
-
+
+ // Hierarchy
+ print ''.$langs->trans("HierarchicalResponsible").' ';
+ print '';
+ if (empty($object->fk_user)) print $langs->trans("None");
+ else {
+ $huser=new User($db);
+ $huser->fetch($object->fk_user);
+ print $huser->getNomUrl(1);
+ }
+ print ' ';
+ print " \n";
+
// Statut
print ''.$langs->trans("Status").' ';
print '';
@@ -1255,30 +1223,7 @@ else
print ' '.$object->openid.' ';
print " \n";
}
-
- // Module Webcalendar
- // TODO external module
- if (! empty($conf->webcalendar->enabled))
- {
- $langs->load("other");
- print ''.$langs->trans("LoginWebcal").' ';
- print ''.$object->webcal_login.' ';
- print ' '."\n";
- }
-
- // Module Phenix
- // TODO external module
- if (! empty($conf->phenix->enabled))
- {
- $langs->load("other");
- print ''.$langs->trans("LoginPhenix").' ';
- print ''.$object->phenix_login.' ';
- print " \n";
- print ''.$langs->trans("PassPhenix").' ';
- print ''.preg_replace('/./i','*',$object->phenix_pass_crypted).' ';
- 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 ''.$langs->trans("Entity").' ';
+ if ($object->admin && ! $object->entity)
+ {
+ print $langs->trans("AllEntities");
+ }
+ else
+ {
+ $mc->getInfo($object->entity);
+ print $mc->label;
+ }
+ 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 '