Qual: Uniformize code (navigation on objects)
Qual: Code to support filter on entity on objects navigation is simpler.
This commit is contained in:
parent
c1ab2cd23b
commit
bbcefa8864
@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/comm/propal/contact.php
|
||||
\ingroup propal
|
||||
\brief Onglet de gestion des contacts de propal
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/comm/propal/contact.php
|
||||
* \ingroup propal
|
||||
* \brief Onglet de gestion des contacts de propal
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require ("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||
@ -162,11 +162,12 @@ $contactstatic=new Contact($db);
|
||||
/* *************************************************************************** */
|
||||
if (isset($mesg)) print $mesg;
|
||||
|
||||
$id = $_GET["propalid"];
|
||||
if ($id > 0)
|
||||
$id = $_GET['propalid'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$propal = New Propal($db);
|
||||
if ( $propal->fetch($_GET['propalid']) > 0)
|
||||
if ( $propal->fetch($id,$ref) > 0)
|
||||
{
|
||||
$soc = new Societe($db, $propal->socid);
|
||||
$soc->fetch($propal->socid);
|
||||
@ -181,10 +182,12 @@ if ($id > 0)
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback="<a href=\"".$_SERVER["PHP_SELF"]."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $propal->ref;
|
||||
print "</td></tr>";
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref','');
|
||||
print '</td></tr>';
|
||||
|
||||
// Ref client
|
||||
print '<tr><td>';
|
||||
|
||||
@ -20,11 +20,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/comm/propal/document.php
|
||||
\ingroup propale
|
||||
\brief Page de gestion des documents attach<EFBFBD>es <EFBFBD> une proposition commerciale
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/comm/propal/document.php
|
||||
* \ingroup propale
|
||||
* \brief Page de gestion des documents attach<EFBFBD>es <EFBFBD> une proposition commerciale
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require('./pre.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||
@ -109,15 +109,19 @@ if ($action=='delete')
|
||||
|
||||
|
||||
/*
|
||||
* Affichage
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($propalid > 0)
|
||||
$html = new Form($db);
|
||||
|
||||
$id = $_GET['propalid'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$propal = new Propal($db);
|
||||
if ($propal->fetch($propalid))
|
||||
if ($propal->fetch($id,$ref))
|
||||
{
|
||||
$upload_dir = $conf->propale->dir_output.'/'.dol_sanitizeFileName($propal->ref);
|
||||
|
||||
@ -139,11 +143,29 @@ if ($propalid > 0)
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$propal->ref.'</td></tr>';
|
||||
$linkback="<a href=\"".$_SERVER["PHP_SELF"]."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";
|
||||
|
||||
// Soci<63>t<EFBFBD>
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref','');
|
||||
print '</td></tr>';
|
||||
|
||||
// Ref client
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print $propal->ref_client;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Customer
|
||||
if ( is_null($propal->client) )
|
||||
$propal->fetch_client();
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
print '<td colspan="3">'.$propal->client->getNomUrl(1).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
@ -20,10 +20,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/comm/propal/note.php
|
||||
\ingroup propale
|
||||
\brief Fiche d'information sur une proposition commerciale
|
||||
\version $Id$
|
||||
* \file htdocs/comm/propal/note.php
|
||||
* \ingroup propale
|
||||
* \brief Fiche d'information sur une proposition commerciale
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require('./pre.inc.php');
|
||||
@ -94,14 +94,16 @@ llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
if ($_GET['propalid'])
|
||||
$id = $_GET['propalid'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
$now=gmmktime();
|
||||
|
||||
$propal = new Propal($db);
|
||||
if ( $propal->fetch($_GET['propalid']) )
|
||||
if ($propal->fetch($id, $ref))
|
||||
{
|
||||
$societe = new Societe($db);
|
||||
if ( $societe->fetch($propal->socid) )
|
||||
@ -111,10 +113,29 @@ if ($_GET['propalid'])
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$propal->ref.'</td></tr>';
|
||||
$linkback="<a href=\"".$_SERVER["PHP_SELF"]."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";
|
||||
|
||||
// Societe
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref','');
|
||||
print '</td></tr>';
|
||||
|
||||
// Ref client
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
|
||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print $propal->ref_client;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Customer
|
||||
if ( is_null($propal->client) )
|
||||
$propal->fetch_client();
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
print '<td colspan="3">'.$propal->client->getNomUrl(1).'</td></tr>';
|
||||
|
||||
// Ligne info remises tiers
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
|
||||
@ -122,7 +143,7 @@ if ($_GET['propalid'])
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$societe->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -42,6 +42,7 @@ class Commande extends CommonObject
|
||||
var $table_element='commande';
|
||||
var $table_element_line = 'commandedet';
|
||||
var $fk_element = 'fk_commande';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id ;
|
||||
|
||||
|
||||
@ -406,22 +406,29 @@ class CommonObject
|
||||
/**
|
||||
* \brief Load properties id_previous and id_next
|
||||
* \param filter Optional filter
|
||||
* \param fieldid Nom du champ a utiliser pour select next et previous
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* \param fieldid Name of field to use for the select MAX and MIN
|
||||
* \return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_previous_next_ref($filter='',$fieldid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (! $this->table_element)
|
||||
{
|
||||
dol_syslog("CommonObject::load_previous_next was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// this->ismultientitymanaged contains
|
||||
// 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
$sql = "SELECT MAX(".$fieldid.")";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
if ($this->table_optional) $sql.= ", ".MAIN_DB_PREFIX.$this->table_optional;
|
||||
$sql.= " WHERE ".$fieldid." < '".addslashes($this->ref)."'";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as te";
|
||||
if ($this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
|
||||
$sql.= " WHERE te.".$fieldid." < '".addslashes($this->ref)."'";
|
||||
if (isset($filter)) $sql.=" AND ".$filter;
|
||||
if ($this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
||||
if ($this->ismultientitymanaged > 0) $sql.= ' AND entity IN (0,'.$conf->entity.')';
|
||||
|
||||
//print $sql."<br>";
|
||||
$result = $this->db->query($sql) ;
|
||||
@ -435,11 +442,13 @@ class CommonObject
|
||||
|
||||
|
||||
$sql = "SELECT MIN(".$fieldid.")";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
if ($this->table_optional) $sql.= ", ".MAIN_DB_PREFIX.$this->table_optional;
|
||||
$sql.= " WHERE ".$fieldid." > '".addslashes($this->ref)."'";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as te";
|
||||
if ($this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
|
||||
$sql.= " WHERE te.".$fieldid." > '".addslashes($this->ref)."'";
|
||||
if (isset($filter)) $sql.=" AND ".$filter;
|
||||
// Rem: Bug in some mysql version: SELECT rowid FROM llx_socpeople WHERE rowid > 1 when one row in database with rowid=1, returns 1 instead of null
|
||||
if ($this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
||||
if ($this->ismultientitymanaged > 0) $sql.= ' AND entity IN (0,'.$conf->entity.')';
|
||||
// Rem: Bug in some mysql version: SELECT MIN(rowid) FROM llx_socpeople WHERE rowid > 1 when one row in database with rowid=1, returns 1 instead of null
|
||||
|
||||
//print $sql."<br>";
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
@ -1977,7 +1977,7 @@ else
|
||||
$facstatic = new Facture($db);
|
||||
|
||||
$fac = new Facture($db);
|
||||
$result=$fac->fetch($_GET['facid'],$_GET['ref']);
|
||||
$result=$fac->fetch($id,$ref);
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($user->societe_id>0 && $user->societe_id!=$fac->socid) accessforbidden('',0);
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
require ("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/discount.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/html.formcompany.class.php');
|
||||
|
||||
@ -159,11 +160,13 @@ $contactstatic=new Contact($db);
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
if (isset($mesg)) print $mesg;
|
||||
$id = $_GET["facid"];
|
||||
if ($id > 0)
|
||||
|
||||
$id = $_GET['facid'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$facture = New Facture($db);
|
||||
if ( $facture->fetch($_GET['facid'], $user->societe_id) > 0)
|
||||
$facture = new Facture($db);
|
||||
if ($facture->fetch($id, $ref) > 0)
|
||||
{
|
||||
$facture->fetch_client();
|
||||
|
||||
@ -176,10 +179,22 @@ if ($id > 0)
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference du facture
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $facture->ref;
|
||||
print "</td></tr>";
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="3">';
|
||||
$morehtmlref='';
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$result=$discount->fetch(0,$facture->id);
|
||||
if ($result > 0)
|
||||
{
|
||||
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error('',$discount->error);
|
||||
}
|
||||
print $html->showrefnav($facture,'ref','',1,'facnumber','ref',$morehtmlref);
|
||||
print '</td></tr>';
|
||||
|
||||
// Customer
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
|
||||
@ -20,14 +20,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/facture/document.php
|
||||
\ingroup facture
|
||||
\brief Page de gestion des documents attach<EFBFBD>es <EFBFBD> une facture
|
||||
\version $Id$
|
||||
* \file htdocs/compta/facture/document.php
|
||||
* \ingroup facture
|
||||
* \brief Page for attached files on invoices
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require('./pre.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/discount.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/invoice.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
@ -109,15 +110,19 @@ if ($action=='delete')
|
||||
}
|
||||
|
||||
/*
|
||||
* Affichage
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($facid > 0)
|
||||
$html = new Form($db);
|
||||
|
||||
$id = $_GET['facid'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$facture = new Facture($db);
|
||||
if ($facture->fetch($facid))
|
||||
if ($facture->fetch($id,$ref) > 0)
|
||||
{
|
||||
$upload_dir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($facture->ref);
|
||||
|
||||
@ -141,9 +146,23 @@ if ($facid > 0)
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$facture->ref.'</td></tr>';
|
||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="3">';
|
||||
$morehtmlref='';
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$result=$discount->fetch(0,$facture->id);
|
||||
if ($result > 0)
|
||||
{
|
||||
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error('',$discount->error);
|
||||
}
|
||||
print $html->showrefnav($facture,'ref','',1,'facnumber','ref',$morehtmlref);
|
||||
print '</td></tr>';
|
||||
|
||||
// Soci<63>t<EFBFBD>
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>';
|
||||
|
||||
@ -18,13 +18,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/facture/info.php
|
||||
\ingroup facture
|
||||
\brief Page des informations d'une facture
|
||||
\version $Id$
|
||||
* \file htdocs/compta/facture/info.php
|
||||
* \ingroup facture
|
||||
* \brief Page des informations d'une facture
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/discount.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||
|
||||
|
||||
@ -18,13 +18,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/facture/note.php
|
||||
\ingroup facture
|
||||
\brief Fiche de notes sur une facture
|
||||
\version $Id$
|
||||
* \file htdocs/compta/facture/note.php
|
||||
* \ingroup facture
|
||||
* \brief Fiche de notes sur une facture
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/discount.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||
|
||||
$socid=isset($_GET["socid"])?$_GET["socid"]:isset($_POST["socid"])?$_POST["socid"]:"";
|
||||
@ -93,9 +95,14 @@ llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
if ($_GET["facid"])
|
||||
$id = $_GET['facid'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$soc = new Societe($db, $fac->socid);
|
||||
$fac = new Facture($db);
|
||||
$fac->fetch($id,$ref);
|
||||
|
||||
$soc = new Societe($db, $fac->socid);
|
||||
$soc->fetch($fac->socid);
|
||||
|
||||
$head = facture_prepare_head($fac);
|
||||
@ -104,10 +111,24 @@ if ($_GET["facid"])
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Reference
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="3">'.$fac->ref.'</td></tr>';
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="3">';
|
||||
$morehtmlref='';
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$result=$discount->fetch(0,$fac->id);
|
||||
if ($result > 0)
|
||||
{
|
||||
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error('',$discount->error);
|
||||
}
|
||||
print $html->showrefnav($fac,'ref','',1,'facnumber','ref',$morehtmlref);
|
||||
print '</td></tr>';
|
||||
|
||||
// Soci<63>t<EFBFBD>
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td colspan="3">'.$soc->getNomUrl(1,'compta').'</td>';
|
||||
|
||||
|
||||
@ -151,15 +151,14 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
|
||||
/*
|
||||
* Fiche propal
|
||||
*
|
||||
* Proposal card
|
||||
*/
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback="<a href=\"propal.php?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";
|
||||
$linkback="<a href=\"".$_SERVER["PHP_SELF"]."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder\">".$langs->trans("BackToList")."</a>";
|
||||
|
||||
// Ref
|
||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">';
|
||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">';
|
||||
print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref','');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ class Facture extends CommonObject
|
||||
var $table_element='facture';
|
||||
var $table_element_line = 'facturedet';
|
||||
var $fk_element = 'fk_facture';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $table;
|
||||
var $tabledetail;
|
||||
|
||||
@ -478,7 +478,6 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
|
||||
|
||||
|
||||
$html = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
$formorder = new FormOrder($db);
|
||||
@ -501,7 +500,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$commande = new CommandeFournisseur($db);
|
||||
|
||||
$result=$commande->fetch($_REQUEST['id'],$_REQUEST['ref']);
|
||||
$result=$commande->fetch($id,$ref);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
|
||||
@ -94,10 +94,10 @@ if ( $societe->fetch($socid) )
|
||||
|
||||
// Phone
|
||||
print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').'</td>';
|
||||
|
||||
|
||||
// Fax
|
||||
print '<td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id,'AC_FAX').'</td></tr>';
|
||||
|
||||
|
||||
// EMail
|
||||
print '<td>'.$langs->trans('EMail').'</td><td colspan="3">'.dol_print_email($societe->email,0,$societe->id,'AC_EMAIL').'</td></tr>';
|
||||
|
||||
@ -140,114 +140,107 @@ if ( $societe->fetch($socid) )
|
||||
print '</a></td></tr></table>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Liste des commandes associees
|
||||
* Last orders
|
||||
*/
|
||||
$orderstatic = new CommandeFournisseur($db);
|
||||
|
||||
$sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||
$sql.= " WHERE p.fk_soc =".$societe->id;
|
||||
$sql.= " ORDER BY p.date_commande DESC";
|
||||
$sql.= " ".$db->plimit($MAXLIST);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
if ($user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num > 0)
|
||||
$sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||
$sql.= " WHERE p.fk_soc =".$societe->id;
|
||||
$sql.= " ORDER BY p.date_commande DESC";
|
||||
$sql.= " ".$db->plimit($MAXLIST);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($resql);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print '<table class="noborder" width="100%"><tr><td>'.$langs->trans("LastOrders",($num<$MAXLIST?$num:$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a href="commande/liste.php?socid='.$societe->id.'">'.$langs->trans("AllOrders").' ('.$num.')</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
while ($i < $num && $i <= $MAXLIST)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
while ($i < $num && $i <= $MAXLIST)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.'</a></td>';
|
||||
print '<td align="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
print dol_print_date($obj->dc,'day');
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.'</a></td>';
|
||||
print '<td align="center" width="80">';
|
||||
if ($obj->dc)
|
||||
{
|
||||
print dol_print_date($obj->dc,'day');
|
||||
}
|
||||
else
|
||||
{
|
||||
print "-";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.$orderstatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "-";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.$orderstatic->LibStatut($obj->fk_statut,5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
if ($num > 0)
|
||||
{
|
||||
$db->free($resql);
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Liste des factures associees
|
||||
* Last invoices
|
||||
*/
|
||||
$MAXLIST=5;
|
||||
|
||||
$langs->load('bills');
|
||||
$facturestatic = new FactureFournisseur($db);
|
||||
|
||||
$sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p';
|
||||
$sql.= ' WHERE p.fk_soc = '.$societe->id;
|
||||
$sql.= ' ORDER BY p.datef DESC';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num > 0)
|
||||
$sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p';
|
||||
$sql.= ' WHERE p.fk_soc = '.$societe->id;
|
||||
$sql.= ' ORDER BY p.datef DESC';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($resql);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">';
|
||||
print '<table class="noborder" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="facture/index.php?socid='.$societe->id.'">'.$langs->trans('AllBills').' ('.$num.')</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
while ($i < min($num,$MAXLIST))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
|
||||
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dol_trunc($obj->libelle,14).'</td>';
|
||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($obj->df,'day').'</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
if ($num > 0)
|
||||
{
|
||||
while ($i < min($num,$MAXLIST))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
|
||||
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dol_trunc($obj->libelle,14).'</td>';
|
||||
print '<td align="center" nowrap="nowrap">'.dol_print_date($obj->df,'day').'</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
@ -36,15 +36,17 @@ require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
|
||||
*/
|
||||
class CommandeFournisseur extends Commande
|
||||
{
|
||||
var $id ;
|
||||
var $db ;
|
||||
var $error;
|
||||
|
||||
var $element='order_supplier';
|
||||
var $table_element='commande_fournisseur';
|
||||
var $table_element_line = 'commande_fournisseurdet';
|
||||
var $fk_element = 'fk_commande';
|
||||
var $table_optional = 'societe as s';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id ;
|
||||
var $ref;
|
||||
var $brouillon;
|
||||
|
||||
|
||||
@ -120,8 +122,6 @@ class CommandeFournisseur extends Commande
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
|
||||
$this->next_prev_filter = 'fk_soc = s.rowid AND s.entity = '.$conf->entity;
|
||||
|
||||
$this->db->free();
|
||||
|
||||
if ($this->statut == 0) $this->brouillon = 1;
|
||||
|
||||
@ -38,11 +38,13 @@ class FactureFournisseur extends Facture
|
||||
{
|
||||
var $id;
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
var $element='facture_fourn';
|
||||
var $table_element='facture_fourn';
|
||||
var $table_element_line='facture_fourn_det';
|
||||
var $fk_element='fk_facture_fourn';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $ref;
|
||||
var $ref_supplier;
|
||||
@ -212,6 +214,8 @@ class FactureFournisseur extends Facture
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = 'SELECT libelle, facnumber, amount, remise, '.$this->db->pdate(datef).'as df,';
|
||||
$sql.= ' total_ht, total_tva, total_ttc, fk_user_author,';
|
||||
$sql.= ' fk_statut, fk_projet as fk_project, paye, f.note, f.note_public,';
|
||||
|
||||
@ -2720,7 +2720,7 @@ class Form
|
||||
4=>$langs->trans("Day4"),
|
||||
5=>$langs->trans("Day5"),
|
||||
6=>$langs->trans("Day6"));
|
||||
|
||||
|
||||
$select_week = '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
@ -2741,7 +2741,7 @@ class Form
|
||||
$select_week .= '</select>';
|
||||
return $select_week;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return HTML combo list of month
|
||||
* \param selected Preselected value
|
||||
@ -2773,7 +2773,7 @@ class Form
|
||||
$select_month .= '</select>';
|
||||
return $select_month;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return HTML combo list of years
|
||||
* \param selected Preselected value
|
||||
@ -2826,6 +2826,7 @@ class Form
|
||||
{
|
||||
$ret='';
|
||||
|
||||
//print "$paramid,$morehtml,$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
||||
$object->load_previous_next_ref($object->next_prev_filter,$fieldid);
|
||||
$previous_ref = $object->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.img_previous().'</a>':'';
|
||||
$next_ref = $object->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.img_next().'</a>':'';
|
||||
|
||||
@ -121,7 +121,7 @@ class FormFile
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche la cartouche de la liste des documents d'une propale, facture...
|
||||
* \brief Show the box with list of available documents for object
|
||||
* \param modulepart propal=propal, facture=facture, ...
|
||||
* \param filename Sub dir to scan (use '' if filedir already complete)
|
||||
* \param filedir Dir to scan
|
||||
@ -130,8 +130,8 @@ class FormFile
|
||||
* \param delallowed Remove is allowed (1/0)
|
||||
* \param modelselected Model to preselect by default
|
||||
* \param modelliste Tableau des modeles possibles. Use '' to hide combo select list.
|
||||
* \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS defini
|
||||
* \param iconPDF N'affiche que l'icone PDF avec le lien (1/0)
|
||||
* \param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined)
|
||||
* \param iconPDF Show only PDF icon with link (1/0)
|
||||
* \param maxfilenamelength Max length for filename shown
|
||||
* \param noform Do not output html form start and end
|
||||
* \param param More param on http links
|
||||
@ -295,7 +295,7 @@ class FormFile
|
||||
print '<input type="hidden" name="action" value="builddoc">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
print_titre($langs->trans("BuildDocuments"));
|
||||
print_titre($langs->trans("Documents"));
|
||||
print '<table class="border" summary="listofdocumentstable" width="100%">';
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
@ -112,10 +112,10 @@ insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`,
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3302__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/liste.php', 'List', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 1, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3303__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/contact/index.php?leftmenu=supplier&type=f', 'Contacts', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 2, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3304__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/stats.php', 'Statistics', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 3, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3400__+MAX_llx_menu__, 'suppliers', '', 4__+MAX_llx_menu__, '/fourn/facture/index.php', 'Bills', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3400__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/facture/index.php', 'Bills', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 4, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3401__+MAX_llx_menu__, 'suppliers', '', 3400__+MAX_llx_menu__, '/fourn/facture/fiche.php?action=create', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3402__+MAX_llx_menu__, 'suppliers', '', 3400__+MAX_llx_menu__, '/fourn/facture/paiement.php', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3500__+MAX_llx_menu__, 'suppliers', '', 4__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=suppliers', 'Orders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 2, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3500__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=suppliers', 'Orders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 5, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3501__+MAX_llx_menu__, 'suppliers', '', 3500__+MAX_llx_menu__, '/societe.php?leftmenu=supplier', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3502__+MAX_llx_menu__, 'suppliers', '', 3500__+MAX_llx_menu__, '/fourn/commande/liste.php?leftmenu=suppliers', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__);
|
||||
insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled && $conf->categorie->enabled', 'auguria', 'left', 4900__+MAX_llx_menu__, 'suppliers', '', 4__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=1', 'Categories', 0, 'categories', '$user->rights->categorie>lire', '', 2, 3, __ENTITY__);
|
||||
|
||||
@ -497,6 +497,7 @@ Canceled=Canceled
|
||||
YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary
|
||||
Color=Color
|
||||
Documents=Linked files
|
||||
DocumentsNb=Linked files (%s)
|
||||
Documents2=Documents
|
||||
BuildDocuments=Generated documents
|
||||
UploadDisabled=Upload disabled
|
||||
|
||||
@ -496,6 +496,7 @@ Canceled=Annulé
|
||||
YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires
|
||||
Color=Couleur
|
||||
Documents=Fichiers joints
|
||||
DocumentsNb=Fichiers joints (%s)
|
||||
Documents2=Documents
|
||||
BuildDocuments=Documents générés
|
||||
UploadDisabled=Transfert désactivé
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
* \param $exludefilter Regex for exclude filter (example: '\.meta$')
|
||||
* \param $sortcriteria Sort criteria ("name","date","size")
|
||||
* \param $sortorder Sort order (SORT_ASC, SORT_DESC)
|
||||
* \param $mode 0=Return array with only keys needed, 1=Force all keys to be loaded
|
||||
* \param $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower)
|
||||
* \return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file')
|
||||
*/
|
||||
function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0)
|
||||
@ -189,7 +189,7 @@ function dol_mimetype($file)
|
||||
/**
|
||||
* \brief Test if a folder is empty
|
||||
* \param folder Name of folder
|
||||
* \return boolean True if dir is empty or non-existing, false if it contains files
|
||||
* \return boolean True if dir is empty or non-existing, False if it contains files
|
||||
*/
|
||||
function dol_dir_is_emtpy($folder)
|
||||
{
|
||||
@ -210,7 +210,7 @@ function dol_dir_is_emtpy($folder)
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
return true; // Le repertoire n'existe pas
|
||||
return true; // Dir does not exists
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
*
|
||||
* 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
|
||||
@ -19,10 +19,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/lib/fourn.lib.php
|
||||
\brief Ensemble de fonctions de base pour le module fournisseur
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/lib/fourn.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module fournisseur
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
function facturefourn_prepare_head($fac)
|
||||
{
|
||||
@ -46,6 +46,10 @@ function facturefourn_prepare_head($fac)
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$fac->id;
|
||||
/*$filesdir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($fac->id,2).$fac->id;
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
@ -107,7 +111,11 @@ function ordersupplier_prepare_head($commande)
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$commande->id;
|
||||
$head[$h][1] = $langs->trans("Documents");
|
||||
/*$filesdir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2009 Laurent Destailleur <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
|
||||
@ -64,6 +64,10 @@ function facture_prepare_head($fac)
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$fac->id;
|
||||
/*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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
|
||||
@ -53,7 +53,7 @@ function commande_prepare_head($commande)
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Commande à facturer
|
||||
// Commande a facturer
|
||||
if ($conf->facture->enabled)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
|
||||
@ -76,6 +76,10 @@ function commande_prepare_head($commande)
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$commande->id;
|
||||
/*$filesdir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-2009 Laurent Destailleur <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
|
||||
@ -77,6 +77,10 @@ function propal_prepare_head($propal)
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?propalid='.$propal->id;
|
||||
/*$filesdir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
@ -42,6 +42,7 @@ class Product extends CommonObject
|
||||
var $errno = 0;
|
||||
var $element='product';
|
||||
var $table_element='product';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
//! Identifiant unique
|
||||
var $id ;
|
||||
@ -971,8 +972,6 @@ class Product extends CommonObject
|
||||
|
||||
$this->import_key = $result["import_key"];
|
||||
|
||||
$this->next_prev_filter = 'entity = '.$conf->entity;
|
||||
|
||||
$this->db->free();
|
||||
|
||||
// multilangs
|
||||
|
||||
@ -48,6 +48,7 @@ class Propal extends CommonObject
|
||||
var $table_element='propal';
|
||||
var $table_element_line='propaldet';
|
||||
var $fk_element='fk_propal';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id;
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ class User extends CommonObject
|
||||
var $errors=array();
|
||||
var $element='user';
|
||||
var $table_element='user';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id=0;
|
||||
var $ldap_sid;
|
||||
@ -211,8 +212,6 @@ class User extends CommonObject
|
||||
$this->contact_id = $obj->fk_socpeople;
|
||||
$this->fk_member = $obj->fk_member;
|
||||
|
||||
$this->next_prev_filter = 'entity IN (0,'.$conf->entity.')';
|
||||
|
||||
if (! $this->lang) $this->lang='fr_FR';
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
@ -28,16 +28,16 @@ if ($conf->ldap->enabled) require_once (DOL_DOCUMENT_ROOT."/lib/ldap.class.php")
|
||||
|
||||
|
||||
/**
|
||||
\class UserGroup
|
||||
\brief Classe permettant la gestion des groupes d'utilisateur
|
||||
* \class UserGroup
|
||||
* \brief Classe permettant la gestion des groupes d'utilisateur
|
||||
*/
|
||||
|
||||
class UserGroup extends CommonObject
|
||||
{
|
||||
var $db; // Database handler
|
||||
var $error;
|
||||
var $errors=array();
|
||||
var $table_element='usergroup';
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id; // Group id
|
||||
var $entity; // Entity of group
|
||||
@ -94,8 +94,6 @@ class UserGroup extends CommonObject
|
||||
$this->datec = $obj->datec;
|
||||
$this->datem = $obj->datem;
|
||||
|
||||
$this->next_prev_filter = 'entity IN (0,'.$conf->entity.')';
|
||||
|
||||
// Sav current LDAP Current DN
|
||||
//$this->ldap_dn = $this->_load_ldap_dn($this->_load_ldap_info(),0);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user