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

Qual: Mutualisation code redondant

parent 8f906b93
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
require_once("./pre.inc.php"); require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
...@@ -46,7 +45,7 @@ if ($conf->fichinter->enabled) $langs->load("interventions"); ...@@ -46,7 +45,7 @@ if ($conf->fichinter->enabled) $langs->load("interventions");
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
// Scurit d'accs client et commerciaux // Securite d'acces client et commerciaux
$socid = restrictedArea($user, 'societe', $socid); $socid = restrictedArea($user, 'societe', $socid);
$sortorder=$_GET["sortorder"]; $sortorder=$_GET["sortorder"];
...@@ -129,7 +128,6 @@ if ($mode == 'search') { ...@@ -129,7 +128,6 @@ if ($mode == 'search') {
llxHeader('',$langs->trans('CustomerCard')); llxHeader('',$langs->trans('CustomerCard'));
$actionstatic=new ActionComm($db);
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);
......
<?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-2008 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
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
$langs->load("companies"); $langs->load("companies");
...@@ -101,7 +100,6 @@ if ($mode == 'search') ...@@ -101,7 +100,6 @@ if ($mode == 'search')
llxHeader(); llxHeader();
$actionstatic=new ActionComm($db);
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
......
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 ric Seigne <erics@rycks.com> * Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 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
...@@ -18,20 +18,17 @@ ...@@ -18,20 +18,17 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**
\file htdocs/fourn/fiche.php \file htdocs/fourn/fiche.php
\ingroup fournisseur, facture \ingroup fournisseur, facture
\brief Page de fiche fournisseur \brief Page de fiche fournisseur
\version $Revision$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
$user->getrights(); $user->getrights();
...@@ -42,7 +39,7 @@ $langs->load('orders'); ...@@ -42,7 +39,7 @@ $langs->load('orders');
$langs->load('companies'); $langs->load('companies');
$langs->load('commercial'); $langs->load('commercial');
// Scurit accs client // Securite acces client
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
...@@ -75,7 +72,6 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0 ...@@ -75,7 +72,6 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0
* Mode fiche * Mode fiche
*/ */
$societe = new Fournisseur($db); $societe = new Fournisseur($db);
$actionstatic = new ActionComm($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
if ( $societe->fetch($socid) ) if ( $societe->fetch($socid) )
......
...@@ -130,8 +130,14 @@ function societe_prepare_head($objsoc) ...@@ -130,8 +130,14 @@ function societe_prepare_head($objsoc)
function show_actions_todo($conf,$langs,$db,$objsoc) function show_actions_todo($conf,$langs,$db,$objsoc)
{ {
global $bc;
if ($conf->agenda->enabled) if ($conf->agenda->enabled)
{ {
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
$actionstatic=new ActionComm($db);
$userstatic=new User($db);
print_titre($langs->trans("ActionsOnCompany")); print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
...@@ -250,8 +256,14 @@ function show_actions_todo($conf,$langs,$db,$objsoc) ...@@ -250,8 +256,14 @@ function show_actions_todo($conf,$langs,$db,$objsoc)
function show_actions_done($conf,$langs,$db,$objsoc) function show_actions_done($conf,$langs,$db,$objsoc)
{ {
global $bc;
if ($conf->agenda->enabled) if ($conf->agenda->enabled)
{ {
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
$actionstatic=new ActionComm($db);
$userstatic=new User($db);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>'; print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment