Skip to content
Snippets Groups Projects
Commit 886aa1f8 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8

parents 210d8435 a73b53ff
No related branches found
No related tags found
No related merge requests found
...@@ -116,17 +116,20 @@ if (empty($reshook)) ...@@ -116,17 +116,20 @@ if (empty($reshook))
if ($result >= 0) if ($result >= 0)
{ {
// Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); // Define output language
$outputlangs->setDefaultLang($newlang); $outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->modelpdf:GETPOST('model','alpha'), $outputlangs);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
...@@ -142,17 +145,20 @@ if (empty($reshook)) ...@@ -142,17 +145,20 @@ if (empty($reshook))
$result = $object->setDraft($user); $result = $object->setDraft($user);
if ($result >= 0) if ($result >= 0)
{ {
// Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); // Define output language
$outputlangs->setDefaultLang($newlang); $outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->modelpdf:GETPOST('model','alpha'), $outputlangs);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
......
...@@ -582,6 +582,7 @@ Permission38=Export products ...@@ -582,6 +582,7 @@ Permission38=Export products
Permission41=Read projects and tasks (shared project and projects i'm contact for). Can also enter time consumed on assigned tasks (timesheet) Permission41=Read projects and tasks (shared project and projects i'm contact for). Can also enter time consumed on assigned tasks (timesheet)
Permission42=Create/modify projects (shared project and projects i'm contact for) Permission42=Create/modify projects (shared project and projects i'm contact for)
Permission44=Delete projects (shared project and projects i'm contact for) Permission44=Delete projects (shared project and projects i'm contact for)
Permission45=Export projects
Permission61=Read interventions Permission61=Read interventions
Permission62=Create/modify interventions Permission62=Create/modify interventions
Permission64=Delete interventions Permission64=Delete interventions
...@@ -635,6 +636,7 @@ Permission162=Create/modify contracts/subscriptions ...@@ -635,6 +636,7 @@ Permission162=Create/modify contracts/subscriptions
Permission163=Activate a service/subscription of a contract Permission163=Activate a service/subscription of a contract
Permission164=Disable a service/subscription of a contract Permission164=Disable a service/subscription of a contract
Permission165=Delete contracts/subscriptions Permission165=Delete contracts/subscriptions
Permission167=Export contracts
Permission171=Read trips and expenses (yours and your subordinates) Permission171=Read trips and expenses (yours and your subordinates)
Permission172=Create/modify trips and expenses Permission172=Create/modify trips and expenses
Permission173=Delete trips and expenses Permission173=Delete trips and expenses
...@@ -783,6 +785,7 @@ Permission2403=Delete actions (events or tasks) linked to his account ...@@ -783,6 +785,7 @@ Permission2403=Delete actions (events or tasks) linked to his account
Permission2411=Read actions (events or tasks) of others Permission2411=Read actions (events or tasks) of others
Permission2412=Create/modify actions (events or tasks) of others Permission2412=Create/modify actions (events or tasks) of others
Permission2413=Delete actions (events or tasks) of others Permission2413=Delete actions (events or tasks) of others
Permission2414=Export actions/tasks of others
Permission2501=Read/Download documents Permission2501=Read/Download documents
Permission2502=Download documents Permission2502=Download documents
Permission2503=Submit or delete documents Permission2503=Submit or delete documents
......
...@@ -583,6 +583,7 @@ Permission38=Exporter les produits ...@@ -583,6 +583,7 @@ Permission38=Exporter les produits
Permission41=Lire les projets et les tâches (projets publiques et projets dont je suis contact). Peut également entrer le temps consommé sur les tâches assignées (feuille de temps) Permission41=Lire les projets et les tâches (projets publiques et projets dont je suis contact). Peut également entrer le temps consommé sur les tâches assignées (feuille de temps)
Permission42=Créer/modifier les projets et tâches (partagés ou dont je suis contact) Permission42=Créer/modifier les projets et tâches (partagés ou dont je suis contact)
Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact) Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact)
Permission45=Exporter les projets
Permission61=Consulter les interventions Permission61=Consulter les interventions
Permission62=Créer/modifier les interventions Permission62=Créer/modifier les interventions
Permission64=Supprimer les interventions Permission64=Supprimer les interventions
...@@ -772,8 +773,8 @@ Permission20001=Lire les demandes de congé (les vôtres et celle de vos subordo ...@@ -772,8 +773,8 @@ Permission20001=Lire les demandes de congé (les vôtres et celle de vos subordo
Permission20002=Créer/modifier vos demandes de congé Permission20002=Créer/modifier vos demandes de congé
Permission20003=Supprimer les demandes de congé Permission20003=Supprimer les demandes de congé
Permission20004=Lire toutes les demandes de congé (même celle des utilisateurs non subordonnés) Permission20004=Lire toutes les demandes de congé (même celle des utilisateurs non subordonnés)
Permission20005=Create/modify leave requests for everybody Permission20005=Créer/modifier les congés pour tout le monde
Permission20006=Admin leave requests (setup and update balance) Permission20006=Administration des demandes de congés (configuration et mise à jour du solde)
Permission23001=Voir les travaux planifiés Permission23001=Voir les travaux planifiés
Permission23002=Créer/Modifier des travaux planifiées Permission23002=Créer/Modifier des travaux planifiées
Permission23003=Effacer travail planifié Permission23003=Effacer travail planifié
...@@ -1660,7 +1661,7 @@ NotSupportedByAllThemes=Fonctionne avec le thème eldy mais n'est pas pris en ch ...@@ -1660,7 +1661,7 @@ NotSupportedByAllThemes=Fonctionne avec le thème eldy mais n'est pas pris en ch
BackgroundColor=Couleur de fond BackgroundColor=Couleur de fond
TopMenuBackgroundColor=Couleur de fond pour le menu Gauche TopMenuBackgroundColor=Couleur de fond pour le menu Gauche
LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche
BackgroundTableTitleColor=Background color for Table title line BackgroundTableTitleColor=Couleur de fond pour les titres des lignes des tables
BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables
BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales
MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai) MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai)
......
...@@ -33,7 +33,7 @@ $langs->load("suppliers"); ...@@ -33,7 +33,7 @@ $langs->load("suppliers");
$langs->load("banks"); $langs->load("banks");
// Security check // Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = GETPOST('socid', 'int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe','',''); $result = restrictedArea($user, 'societe','','');
...@@ -43,7 +43,7 @@ $hookmanager->initHooks(array('salesrepresentativescard','globalcard')); ...@@ -43,7 +43,7 @@ $hookmanager->initHooks(array('salesrepresentativescard','globalcard'));
* Actions * Actions
*/ */
if($_GET["socid"] && $_GET["commid"]) if (! empty($socid) && $_GET["commid"])
{ {
$action = 'add'; $action = 'add';
...@@ -51,8 +51,8 @@ if($_GET["socid"] && $_GET["commid"]) ...@@ -51,8 +51,8 @@ if($_GET["socid"] && $_GET["commid"])
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->id = $_GET["socid"]; $soc->id = $socid;
$soc->fetch($_GET["socid"]); $soc->fetch($socid);
$parameters=array('id'=>$_GET["commid"]); $parameters=array('id'=>$_GET["commid"]);
...@@ -61,17 +61,17 @@ if($_GET["socid"] && $_GET["commid"]) ...@@ -61,17 +61,17 @@ if($_GET["socid"] && $_GET["commid"])
if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]); if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]);
header("Location: commerciaux.php?socid=".$soc->id); header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$soc->id);
exit; exit;
} }
else else
{ {
header("Location: commerciaux.php?socid=".$_GET["socid"]); header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid);
exit; exit;
} }
} }
if($_GET["socid"] && $_GET["delcommid"]) if (! empty($socid) && $_GET["delcommid"])
{ {
$action = 'delete'; $action = 'delete';
...@@ -87,12 +87,12 @@ if($_GET["socid"] && $_GET["delcommid"]) ...@@ -87,12 +87,12 @@ if($_GET["socid"] && $_GET["delcommid"])
if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]); if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]);
header("Location: commerciaux.php?socid=".$soc->id); header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$soc->id);
exit; exit;
} }
else else
{ {
header("Location: commerciaux.php?socid=".$_GET["socid"]); header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid);
exit; exit;
} }
} }
...@@ -107,11 +107,11 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url); ...@@ -107,11 +107,11 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url);
$form = new Form($db); $form = new Form($db);
if ($_GET["socid"]) if (! empty($socid))
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->id = $_GET["socid"]; $soc->id = $socid;
$result=$soc->fetch($_GET["socid"]); $result=$soc->fetch($socid);
$action='view'; $action='view';
...@@ -190,7 +190,7 @@ if ($_GET["socid"]) ...@@ -190,7 +190,7 @@ if ($_GET["socid"])
print '</a>&nbsp;'; print '</a>&nbsp;';
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
print '<a href="commerciaux.php?socid='.$_GET["socid"].'&amp;delcommid='.$obj->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&amp;delcommid='.$obj->rowid.'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }
...@@ -222,9 +222,17 @@ if ($_GET["socid"]) ...@@ -222,9 +222,17 @@ if ($_GET["socid"])
$langs->load("users"); $langs->load("users");
$title=$langs->trans("ListOfUsers"); $title=$langs->trans("ListOfUsers");
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.login"; $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.login";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.entity IN (0,".$conf->entity.")"; if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode))
{
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE (ug.fk_user = u.rowid";
$sql.= " AND ug.entity = ".$conf->entity.")";
$sql.= " OR u.admin = 1";
}
else
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 "; if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 ";
$sql.= " ORDER BY u.lastname ASC "; $sql.= " ORDER BY u.lastname ASC ";
...@@ -256,7 +264,7 @@ if ($_GET["socid"]) ...@@ -256,7 +264,7 @@ if ($_GET["socid"])
print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n"; print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n";
print '</a>'; print '</a>';
print '</td><td>'.$obj->login.'</td>'; print '</td><td>'.$obj->login.'</td>';
print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';
print '</tr>'."\n"; print '</tr>'."\n";
$i++; $i++;
......
...@@ -2366,7 +2366,18 @@ else ...@@ -2366,7 +2366,18 @@ else
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) if (empty($reshook))
{ {
if (! empty($object->email)) $at_least_one_email_contact = false;
$TContact = $object->contact_array_objects();
foreach ($TContact as &$contact)
{
if (!empty($contact->email))
{
$at_least_one_email_contact = true;
break;
}
}
if (! empty($object->email) || $at_least_one_email_contact)
{ {
$langs->load("mails"); $langs->load("mails");
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendMail').'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendMail').'</a></div>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment