Contact page picto is more clear to distinguish internal from external users.
This commit is contained in:
parent
ba8a2b094a
commit
5fcd6b4af5
@ -31,6 +31,7 @@ For users:
|
|||||||
- New: Distinct status "running not expired" from "running expired" in lines
|
- New: Distinct status "running not expired" from "running expired" in lines
|
||||||
contract status.
|
contract status.
|
||||||
- New: Add a first version of a module for Paybox.
|
- New: Add a first version of a module for Paybox.
|
||||||
|
- New: Can add contact to suppliers orders.
|
||||||
- Fix: Handle correctly the comment in status changing of supplier orders.
|
- Fix: Handle correctly the comment in status changing of supplier orders.
|
||||||
- Fix: Author, title and topic are correctly encoded in PDF.
|
- Fix: Author, title and topic are correctly encoded in PDF.
|
||||||
- Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users.
|
- Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
|
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||||
* Copyright (C) 2005-2007 Destailleur Laurent <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -230,8 +230,8 @@ if ($id > 0)
|
|||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("Internal");
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
@ -260,8 +260,8 @@ if ($id > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("External");
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
@ -315,8 +315,8 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
|
|||||||
@ -232,8 +232,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("Internal");
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
@ -262,8 +262,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("External");
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
@ -317,8 +317,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
|
|||||||
@ -211,9 +211,9 @@ if ($id > 0)
|
|||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("Internal");
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
print $mysoc->nom;
|
print $mysoc->nom;
|
||||||
@ -241,9 +241,9 @@ if ($id > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("External");
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$facture->client->id;
|
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$facture->client->id;
|
||||||
@ -296,8 +296,8 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||||
* Copyright (C) 2005-2007 Destailleur Laurent <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -232,9 +232,9 @@ if ($id > 0)
|
|||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("Internal");
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||||
@ -262,9 +262,9 @@ if ($id > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("External");
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$contrat->societe->id;
|
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$contrat->societe->id;
|
||||||
@ -318,8 +318,8 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
/* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -218,8 +218,8 @@ if ($id > 0)
|
|||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("Internal");
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
@ -248,8 +248,8 @@ if ($id > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("External");
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
@ -303,8 +303,8 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
|
|||||||
392
htdocs/fourn/commande/contact.php
Normal file
392
htdocs/fourn/commande/contact.php
Normal file
@ -0,0 +1,392 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||||
|
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/commande/contact.php
|
||||||
|
\ingroup commande
|
||||||
|
\brief Onglet de gestion des contacts de commande
|
||||||
|
\version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
require ("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||||
|
require_once DOL_DOCUMENT_ROOT."/lib/fourn.lib.php";
|
||||||
|
|
||||||
|
$langs->load("facture");
|
||||||
|
$langs->load("orders");
|
||||||
|
$langs->load("sendings");
|
||||||
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$commandeid = isset($_GET["id"])?$_GET["id"]:'';
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'commande_fournisseur', $commandeid);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ajout d'un nouveau contact
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($_POST["action"] == 'addcontact' && $user->rights->commande->creer)
|
||||||
|
{
|
||||||
|
|
||||||
|
$result = 0;
|
||||||
|
$commande = new CommandeFournisseur($db);
|
||||||
|
$result = $commande->fetch($_GET["id"]);
|
||||||
|
|
||||||
|
if ($result > 0 && $_GET["id"] > 0)
|
||||||
|
{
|
||||||
|
$result = $commande->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
Header("Location: contact.php?id=".$commande->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($commande->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mesg = '<div class="error">'.$commande->error.'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// modification d'un contact. On enregistre le type
|
||||||
|
if ($_POST["action"] == 'updateligne' && $user->rights->commande->creer)
|
||||||
|
{
|
||||||
|
$commande = new CommandeFournisseur($db);
|
||||||
|
if ($commande->fetch($_GET["id"]))
|
||||||
|
{
|
||||||
|
$contact = $commande->detail_contact($_POST["elrowid"]);
|
||||||
|
$type = $_POST["type"];
|
||||||
|
$statut = $contact->statut;
|
||||||
|
|
||||||
|
$result = $commande->update_contact($_POST["elrowid"], $statut, $type);
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db, "result=$result");
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// bascule du statut d'un contact
|
||||||
|
if ($_GET["action"] == 'swapstatut' && $user->rights->commande->creer)
|
||||||
|
{
|
||||||
|
$commande = new CommandeFournisseur($db);
|
||||||
|
if ($commande->fetch($_GET["id"]))
|
||||||
|
{
|
||||||
|
$contact = $commande->detail_contact($_GET["ligne"]);
|
||||||
|
$id_type_contact = $contact->fk_c_type_contact;
|
||||||
|
$statut = ($contact->statut == 4) ? 5 : 4;
|
||||||
|
|
||||||
|
$result = $commande->update_contact($_GET["ligne"], $statut, $id_type_contact);
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db, "result=$result");
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Efface un contact
|
||||||
|
if ($_GET["action"] == 'deleteline' && $user->rights->commande->creer)
|
||||||
|
{
|
||||||
|
$commande = new CommandeFournisseur($db);
|
||||||
|
$commande->fetch($_GET["id"]);
|
||||||
|
$result = $commande->delete_contact($_GET["lineid"]);
|
||||||
|
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
Header("Location: contact.php?id=".$commande->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader('', $langs->trans("Order"), "Commande");
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
$contactstatic=new Contact($db);
|
||||||
|
|
||||||
|
|
||||||
|
/* *************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* Mode vue et edition */
|
||||||
|
/* */
|
||||||
|
/* *************************************************************************** */
|
||||||
|
if (isset($mesg)) print $mesg;
|
||||||
|
|
||||||
|
$id = $_GET['id'];
|
||||||
|
$ref= $_GET['ref'];
|
||||||
|
if ($id > 0 || ! empty($ref))
|
||||||
|
{
|
||||||
|
$langs->trans("OrderCard");
|
||||||
|
$commande = new CommandeFournisseur($db);
|
||||||
|
if ( $commande->fetch($_GET['id'],$_GET['ref']) > 0)
|
||||||
|
{
|
||||||
|
$soc = new Societe($db, $commande->socid);
|
||||||
|
$soc->fetch($commande->socid);
|
||||||
|
|
||||||
|
|
||||||
|
$head = ordersupplier_prepare_head($commande);
|
||||||
|
dolibarr_fiche_head($head, 'contact', $langs->trans("SupplierOrder"));
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Facture synthese pour rappel
|
||||||
|
*/
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $html->showrefnav($commande,'ref','',1,'ref','ref');
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Fournisseur
|
||||||
|
print '<tr><td>'.$langs->trans("Supplier")."</td>";
|
||||||
|
print '<td colspan="2">'.$soc->getNomUrl(1,'supplier').'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lignes de contacts
|
||||||
|
*/
|
||||||
|
echo '<br><table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ajouter une ligne de contact
|
||||||
|
* Non affiché en mode modification de ligne
|
||||||
|
*/
|
||||||
|
if ($_GET["action"] != 'editline' && $user->rights->fournisseur->facture->creer)
|
||||||
|
{
|
||||||
|
// TODO All contacts page should use same code
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Source").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Company").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Contacts").'</td>';
|
||||||
|
print '<td>'.$langs->trans("ContactType").'</td>';
|
||||||
|
print '<td colspan="3"> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var = false;
|
||||||
|
|
||||||
|
print '<form action="contact.php?id='.$id.'" method="post">';
|
||||||
|
print '<input type="hidden" name="action" value="addcontact">';
|
||||||
|
print '<input type="hidden" name="source" value="internal">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
|
// Ligne ajout pour contact interne
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
|
print '<td nowrap="0">';
|
||||||
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td colspan="1">';
|
||||||
|
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td colspan="1">';
|
||||||
|
// On récupère les id des users déjà sélectionnés
|
||||||
|
//$userAlreadySelected = $commande->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||||
|
$html->select_users($user->id,'contactid',0,$userAlreadySelected);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
$commande->selectTypeContact($commande, '', 'type','internal');
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
print '<form action="contact.php?id='.$id.'" method="post">';
|
||||||
|
print '<input type="hidden" name="action" value="addcontact">';
|
||||||
|
print '<input type="hidden" name="source" value="external">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
|
// Ligne ajout pour contact externe
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
|
print '<td nowrap="nowrap">';
|
||||||
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td colspan="1">';
|
||||||
|
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$commande->client->id;
|
||||||
|
$selectedCompany = $commande->selectCompaniesForNewContact($commande, 'id', $selectedCompany, $htmlname = 'newcompany');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td colspan="1">';
|
||||||
|
// On récupère les id des contacts déjà sélectionnés
|
||||||
|
// $contactAlreadySelected = $commande->getListContactId('external'); // On ne doit pas desactiver un contact deja selectionner car on doit pouvoir le seclectionner une deuxieme fois pour un autre type
|
||||||
|
$nbofcontacts=$html->select_contacts($selectedCompany, $selected = '', $htmlname = 'contactid',0,$contactAlreadySelected);
|
||||||
|
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
$commande->selectTypeContact($commande, '', 'type','external');
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"';
|
||||||
|
if (! $nbofcontacts) print ' disabled="true"';
|
||||||
|
print '></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
|
print '<tr><td colspan="6"> </td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Liste des contacts liés
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("Source").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Company").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Contacts").'</td>';
|
||||||
|
print '<td>'.$langs->trans("ContactType").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Status").'</td>';
|
||||||
|
print '<td colspan="2"> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$societe = new Societe($db);
|
||||||
|
$var = true;
|
||||||
|
|
||||||
|
foreach(array('internal','external') as $source)
|
||||||
|
{
|
||||||
|
$tab = $commande->liste_contact(-1,$source);
|
||||||
|
$num=sizeof($tab);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$var = !$var;
|
||||||
|
|
||||||
|
print '<tr '.$bc[$var].' valign="top">';
|
||||||
|
|
||||||
|
// Source
|
||||||
|
print '<td align="left">';
|
||||||
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Societe
|
||||||
|
print '<td align="left">';
|
||||||
|
if ($tab[$i]['socid'] > 0)
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$tab[$i]['socid'].'">';
|
||||||
|
print img_object($langs->trans("ShowCompany"),"company").' '.$societe->get_nom($tab[$i]['socid']);
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
if ($tab[$i]['socid'] < 0)
|
||||||
|
{
|
||||||
|
print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||||
|
}
|
||||||
|
if (! $tab[$i]['socid'])
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Contact
|
||||||
|
print '<td>';
|
||||||
|
if ($tab[$i]['source']=='internal')
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$tab[$i]['id'].'">';
|
||||||
|
print img_object($langs->trans("ShowUser"),"user").' '.$tab[$i]['nom'].'</a>';
|
||||||
|
}
|
||||||
|
if ($tab[$i]['source']=='external')
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$tab[$i]['id'].'">';
|
||||||
|
print img_object($langs->trans("ShowContact"),"contact").' '.$tab[$i]['nom'].'</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Type de contact
|
||||||
|
print '<td>'.$tab[$i]['libelle'].'</td>';
|
||||||
|
|
||||||
|
// Statut
|
||||||
|
print '<td align="center">';
|
||||||
|
// Activation desativation du contact
|
||||||
|
if ($commande->statut >= 0) print '<a href="contact.php?id='.$commande->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">';
|
||||||
|
print $contactstatic->LibStatut($tab[$i]['status'],3);
|
||||||
|
if ($commande->statut >= 0) print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Icon update et delete
|
||||||
|
print '<td align="center" nowrap>';
|
||||||
|
if ($commande->statut < 5 && $user->rights->commande->creer)
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
print '<a href="contact.php?id='.$commande->id.'&action=deleteline&lineid='.$tab[$i]['rowid'].'">';
|
||||||
|
print img_delete();
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$i ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Contrat non trouv
|
||||||
|
print "ErrorRecordNotFound";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
|
||||||
|
llxFooter('$Date$');
|
||||||
|
?>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -16,16 +16,14 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/fourn/contact.php
|
* \file htdocs/fourn/contact.php
|
||||||
\ingroup fournisseur
|
* \ingroup fournisseur
|
||||||
\brief Liste des contacts fournisseurs
|
* \brief Liste des contacts fournisseurs
|
||||||
\version $Revision$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
|
|||||||
@ -219,9 +219,9 @@ if ($id > 0)
|
|||||||
// Ligne ajout pour contact interne
|
// Ligne ajout pour contact interne
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("Internal");
|
print img_object('','user').' '.$langs->trans("Users");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
print $mysoc->nom;
|
print $mysoc->nom;
|
||||||
@ -249,9 +249,9 @@ if ($id > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("External");
|
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td colspan="1">';
|
print '<td colspan="1">';
|
||||||
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$facture->client->id;
|
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$facture->client->id;
|
||||||
@ -304,8 +304,8 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Source
|
// Source
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($tab[$i]['source']=='internal') print $langs->trans("Internal");
|
if ($tab[$i]['source']=='internal') print $langs->trans("User");
|
||||||
if ($tab[$i]['source']=='external') print $langs->trans("External");
|
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
|
|||||||
@ -170,7 +170,7 @@ class CommandeFournisseur extends Commande
|
|||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,6 +25,9 @@ IdThirdParty=Id third party
|
|||||||
IdCompany=Company Id
|
IdCompany=Company Id
|
||||||
IdContact=Contact Id
|
IdContact=Contact Id
|
||||||
Contacts=Contacts
|
Contacts=Contacts
|
||||||
|
ThirdPartyContacts=Third party contacts
|
||||||
|
ThirdPartyContact=Third party contact
|
||||||
|
StatusContactValidated=Status of contact
|
||||||
Company=Company
|
Company=Company
|
||||||
CompanyName=Company name
|
CompanyName=Company name
|
||||||
Companies=Companies
|
Companies=Companies
|
||||||
|
|||||||
@ -25,6 +25,10 @@ IdThirdParty=Id tiers
|
|||||||
IdCompany=Id société
|
IdCompany=Id société
|
||||||
IdContact=Id contact
|
IdContact=Id contact
|
||||||
Contacts=Contacts
|
Contacts=Contacts
|
||||||
|
ThirdPartyContacts=Contacts tiers
|
||||||
|
ThirdPartyContact=Contact tiers
|
||||||
|
StatusContactValidated=Etat du contact
|
||||||
|
CustomerContact=Contact client
|
||||||
Company=Société
|
Company=Société
|
||||||
CompanyName=Raison sociale
|
CompanyName=Raison sociale
|
||||||
Companies=Sociétés
|
Companies=Sociétés
|
||||||
|
|||||||
@ -81,18 +81,24 @@ function ordersupplier_prepare_head($commande)
|
|||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
|
||||||
$head[$h][1] = $langs->trans("OrderCard");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($conf->stock->enabled)
|
if ($conf->stock->enabled)
|
||||||
{
|
{
|
||||||
|
$langs->load("stocks");
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$commande->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$commande->id;
|
||||||
$head[$h][1] = $langs->trans("OrderDispatch");
|
$head[$h][1] = $langs->trans("OrderDispatch");
|
||||||
$head[$h][2] = 'dispatch';
|
$head[$h][2] = 'dispatch';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$commande->id;
|
||||||
|
$head[$h][1] = $langs->trans('OrderContact');
|
||||||
|
$head[$h][2] = 'contact';
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id;
|
||||||
$head[$h][1] = $langs->trans("Note");
|
$head[$h][1] = $langs->trans("Note");
|
||||||
$head[$h][2] = 'note';
|
$head[$h][2] = 'note';
|
||||||
|
|||||||
@ -1287,11 +1287,11 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
|
|||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'facture_fourn', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'facture_fourn', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'facture_fourn', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'facture_fourn', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
|
||||||
|
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'commande_fourn','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'commande_fourn','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'commande_fourn','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'commande_fourn','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'commande_fourn','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|||||||
@ -6,11 +6,11 @@
|
|||||||
-- when current version is 2.4.0 or higher.
|
-- when current version is 2.4.0 or higher.
|
||||||
--
|
--
|
||||||
|
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'commande_fourn','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'commande_fourn','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'commande_fourn','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'commande_fourn','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
|
||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'commande_fourn','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
|
||||||
|
|
||||||
|
|
||||||
alter table llx_expedition_methode change statut active tinyint DEFAULT 1;
|
alter table llx_expedition_methode change statut active tinyint DEFAULT 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user