Fix: bad link and uniformize code

This commit is contained in:
Regis Houssin 2012-08-01 18:40:47 +02:00
parent 2e73cd7ddf
commit 9451edafd8
5 changed files with 21 additions and 26 deletions

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,7 +40,7 @@ $socid=0;
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$ref = GETPOST("ref"); $ref = GETPOST("ref");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'propale', $id, 'propal'); $result = restrictedArea($user, 'propal', $id);
/* /*

View File

@ -43,7 +43,7 @@ $action=GETPOST('action','alpha');
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'propale', $id, 'propal'); $result = restrictedArea($user, 'propal', $id);
$object = new Propal($db); $object = new Propal($db);

View File

@ -27,8 +27,6 @@ require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT ."/comm/propal/class/propal.class.php"); require_once(DOL_DOCUMENT_ROOT ."/comm/propal/class/propal.class.php");
if (!$user->rights->propale->lire) accessforbidden();
$langs->load("propal"); $langs->load("propal");
$langs->load("companies"); $langs->load("companies");
@ -39,7 +37,7 @@ if (isset($user->societe_id) && $user->societe_id > 0)
$action = ''; $action = '';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result = restrictedArea($user, 'propal');
/* /*
@ -65,7 +63,7 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
*/ */
$var=false; $var=false;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchPropal").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchPropal").'</td></tr>';
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 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
* 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
@ -31,11 +31,12 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/propal.lib.php");
$langs->load('propal'); $langs->load('propal');
$langs->load('compta'); $langs->load('compta');
$id = isset($_GET["id"])?$_GET["id"]:''; $id=GETPOST('id','int');
$socid=GETPOST('socid','int');
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if (! empty($user->societe_id)) $socid=$user->societe_id;
$result = restrictedArea($user, 'propale', $id, 'propal'); $result = restrictedArea($user, 'propal', $id);
/* /*
@ -44,25 +45,22 @@ $result = restrictedArea($user, 'propale', $id, 'propal');
llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
$propal = new Propal($db); $object = new Propal($db);
$propal->fetch($_GET["id"]); $object->fetch($id);
$object->fetch_thirdparty();
$societe = new Societe($db); $head = propal_prepare_head($object);
$societe->fetch($propal->socid);
$head = propal_prepare_head($propal);
dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal'); dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal');
$propal->info($propal->id); $object->info($object->id);
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dol_print_object_info($propal); dol_print_object_info($object);
print '</td></tr></table>'; print '</td></tr></table>';
print '</div>'; print '</div>';
$db->close();
llxFooter(); llxFooter();
$db->close();
?> ?>

View File

@ -67,7 +67,8 @@ $month=GETPOST("month");
$NBLINES=4; $NBLINES=4;
// Security check // Security check
$module='propale'; $module='propal';
$dbtable='';
if (isset($socid)) if (isset($socid))
{ {
$objectid=$socid; $objectid=$socid;
@ -77,8 +78,6 @@ if (isset($socid))
else if (isset($id) && $id > 0) else if (isset($id) && $id > 0)
{ {
$objectid=$id; $objectid=$id;
$module='propale';
$dbtable='propal';
} }
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, $module, $objectid, $dbtable); $result = restrictedArea($user, $module, $objectid, $dbtable);