cvsimport
This commit is contained in:
commit
10e395f43c
@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.0.0
|
||||
PROJECT_NUMBER = 3.1.0
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file dolibarr.pl
|
||||
# \brief Dolibarr script install for Virtualmin Pro
|
||||
# \version $Revision$
|
||||
# \version $Revision: 1.20 $
|
||||
# \author (c)2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@ -31,7 +31,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.0.0" );
|
||||
return ( "3.1.0" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \ingroup member
|
||||
* \brief File of class to manage members types
|
||||
* \author Rodolphe Quiedeville
|
||||
* \version $Id$
|
||||
* \version $Id: adherent_type.class.php,v 1.11 2011/07/05 08:08:16 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
@ -195,12 +195,12 @@ class AdherentType extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return list of members' type
|
||||
* \return array List of types
|
||||
* Return list of members' type
|
||||
* @return array List of types of members
|
||||
*/
|
||||
function liste_array()
|
||||
{
|
||||
global $conf;
|
||||
global $conf,$langs;
|
||||
|
||||
$projets = array();
|
||||
|
||||
@ -220,7 +220,7 @@ class AdherentType extends CommonObject
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$projets[$obj->rowid] = $obj->libelle;
|
||||
$projets[$obj->rowid] = $langs->trans($obj->libelle);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/adherents/class/adherentstats.class.php
|
||||
* \ingroup member
|
||||
* \brief Fichier de la classe de gestion des stats des adhérents
|
||||
* \version $Id$
|
||||
* \version $Id: adherentstats.class.php,v 1.2 2011/07/04 10:30:01 eldy Exp $
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/class/stats.class.php";
|
||||
@ -90,7 +90,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)";
|
||||
$sql.= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -126,7 +126,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -144,7 +144,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(p.dateadh,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/adherents/document.php
|
||||
* \brief Tab for documents linked to third party
|
||||
* \ingroup societe
|
||||
* \version $Id$
|
||||
* \version $Id: document.php,v 1.7 2011/07/05 16:10:56 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -194,7 +194,7 @@ if ($id > 0)
|
||||
|
||||
print '</div>';
|
||||
|
||||
if ($mesg) { print "$mesg<br>"; }
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
@ -231,6 +231,6 @@ else
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/05 16:10:56 $ - $Revision: 1.7 $');
|
||||
|
||||
?>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/admin/societe.php
|
||||
* \ingroup company
|
||||
* \brief Third party module setup page
|
||||
* \version $Id$
|
||||
* \version $Id: societe.php,v 1.60 2011/07/04 07:38:22 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -166,8 +166,8 @@ if ($_GET["action"] == 'setdoc')
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
llxHeader('',$langs->trans("CompanySetup"),'EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers');
|
||||
$help_url='EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers';
|
||||
llxHeader('',$langs->trans("CompanySetup"),$help_url);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup');
|
||||
@ -499,5 +499,5 @@ dol_fiche_end();
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 07:38:22 $ - $Revision: 1.60 $');
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/admin/societe_extrafields.php
|
||||
* \ingroup societe
|
||||
* \brief Page to setup extra fields of third party
|
||||
* \version $Id$
|
||||
* \version $Id: societe_extrafields.php,v 1.4 2011/07/04 07:38:22 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -169,7 +169,7 @@ if ($action == 'delete')
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("ThirdParty");
|
||||
|
||||
$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
$help_url='EN:Module Third Parties setup|FR:Paramétrage_du_module_Tiers';
|
||||
llxHeader('',$langs->trans("CompanySetup"),$help_url);
|
||||
|
||||
|
||||
@ -312,5 +312,5 @@ if ($_GET["attrname"] && $action == 'edit')
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 07:38:22 $ - $Revision: 1.4 $');
|
||||
?>
|
||||
|
||||
@ -27,17 +27,17 @@ include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||
class Facturation {
|
||||
|
||||
/**
|
||||
* Attributs "volatiles" : reinitialises apres chaque traitement d'un article
|
||||
* <p>Attributs "volatiles" : reinitialises apres chaque traitement d'un article</p>
|
||||
* @var int $id => 'rowid' du produit dans llx_product
|
||||
* @var string $ref => 'ref' du produit dans llx_product
|
||||
* @var int $qte => Quantite pour le produit en cours de traitement
|
||||
* @var int $stock => Stock theorique pour le produit en cours de traitement
|
||||
* @var int $remise_percent => Remise en pourcent sur le produit en cours
|
||||
* @var int $montant_remise => Remise en pourcent sur le produit en cours
|
||||
* @var int $prix => Prix HT du produit en cours
|
||||
* @var int $tva => 'rowid' du taux de tva dans llx_c_tva
|
||||
*/
|
||||
* Attributs "volatiles" : reinitialises apres chaque traitement d'un article
|
||||
* <p>Attributs "volatiles" : reinitialises apres chaque traitement d'un article</p>
|
||||
* int $id => 'rowid' du produit dans llx_product
|
||||
* string $ref => 'ref' du produit dans llx_product
|
||||
* int $qte => Quantite pour le produit en cours de traitement
|
||||
* int $stock => Stock theorique pour le produit en cours de traitement
|
||||
* int $remise_percent => Remise en pourcent sur le produit en cours
|
||||
* int $montant_remise => Remise en pourcent sur le produit en cours
|
||||
* int $prix => Prix HT du produit en cours
|
||||
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
||||
*/
|
||||
var $id;
|
||||
protected $ref;
|
||||
protected $qte;
|
||||
@ -48,17 +48,17 @@ class Facturation {
|
||||
protected $tva;
|
||||
|
||||
/**
|
||||
* Attributs persistants : utilises pour toute la duree de la vente (jusqu'a validation ou annulation)
|
||||
* @var string $num_facture => Numero de la facture (de la forme FAYYMM-XXXX)
|
||||
* @var string $mode_reglement => Mode de reglement (ESP, CB ou CHQ)
|
||||
* @var int $montant_encaisse => Montant encaisse en cas de reglement en especes
|
||||
* @var int $montant_rendu => Monnaie rendue en cas de reglement en especes
|
||||
* @var int $paiement_le => Date de paiement en cas de paiement differe
|
||||
*
|
||||
* @var int $prix_total_ht => Prix total hors taxes
|
||||
* @var int $montant_tva => Montant total de la TVA, tous taux confondus
|
||||
* @var int $prix_total_ttc => Prix total TTC
|
||||
*/
|
||||
* Attributs persistants : utilises pour toute la duree de la vente (jusqu'a validation ou annulation)
|
||||
* string $num_facture => Numero de la facture (de la forme FAYYMM-XXXX)
|
||||
* string $mode_reglement => Mode de reglement (ESP, CB ou CHQ)
|
||||
* int $montant_encaisse => Montant encaisse en cas de reglement en especes
|
||||
* int $montant_rendu => Monnaie rendue en cas de reglement en especes
|
||||
* int $paiement_le => Date de paiement en cas de paiement differe
|
||||
*
|
||||
* int $prix_total_ht => Prix total hors taxes
|
||||
* int $montant_tva => Montant total de la TVA, tous taux confondus
|
||||
* int $prix_total_ttc => Prix total TTC
|
||||
*/
|
||||
protected $num_facture;
|
||||
protected $mode_reglement;
|
||||
protected $montant_encaisse;
|
||||
@ -82,9 +82,9 @@ class Facturation {
|
||||
|
||||
// Methodes de traitement des donnees
|
||||
|
||||
/**
|
||||
* \brief Ajout d'un article au panier
|
||||
*/
|
||||
/**
|
||||
* Ajout d'un article au panier
|
||||
*/
|
||||
public function ajoutArticle()
|
||||
{
|
||||
global $db;
|
||||
@ -96,7 +96,7 @@ class Facturation {
|
||||
dol_syslog("ajoutArticle sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$vat_rate=$obj->taux;
|
||||
@ -156,10 +156,10 @@ class Facturation {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Suppression du panier d'un article identifie par son id dans la table llx_pos_tmp
|
||||
* @param aArticle
|
||||
*/
|
||||
/**
|
||||
* Suppression du panier d'un article identifie par son id dans la table llx_pos_tmp
|
||||
* @param aArticle
|
||||
*/
|
||||
public function supprArticle($aArticle)
|
||||
{
|
||||
global $db;
|
||||
@ -172,9 +172,9 @@ class Facturation {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Calcul du total HT, total TTC et montants TVA
|
||||
*/
|
||||
/**
|
||||
* \brief Calcul du total HT, total TTC et montants TVA
|
||||
*/
|
||||
public function calculTotaux()
|
||||
{
|
||||
global $db;
|
||||
@ -234,7 +234,7 @@ class Facturation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reinitialisation des attributs persistants
|
||||
* Reinitialisation des attributs persistants
|
||||
*/
|
||||
public function raz_pers ()
|
||||
{
|
||||
@ -300,10 +300,10 @@ class Facturation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for qte
|
||||
* @param $aQte
|
||||
* @return
|
||||
*/
|
||||
* Getter for qte
|
||||
* @param $aQte
|
||||
* @return
|
||||
*/
|
||||
public function qte ( $aQte=null ) {
|
||||
|
||||
if ( !$aQte ) {
|
||||
@ -322,11 +322,11 @@ class Facturation {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for stock
|
||||
* @param aStock
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* Getter for stock
|
||||
* @param aStock
|
||||
* @return
|
||||
*/
|
||||
public function stock ( $aStock=null )
|
||||
{
|
||||
|
||||
@ -347,10 +347,10 @@ class Facturation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for remise_percent
|
||||
* @param aRemisePercent
|
||||
* @return
|
||||
*/
|
||||
* Getter for remise_percent
|
||||
* @param aRemisePercent
|
||||
* @return
|
||||
*/
|
||||
public function remise_percent ( $aRemisePercent=null )
|
||||
{
|
||||
|
||||
@ -371,10 +371,10 @@ class Facturation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for montant_remise
|
||||
* @param aMontantRemise
|
||||
* @return
|
||||
*/
|
||||
* Getter for montant_remise
|
||||
* @param aMontantRemise
|
||||
* @return
|
||||
*/
|
||||
public function montant_remise ( $aMontantRemise=null ) {
|
||||
|
||||
if ( !$aMontantRemise ) {
|
||||
@ -394,10 +394,10 @@ class Facturation {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for prix
|
||||
* @param aPrix
|
||||
* @return
|
||||
*/
|
||||
* Getter for prix
|
||||
* @param aPrix
|
||||
* @return
|
||||
*/
|
||||
public function prix ( $aPrix=null )
|
||||
{
|
||||
|
||||
@ -417,11 +417,11 @@ class Facturation {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for tva
|
||||
* @param aTva
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* Getter for tva
|
||||
* @param aTva
|
||||
* @return
|
||||
*/
|
||||
public function tva ( $aTva=null )
|
||||
{
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2008 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/categories/class/categorie.class.php
|
||||
* \ingroup categorie
|
||||
* \brief File of class to manage categories
|
||||
* \version $Id: categorie.class.php,v 1.16 2011/06/28 09:25:57 cdelambert Exp $
|
||||
* \version $Id: categorie.class.php,v 1.17 2011/07/04 09:54:02 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
@ -70,8 +70,8 @@ class Categorie
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge la categorie
|
||||
* @param id id de la categorie a charger
|
||||
* Load category into memory from database
|
||||
* @param id id of category
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
@ -121,7 +121,7 @@ class Categorie
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajoute la categorie dans la base de donnees
|
||||
* Add category into database
|
||||
* @return int -1 : erreur SQL
|
||||
* -2 : nouvel ID inconnu
|
||||
* -3 : categorie invalide
|
||||
@ -147,14 +147,18 @@ class Categorie
|
||||
{
|
||||
$sql.= "fk_soc,";
|
||||
}
|
||||
$sql.= "visible, type, fk_parent_id) ";
|
||||
$sql.= "VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',";
|
||||
$sql.= " visible,";
|
||||
$sql.= " type";
|
||||
//$sql.= ", fk_parent_id";
|
||||
$sql.= ")";
|
||||
$sql.= " VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',";
|
||||
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
|
||||
{
|
||||
$sql.= ($this->socid != -1 ? $this->socid : 'null').",";
|
||||
}
|
||||
$sql.= "'".$this->visible."',".$this->type.",".$this->parentId .")";
|
||||
|
||||
$sql.= "'".$this->visible."',".$this->type;
|
||||
//$sql.= ",".$this->parentId;
|
||||
$sql.= ")";
|
||||
|
||||
$res = $this->db->query ($sql);
|
||||
if ($res)
|
||||
@ -254,7 +258,7 @@ class Categorie
|
||||
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');
|
||||
}
|
||||
$sql .= ", visible = '".$this->visible."'";
|
||||
$sql .= ", fk_parent_id = ".$this->parentId;
|
||||
//$sql .= ", fk_parent_id = ".$this->parentId;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("Categorie::update sql=".$sql);
|
||||
@ -815,8 +819,8 @@ class Categorie
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Check if no category with same label already exists for this cat's parent or root and for this cat's type
|
||||
* \return boolean 1 if already exist, 0 otherwise, -1 if error
|
||||
* Check if no category with same label already exists for this cat's parent or root and for this cat's type
|
||||
* @return boolean 1 if already exist, 0 otherwise, -1 if error
|
||||
*/
|
||||
function already_exists()
|
||||
{
|
||||
@ -830,7 +834,7 @@ class Categorie
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."categorie_association as ca";
|
||||
$sql.= " ON c.rowid=ca.fk_categorie_fille";
|
||||
$sql.= " WHERE ca.fk_categorie_mere=".$this->id_mere;
|
||||
$sql.= " AND c.label='".$this->label."'";
|
||||
$sql.= " AND c.label='".$this->db->escape($this->label)."'";
|
||||
}
|
||||
else // mother_id undefined (so it's root)
|
||||
{
|
||||
@ -843,7 +847,7 @@ class Categorie
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."categorie_association as ca";
|
||||
$sql.= " ON c.rowid!=ca.fk_categorie_fille";
|
||||
$sql.= " WHERE c.type=".$this->type;
|
||||
$sql.= " AND c.label='".$this->label."'";
|
||||
$sql.= " AND c.label='".$this->db->escape($this->label)."'";
|
||||
}
|
||||
dol_syslog("Categorie::already_exists sql=".$sql);
|
||||
$res = $this->db->query($sql);
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/categories/fiche.php
|
||||
* \ingroup category
|
||||
* \brief Page to create a new category
|
||||
* \version $Id$
|
||||
* \version $Id: fiche.php,v 1.84 2011/07/04 09:54:02 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -131,7 +131,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
||||
}
|
||||
|
||||
// Confirm action
|
||||
if ($action == 'add' && $user->rights->categorie->creer)
|
||||
if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->creer)
|
||||
{
|
||||
// Action confirmation de creation categorie
|
||||
if ($action == 'confirmed')
|
||||
@ -235,5 +235,5 @@ if ($user->rights->categorie->creer)
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 09:54:02 $ - $Revision: 1.84 $');
|
||||
?>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/comm/action/class/actioncomm.class.php
|
||||
* \ingroup commercial
|
||||
* \brief File of class to manage agenda events (actions)
|
||||
* \version $Id: actioncomm.class.php,v 1.41 2011/06/30 07:52:43 eldy Exp $
|
||||
* \version $Id: actioncomm.class.php,v 1.42 2011/07/04 09:36:29 eldy Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php');
|
||||
@ -391,8 +391,10 @@ class ActionComm extends CommonObject
|
||||
|
||||
/**
|
||||
* Load all objects with filters
|
||||
* @param socid Filter by thirdparty
|
||||
* @param filter Other filter
|
||||
* @param socid Filter by thirdparty
|
||||
* @param fk_element Id of element action is linked to
|
||||
* @param elementtype Type of element action is linked to
|
||||
* @param filter Other filter
|
||||
*/
|
||||
function getActions($socid=0, $fk_element=0, $elementtype='', $filter='')
|
||||
{
|
||||
@ -603,7 +605,7 @@ class ActionComm extends CommonObject
|
||||
* Utilise $this->id, $this->code et $this->label
|
||||
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param maxlength Nombre de caracteres max dans libelle
|
||||
* @param class Force style class on a link
|
||||
* @param classname Force style class on a link
|
||||
* @param option ''=Link to action,'birthday'=Link to contact
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* \file htdocs/comm/propal.php
|
||||
* \ingroup propale
|
||||
* \brief Page of commercial proposals card and list
|
||||
* \version $Id: propal.php,v 1.607 2011/07/02 16:48:32 eldy Exp $
|
||||
* \version $Id: propal.php,v 1.608 2011/07/04 10:30:02 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -1805,13 +1805,13 @@ else
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
$sql.= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
||||
$sql.= " AND date_format(p.datep, '%Y-%m') = '".$year."-".$month."'";
|
||||
else
|
||||
$sql.= " AND date_format(p.datep, '%m') = '$month'";
|
||||
$sql.= " AND date_format(p.datep, '%m') = '".$month."'";
|
||||
}
|
||||
if ($year > 0)
|
||||
{
|
||||
$sql.= " AND date_format(p.datep, '%Y') = $year";
|
||||
$sql.= " AND date_format(p.datep, '%Y') = '".$year."'";
|
||||
}
|
||||
if (dol_strlen($_POST['sf_ref']) > 0)
|
||||
{
|
||||
@ -1975,6 +1975,6 @@ else
|
||||
}
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/02 16:48:32 $ - $Revision: 1.607 $');
|
||||
llxFooter('$Date: 2011/07/04 10:30:02 $ - $Revision: 1.608 $');
|
||||
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/comm/propal/class/propalestats.class.php
|
||||
* \ingroup propales
|
||||
* \brief Fichier de la classe de gestion des stats des propales
|
||||
* \version $Id$
|
||||
* \version $Id: propalestats.class.php,v 1.5 2011/07/04 10:30:03 eldy Exp $
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/class/stats.class.php";
|
||||
@ -91,7 +91,7 @@ class PropaleStats extends Stats
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, count(*)";
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -127,7 +127,7 @@ class PropaleStats extends Stats
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, sum(p.".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -145,7 +145,7 @@ class PropaleStats extends Stats
|
||||
$sql = "SELECT date_format(p.datep,'%m') as dm, avg(p.".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/comm/propal/document.php
|
||||
* \ingroup propale
|
||||
* \brief Page de gestion des documents attaches a une proposition commerciale
|
||||
* \version $Id$
|
||||
* \version $Id: document.php,v 1.65 2011/07/05 16:10:56 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
@ -35,14 +35,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
$langs->load('compta');
|
||||
$langs->load('other');
|
||||
|
||||
$action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action'];
|
||||
|
||||
$id = isset($_GET["id"])?$_GET["id"]:'';
|
||||
$action = GETPOST('action');
|
||||
$confirm = GETPOST('confirm');
|
||||
$id = GETPOST('id');
|
||||
$ref = GETPOST('ref');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id)
|
||||
{
|
||||
unset($_GET["action"]);
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
@ -59,6 +59,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
$object = new Propal($db);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -67,13 +68,11 @@ if (! $sortfield) $sortfield="name";
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$propal = new Propal($db);
|
||||
|
||||
if ($propal->fetch($id))
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
{
|
||||
@ -103,14 +102,13 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($action=='delete')
|
||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
$propal = new Propal($db);
|
||||
|
||||
$id=$_GET["id"];
|
||||
if ($propal->fetch($id))
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
@ -126,19 +124,15 @@ llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
$id = $_GET["id"];
|
||||
$ref= $_GET["ref"];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$propal = new Propal($db);
|
||||
if ($propal->fetch($id,$ref))
|
||||
if ($object->fetch($id,$ref))
|
||||
{
|
||||
$upload_dir = $conf->propale->dir_output.'/'.dol_sanitizeFileName($propal->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->propale->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($propal->socid);
|
||||
|
||||
$head = propal_prepare_head($propal);
|
||||
$head = propal_prepare_head($object);
|
||||
dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal');
|
||||
|
||||
|
||||
@ -153,11 +147,11 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
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>";
|
||||
$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 $html->showrefnav($propal,'ref',$linkback,1,'ref','ref','');
|
||||
print $html->showrefnav($object,'ref',$linkback,1,'ref','ref','');
|
||||
print '</td></tr>';
|
||||
|
||||
// Ref client
|
||||
@ -167,15 +161,13 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
print $propal->ref_client;
|
||||
print $object->ref_client;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Customer
|
||||
if ( is_null($propal->client) )
|
||||
$propal->fetch_thirdparty();
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
print '<td colspan="3">'.$propal->client->getNomUrl(1).'</td></tr>';
|
||||
print '<td colspan="3">'.$object->thirdparty->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>';
|
||||
@ -184,16 +176,25 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '</div>';
|
||||
|
||||
if ($mesg) { print "$mesg<br>"; }
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/propal/document.php?id='.$propal->id,'',0,0,$user->rights->propale->creer);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id,'',0,0,$user->rights->propale->creer);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&id='.$propal->id;
|
||||
$formfile->list_of_documents($filearray,$propal,'propal',$param);
|
||||
$param='&id='.$object->id;
|
||||
$formfile->list_of_documents($filearray,$object,'propal',$param);
|
||||
|
||||
}
|
||||
else
|
||||
@ -208,5 +209,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/05 16:10:56 $ - $Revision: 1.65 $');
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/comm/propal/index.php
|
||||
* \ingroup propal
|
||||
* \brief Home page of proposal area
|
||||
* \version $Id$
|
||||
* \version $Id: index.php,v 1.6 2011/07/04 10:35:49 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
@ -249,7 +249,7 @@ if ($resql)
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print '</td></tr></table>';
|
||||
@ -416,6 +416,6 @@ print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:35:49 $ - $Revision: 1.6 $');
|
||||
|
||||
?>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/commande/class/commande.class.php
|
||||
* \ingroup commande
|
||||
* \brief Fichier des classes de commandes
|
||||
* \version $Id: commande.class.php,v 1.116 2011/06/30 13:27:20 hregis Exp $
|
||||
* \version $Id: commande.class.php,v 1.118 2011/07/04 10:35:49 hregis Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
@ -177,7 +177,7 @@ class Commande extends CommonObject
|
||||
function valid($user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -239,7 +239,7 @@ class Commande extends CommonObject
|
||||
if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
|
||||
$langs->load("agenda");
|
||||
$langs->load("agenda");
|
||||
|
||||
// Loop on each line
|
||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
||||
@ -258,6 +258,8 @@ class Commande extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->oldref='';
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
@ -273,6 +275,8 @@ class Commande extends CommonObject
|
||||
|
||||
if (@rename($dirsource, $dirdest))
|
||||
{
|
||||
$this->oldref = $comref;
|
||||
|
||||
dol_syslog("Rename ok");
|
||||
// Suppression ancien fichier PDF dans nouveau rep
|
||||
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*');
|
||||
@ -347,7 +351,7 @@ class Commande extends CommonObject
|
||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
|
||||
$langs->load("agenda");
|
||||
$langs->load("agenda");
|
||||
|
||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
||||
{
|
||||
@ -402,7 +406,7 @@ class Commande extends CommonObject
|
||||
|
||||
if ($this->statut != 3)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
@ -451,13 +455,13 @@ class Commande extends CommonObject
|
||||
function cloture($user)
|
||||
{
|
||||
global $conf;
|
||||
$error=0;
|
||||
$error=0;
|
||||
|
||||
if ($user->rights->commande->valider)
|
||||
{
|
||||
$this->db->begin();
|
||||
$this->db->begin();
|
||||
|
||||
$now=dol_now();
|
||||
$now=dol_now();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
|
||||
$sql.= ' SET fk_statut = 3,';
|
||||
@ -476,21 +480,21 @@ class Commande extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
|
||||
$this->db->rollback();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -523,7 +527,7 @@ class Commande extends CommonObject
|
||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
|
||||
$langs->load("agenda");
|
||||
$langs->load("agenda");
|
||||
|
||||
if ($this->lines[$i]->fk_product > 0)
|
||||
{
|
||||
@ -570,9 +574,10 @@ class Commande extends CommonObject
|
||||
|
||||
/**
|
||||
* Create order
|
||||
* @param user Objet user that make creation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* remarks this->ref can be set or empty. If empty, we will use "(PROV)"
|
||||
* Note that this->ref can be set or empty. If empty, we will use "(PROV)"
|
||||
* @param user Objet user that make creation
|
||||
* @param notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $notrigger=0)
|
||||
{
|
||||
@ -694,7 +699,7 @@ class Commande extends CommonObject
|
||||
{
|
||||
if ($this->id)
|
||||
{
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
|
||||
// Add linked object
|
||||
if ($this->origin && $this->origin_id)
|
||||
@ -728,7 +733,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
@ -825,23 +830,23 @@ class Commande extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
{
|
||||
foreach($object->hooks as $hook)
|
||||
{
|
||||
if (! empty($hook['modules']))
|
||||
{
|
||||
foreach($hook['modules'] as $module)
|
||||
{
|
||||
if (method_exists($module,'createfrom'))
|
||||
{
|
||||
$result = $module->createfrom($objFrom,$result,$object->element);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty($object->hooks))
|
||||
{
|
||||
foreach($object->hooks as $hook)
|
||||
{
|
||||
if (! empty($hook['modules']))
|
||||
{
|
||||
foreach($hook['modules'] as $module)
|
||||
{
|
||||
if (method_exists($module,'createfrom'))
|
||||
{
|
||||
$result = $module->createfrom($objFrom,$result,$object->element);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
@ -865,103 +870,103 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load an object from a proposal and create a new order into database
|
||||
* @param object Object source
|
||||
* @param invertdetail Reverse sign of amounts for lines
|
||||
* @return int <0 if KO, 0 if nothing done, 1 if OK
|
||||
*/
|
||||
function createFromProposal($object,$invertdetail=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
/**
|
||||
* Load an object from a proposal and create a new order into database
|
||||
* @param object Object source
|
||||
* @param invertdetail Reverse sign of amounts for lines
|
||||
* @return int <0 if KO, 0 if nothing done, 1 if OK
|
||||
*/
|
||||
function createFromProposal($object,$invertdetail=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$error=0;
|
||||
$error=0;
|
||||
|
||||
// Signed proposal
|
||||
if ($object->statut == 2)
|
||||
{
|
||||
$this->date_commande = dol_now();
|
||||
$this->source = 0;
|
||||
// Signed proposal
|
||||
if ($object->statut == 2)
|
||||
{
|
||||
$this->date_commande = dol_now();
|
||||
$this->source = 0;
|
||||
|
||||
for ($i = 0 ; $i < sizeof($object->lines) ; $i++)
|
||||
{
|
||||
$line = new OrderLine($this->db);
|
||||
for ($i = 0 ; $i < sizeof($object->lines) ; $i++)
|
||||
{
|
||||
$line = new OrderLine($this->db);
|
||||
|
||||
$line->libelle = $object->lines[$i]->libelle;
|
||||
$line->desc = $object->lines[$i]->desc;
|
||||
$line->price = $object->lines[$i]->price;
|
||||
$line->subprice = $object->lines[$i]->subprice;
|
||||
$line->tva_tx = $object->lines[$i]->tva_tx;
|
||||
$line->localtax1_tx = $object->lines[$i]->localtax1_tx;
|
||||
$line->localtax2_tx = $object->lines[$i]->localtax2_tx;
|
||||
$line->qty = $object->lines[$i]->qty;
|
||||
$line->fk_remise_except = $object->lines[$i]->fk_remise_except;
|
||||
$line->remise_percent = $object->lines[$i]->remise_percent;
|
||||
$line->fk_product = $object->lines[$i]->fk_product;
|
||||
$line->info_bits = $object->lines[$i]->info_bits;
|
||||
$line->product_type = $object->lines[$i]->product_type;
|
||||
$line->rang = $object->lines[$i]->rang;
|
||||
$line->special_code = $object->lines[$i]->special_code;
|
||||
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
|
||||
$line->libelle = $object->lines[$i]->libelle;
|
||||
$line->desc = $object->lines[$i]->desc;
|
||||
$line->price = $object->lines[$i]->price;
|
||||
$line->subprice = $object->lines[$i]->subprice;
|
||||
$line->tva_tx = $object->lines[$i]->tva_tx;
|
||||
$line->localtax1_tx = $object->lines[$i]->localtax1_tx;
|
||||
$line->localtax2_tx = $object->lines[$i]->localtax2_tx;
|
||||
$line->qty = $object->lines[$i]->qty;
|
||||
$line->fk_remise_except = $object->lines[$i]->fk_remise_except;
|
||||
$line->remise_percent = $object->lines[$i]->remise_percent;
|
||||
$line->fk_product = $object->lines[$i]->fk_product;
|
||||
$line->info_bits = $object->lines[$i]->info_bits;
|
||||
$line->product_type = $object->lines[$i]->product_type;
|
||||
$line->rang = $object->lines[$i]->rang;
|
||||
$line->special_code = $object->lines[$i]->special_code;
|
||||
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
$this->socid = $object->socid;
|
||||
$this->fk_project = $object->fk_project;
|
||||
$this->cond_reglement_id = $object->cond_reglement_id;
|
||||
$this->mode_reglement_id = $object->mode_reglement_id;
|
||||
$this->availability_id = $object->availability_id;
|
||||
$this->socid = $object->socid;
|
||||
$this->fk_project = $object->fk_project;
|
||||
$this->cond_reglement_id = $object->cond_reglement_id;
|
||||
$this->mode_reglement_id = $object->mode_reglement_id;
|
||||
$this->availability_id = $object->availability_id;
|
||||
$this->demand_reason_id = $object->demand_reason_id;
|
||||
$this->date_livraison = $object->date_livraison;
|
||||
$this->fk_delivery_address = $object->fk_delivery_address;
|
||||
$this->contact_id = $object->contactid;
|
||||
$this->ref_client = $object->ref_client;
|
||||
$this->note = $object->note;
|
||||
$this->note_public = $object->note_public;
|
||||
$this->date_livraison = $object->date_livraison;
|
||||
$this->fk_delivery_address = $object->fk_delivery_address;
|
||||
$this->contact_id = $object->contactid;
|
||||
$this->ref_client = $object->ref_client;
|
||||
$this->note = $object->note;
|
||||
$this->note_public = $object->note_public;
|
||||
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
$ret = $this->create($user);
|
||||
$ret = $this->create($user);
|
||||
|
||||
if ($ret > 0)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
{
|
||||
foreach($object->hooks as $hook)
|
||||
{
|
||||
if (! empty($hook['modules']))
|
||||
{
|
||||
foreach($hook['modules'] as $module)
|
||||
{
|
||||
if (method_exists($module,'createfrom'))
|
||||
{
|
||||
$result = $module->createfrom($object,$ret,$this->element);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ret > 0)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
{
|
||||
foreach($object->hooks as $hook)
|
||||
{
|
||||
if (! empty($hook['modules']))
|
||||
{
|
||||
foreach($hook['modules'] as $module)
|
||||
{
|
||||
if (method_exists($module,'createfrom'))
|
||||
{
|
||||
$result = $module->createfrom($object,$ret,$this->element);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Ne pas passer par la commande provisoire
|
||||
if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1)
|
||||
{
|
||||
$this->fetch($ret);
|
||||
$this->valid($user);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else return -1;
|
||||
}
|
||||
else return -1;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
// Ne pas passer par la commande provisoire
|
||||
if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1)
|
||||
{
|
||||
$this->fetch($ret);
|
||||
$this->valid($user);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else return -1;
|
||||
}
|
||||
else return -1;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -998,13 +1003,13 @@ class Commande extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
@ -1124,12 +1129,12 @@ class Commande extends CommonObject
|
||||
/**
|
||||
* Add line into array
|
||||
* $this->client doit etre charge
|
||||
* @param idproduct Id du produit a ajouter
|
||||
* @param qty Quantite
|
||||
* @param date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @param date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @remise_percent remise_percent Remise relative effectuee sur le produit
|
||||
* @return void
|
||||
* @param idproduct Id du produit a ajouter
|
||||
* @param qty Quantite
|
||||
* @param remise_percent Remise relative effectuee sur le produit
|
||||
* @param date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @param date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @return void
|
||||
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
||||
* insere dans tableau $this->products
|
||||
*/
|
||||
@ -1202,7 +1207,7 @@ class Commande extends CommonObject
|
||||
* @param id Id of object to load
|
||||
* @param ref Ref of object
|
||||
* @param ref_ext External reference of object
|
||||
* @param ref_int Internal reference of other object
|
||||
* @param ref_int Internal reference of other object
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function fetch($id, $ref='', $ref_ext='', $ref_int='')
|
||||
@ -1231,9 +1236,9 @@ class Commande extends CommonObject
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = c.rowid AND el.targettype = '".$this->element."'";
|
||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||
if ($id) $sql.= " AND c.rowid=".$id;
|
||||
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
|
||||
if ($ref_ext) $sql.= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
if ($ref_int) $sql.= " AND c.ref_int='".$this->db->escape($ref_int)."'";
|
||||
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
|
||||
if ($ref_ext) $sql.= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
if ($ref_int) $sql.= " AND c.ref_int='".$this->db->escape($ref_int)."'";
|
||||
|
||||
dol_syslog("Commande::fetch sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql) ;
|
||||
@ -1330,9 +1335,9 @@ class Commande extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Ajout d'une ligne remise fixe dans la commande, en base
|
||||
* \param idremise Id de la remise fixe
|
||||
* \return int >0 si ok, <0 si ko
|
||||
* Ajout d'une ligne remise fixe dans la commande, en base
|
||||
* @param idremise Id de la remise fixe
|
||||
* @return int >0 si ok, <0 si ko
|
||||
*/
|
||||
function insert_discount($idremise)
|
||||
{
|
||||
@ -1405,9 +1410,9 @@ class Commande extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Reinitialize array lignes
|
||||
* \param only_product Return only physical products
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Load array lines
|
||||
* @param only_product Return only physical products
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_lines($only_product=0)
|
||||
{
|
||||
@ -1558,12 +1563,12 @@ class Commande extends CommonObject
|
||||
*/
|
||||
function nb_expedition()
|
||||
{
|
||||
$sql = 'SELECT count(*)';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||
$sql.= ' WHERE el.fk_source = '.$this->id;
|
||||
$sql.= " AND el.fk_target = e.rowid";
|
||||
$sql.= " AND el.targettype = 'shipping'";
|
||||
$sql = 'SELECT count(*)';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||
$sql.= ' WHERE el.fk_source = '.$this->id;
|
||||
$sql.= " AND el.fk_target = e.rowid";
|
||||
$sql.= " AND el.targettype = 'shipping'";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -1571,7 +1576,7 @@ class Commande extends CommonObject
|
||||
$row = $this->db->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
else dol_print_error($this->db);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1588,10 +1593,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoie un tableau avec les stocks restant par produit
|
||||
* \param filtre_statut Filtre sur statut
|
||||
* \return int 0 si OK, <0 si KO
|
||||
* \todo FONCTION NON FINIE A FINIR
|
||||
* Renvoie un tableau avec les stocks restant par produit
|
||||
* @param filtre_statut Filtre sur statut
|
||||
* @return int 0 si OK, <0 si KO
|
||||
* TODO FONCTION NON FINIE A FINIR
|
||||
*/
|
||||
function stock_array($filtre_statut=-1)
|
||||
{
|
||||
@ -1625,9 +1630,9 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Supprime une ligne de la commande
|
||||
* \param idligne Id de la ligne a supprimer
|
||||
* \return int >0 si ok, 0 si rien a supprimer, <0 si ko
|
||||
* Delete an order line
|
||||
* @param lineid Id of line to delete
|
||||
* @return int >0 if OK, 0 if nothing to do, <0 if KO
|
||||
*/
|
||||
function deleteline($lineid)
|
||||
{
|
||||
@ -1700,10 +1705,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Applique une remise relative
|
||||
* \param user User qui positionne la remise
|
||||
* \param remise
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Applique une remise relative
|
||||
* @param user User qui positionne la remise
|
||||
* @param remise
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_remise($user, $remise)
|
||||
{
|
||||
@ -1733,10 +1738,10 @@ class Commande extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Applique une remise absolue
|
||||
* \param user User qui positionne la remise
|
||||
* \param remise
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Applique une remise absolue
|
||||
* @param user User qui positionne la remise
|
||||
* @param remise
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_remise_absolue($user, $remise)
|
||||
{
|
||||
@ -1769,8 +1774,8 @@ class Commande extends CommonObject
|
||||
|
||||
/**
|
||||
* Set the order date
|
||||
* @param user Object user
|
||||
* @param date_livraison Date delivery
|
||||
* @param user Object user making change
|
||||
* @param date Date
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_date($user, $date)
|
||||
@ -1802,10 +1807,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set the planned delivery date
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param date_livraison Date de livraison
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Set the planned delivery date
|
||||
* @param user Objet utilisateur qui modifie
|
||||
* @param date_livraison Date de livraison
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function set_date_livraison($user, $date_livraison)
|
||||
{
|
||||
@ -1836,10 +1841,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Definit une adresse de livraison
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param adresse_livraison Adresse de livraison
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Set address
|
||||
* @param user Object user making change
|
||||
* @param fk_address Adress of delivery
|
||||
* @return int <0 ig KO, >0 if Ok
|
||||
*/
|
||||
function set_adresse_livraison($user, $fk_address)
|
||||
{
|
||||
@ -1862,11 +1867,11 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set delivery
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param delivery delai de livraison
|
||||
* \return int <0 si ko, >0 si ok
|
||||
/**
|
||||
* Set availability
|
||||
* @param user Object user making change
|
||||
* @param id If of availability delay
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_availability($user, $id)
|
||||
{
|
||||
@ -1891,10 +1896,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set source of demand
|
||||
* \param user Objet utilisateur qui modifie
|
||||
* \param delivery delai de livraison
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Set source of demand
|
||||
* @param user Object user making change
|
||||
* @param id Id of source
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_demand_reason($user, $id)
|
||||
{
|
||||
@ -1935,7 +1940,7 @@ class Commande extends CommonObject
|
||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
if ($brouillon) $sql.= " AND c.fk_statut = 0";
|
||||
if ($user) $sql.= " AND c.fk_user_author <> ".$user->id;
|
||||
if ($user) $sql.= " AND c.fk_user_author <> ".$user->id;
|
||||
$sql .= " ORDER BY c.date_commande DESC";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
@ -1963,9 +1968,9 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Change les conditions de reglement de la commande
|
||||
* \param cond_reglement_id Id de la nouvelle condition de reglement
|
||||
* \return int >0 si ok, <0 si ko
|
||||
* Change les conditions de reglement de la commande
|
||||
* @param cond_reglement_id Id de la nouvelle condition de reglement
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function cond_reglement($cond_reglement_id)
|
||||
{
|
||||
@ -2029,10 +2034,10 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Change le delai de livraison
|
||||
* \param mode Id du nouveau mode
|
||||
* \return int >0 si ok, <0 si ko
|
||||
/**
|
||||
* Change le delai de livraison
|
||||
* @param availability_id Id du nouveau mode
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function availability($availability_id)
|
||||
{
|
||||
@ -2177,7 +2182,7 @@ class Commande extends CommonObject
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0)
|
||||
{
|
||||
global $conf;
|
||||
global $conf;
|
||||
|
||||
dol_syslog("CustomerOrder::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $date_start, $date_end, $type");
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||
@ -2280,14 +2285,14 @@ class Commande extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Delete the customer order
|
||||
* \user User object
|
||||
* \return int <=0 if KO, >0 if OK
|
||||
* Delete the customer order
|
||||
* @param user User object
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
global $conf, $langs;
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$err = 0;
|
||||
|
||||
@ -2380,9 +2385,9 @@ class Commande extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
* @param user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
* @param user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
@ -2515,10 +2520,12 @@ class Commande extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
* @param withpicto Add picto into link
|
||||
* @param option Where point the link
|
||||
* @return string String with URL
|
||||
* Return clicable link of object (with eventually picto)
|
||||
* @param withpicto Add picto into link
|
||||
* @param option Where point the link
|
||||
* @param max Max length to show
|
||||
* @param short Use short labels
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
|
||||
{
|
||||
@ -2788,7 +2795,7 @@ class OrderLine
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
var $oldline;
|
||||
|
||||
// From llx_commandedet
|
||||
@ -2887,9 +2894,9 @@ class OrderLine
|
||||
$this->rang = $objp->rang;
|
||||
|
||||
$this->ref = $objp->product_ref; // deprecated
|
||||
$this->product_ref = $objp->product_ref;
|
||||
$this->libelle = $objp->product_libelle; // deprecated
|
||||
$this->product_label = $objp->product_libelle;
|
||||
$this->product_ref = $objp->product_ref;
|
||||
$this->libelle = $objp->product_libelle; // deprecated
|
||||
$this->product_label = $objp->product_libelle;
|
||||
$this->product_desc = $objp->product_desc;
|
||||
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
@ -2951,17 +2958,17 @@ class OrderLine
|
||||
if (empty($this->localtax2_tx)) $this->localtax2_tx=0;
|
||||
if (empty($this->total_localtax1)) $this->total_localtax1=0;
|
||||
if (empty($this->total_localtax2)) $this->total_localtax2=0;
|
||||
if (empty($this->rang)) $this->rang=0;
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->rang)) $this->rang=0;
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) return -1;
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) return -1;
|
||||
|
||||
$this->db->begin();
|
||||
$this->db->begin();
|
||||
|
||||
// Insertion dans base de la ligne
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commandedet';
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/commande/class/commandestats.class.php
|
||||
* \ingroup commandes
|
||||
* \brief Fichier de la classe de gestion des stats des commandes
|
||||
* \version $Id$
|
||||
* \version $Id: commandestats.class.php,v 1.5 2011/07/04 10:30:01 eldy Exp $
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/class/stats.class.php";
|
||||
include_once DOL_DOCUMENT_ROOT . "/commande/class/commande.class.php";
|
||||
@ -102,7 +102,7 @@ class CommandeStats extends Stats
|
||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, count(*) nb";
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_valid,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(c.date_valid,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -141,7 +141,7 @@ class CommandeStats extends Stats
|
||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, sum(c.".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_valid,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(c.date_valid,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -161,7 +161,7 @@ class CommandeStats extends Stats
|
||||
$sql = "SELECT date_format(c.date_valid,'%m') as dm, avg(c.".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_valid,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(c.date_valid,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/commande/document.php
|
||||
* \ingroup order
|
||||
* \brief Page de gestion des documents attachees a une commande
|
||||
* \version $Id$
|
||||
* \version $Id: document.php,v 1.33 2011/07/05 16:10:56 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -32,20 +32,22 @@ require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php");
|
||||
|
||||
if (!$user->rights->commande->lire) accessforbidden();
|
||||
|
||||
$langs->load('companies');
|
||||
//$langs->load("bills");
|
||||
$langs->load('other');
|
||||
|
||||
$id=empty($_GET['id']) ? 0 : intVal($_GET['id']);
|
||||
$action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action'];
|
||||
$action = GETPOST('action');
|
||||
$confirm = GETPOST('confirm');
|
||||
$id = GETPOST('id');
|
||||
$ref = GETPOST('ref');
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
$comid = isset($_GET["id"])?$_GET["id"]:'';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'commande',$comid,'');
|
||||
if ($user->societe_id)
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'commande',$id,'');
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -59,13 +61,7 @@ if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$ref= $_GET['ref'];
|
||||
$commande = new Commande($db);
|
||||
if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$object = new Commande($db);
|
||||
|
||||
|
||||
/*
|
||||
@ -75,43 +71,51 @@ if (! $commande->fetch($_GET['id'],$_GET['ref']) > 0)
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
|
||||
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
$langs->load("errors");
|
||||
if ($resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($action=='delete')
|
||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -125,49 +129,62 @@ $html = new Form($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($commande->ref);
|
||||
if ($object->fetch($id, $ref))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($commande->socid);
|
||||
|
||||
$head = commande_prepare_head($commande);
|
||||
dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), 0, 'order');
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_ASC:SORT_DESC),1);
|
||||
$totalsize=0;
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
$totalsize+=$file['size'];
|
||||
$head = commande_prepare_head($object);
|
||||
dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), 0, 'order');
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_ASC:SORT_DESC),1);
|
||||
$totalsize=0;
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $html->showrefnav($object,'ref','',1,'ref','ref');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->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>';
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/commande/document.php?id='.$object->id,'',0,0,$user->rights->commande->creer);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&id='.$object->id;
|
||||
$formfile->list_of_documents($filearray,$object,'commande',$param);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">';
|
||||
print $html->showrefnav($commande,'ref','',1,'ref','ref');
|
||||
print '</td></tr>';
|
||||
|
||||
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>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
if ($mesg) { print $mesg."<br>"; }
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/commande/document.php?id='.$commande->id,'',0,0,$user->rights->commande->creer);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&id='.$commande->id;
|
||||
$formfile->list_of_documents($filearray,$commande,'commande',$param);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -176,5 +193,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/05 16:10:56 $ - $Revision: 1.33 $');
|
||||
?>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/commande/liste.php
|
||||
* \ingroup commande
|
||||
* \brief Page to list orders
|
||||
* \version $Id$
|
||||
* \version $Id: liste.php,v 1.77 2011/07/04 10:30:02 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -115,19 +115,19 @@ if ($viewstatut <> '')
|
||||
}
|
||||
if ($_GET['ordermonth'] > 0)
|
||||
{
|
||||
$sql.= " AND date_format(c.date_valid, '%Y-%m') = '$orderyear-$ordermonth'";
|
||||
$sql.= " AND date_format(c.date_valid, '%Y-%m') = '".$orderyear."-".$ordermonth."'";
|
||||
}
|
||||
if ($_GET['orderyear'] > 0)
|
||||
{
|
||||
$sql.= " AND date_format(c.date_valid, '%Y') = $orderyear";
|
||||
$sql.= " AND date_format(c.date_valid, '%Y') = '".$orderyear."'";
|
||||
}
|
||||
if ($_GET['deliverymonth'] > 0)
|
||||
{
|
||||
$sql.= " AND date_format(c.date_livraison, '%Y-%m') = '$deliveryyear-$deliverymonth'";
|
||||
$sql.= " AND date_format(c.date_livraison, '%Y-%m') = '".$deliveryyear."-".$deliverymonth."'";
|
||||
}
|
||||
if ($_GET['deliveryyear'] > 0)
|
||||
{
|
||||
$sql.= " AND date_format(c.date_livraison, '%Y') = $deliveryyear";
|
||||
$sql.= " AND date_format(c.date_livraison, '%Y') = '".$deliveryyear."'";
|
||||
}
|
||||
if (!empty($snom))
|
||||
{
|
||||
@ -278,5 +278,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:30:02 $ - $Revision: 1.77 $');
|
||||
?>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/compta/bank/account.php
|
||||
* \ingroup banque
|
||||
* \brief List of details of bank transactions for an account
|
||||
* \version $Id$
|
||||
* \version $Id: account.php,v 1.154 2011/07/04 11:33:22 eldy Exp $
|
||||
*/
|
||||
|
||||
require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu
|
||||
@ -491,7 +491,7 @@ if ($account || $_GET["ref"])
|
||||
if ($result)
|
||||
{
|
||||
$now=dol_now();
|
||||
$nows=dol_date('Ymd',$now);
|
||||
$nows=dol_print_date($now,'%Y%m%d');
|
||||
|
||||
//$html->load_cache_types_paiements();
|
||||
//$html->cache_types_paiements
|
||||
@ -510,7 +510,7 @@ if ($account || $_GET["ref"])
|
||||
$var=!$var;
|
||||
|
||||
// Is it a transaction in future ?
|
||||
$dos=dol_date('Ymd',$db->jdate($objp->do));
|
||||
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
|
||||
//print "dos=".$dos." nows=".$nows;
|
||||
if ($dos > $nows && !$sep) // Yes, we show a subtotal
|
||||
{
|
||||
@ -786,5 +786,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 11:33:22 $ - $Revision: 1.154 $');
|
||||
?>
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* \file htdocs/compta/bank/class/account.class.php
|
||||
* \ingroup banque
|
||||
* \brief File of class to manage bank accounts
|
||||
* \version $Id$
|
||||
* \version $Id: account.class.php,v 1.32 2011/07/04 10:44:36 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||
@ -769,51 +769,54 @@ class Account extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param rowid
|
||||
* @param sign 1 or -1
|
||||
*/
|
||||
function datev_change($rowid,$sign=1)
|
||||
{
|
||||
$sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$this->db->fetch_object($resql);
|
||||
$newdate=$this->db->jdate($obj->datev)+(3600*24*$sign);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET ";
|
||||
$sql.= " datev = '".$this->db->idate($newdate)."'";
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->affected_rows($result))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rowid
|
||||
*/
|
||||
function datev_next($rowid)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET ";
|
||||
$sql.= " datev = adddate(datev, interval 1 day)";
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->affected_rows($result))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
return $this->datev_change($rowid,1);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param rowid
|
||||
*/
|
||||
function datev_previous($rowid)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank SET ";
|
||||
$sql.= " datev = adddate(datev, interval -1 day)";
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->affected_rows($result))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
return $this->datev_change($rowid,-1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1040,7 +1043,7 @@ class AccountLine extends CommonObject
|
||||
|
||||
/**
|
||||
* Load into memory content of a bank transaction line
|
||||
* @param id Id of bank transaction to load
|
||||
* @param rowid Id of bank transaction to load
|
||||
* @param ref Ref of bank transaction to load
|
||||
* @param num External num to load (ex: num of transaction for paypal fee)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -1159,7 +1162,7 @@ class AccountLine extends CommonObject
|
||||
* Update bank account record in database
|
||||
* @param user Object user making update
|
||||
* @param notrigger 0=Disable all triggers
|
||||
* @param int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user,$notrigger=0)
|
||||
{
|
||||
@ -1192,7 +1195,7 @@ class AccountLine extends CommonObject
|
||||
* Update conciliation field
|
||||
* @param user Objet user making update
|
||||
* @param cat Category id
|
||||
* @param int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_conciliation($user,$cat)
|
||||
{
|
||||
@ -1237,8 +1240,8 @@ class AccountLine extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet facture
|
||||
* @param id Id de la facture a charger
|
||||
* Charge les informations d'ordre info dans l'objet
|
||||
* @param rowid Id of object
|
||||
*/
|
||||
function info($rowid)
|
||||
{
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/compta/bank/pre.inc.php
|
||||
* \ingroup compta
|
||||
* \brief Fichier gestionnaire du menu compta banque
|
||||
* \version $Id$
|
||||
* \version $Id: pre.inc.php,v 1.51 2011/07/04 11:33:22 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once("../../main.inc.php");
|
||||
@ -73,16 +73,11 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add_submenu('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
$menu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != 2 && ! $objp->clos) // If not cash account and not closed and can be reconciliate
|
||||
{
|
||||
$menu->add_submenu('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
$menu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
/*
|
||||
$menu->add_submenu("/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu("/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
if ($objp->courant != 2) $menu->add_submenu("/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/compta/bank/virement.php
|
||||
* \ingroup banque
|
||||
* \brief Page de saisie d'un virement
|
||||
* \version $Id$
|
||||
* \version $Id: virement.php,v 1.48 2011/07/04 10:34:56 eldy Exp $
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
@ -49,7 +49,7 @@ if ($_POST["action"] == 'add')
|
||||
if (! $label)
|
||||
{
|
||||
$error=1;
|
||||
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"))."</div>";
|
||||
$mesg.="<div class=\"error\">".$langs->trans("ErrorFieldRequired",$langs->transnoentities("Description"))."</div>";
|
||||
}
|
||||
if (! $amount)
|
||||
{
|
||||
@ -138,9 +138,7 @@ $html=new Form($db);
|
||||
|
||||
print_fiche_titre($langs->trans("BankTransfer"));
|
||||
|
||||
if ($mesg) {
|
||||
print "$mesg<br>";
|
||||
}
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print $langs->trans("TransferDesc");
|
||||
print "<br><br>";
|
||||
@ -178,5 +176,5 @@ print "</form>";
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:34:56 $ - $Revision: 1.48 $');
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/compta/deplacement/class/deplacementstats.class.php
|
||||
* \ingroup factures
|
||||
* \brief Fichier de la classe de gestion des stats des deplacement et notes de frais
|
||||
* \version $Id$
|
||||
* \version $Id: deplacementstats.class.php,v 1.5 2011/07/04 10:30:02 eldy Exp $
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/class/stats.class.php";
|
||||
include_once DOL_DOCUMENT_ROOT . "/compta/deplacement/class/deplacement.class.php";
|
||||
@ -117,7 +117,7 @@ class DeplacementStats extends Stats
|
||||
{
|
||||
$sql = "SELECT date_format(dated,'%m') as dm, sum(".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(dated,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
@ -136,7 +136,7 @@ class DeplacementStats extends Stats
|
||||
{
|
||||
$sql = "SELECT date_format(dated,'%m') as dm, avg(".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(dated,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* \file htdocs/compta/facture/class/facture.class.php
|
||||
* \ingroup facture
|
||||
* \brief Fichier de la classe des factures clients
|
||||
* \version $Id: facture.class.php,v 1.122 2011/06/30 13:27:20 hregis Exp $
|
||||
* \version $Id: facture.class.php,v 1.123 2011/07/04 10:35:48 hregis Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||
@ -1664,6 +1664,8 @@ class Facture extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->oldref = '';
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
@ -1679,6 +1681,8 @@ class Facture extends CommonObject
|
||||
|
||||
if (@rename($dirsource, $dirdest))
|
||||
{
|
||||
$this->oldref = $facref;
|
||||
|
||||
dol_syslog("Rename ok");
|
||||
// Suppression ancien fichier PDF dans nouveau rep
|
||||
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'.*');
|
||||
@ -1690,7 +1694,7 @@ class Facture extends CommonObject
|
||||
// Set new ref and define current statut
|
||||
if (! $error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->ref = $num;
|
||||
$this->facnumber=$num;
|
||||
$this->statut=1;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/compta/facture/class/facturestats.class.php
|
||||
* \ingroup factures
|
||||
* \brief Fichier de la classe de gestion des stats des factures
|
||||
* \version $Id$
|
||||
* \version $Id: facturestats.class.php,v 1.6 2011/07/04 10:30:01 eldy Exp $
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/class/stats.class.php";
|
||||
include_once DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php";
|
||||
@ -78,7 +78,7 @@ class FactureStats extends Stats
|
||||
|
||||
$this->where = " fk_statut > 0";
|
||||
$this->where.= " AND entity = ".$conf->entity;
|
||||
if ($mode == 'customer') $this->where.=" AND (fk_statut != 3 OR close_code != 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons)
|
||||
if ($mode == 'customer') $this->where.=" AND (fk_statut <> 3 OR close_code <> 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons)
|
||||
if ($this->socid)
|
||||
{
|
||||
$this->where.=" AND fk_soc = ".$this->socid;
|
||||
@ -132,7 +132,7 @@ class FactureStats extends Stats
|
||||
{
|
||||
$sql = "SELECT date_format(datef,'%m') as dm, SUM(".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE date_format(datef,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(datef,'%Y') = '".$year."'";
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/compta/facture/document.php
|
||||
* \ingroup facture
|
||||
* \brief Page for attached files on invoices
|
||||
* \version $Id$
|
||||
* \version $Id: document.php,v 1.43 2011/07/05 16:10:56 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
@ -38,19 +38,19 @@ $langs->load('compta');
|
||||
$langs->load('other');
|
||||
$langs->load("bills");
|
||||
|
||||
if (!$user->rights->facture->lire)
|
||||
accessforbidden();
|
||||
|
||||
$facid=empty($_GET['facid']) ? 0 : intVal($_GET['facid']);
|
||||
$action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action'];
|
||||
$action = GETPOST('action');
|
||||
$confirm = GETPOST('confirm');
|
||||
$id = GETPOST('facid');
|
||||
$ref = GETPOST('ref');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
if ($user->societe_id)
|
||||
{
|
||||
unset($_GET["action"]);
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'facture',$id,'');
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -63,6 +63,8 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
$object = new Facture($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -71,12 +73,11 @@ if (! $sortfield) $sortfield="name";
|
||||
// Envoi fichier
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$facture = new Facture($db);
|
||||
if ($facture->fetch($facid))
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($facture->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
{
|
||||
@ -106,15 +107,13 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($action=='delete')
|
||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
$facture = new Facture($db);
|
||||
|
||||
$facid=$_GET["id"];
|
||||
if ($facture->fetch($facid))
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($facture->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
@ -133,15 +132,13 @@ $id = $_GET['facid']?$_GET['facid']:$_GET['id'];
|
||||
$ref= $_GET['ref'];
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$facture = new Facture($db);
|
||||
if ($facture->fetch($id,$ref) > 0)
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
$upload_dir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($facture->ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
$societe = new Societe($db);
|
||||
$societe->fetch($facture->socid);
|
||||
|
||||
$head = facture_prepare_head($facture);
|
||||
$head = facture_prepare_head($object);
|
||||
dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), 0, 'bill');
|
||||
|
||||
|
||||
@ -162,7 +159,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<td colspan="3">';
|
||||
$morehtmlref='';
|
||||
$discount=new DiscountAbsolute($db);
|
||||
$result=$discount->fetch(0,$facture->id);
|
||||
$result=$discount->fetch(0,$object->id);
|
||||
if ($result > 0)
|
||||
{
|
||||
$morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')';
|
||||
@ -171,28 +168,37 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
dol_print_error('',$discount->error);
|
||||
}
|
||||
print $html->showrefnav($facture,'ref','',1,'facnumber','ref',$morehtmlref);
|
||||
print $html->showrefnav($object,'ref','',1,'facnumber','ref',$morehtmlref);
|
||||
print '</td></tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->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>';
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
if ($mesg) { print $mesg."<br>"; }
|
||||
dol_htmloutput_mesg($mesg,$mesgs);
|
||||
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$facture->id,'',0,0,$user->rights->facture->creer);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id,'',0,0,$user->rights->facture->creer);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&facid='.$facture->id;
|
||||
$formfile->list_of_documents($filearray,$facture,'facture',$param);
|
||||
$param='&facid='.$object->id;
|
||||
$formfile->list_of_documents($filearray,$object,'facture',$param);
|
||||
|
||||
}
|
||||
else
|
||||
@ -207,5 +213,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/05 16:10:56 $ - $Revision: 1.43 $');
|
||||
?>
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* \file htdocs/compta/paiement.php
|
||||
* \ingroup compta
|
||||
* \brief Page to create a payment
|
||||
* \version $Id: paiement.php,v 1.108 2011/07/01 16:18:10 hregis Exp $
|
||||
* \version $Id: paiement.php,v 1.109 2011/07/04 16:39:48 cdelambert Exp $
|
||||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
@ -521,19 +521,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
if (! empty($conf->global->MAIN_JS_ON_PAYMENT))
|
||||
{
|
||||
print img_picto($langs->trans('AddRemind'),'rightarrow.png','id="calcRemind'.$i.'" onclick="calcRemind(\''.$i.'\');return false;"');
|
||||
print '<script type="text/javascript" language="javascript">';
|
||||
print 'amountInput.push(new Array("'.$namef.'","'.price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits)).'","0"));'; // Push a new Array into the amountInput Array
|
||||
print 'jQuery(document).ready(function () {';
|
||||
print 'jQuery("#'.$namef.'").keyup(function() { changeAmount('.$i.'); });';
|
||||
print '});</script>';
|
||||
print img_picto($langs->trans('AddRemind'),'rightarrow.png','id="'.$objp->facid.'" "');
|
||||
}
|
||||
print '<input id="'.$namef.'" type="text" size="8" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
print '<input type=hidden name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled="true">';
|
||||
print '<input id="'.$namef.'" type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
@ -682,5 +678,5 @@ if (! GETPOST('action'))
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/01 16:18:10 $ - $Revision: 1.108 $');
|
||||
llxFooter('$Date: 2011/07/04 16:39:48 $ - $Revision: 1.109 $');
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/compta/paiement/cheque/pre.inc.php
|
||||
* \ingroup compta
|
||||
* \brief Fichier gestionnaire du menu cheques
|
||||
* \version $Id$
|
||||
* \version $Id: pre.inc.php,v 1.19 2011/07/04 11:33:23 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once("../../../main.inc.php");
|
||||
@ -72,16 +72,11 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add_submenu('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
$menu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != 2) // If not cash account and can be reconciliate
|
||||
{
|
||||
$menu->add_submenu('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
$menu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
/*
|
||||
$menu->add_submenu("/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu("/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
if ($objp->courant != 2) $menu->add_submenu("/compta/bank/releve.php?account=".$objp->rowid ,$langs->trans("AccountStatements"));
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/compta/propal.php
|
||||
* \ingroup propale
|
||||
* \brief Page liste des propales (vision compta)
|
||||
* \version $Id$
|
||||
* \version $Id: propal.php,v 1.193 2011/07/04 10:30:00 eldy Exp $
|
||||
*/
|
||||
|
||||
require('../main.inc.php');
|
||||
@ -561,11 +561,11 @@ else
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
$sql.= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
||||
$sql.= " AND date_format(p.datep, '%Y-%m') = '".$year."-".$month."'";
|
||||
else
|
||||
$sql.= " AND date_format(p.datep, '%m') = '$month'";
|
||||
$sql.= " AND date_format(p.datep, '%m') = '".$month."'";
|
||||
}
|
||||
if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = $year";
|
||||
if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = '".$year."'";
|
||||
if (!empty($_GET['search_ref']))
|
||||
{
|
||||
$sql.= " AND p.ref LIKE '%".$db->escape($_GET['search_ref'])."%'";
|
||||
@ -702,6 +702,6 @@ else
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:30:00 $ - $Revision: 1.193 $');
|
||||
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/compta/sociales/index.php
|
||||
* \ingroup tax
|
||||
* \brief Page to list all social contributions
|
||||
* \version $Id$
|
||||
* \version $Id: index.php,v 1.65 2011/07/04 10:30:01 eldy Exp $
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
@ -86,8 +86,8 @@ if ($year > 0)
|
||||
$sql .= " AND (";
|
||||
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
|
||||
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
|
||||
$sql .= " (s.periode is not null and date_format(s.periode, '%Y') = ".$year.") ";
|
||||
$sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = ".$year.")";
|
||||
$sql .= " (s.periode is not null and date_format(s.periode, '%Y') = '".$year."') ";
|
||||
$sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = '".$year."')";
|
||||
$sql .= ")";
|
||||
}
|
||||
if ($filtre) {
|
||||
@ -229,5 +229,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:30:01 $ - $Revision: 1.65 $');
|
||||
?>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/stats/comp.php
|
||||
* \ingroup commercial
|
||||
* \version $Id: comp.php,v 1.43 2011/06/29 11:22:36 eldy Exp $
|
||||
* \version $Id: comp.php,v 1.44 2011/07/04 10:30:01 eldy Exp $
|
||||
* TODO Remove or add page in menus
|
||||
*/
|
||||
|
||||
@ -47,8 +47,9 @@ function propals ($db, $year, $month)
|
||||
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_statut in (1,2,4)";
|
||||
$sql.= " AND date_format(p.datep, '%Y') = ".$year;
|
||||
$sql.= " AND round(date_format(p.datep, '%m')) = ".$month;
|
||||
// TODO Use between instead of date_format
|
||||
$sql.= " AND date_format(p.datep, '%Y') = '".$year."'";
|
||||
$sql.= " AND round(date_format(p.datep, '%m')) = '".$month."'";
|
||||
$sql.= " ORDER BY p.fk_statut";
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -121,7 +122,7 @@ function factures ($db, $year, $month, $paye)
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($conf->compta->mode != 'CREANCES-DETTES') $sql.= " AND f.paye = ".$paye;
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND date_format(f.datef, '%Y') = ".$year;
|
||||
$sql.= " AND date_format(f.datef, '%Y') = '".$year."'";
|
||||
$sql.= " AND round(date_format(f.datef, '%m')) = ".$month;
|
||||
$sql.= " ORDER BY f.datef DESC ";
|
||||
|
||||
@ -271,7 +272,7 @@ function ppt ($db, $year, $socid)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||
$sql.= " WHERE p.fk_statut in (1,2,4)";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " AND date_format(p.datep,'%Y') = '".$year."'";
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY dm";
|
||||
|
||||
@ -284,7 +285,7 @@ function ppt ($db, $year, $socid)
|
||||
$sql.= " WHERE f.fk_statut in (1,2)";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($conf->compta->mode != 'CREANCES-DETTES') $sql.= " AND f.paye = 1";
|
||||
$sql.= " AND date_format(f.datef,'%Y') = ".$year;
|
||||
$sql.= " AND date_format(f.datef,'%Y') = '".$year."'";
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY dm";
|
||||
|
||||
@ -350,5 +351,5 @@ if ($details == 1)
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter('$Date: 2011/06/29 11:22:36 $ - $Revision: 1.43 $');
|
||||
llxFooter('$Date: 2011/07/04 10:30:01 $ - $Revision: 1.44 $');
|
||||
?>
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
\file htdocs/compta/tva/quadri.php
|
||||
\ingroup tax
|
||||
\brief Trimestrial page
|
||||
\version $Id$
|
||||
\version $Id: quadri.php,v 1.15 2011/07/04 10:30:00 eldy Exp $
|
||||
\todo Deal with recurrent invoices as well
|
||||
*/
|
||||
|
||||
@ -49,13 +49,12 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
|
||||
/**
|
||||
* Gets VAT to collect for the given month of the given year
|
||||
*
|
||||
* The function gets the VAT in split results, as the VAT declaration asks
|
||||
* to report the amounts for different VAT rates as different lines.
|
||||
* This function also accounts recurrent invoices
|
||||
* @param object Database handler object
|
||||
* @param integer Year
|
||||
* @param integer Year quarter (1-4)
|
||||
* @param db Database handler
|
||||
* @param y Year
|
||||
* @param q Year quarter (1-4)
|
||||
*/
|
||||
function tva_coll($db,$y,$q)
|
||||
{
|
||||
@ -71,9 +70,9 @@ function tva_coll($db,$y,$q)
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND f.fk_statut in (1,2)";
|
||||
$sql.= " AND f.rowid = d.fk_facture ";
|
||||
$sql.= " AND date_format(f.datef,'%Y') = ".$y;
|
||||
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3);
|
||||
$sql.= " AND date_format(f.datef,'%m') <= ".($q*3).")";
|
||||
$sql.= " AND date_format(f.datef,'%Y') = '".$y."'";
|
||||
$sql.= " AND (round(date_format(f.datef,'%m') > ".(($q-1)*3);
|
||||
$sql.= " AND round(date_format(f.datef,'%m')) <= ".($q*3).")";
|
||||
$sql.= " ORDER BY rate, facid";
|
||||
|
||||
}
|
||||
@ -116,12 +115,11 @@ function tva_coll($db,$y,$q)
|
||||
|
||||
/**
|
||||
* Gets VAT to pay for the given month of the given year
|
||||
*
|
||||
* The function gets the VAT in split results, as the VAT declaration asks
|
||||
* to report the amounts for different VAT rates as different lines.
|
||||
* @param object Database handler object
|
||||
* @param integer Year
|
||||
* @param integer Year quarter (1-4)
|
||||
* @param y Year
|
||||
* @param q Year quarter (1-4)
|
||||
*/
|
||||
function tva_paye($db, $y,$q)
|
||||
{
|
||||
@ -138,9 +136,9 @@ function tva_paye($db, $y,$q)
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND f.fk_statut = 1 ";
|
||||
$sql.= " AND f.rowid = d.fk_facture_fourn ";
|
||||
$sql.= " AND date_format(f.datef,'%Y') = ".$y;
|
||||
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3);
|
||||
$sql.= " AND date_format(f.datef,'%m') <= ".($q*3).")";
|
||||
$sql.= " AND date_format(f.datef,'%Y') = '".$y."'";
|
||||
$sql.= " AND (round(date_format(f.datef,'%m')) > ".(($q-1)*3);
|
||||
$sql.= " AND round(date_format(f.datef,'%m')) <= ".($q*3).")";
|
||||
$sql.= " ORDER BY rate, facid ";
|
||||
}
|
||||
else
|
||||
@ -317,5 +315,5 @@ echo '</table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:30:00 $ - $Revision: 1.15 $');
|
||||
?>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/contact/class/contact.class.php
|
||||
* \ingroup societe
|
||||
* \brief File of contacts class
|
||||
* \version $Id$
|
||||
* \version $Id: contact.class.php,v 1.30 2011/07/04 09:36:29 eldy Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||
|
||||
@ -83,7 +83,6 @@ class Contact extends CommonObject
|
||||
/**
|
||||
* Constructor of class Contact
|
||||
* @param DB Habler d'acces base
|
||||
* @param id Id contact
|
||||
*/
|
||||
function Contact($DB)
|
||||
{
|
||||
@ -583,7 +582,7 @@ class Contact extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Charge le nombre d'elements auquel est lie ce contact
|
||||
* ref_facturation
|
||||
* ref_contrat
|
||||
@ -626,9 +625,10 @@ class Contact extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* \brief Efface le contact de la base
|
||||
* \return int <0 si ko, >0 si ok
|
||||
/**
|
||||
* Efface le contact de la base
|
||||
* @param notrigger Disable all trigger
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($notrigger=0)
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* \file htdocs/contact/fiche.php
|
||||
* \ingroup societe
|
||||
* \brief Card of a contact
|
||||
* \version $Id: fiche.php,v 1.220 2011/07/02 14:53:42 eldy Exp $
|
||||
* \version $Id: fiche.php,v 1.221 2011/07/04 08:00:52 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -123,7 +123,14 @@ if (method_exists($objcanvas->control,'doActions'))
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Creation utilisateur depuis contact
|
||||
// Cancel
|
||||
if (GETPOST("cancel") && GETPOST('backtopage'))
|
||||
{
|
||||
header("Location: ".GETPOST('backtopage'));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Creation utilisateur depuis contact
|
||||
if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer)
|
||||
{
|
||||
// Recuperation contact actuel
|
||||
@ -162,13 +169,6 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if (GETPOST("cancel") && GETPOST('backtopage'))
|
||||
{
|
||||
header("Location: ".GETPOST('backtopage'));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Add contact
|
||||
if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer)
|
||||
{
|
||||
@ -974,5 +974,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/02 14:53:42 $ - $Revision: 1.220 $');
|
||||
llxFooter('$Date: 2011/07/04 08:00:52 $ - $Revision: 1.221 $');
|
||||
?>
|
||||
|
||||
@ -119,50 +119,57 @@ class UploadHandler
|
||||
private function create_scaled_image($file_name, $options) {
|
||||
$file_path = $this->options['upload_dir'].$file_name;
|
||||
$new_file_path = $options['upload_dir'].$file_name;
|
||||
list($img_width, $img_height) = @getimagesize($file_path);
|
||||
if (!$img_width || !$img_height) {
|
||||
return false;
|
||||
if (create_exdir($options['upload_dir']) >= 0)
|
||||
{
|
||||
list($img_width, $img_height) = @getimagesize($file_path);
|
||||
if (!$img_width || !$img_height) {
|
||||
return false;
|
||||
}
|
||||
$scale = min(
|
||||
$options['max_width'] / $img_width,
|
||||
$options['max_height'] / $img_height
|
||||
);
|
||||
if ($scale > 1) {
|
||||
$scale = 1;
|
||||
}
|
||||
$new_width = $img_width * $scale;
|
||||
$new_height = $img_height * $scale;
|
||||
$new_img = @imagecreatetruecolor($new_width, $new_height);
|
||||
switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$src_img = @imagecreatefromjpeg($file_path);
|
||||
$write_image = 'imagejpeg';
|
||||
break;
|
||||
case 'gif':
|
||||
$src_img = @imagecreatefromgif($file_path);
|
||||
$write_image = 'imagegif';
|
||||
break;
|
||||
case 'png':
|
||||
$src_img = @imagecreatefrompng($file_path);
|
||||
$write_image = 'imagepng';
|
||||
break;
|
||||
default:
|
||||
$src_img = $image_method = null;
|
||||
}
|
||||
$success = $src_img && @imagecopyresampled(
|
||||
$new_img,
|
||||
$src_img,
|
||||
0, 0, 0, 0,
|
||||
$new_width,
|
||||
$new_height,
|
||||
$img_width,
|
||||
$img_height
|
||||
) && $write_image($new_img, $new_file_path);
|
||||
// Free up memory (imagedestroy does not delete files):
|
||||
@imagedestroy($src_img);
|
||||
@imagedestroy($new_img);
|
||||
return $success;
|
||||
}
|
||||
$scale = min(
|
||||
$options['max_width'] / $img_width,
|
||||
$options['max_height'] / $img_height
|
||||
);
|
||||
if ($scale > 1) {
|
||||
$scale = 1;
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$new_width = $img_width * $scale;
|
||||
$new_height = $img_height * $scale;
|
||||
$new_img = @imagecreatetruecolor($new_width, $new_height);
|
||||
switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$src_img = @imagecreatefromjpeg($file_path);
|
||||
$write_image = 'imagejpeg';
|
||||
break;
|
||||
case 'gif':
|
||||
$src_img = @imagecreatefromgif($file_path);
|
||||
$write_image = 'imagegif';
|
||||
break;
|
||||
case 'png':
|
||||
$src_img = @imagecreatefrompng($file_path);
|
||||
$write_image = 'imagepng';
|
||||
break;
|
||||
default:
|
||||
$src_img = $image_method = null;
|
||||
}
|
||||
$success = $src_img && @imagecopyresampled(
|
||||
$new_img,
|
||||
$src_img,
|
||||
0, 0, 0, 0,
|
||||
$new_width,
|
||||
$new_height,
|
||||
$img_width,
|
||||
$img_height
|
||||
) && $write_image($new_img, $new_file_path);
|
||||
// Free up memory (imagedestroy does not delete files):
|
||||
@imagedestroy($src_img);
|
||||
@imagedestroy($new_img);
|
||||
return $success;
|
||||
}
|
||||
|
||||
private function has_error($uploaded_file, $file, $error) {
|
||||
@ -202,7 +209,7 @@ class UploadHandler
|
||||
$file->size = intval($size);
|
||||
$file->type = $type;
|
||||
$error = $this->has_error($uploaded_file, $file, $error);
|
||||
if (!$error && $file->name) {
|
||||
if (!$error && $file->name && create_exdir($this->options['upload_dir']) >= 0) {
|
||||
if ($file->name[0] === '.') {
|
||||
$file->name = substr($file->name, 1);
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/core/class/commonobject.class.php
|
||||
* \ingroup core
|
||||
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
|
||||
* \version $Id: commonobject.class.php,v 1.143 2011/07/01 23:05:39 eldy Exp $
|
||||
* \version $Id: commonobject.class.php,v 1.144 2011/07/04 09:36:29 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -78,11 +78,12 @@ class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Add a link between element $this->element and a contact
|
||||
* \param fk_socpeople Id of contact to link
|
||||
* \param type_contact Type of contact (code or id)
|
||||
* \param source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Add a link between element $this->element and a contact
|
||||
* @param fk_socpeople Id of contact to link
|
||||
* @param type_contact Type of contact (code or id)
|
||||
* @param source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
|
||||
* @param notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
|
||||
{
|
||||
@ -168,11 +169,11 @@ class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Update a link to contact line
|
||||
* \param rowid Id of line contact-element
|
||||
* \param statut New status of link
|
||||
* \param type_contact_id Id of contact type
|
||||
* \return int <0 if KO, >= 0 if OK
|
||||
* Update a link to contact line
|
||||
* @param rowid Id of line contact-element
|
||||
* @param statut New status of link
|
||||
* @param type_contact_id Id of contact type
|
||||
* @return int <0 if KO, >= 0 if OK
|
||||
*/
|
||||
function update_contact($rowid, $statut, $type_contact_id)
|
||||
{
|
||||
@ -194,9 +195,10 @@ class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Delete a link to contact line
|
||||
* \param rowid Id of link line to delete
|
||||
* \return statur >0 si ok, <0 si ko
|
||||
* Delete a link to contact line
|
||||
* @param rowid Id of contact link line to delete
|
||||
* @param notrigger Disable all triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function delete_contact($rowid,$notrigger=0)
|
||||
{
|
||||
@ -1321,8 +1323,8 @@ class CommonObject
|
||||
/**
|
||||
* Set statut of an object
|
||||
* @param statut Statut to set
|
||||
* @param elementid Id of element to force (use this->id by default)
|
||||
* @param elementtype Type of element to force (use ->this->element by default)
|
||||
* @param elementId Id of element to force (use this->id by default)
|
||||
* @param elementType Type of element to force (use ->this->element by default)
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function setStatut($statut,$elementId='',$elementType='')
|
||||
@ -1664,6 +1666,8 @@ class CommonObject
|
||||
* TODO Edit templates to use global variables and include them directly in controller call
|
||||
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
||||
* @param $dateSelector 1=Show also date range input fields
|
||||
* @param $seller Object thirdparty who sell
|
||||
* @param $buyer Object thirdparty who buy
|
||||
*/
|
||||
function formAddPredefinedProduct($dateSelector,$seller,$buyer)
|
||||
{
|
||||
@ -1699,10 +1703,11 @@ class CommonObject
|
||||
* TODO Move this into an output class file (htmlline.class.php)
|
||||
* If lines are into a template, title must also be into a template
|
||||
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
|
||||
* @param $seller Object of seller third party
|
||||
* @param $buyer Object of buyer third party
|
||||
* @param $selected Object line selected
|
||||
* @param $dateSelector 1=Show also date range input fields
|
||||
* @param $action Action code
|
||||
* @param $seller Object of seller third party
|
||||
* @param $buyer Object of buyer third party
|
||||
* @param $selected Object line selected
|
||||
* @param $dateSelector 1=Show also date range input fields
|
||||
*/
|
||||
function printObjectLines($action='viewline',$seller,$buyer,$selected=0,$dateSelector=0)
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
* \file htdocs/core/class/html.form.class.php
|
||||
* \ingroup core
|
||||
* \brief File of class with all html predefined components
|
||||
* \version $Id: html.form.class.php,v 1.184 2011/06/29 15:48:03 grandoc Exp $
|
||||
* \version $Id: html.form.class.php,v 1.186 2011/07/04 11:33:22 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -134,15 +134,6 @@ class Form
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Old version of textwithtooltip. Kept for backward compatibility with modules for 2.6.
|
||||
* @deprecated
|
||||
*/
|
||||
function textwithhelp($text,$htmltext,$tooltipon=1)
|
||||
{
|
||||
return $this->textwithtooltip($text,$htmltext,$tooltipon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a text and picto with tooltip on text or picto
|
||||
* @param text Text to show
|
||||
@ -163,19 +154,14 @@ class Form
|
||||
if ($incbefore) $text = $incbefore.$text;
|
||||
if (! $htmltext) return $text;
|
||||
|
||||
$paramfortooltip ='';
|
||||
|
||||
// Sanitize tooltip
|
||||
$htmltext=str_replace("\\","\\\\",$htmltext);
|
||||
//$htmltext=str_replace("'","\'",$htmltext);
|
||||
//$htmltext=str_replace("'","\'",$htmltext);
|
||||
$htmltext=str_replace("\r","",$htmltext);
|
||||
$htmltext=str_replace("<br>\n","<br>",$htmltext);
|
||||
$htmltext=str_replace("\n","",$htmltext);
|
||||
|
||||
$htmltext=str_replace('"',""",$htmltext);
|
||||
$extracss = (!empty($extracss) ? ' '.$extracss : '');
|
||||
$paramfortooltip.=' class="classfortooltip'.$extracss.'" title="'.$htmltext.'"'; // Attribut to put on td tag to store tooltip
|
||||
$paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.dol_escape_htmltag($htmltext,1).'"'; // Attribut to put on td img tag to store tooltip
|
||||
$paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
||||
|
||||
$s="";
|
||||
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
||||
@ -183,18 +169,18 @@ class Form
|
||||
{
|
||||
if ($text != '')
|
||||
{
|
||||
$s.='<td'.$paramfortooltip.'>'.$text;
|
||||
$s.='<td'.$paramfortooltiptd.'>'.$text;
|
||||
if ($direction) $s.=' ';
|
||||
$s.='</td>';
|
||||
}
|
||||
if ($direction) $s.='<td'.$paramfortooltip.' valign="top" width="14">'.$img.'</td>';
|
||||
if ($direction) $s.='<td'.$paramfortooltipimg.' valign="top" width="14">'.$img.'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($direction) $s.='<td'.$paramfortooltip.' valign="top" width="14">'.$img.'</td>';
|
||||
if ($direction) $s.='<td'.$paramfortooltipimg.' valign="top" width="14">'.$img.'</td>';
|
||||
if ($text != '')
|
||||
{
|
||||
$s.='<td'.$paramfortooltip.'>';
|
||||
$s.='<td'.$paramfortooltiptd.'>';
|
||||
if ($direction) $s.=' ';
|
||||
$s.=$text.'</td>';
|
||||
}
|
||||
@ -210,6 +196,7 @@ class Form
|
||||
* @param htmltooltip Content of tooltip
|
||||
* @param direction 1=Icon is after text, -1=Icon is before text
|
||||
* @param type Type of picto (info, help, warning, superadmin...)
|
||||
* @param extracss Add a CSS style to td tags
|
||||
* @return string HTML code of text, picto, tooltip
|
||||
*/
|
||||
function textwithpicto($text,$htmltext,$direction=1,$type='help',$extracss='')
|
||||
@ -2511,7 +2498,7 @@ class Form
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche formulaire de selection des tiers
|
||||
* \param page Page
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/core/class/html.formfile.class.php
|
||||
* \ingroup core
|
||||
* \brief File of class to offer components to list and upload files
|
||||
* \version $Id: html.formfile.class.php,v 1.37 2011/07/03 15:04:18 hregis Exp $
|
||||
* \version $Id: html.formfile.class.php,v 1.38 2011/07/05 09:14:27 hregis Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -739,12 +739,27 @@ class FormFile
|
||||
{
|
||||
global $langs;
|
||||
|
||||
// PHP post_max_size
|
||||
$post_max_size = ini_get('post_max_size');
|
||||
$mul_post_max_size = substr($post_max_size, -1);
|
||||
$mul_post_max_size = ($mul_post_max_size == 'M' ? 1048576 : ($mul_post_max_size == 'K' ? 1024 : ($mul_post_max_size == 'G' ? 1073741824 : 1)));
|
||||
$post_max_size = $mul_post_max_size*(int)$post_max_size;
|
||||
// PHP upload_max_filesize
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
$mul_upload_max_filesize = substr($upload_max_filesize, -1);
|
||||
$mul_upload_max_filesize = ($mul_upload_max_filesize == 'M' ? 1048576 : ($mul_upload_max_filesize == 'K' ? 1024 : ($mul_upload_max_filesize == 'G' ? 1073741824 : 1)));
|
||||
$upload_max_filesize = $mul_upload_max_filesize*(int)$upload_max_filesize;
|
||||
// Max file size
|
||||
$max_file_size = (($post_max_size < $upload_max_filesize) ? $post_max_size : $upload_max_filesize);
|
||||
|
||||
print '<script type="text/javascript">
|
||||
$(function () {
|
||||
\'use strict\';
|
||||
|
||||
var max_file_size = \''.$max_file_size.'\';
|
||||
|
||||
// Initialize the jQuery File Upload widget:
|
||||
$("#fileupload").fileupload();
|
||||
$("#fileupload").fileupload( { maxFileSize: max_file_size} );
|
||||
|
||||
// Load existing files:
|
||||
$.getJSON($("#fileupload form").prop("action"), { fk_element: "'.$object->id.'", element: "'.$object->element.'"}, function (files) {
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
* \file htdocs/core/class/html.formother.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe des fonctions predefinie de composants html autre
|
||||
* \version $Id: html.formother.class.php,v 1.16 2011/06/26 09:32:13 hregis Exp $
|
||||
* \version $Id: html.formother.class.php,v 1.17 2011/07/04 08:53:01 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -653,7 +653,8 @@ class FormOther
|
||||
* @param $parent
|
||||
* @param $lines
|
||||
* @param $level
|
||||
* @param $selected
|
||||
* @param $selectedtask
|
||||
* @param $selectedproject
|
||||
*/
|
||||
function PLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
|
||||
{
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
* \file htdocs/core/class/menu.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe de gestion du menu gauche
|
||||
* \version $Id$
|
||||
* \version $Id: menu.class.php,v 1.4 2011/07/04 11:33:22 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -76,18 +76,4 @@ class Menu {
|
||||
if (sizeof($this->liste) > 1) array_pop($this->liste);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Add a menu entry
|
||||
* \param url Url to follown on click
|
||||
* \param titre Menu label to show
|
||||
* \param level Level of menu to show (0=First level, 1=Second...)
|
||||
* \param enabled Menu active or not
|
||||
* \param target Target lien
|
||||
* \deprecated
|
||||
*/
|
||||
function add_submenu($url, $titre, $level=1, $enabled=1, $target='')
|
||||
{
|
||||
$this->add($url, $titre, $level, $enabled, $target);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id: ajaxfileupload.tpl.php,v 1.4 2011/07/03 14:43:12 hregis Exp $
|
||||
* $Id: ajaxfileupload.tpl.php,v 1.6 2011/07/05 09:30:11 hregis Exp $
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -26,8 +26,8 @@
|
||||
<td class="preview"></td>
|
||||
<td class="size">${sizef}</td>
|
||||
{{if error}}
|
||||
<td class="error" colspan="2">Error:
|
||||
{{if error === 'maxFileSize'}}File is too big
|
||||
<td class="error" colspan="2"><?php echo $langs->trans('Error'); ?>:
|
||||
{{if error === 'maxFileSize'}}<?php echo $langs->trans('FileIsTooBig'); ?>
|
||||
{{else error === 'minFileSize'}}File is too small
|
||||
{{else error === 'acceptFileTypes'}}Filetype not allowed
|
||||
{{else error === 'maxNumberOfFiles'}}Max number of files exceeded
|
||||
@ -36,9 +36,9 @@
|
||||
</td>
|
||||
{{else}}
|
||||
<td class="progress"><div></div></td>
|
||||
<td class="start"><button><?php echo $langs->trans('Start'); ?></button></td>
|
||||
<td align="right" class="start"><button><?php echo $langs->trans('Start'); ?></button></td>
|
||||
{{/if}}
|
||||
<td class="cancel"><button><?php echo $langs->trans('Cancel'); ?></button></td>
|
||||
<td align="right" class="cancel"><button><?php echo $langs->trans('Cancel'); ?></button></td>
|
||||
</tr>
|
||||
</script>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<td></td>
|
||||
<td class="name">${name}</td>
|
||||
<td class="size">${sizef}</td>
|
||||
<td class="error" colspan="2">Error:
|
||||
<td class="error" colspan="2"><?php echo $langs->trans('Error'); ?>:
|
||||
{{if error === 1}}File exceeds upload_max_filesize (php.ini directive)
|
||||
{{else error === 2}}File exceeds MAX_FILE_SIZE (HTML form directive)
|
||||
{{else error === 3}}File was only partially uploaded
|
||||
@ -56,7 +56,7 @@
|
||||
{{else error === 5}}Missing a temporary folder
|
||||
{{else error === 6}}Failed to write file to disk
|
||||
{{else error === 7}}File upload stopped by extension
|
||||
{{else error === 'maxFileSize'}}File is too big
|
||||
{{else error === 'maxFileSize'}}<?php echo $langs->trans('FileIsTooBig'); ?>
|
||||
{{else error === 'minFileSize'}}File is too small
|
||||
{{else error === 'acceptFileTypes'}}Filetype not allowed
|
||||
{{else error === 'maxNumberOfFiles'}}Max number of files exceeded
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
* \file htdocs/expedition/class/expeditionstats.class.php
|
||||
* \ingroup expedition
|
||||
* \brief Fichier des classes expedition
|
||||
* \version $Id$
|
||||
* \version $Id: expeditionstats.class.php,v 1.4 2011/07/04 10:30:01 eldy Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -78,7 +78,7 @@ class ExpeditionStats
|
||||
$result = array();
|
||||
$sql = "SELECT count(*), date_format(date_expedition,'%m') as dm";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql.= " WHERE date_format(date_expedition,'%Y') = ".$year;
|
||||
$sql.= " WHERE date_format(date_expedition,'%Y') = '".$year."'";
|
||||
$sql.= " AND fk_statut > 0";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/fourn/class/fournisseur.commande.class.php
|
||||
* \ingroup fournisseur,commande
|
||||
* \brief File of class to manage suppliers orders
|
||||
* \version $Id$
|
||||
* \version $Id: fournisseur.commande.class.php,v 1.47 2011/07/04 09:36:29 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||
@ -49,27 +49,27 @@ class CommandeFournisseur extends Commande
|
||||
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $ref; // TODO deprecated
|
||||
var $product_ref;
|
||||
var $ref_supplier;
|
||||
var $product_ref;
|
||||
var $ref_supplier;
|
||||
var $brouillon;
|
||||
var $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
|
||||
// -> 7=Canceled/Never received -> (reopen) 3=Process runing
|
||||
// -> 6=Canceled -> (reopen) 2=Approved
|
||||
// -> 9=Refused -> (reopen) 1=Validated
|
||||
var $socid;
|
||||
var $fourn_id;
|
||||
var $socid;
|
||||
var $fourn_id;
|
||||
var $date;
|
||||
var $date_commande;
|
||||
var $total_ht;
|
||||
var $total_tva;
|
||||
var $date_commande;
|
||||
var $total_ht;
|
||||
var $total_tva;
|
||||
var $total_localtax1; // Total Local tax 1
|
||||
var $total_localtax2; // Total Local tax 2
|
||||
var $total_ttc;
|
||||
var $source;
|
||||
var $note;
|
||||
var $note_public;
|
||||
var $model_pdf;
|
||||
var $fk_project;
|
||||
var $total_ttc;
|
||||
var $source;
|
||||
var $note;
|
||||
var $note_public;
|
||||
var $model_pdf;
|
||||
var $fk_project;
|
||||
var $cond_reglement_id;
|
||||
var $cond_reglement_code;
|
||||
var $mode_reglement_id;
|
||||
@ -247,7 +247,7 @@ class CommandeFournisseur extends Commande
|
||||
* @param user User making action
|
||||
* @param statut Status of order
|
||||
* @param datelog Date of change
|
||||
* @param comment Comment
|
||||
* @param comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function log($user, $statut, $datelog, $comment='')
|
||||
@ -278,7 +278,7 @@ class CommandeFournisseur extends Commande
|
||||
function valid($user)
|
||||
{
|
||||
global $langs,$conf;
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -479,18 +479,18 @@ class CommandeFournisseur extends Commande
|
||||
global $langs;
|
||||
$langs->load('orders');
|
||||
|
||||
// List of language codes for status
|
||||
$statutshort[0] = 'StatusOrderDraftShort';
|
||||
$statutshort[1] = 'StatusOrderValidatedShort';
|
||||
$statutshort[2] = 'StatusOrderApprovedShort';
|
||||
$statutshort[3] = 'StatusOrderOnProcessShort';
|
||||
$statutshort[4] = 'StatusOrderReceivedPartiallyShort';
|
||||
$statutshort[5] = 'StatusOrderReceivedAllShort';
|
||||
$statutshort[6] = 'StatusOrderCanceledShort';
|
||||
$statutshort[7] = 'StatusOrderCanceledShort';
|
||||
$statutshort[9] = 'StatusOrderRefusedShort';
|
||||
// List of language codes for status
|
||||
$statutshort[0] = 'StatusOrderDraftShort';
|
||||
$statutshort[1] = 'StatusOrderValidatedShort';
|
||||
$statutshort[2] = 'StatusOrderApprovedShort';
|
||||
$statutshort[3] = 'StatusOrderOnProcessShort';
|
||||
$statutshort[4] = 'StatusOrderReceivedPartiallyShort';
|
||||
$statutshort[5] = 'StatusOrderReceivedAllShort';
|
||||
$statutshort[6] = 'StatusOrderCanceledShort';
|
||||
$statutshort[7] = 'StatusOrderCanceledShort';
|
||||
$statutshort[9] = 'StatusOrderRefusedShort';
|
||||
|
||||
if ($mode == 0)
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
@ -618,6 +618,7 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Accept an order
|
||||
* @param user Object user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function approve($user)
|
||||
{
|
||||
@ -647,7 +648,7 @@ class CommandeFournisseur extends Commande
|
||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
||||
{
|
||||
// Product with reference
|
||||
if ($this->lines[$i]->fk_product > 0)
|
||||
if ($this->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We decrement stock of product (and sub-products)
|
||||
@ -739,9 +740,9 @@ class CommandeFournisseur extends Commande
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel an approved order
|
||||
* Cancel an approved order.
|
||||
* L'annulation se fait apres l'approbation
|
||||
* @param user User making action
|
||||
* @remarks L'annulation se fait apres l'approbation
|
||||
*/
|
||||
function Cancel($user)
|
||||
{
|
||||
@ -800,6 +801,11 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Send a supplier order to supplier
|
||||
* @param user User making change
|
||||
* @param date Date
|
||||
* @param methode Method
|
||||
* @param comment Comment
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function commande($user, $date, $methode, $comment='')
|
||||
{
|
||||
@ -912,14 +918,14 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Add order line
|
||||
* @param desc Description
|
||||
* @param pu Unit price
|
||||
* @param pu_ht Unit price
|
||||
* @param qty Quantity
|
||||
* @param txtva Taux tva
|
||||
* @param txlocaltax1 Localtax1 tax
|
||||
* @param txlocaltax2 Localtax2 tax
|
||||
* @param fk_product Id produit
|
||||
* @param fk_prod_fourn_price Id supplier price
|
||||
* @param fournref Supplier reference
|
||||
* @param fourn_ref Supplier reference
|
||||
* @param remise_percent Remise
|
||||
* @param price_base_type HT or TTC
|
||||
* @param pu_ttc Unit price TTC
|
||||
@ -1117,13 +1123,13 @@ class CommandeFournisseur extends Commande
|
||||
$mouv = new MouvementStock($this->db);
|
||||
if ($product > 0)
|
||||
{
|
||||
$result=$mouv->reception($user, $product, $entrepot, $qty, $price, $comment);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$mouv->error;
|
||||
dol_syslog("CommandeFournisseur::DispatchProduct ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
$result=$mouv->reception($user, $product, $entrepot, $qty, $price, $comment);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$mouv->error;
|
||||
dol_syslog("CommandeFournisseur::DispatchProduct ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -1159,15 +1165,15 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
dol_syslog("Fournisseur.commande.class::deleteline sql=".$sql);
|
||||
if ($resql)
|
||||
{
|
||||
$result=$this->update_price();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
{
|
||||
$result=$this->update_price();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1176,8 +1182,8 @@ class CommandeFournisseur extends Commande
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Delete an order
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Delete an order
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete()
|
||||
{
|
||||
@ -1229,8 +1235,7 @@ class CommandeFournisseur extends Commande
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Return list of order methods
|
||||
*/
|
||||
function get_methodes_commande()
|
||||
{
|
||||
@ -1295,8 +1300,8 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
/**
|
||||
* Change le mode de reglement
|
||||
* @param mode Id du nouveau mode
|
||||
* @return int >0 si ok, <0 si ko
|
||||
* @param mode_reglement_id Id du nouveau mode
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function mode_reglement($mode_reglement_id)
|
||||
{
|
||||
@ -1331,6 +1336,7 @@ class CommandeFournisseur extends Commande
|
||||
* @param user User that input data
|
||||
* @param date Date of reception
|
||||
* @param type Type of receipt
|
||||
* @param comment Comment
|
||||
*/
|
||||
function Livraison($user, $date, $type, $comment)
|
||||
{
|
||||
@ -1388,7 +1394,8 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Cree la commande depuis une propale existante
|
||||
* @param user Utilisateur qui cree
|
||||
* @param propale_id id de la propale qui sert de modele
|
||||
* @param idc Id de la propale qui sert de modele
|
||||
* @param comclientid Id thirdparty
|
||||
*/
|
||||
function updateFromCommandeClient($user, $idc, $comclientid)
|
||||
{
|
||||
@ -1425,8 +1432,12 @@ class CommandeFournisseur extends Commande
|
||||
|
||||
|
||||
/**
|
||||
* Met a jour les notes
|
||||
* @return int <0 si ko, >=0 si ok
|
||||
* Update notes
|
||||
* @param user
|
||||
* @param note
|
||||
* @param note_public
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
* TODO Use instead update_note_public and update_note
|
||||
*/
|
||||
function UpdateNote($user, $note, $note_public)
|
||||
{
|
||||
@ -1457,10 +1468,8 @@ class CommandeFournisseur extends Commande
|
||||
return $result ;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
/**
|
||||
* Get list of user that can approve an order
|
||||
*/
|
||||
function ReadApprobators()
|
||||
{
|
||||
@ -1500,6 +1509,7 @@ class CommandeFournisseur extends Commande
|
||||
/**
|
||||
* Tag order with a particular status
|
||||
* @param user Object user that change status
|
||||
* @param status New status
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setStatus($user,$status)
|
||||
@ -1688,7 +1698,7 @@ class CommandeFournisseur extends Commande
|
||||
$this->specimen=1;
|
||||
$this->socid = 1;
|
||||
$this->date = time();
|
||||
$this->date_commande = time();
|
||||
$this->date_commande = time();
|
||||
$this->date_lim_reglement=$this->date+3600*24*30;
|
||||
$this->cond_reglement_code = 'RECEP';
|
||||
$this->mode_reglement_code = 'CHQ';
|
||||
@ -1703,14 +1713,14 @@ class CommandeFournisseur extends Commande
|
||||
$line->desc=$langs->trans("Description")." ".$xnbp;
|
||||
$line->qty=1;
|
||||
$line->subprice=100;
|
||||
$line->price=100;
|
||||
$line->tva_tx=19.6;
|
||||
$line->localtax1_tx=0;
|
||||
$line->localtax2_tx=0;
|
||||
$line->remise_percent=10;
|
||||
$line->total_ht=90;
|
||||
$line->total_ttc=107.64; // 90 * 1.196
|
||||
$line->total_tva=17.64;
|
||||
$line->price=100;
|
||||
$line->tva_tx=19.6;
|
||||
$line->localtax1_tx=0;
|
||||
$line->localtax2_tx=0;
|
||||
$line->remise_percent=10;
|
||||
$line->total_ht=90;
|
||||
$line->total_ttc=107.64; // 90 * 1.196
|
||||
$line->total_tva=17.64;
|
||||
$line->ref_fourn='SUPPLIER_REF_'.$xnbp;
|
||||
$prodid = rand(1, $num_prods);
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
@ -1726,48 +1736,48 @@ class CommandeFournisseur extends Commande
|
||||
$this->total_ttc = $xnbp*119.6;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
* @param user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
global $conf, $user;
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
* @param user Objet user
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$now=gmmktime();
|
||||
$now=gmmktime();
|
||||
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$clause = " WHERE";
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc";
|
||||
$sql.= " WHERE sc.fk_user = " .$user->id;
|
||||
$clause = " AND";
|
||||
}
|
||||
$sql.= $clause." c.entity = ".$conf->entity;
|
||||
$sql.= " AND (c.fk_statut BETWEEN 1 AND 2)";
|
||||
if ($user->societe_id) $sql.=" AND c.fk_soc = ".$user->societe_id;
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc";
|
||||
$sql.= " WHERE sc.fk_user = " .$user->id;
|
||||
$clause = " AND";
|
||||
}
|
||||
$sql.= $clause." c.entity = ".$conf->entity;
|
||||
$sql.= " AND (c.fk_statut BETWEEN 1 AND 2)";
|
||||
if ($user->societe_id) $sql.=" AND c.fk_soc = ".$user->societe_id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->fournisseur->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->fournisseur->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
* \file htdocs/imports/import.php
|
||||
* \ingroup import
|
||||
* \brief Pages of import Wizard
|
||||
* \version $Id$
|
||||
* \version $Id: import.php,v 1.67 2011/07/04 11:33:23 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once("../main.inc.php");
|
||||
@ -195,8 +195,8 @@ if ($step == 3 && $datatoimport)
|
||||
|
||||
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
create_exdir($conf->import->dir_temp);
|
||||
$nowyearmonth=dol_date('YmdHis',dol_now(),0);
|
||||
dol_mkdir($conf->import->dir_temp);
|
||||
$nowyearmonth=dol_print_date(dol_now(),'%Y%m%d%H%M%S');
|
||||
|
||||
$fullpath=$conf->import->dir_temp . "/" . $nowyearmonth . '-'.$_FILES['userfile']['name'];
|
||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $fullpath,1) > 0)
|
||||
@ -1669,7 +1669,7 @@ print '<br>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 11:33:23 $ - $Revision: 1.67 $');
|
||||
|
||||
|
||||
/*
|
||||
@ -1729,8 +1729,8 @@ function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='')
|
||||
|
||||
/**
|
||||
* Return not used field number
|
||||
*
|
||||
* @param $listofkey
|
||||
* @param $fieldssource
|
||||
* @param $listofkey
|
||||
* @return
|
||||
*/
|
||||
function getnewkey(&$fieldssource,&$listofkey)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/includes/menus/standard/eldy.lib.php
|
||||
* \brief Library for file eldy menus
|
||||
* \version $Id: eldy.lib.php,v 1.54 2011/07/03 16:00:18 eldy Exp $
|
||||
* \version $Id: eldy.lib.php,v 1.55 2011/07/04 11:33:22 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -1012,13 +1012,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
{
|
||||
$newmenu->add("/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire);
|
||||
|
||||
$newmenu->add_submenu("/compta/bank/fiche.php?action=create",$langs->trans("MenuNewFinancialAccount"),1,$user->rights->banque->configurer);
|
||||
$newmenu->add_submenu("/compta/bank/categ.php",$langs->trans("Rubriques"),1,$user->rights->banque->configurer);
|
||||
$newmenu->add("/compta/bank/fiche.php?action=create",$langs->trans("MenuNewFinancialAccount"),1,$user->rights->banque->configurer);
|
||||
$newmenu->add("/compta/bank/categ.php",$langs->trans("Rubriques"),1,$user->rights->banque->configurer);
|
||||
|
||||
$newmenu->add_submenu("/compta/bank/search.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire);
|
||||
$newmenu->add_submenu("/compta/bank/budget.php",$langs->trans("ListTransactionsByCategory"),1,$user->rights->banque->lire);
|
||||
$newmenu->add("/compta/bank/search.php",$langs->trans("ListTransactions"),1,$user->rights->banque->lire);
|
||||
$newmenu->add("/compta/bank/budget.php",$langs->trans("ListTransactionsByCategory"),1,$user->rights->banque->lire);
|
||||
|
||||
$newmenu->add_submenu("/compta/bank/virement.php",$langs->trans("BankTransfers"),1,$user->rights->banque->transfer);
|
||||
$newmenu->add("/compta/bank/virement.php",$langs->trans("BankTransfers"),1,$user->rights->banque->transfer);
|
||||
}
|
||||
|
||||
// Prelevements
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* \ingroup commande
|
||||
* \brief Fichier contenant la classe mere de generation des commandes en PDF
|
||||
* et la classe mere de numerotation des commandes
|
||||
* \version $Id$
|
||||
* \version $Id: modules_commande.php,v 1.47 2011/07/04 10:35:49 hregis Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
@ -146,7 +146,7 @@ class ModeleNumRefCommandes
|
||||
*/
|
||||
function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$user,$langs;
|
||||
$langs->load("orders");
|
||||
|
||||
$dir = "/includes/modules/commande/";
|
||||
@ -198,6 +198,14 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
// on supprime l'image correspondant au preview
|
||||
commande_delete_preview($db, $object->id);
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('ORDER_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \ingroup facture
|
||||
* \brief Fichier contenant la classe mere de generation des factures en PDF
|
||||
* et la classe mere de numerotation des factures
|
||||
* \version $Id$
|
||||
* \version $Id: modules_facture.php,v 1.92 2011/07/04 10:35:48 hregis Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
@ -147,7 +147,8 @@ class ModeleNumRefFactures
|
||||
*/
|
||||
function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
// Increase limit for PDF build
|
||||
@ -218,6 +219,14 @@ function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hide
|
||||
facture_delete_preview($db, $object->id);
|
||||
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('BILL_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* \file htdocs/includes/modules/member/cards/modules_cards.php
|
||||
* \ingroup member
|
||||
* \brief File of parent class of document generator for members cards.
|
||||
* \version $Id$
|
||||
* \version $Id: modules_cards.php,v 1.10 2011/07/04 08:53:01 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
@ -61,13 +61,12 @@ class ModelePDFCards
|
||||
|
||||
|
||||
/**
|
||||
* \brief Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF
|
||||
* \param db objet base de donnee
|
||||
* \param id id de la facture a creer
|
||||
* \param message message
|
||||
* \param modele force le modele a utiliser ('' to not force)
|
||||
* \param outputlangs objet lang a utiliser pour traduction
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF
|
||||
* @param db Database handler
|
||||
* @param arrayofmembers Array of members
|
||||
* @param modele Force modele to use ('' to not force)
|
||||
* @param outputlangs Objet langs to use for translation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs)
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* \ingroup propale
|
||||
* \brief Fichier contenant la classe mere de generation des propales en PDF
|
||||
* et la classe mere de numerotation des propales
|
||||
* \version $Id$
|
||||
* \version $Id: modules_propale.php,v 1.62 2011/07/04 10:35:49 hregis Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
@ -132,10 +132,10 @@ class ModeleNumRefPropales
|
||||
|
||||
/**
|
||||
* Cree une propale sur disque en fonction du modele de PROPALE_ADDON_PDF
|
||||
* @param db objet base de donnee
|
||||
* @param id id de la propale a creer
|
||||
* @param modele force le modele a utiliser ('' to not force)
|
||||
* @param outputlangs objet lang a utiliser pour traduction
|
||||
* @param db Database handler
|
||||
* @param object Object proposal
|
||||
* @param modele Force model to use ('' to not force)
|
||||
* @param outputlangs Object langs to use for output
|
||||
* @param hidedetails Hide details of lines
|
||||
* @param hidedesc Hide description
|
||||
* @param hideref Hide ref
|
||||
@ -143,7 +143,7 @@ class ModeleNumRefPropales
|
||||
*/
|
||||
function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$user,$langs;
|
||||
$langs->load("propale");
|
||||
|
||||
$dir = "/includes/modules/propale/";
|
||||
@ -197,6 +197,14 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
// on supprime l'image correspondant au preview
|
||||
propale_delete_preview($db, $object->id);
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('PROPAL_BUILDDOC',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* - Le nom de la classe doit etre InterfaceMytrigger
|
||||
* - Le nom de la methode constructeur doit etre InterfaceMytrigger
|
||||
* - Le nom de la propriete name doit etre Mytrigger
|
||||
* \version $Id$
|
||||
* \version $Id: interface_all_Demo.class.php-NORUN,v 1.27 2011/07/05 16:10:56 hregis Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -225,6 +225,10 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'ORDER_BUILDDOC')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'ORDER_SENTBYMAIL')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
@ -269,6 +273,10 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'PROPAL_BUILDDOC')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'PROPAL_SENTBYMAIL')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
@ -341,6 +349,10 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'BILL_BUILDDOC')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'BILL_SENTBYMAIL')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
@ -490,6 +502,16 @@ class InterfaceDemo
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'SHIPPINGL_DELETE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
|
||||
// File
|
||||
elseif ($action == 'FILE_UPLOAD')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'FILE_DELETE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
|
||||
@ -17,10 +17,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file /paypal/inc/triggers/interface_modPaypal_PaypalWorkflow.class.php
|
||||
* \file /htdocs/includes/triggers/interface_modPaypal_PaypalWorkflow.class.php
|
||||
* \ingroup paypal
|
||||
* \brief Trigger file for paypal workflow
|
||||
* \version $Id$
|
||||
* \version $Id: interface_modPaypal_PaypalWorkflow.class.php,v 1.6 2011/07/04 08:38:51 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -307,7 +307,7 @@ ConnectionTimeout=Timeout de connexió
|
||||
ResponseTimeout=Timeout de resposta
|
||||
SmsTestMessage=Missatge de prova de __PHONEFROM__ per __PHONETO__
|
||||
ModuleMustBeEnabledFirst=Per utilitzar aquesta funció ha d'estar activat el mòdul <b>%s</b>.
|
||||
SecurityToken=Token de seguretat
|
||||
SecurityToken=Clau per encriptar urls
|
||||
# Modules
|
||||
Module0Name=Usuaris y grups
|
||||
Module0Desc=Gestió d'usuaris i grups
|
||||
|
||||
@ -18,7 +18,7 @@ BoxLastContracts=Últims contractes
|
||||
BoxLastContacts=Últims contactes/adreçes
|
||||
BoxLastMembers=Últims membres modificats
|
||||
BoxCurrentAccounts=Saldos comptes corrents
|
||||
BoxSalesTurnover=Volum de negoci
|
||||
BoxSalesTurnover=Volum de vendes
|
||||
BoxTotalUnpaidCustomerBills=Total factures a clients pendents de cobrament
|
||||
BoxTotalUnpaidSuppliersBills=Total factures de proveïdors pendents de pagament
|
||||
BoxTitleLastBooks=Els %s darrers marcadors registrats
|
||||
@ -40,7 +40,7 @@ BoxTitleLastProductsInContract=Els %s darrers productes/serveis contractats
|
||||
BoxTitleOldestUnpaidCustomerBills=Les %s factures més antigues a clients pendents de cobrament
|
||||
BoxTitleOldestUnpaidSupplierBills=Les %s factures més antigues de proveïdors pendents de pagament
|
||||
BoxTitleCurrentAccounts=Saldos dels comptes corrents
|
||||
BoxTitleSalesTurnover=Volum de negoci realitzat
|
||||
BoxTitleSalesTurnover=Volum de vendes realitzades
|
||||
BoxTitleTotalUnpaidCustomerBills=Pendent de clients
|
||||
BoxTitleTotalUnpaidSuppliersBills=Pendent a proveïdors
|
||||
BoxTitleLastModifiedContacts=Els últims %s contactes/adreçes modificades
|
||||
|
||||
@ -81,7 +81,7 @@ ActionAC_SUP_ORD=Enviament comanda a proveïdor per correu
|
||||
ActionAC_SUP_INV=Enviament factura de proveïdor per correu
|
||||
ActionAC_OTH=Altra
|
||||
Stats=Estadístiques de venda
|
||||
CAOrder=Volum de negocis (Comandes validades)
|
||||
CAOrder=Volum de vendes (Comandes validades)
|
||||
FromTo=de %s a %s
|
||||
MargeOrder=Marges (Comandes validades)
|
||||
RecapAnnee=Recapitulació de l'any
|
||||
|
||||
@ -20,7 +20,7 @@ BillsForSuppliers=Factures de proveïdors
|
||||
Income=Ingressos
|
||||
Outcome=Despeses
|
||||
ReportInOut=Resultat / Exercici
|
||||
ReportTurnover=Volum de negoci
|
||||
ReportTurnover=Volum de vendes
|
||||
PaymentsNotLinkedToInvoice=Pagaments vinculats a cap factura, per la qual cosa sense tercer
|
||||
PaymentsNotLinkedToUser=Pagaments no vinculats a un usuari
|
||||
Profit=Benefici
|
||||
@ -73,12 +73,12 @@ AlreadyPaid=Ja pagat
|
||||
AccountNumberShort=Nº de compte
|
||||
AccountNumber=Número de compte
|
||||
NewAccount=Nou compte
|
||||
SalesTurnover=Volum de negoci
|
||||
SalesTurnover=Volum de vendes
|
||||
ByThirdParties=Per tercer
|
||||
ByUserAuthorOfInvoice=Per autor de la factura
|
||||
AccountancyExport=Exportació comptabilitat
|
||||
ErrorWrongAccountancyCodeForCompany=Codi comptable incorrecte per a %s
|
||||
SuppliersProductsSellSalesTurnover=Volum de negoci generat per la venda dels productes dels proveïdors
|
||||
SuppliersProductsSellSalesTurnover=Volum de vendes generat per la venda dels productes dels proveïdors
|
||||
CheckReceipt=Llista de remeses
|
||||
CheckReceiptShort=Remeses
|
||||
NewCheckReceipt=Nova remesa
|
||||
|
||||
@ -298,7 +298,7 @@ VAT=IVA
|
||||
VATRate=Taxa IVA
|
||||
Average=Mitja
|
||||
Sum=Suma
|
||||
Delta=Divergència
|
||||
Delta=Diferència
|
||||
Module=Mòdul
|
||||
Option=Opció
|
||||
List=Llistat
|
||||
|
||||
@ -109,7 +109,9 @@ ValidateMember=Validar un membre
|
||||
ConfirmValidateMember=Esteu segur de voler validar a aquest membre?
|
||||
FollowingLinksArePublic=Els enllaços següents són pàgines accessibles a tothom i no protegides per cap habilitació Dolibarr.
|
||||
PublicMemberList=Llistat públic de membres
|
||||
BlankSubscriptionForm=Formulari d'inscripció
|
||||
BlankSubscriptionForm=Formulari públic d'auto-inscripció
|
||||
BlankSubscriptionFormDesc=Dolibarr pot proporcionar una URL de pàgina pública perquè els visitants externs demanin afiliar-se. Si es troba actiu un mòdul de pagament en línia, es proposarà automàticament un formulari de pagament.
|
||||
EnablePublicSubscriptionForm=Activar el formulari públic d'auto-inscripció
|
||||
MemberPublicLinks=Links/pàgines públiques
|
||||
ExportDataset_member_1=Membres i afiliacions
|
||||
ImportDataset_member_1=Membres
|
||||
@ -165,8 +167,8 @@ SubscriptionPayment=Pagament quota
|
||||
LastSubscriptionDate=Data de l'última cotització
|
||||
LastSubscriptionAmount=Import de l'última cotització
|
||||
MembersStatisticsByCountries=Estadístiques de membres per país
|
||||
MembersStatisticsByState=Estadístiques de membres per departament/província/regió
|
||||
MembersStatisticsByState=Estadístiques de membres per població
|
||||
MembersStatisticsByTown=Estadístiques de membres per població
|
||||
NbOfMembers=Nombre de membres
|
||||
NoValidatedMemberYet=Cap membre validat trobat
|
||||
MembersByCountryDesc=Aquesta pantalla presenta una estadística del nombre de membres per país. No obstant això, el gràfic utilitza el servei en línia de gràfics de Google i només és operatiu quan es troba disponible una connexió a Internet.
|
||||
@ -183,4 +185,7 @@ NewMemberForm=Formulari d'inscripció
|
||||
SubscriptionsStatistics=Estadístiques de cotitzacions
|
||||
NbOfSubscriptions=Nombre de cotitzacions
|
||||
AmountOfSubscriptions=Import de cotitzacions
|
||||
TurnoverOrBudget=Volum de negoci (empresa) o Pressupost (associació o col.lectiu)
|
||||
TurnoverOrBudget=Volum de vendes (empresa) o Pressupost (associació o col.lectiu)
|
||||
DefaultAmount=Import per defecte cotització
|
||||
CanEditAmount=El visitant pot triar/modificar l'import de la seva cotització
|
||||
MEMBER_NEWFORM_PAYONLINE=Anar a la pàgina integrada de pagament en línia
|
||||
|
||||
@ -188,4 +188,8 @@ AmountOfSubscriptions=Amount of subscriptions
|
||||
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
|
||||
DefaultAmount=Default amount of subscription
|
||||
CanEditAmount=Visitor can choose/edit amount of its subscription
|
||||
MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page
|
||||
MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page
|
||||
Associations=Foundations
|
||||
Collectivités=Organizations
|
||||
Particuliers=Personal
|
||||
Entreprises=Companies
|
||||
|
||||
@ -158,6 +158,10 @@ ClickHere=Click here
|
||||
UseAdvancedPerms=Use the advanced rights permissions in modules
|
||||
FileFormat=File format
|
||||
SelectAColor=Choose a color
|
||||
AddFiles=Add Files
|
||||
StartUpload=Start upload
|
||||
CancelUpload=Cancel upload
|
||||
FileIsTooBig=Files is too big
|
||||
|
||||
##### Bookmark #####
|
||||
Bookmark=Bookmark
|
||||
|
||||
@ -307,7 +307,7 @@ ConnectionTimeout=Timeout de conexión
|
||||
ResponseTimeout=Timeout de respuesta
|
||||
SmsTestMessage=Mensaje de prueba de __PHONEFROM__ para __PHONETO__
|
||||
ModuleMustBeEnabledFirst=Para usar esta función debe estar activado el módulo <b>%s</b>.
|
||||
SecurityToken=Token de seguridad
|
||||
SecurityToken=Clave para encriptar urls
|
||||
# Modules
|
||||
Module0Name=Usuarios y grupos
|
||||
Module0Desc=Gestión de usuarios y grupos
|
||||
|
||||
@ -18,7 +18,7 @@ BoxLastContracts=Últimos contratos
|
||||
BoxLastContacts=Últimos contactos/direcciones
|
||||
BoxLastMembers=Últimos miembros modificados
|
||||
BoxCurrentAccounts=Saldos cuentas corrientes
|
||||
BoxSalesTurnover=Volumen de negocio
|
||||
BoxSalesTurnover=Volumen de ventas
|
||||
BoxTotalUnpaidCustomerBills=Total facturas a clientes pendientes de pago
|
||||
BoxTotalUnpaidSuppliersBills=Total facturas de proveedores pendientes de pago
|
||||
BoxTitleLastBooks=Los %s últimos marcadores registrados
|
||||
@ -40,7 +40,7 @@ BoxTitleLastProductsInContract=Los %s últimos productos/servicios contratados
|
||||
BoxTitleOldestUnpaidCustomerBills=Las %s facturas más antiguas a clientes pendientes de cobro
|
||||
BoxTitleOldestUnpaidSupplierBills=Las %s facturas más antiguas de proveedores pendientes de pago
|
||||
BoxTitleCurrentAccounts=Saldos de las cuentas corrientes
|
||||
BoxTitleSalesTurnover=Volumen de negocio realizado
|
||||
BoxTitleSalesTurnover=Volumen de ventas realizado
|
||||
BoxTitleTotalUnpaidCustomerBills=Pendiente de clientes
|
||||
BoxTitleTotalUnpaidSuppliersBills=Pendiente a proveedores
|
||||
BoxTitleLastModifiedContacts=Los %s últimos contactos/direcciones modificadas
|
||||
|
||||
@ -81,7 +81,7 @@ ActionAC_SUP_ORD=Envío pedido a proveedor por correo
|
||||
ActionAC_SUP_INV=Envío factura de proveedor por correo
|
||||
ActionAC_OTH=Otra
|
||||
Stats=Estadísticas de venta
|
||||
CAOrder=Volumen de negocios (Pedidos validados)
|
||||
CAOrder=Volumen de ventas (Pedidos validados)
|
||||
FromTo=de %s a %s
|
||||
MargeOrder=Márgenes (Pedidos validados)
|
||||
RecapAnnee=Recapitulación del año
|
||||
|
||||
@ -20,7 +20,7 @@ BillsForSuppliers=Facturas de proveedores
|
||||
Income=Ingresos
|
||||
Outcome=Gastos
|
||||
ReportInOut=Resultado / Ejercicio
|
||||
ReportTurnover=Volumen de negocio
|
||||
ReportTurnover=Volumen de ventas
|
||||
PaymentsNotLinkedToInvoice=Pagos vinculados a ninguna factura, por lo que ninguún tercero
|
||||
PaymentsNotLinkedToUser=Pagos no vinculados a un usuario
|
||||
Profit=Beneficio
|
||||
@ -73,12 +73,12 @@ AlreadyPaid=Ya pagado
|
||||
AccountNumberShort=Nº de cuenta
|
||||
AccountNumber=Número de cuenta
|
||||
NewAccount=Nueva cuenta
|
||||
SalesTurnover=Volumen de negocio
|
||||
SalesTurnover=Volumen de ventas
|
||||
ByThirdParties=Por tercero
|
||||
ByUserAuthorOfInvoice=Por autor de la factura
|
||||
AccountancyExport=Exportación contabilidad
|
||||
ErrorWrongAccountancyCodeForCompany=Código contable incorrecto para %s
|
||||
SuppliersProductsSellSalesTurnover=Volumen de negocio generado por la venta de los productos de los proveedores
|
||||
SuppliersProductsSellSalesTurnover=Volumen de ventas generado por la venta de los productos de los proveedores
|
||||
CheckReceipt=Lista de remesas
|
||||
CheckReceiptShort=Remesas
|
||||
NewCheckReceipt=Nueva remesa
|
||||
|
||||
@ -298,7 +298,7 @@ VAT=IVA
|
||||
VATRate=Tasa IVA
|
||||
Average=Media
|
||||
Sum=Suma
|
||||
Delta=Divergencia
|
||||
Delta=Diferencia
|
||||
Module=Módulo
|
||||
Option=Opción
|
||||
List=Listado
|
||||
|
||||
@ -109,7 +109,9 @@ ValidateMember=Validar un miembro
|
||||
ConfirmValidateMember=¿Está seguro de querer validar a este miembro?
|
||||
FollowingLinksArePublic=Los vínculos siguientes son páginas accesibles a todos y no protegidas por ninguna habilitación Dolibarr.
|
||||
PublicMemberList=Listado público de miembros
|
||||
BlankSubscriptionForm=Formulario de inscripción
|
||||
BlankSubscriptionForm=Formulario público de auto-inscripción
|
||||
BlankSubscriptionFormDesc=Dolibarr puede proporcionar una URL de página pública para que los visitantes externos soliciten afiliarse. Si se encuentra activo un módulo de pago en línea, se propondrá automáticamente un formulario de pago.
|
||||
EnablePublicSubscriptionForm=Activar el formulario público de auto-inscripción
|
||||
MemberPublicLinks=Enlaces/páginas públicas
|
||||
ExportDataset_member_1=Miembros y afiliaciones
|
||||
ImportDataset_member_1=Miembros
|
||||
@ -176,11 +178,14 @@ MembersStatisticsDesc=Elija las estadísticas que desea consultar...
|
||||
MenuMembersStats=Estadísticas
|
||||
LastMemberDate=Fecha último miembro
|
||||
Nature=Naturaleza
|
||||
Public=Público
|
||||
Public=Informació pública (no=privada)
|
||||
Exports=Exportaciones
|
||||
NewMemberbyWeb=Nuevo miembro añadido. En espera de validación
|
||||
NewMemberForm=Formulario de inscripción
|
||||
SubscriptionsStatistics=Estadísticas de cotizaciones
|
||||
NbOfSubscriptions=Número de cotizaciones
|
||||
AmountOfSubscriptions=Importe de cotizaciones
|
||||
TurnoverOrBudget=Volumen de negocio (empresa) o Presupuesto (asociación o colectivo)
|
||||
TurnoverOrBudget=Volumen de ventas (empresa) o Presupuesto (asociación o colectivo)
|
||||
DefaultAmount=Importe por defecto cotización
|
||||
CanEditAmount=El visitante puede elegir/modificar el importe de su cotización
|
||||
MEMBER_NEWFORM_PAYONLINE=Ir a la página integrada de pago en línea
|
||||
@ -189,4 +189,8 @@ AmountOfSubscriptions=Montant de cotisations
|
||||
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
|
||||
DefaultAmount=Montant par défaut de la cotisation
|
||||
CanEditAmount=Le visiteur peut modifier/choisir le montant de sa cotisation
|
||||
MEMBER_NEWFORM_PAYONLINE=Débrancher sur la page intégrée de paiement en ligne
|
||||
MEMBER_NEWFORM_PAYONLINE=Débrancher sur la page intégrée de paiement en ligne
|
||||
Associations=Associations
|
||||
Collectivités=Collectivités
|
||||
Particuliers=Particuliers
|
||||
Entreprises=Entreprises
|
||||
|
||||
@ -158,6 +158,10 @@ ClickHere=Cliquez ici
|
||||
UseAdvancedPerms=Utiliser les droits avancés dans les permissions des modules
|
||||
FileFormat=Format de fichier
|
||||
SelectAColor=Choisissez une couleur
|
||||
AddFiles=Ajouter des fichiers
|
||||
StartUpload=Transférer
|
||||
CancelUpload=Annuler le transfert
|
||||
FileIsTooBig=Le fichier est trop volumineux
|
||||
|
||||
##### Bookmark #####
|
||||
Bookmark=Marque-page
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/CMailFile.class.php
|
||||
* \brief File of class to send emails (with attachments or not)
|
||||
* \version $Id: CMailFile.class.php,v 1.142 2011/07/02 16:48:31 eldy Exp $
|
||||
* \version $Id: CMailFile.class.php,v 1.143 2011/07/04 09:36:29 eldy Exp $
|
||||
* \author Dan Potter.
|
||||
* \author Eric Seigne
|
||||
* \author Laurent Destailleur.
|
||||
@ -86,20 +86,20 @@ class CMailFile
|
||||
|
||||
|
||||
/**
|
||||
* \brief CMailFile
|
||||
* \param subject Topic/Subject of mail
|
||||
* \param to Recipients emails (RFC 2822: "Nom prenom <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* \param from Sender email (RFC 2822: "Nom prenom <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* \param msg Message
|
||||
* \param filename_list List of files to attach (full path of filename on file system)
|
||||
* \param mimetype_list List of MIME type of attached files
|
||||
* \param mimefilename_list List of attached file name in message
|
||||
* \param addr_cc Email cc
|
||||
* \param addr_bcc Email bcc
|
||||
* \param deliveryreceipt Ask a delivery receipt
|
||||
* \param msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
|
||||
* \param error_to Email errors
|
||||
* \param css Css option
|
||||
* CMailFile
|
||||
* @param subject Topic/Subject of mail
|
||||
* @param to Recipients emails (RFC 2822: "Nom prenom <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param from Sender email (RFC 2822: "Nom prenom <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param msg Message
|
||||
* @param filename_list List of files to attach (full path of filename on file system)
|
||||
* @param mimetype_list List of MIME type of attached files
|
||||
* @param mimefilename_list List of attached file name in message
|
||||
* @param addr_cc Email cc
|
||||
* @param addr_bcc Email bcc
|
||||
* @param deliveryreceipt Ask a delivery receipt
|
||||
* @param msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
|
||||
* @param errors_to Email errors
|
||||
* @param css Css option
|
||||
*/
|
||||
function CMailFile($subject,$to,$from,$msg,
|
||||
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
|
||||
@ -781,9 +781,8 @@ class CMailFile
|
||||
|
||||
/**
|
||||
* Try to create a socket connection
|
||||
*
|
||||
* @param $host. Add ssl:// for SSL/TLS.
|
||||
* @param $port. Example: 25, 465
|
||||
* @param $host Add ssl:// for SSL/TLS.
|
||||
* @param $port Example: 25, 465
|
||||
* @return Socket id if ok, 0 if KO
|
||||
*/
|
||||
function check_server_port($host,$port)
|
||||
@ -939,7 +938,6 @@ class CMailFile
|
||||
|
||||
/**
|
||||
* Return an address for SMTP protocol
|
||||
*
|
||||
* @param adresses Example: 'John Doe <john@doe.com>' or 'john@doe.com'
|
||||
* @param format 0=Auto, 1=emails with <>, 2=emails without <>
|
||||
* @param encode 1=Encode name to RFC2822
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/CSMSFile.class.php
|
||||
* \brief File of class to send sms
|
||||
* \version $Id$
|
||||
* \version $Id: CSMSFile.class.php,v 1.4 2011/07/04 09:36:29 eldy Exp $
|
||||
* \author Laurent Destailleur.
|
||||
*/
|
||||
|
||||
@ -54,6 +54,9 @@ class CSMSFile
|
||||
* @param from Sender SMS
|
||||
* @param msg Message
|
||||
* @param deliveryreceipt Ask a delivery receipt
|
||||
* @param deferred Deferred or not
|
||||
* @param priority Priority
|
||||
* @param class Class
|
||||
*/
|
||||
function CSMSFile($to,$from,$msg,$deliveryreceipt=0,$deferred=0,$priority=3,$class=1)
|
||||
{
|
||||
|
||||
@ -20,21 +20,23 @@
|
||||
/**
|
||||
* \file htdocs/lib/accountancy.lib.php
|
||||
* \brief Library of accountancy functions
|
||||
* \version $Id$
|
||||
* \version $Id: accountancy.lib.php,v 1.2 2011/07/04 10:30:01 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param $db
|
||||
* @param $year
|
||||
* @param $socid
|
||||
*/
|
||||
function get_ca_propal ($db, $year, $socid)
|
||||
{
|
||||
|
||||
$sql = "SELECT sum(f.price - f.remise) as sum FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = $year ";
|
||||
$sql = "SELECT sum(f.price - f.remise) as sum FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = '".$year."'";
|
||||
if ($socid)
|
||||
{
|
||||
$sql .= " AND f.fk_soc = $socid";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$res = $db->fetch_object($result);
|
||||
@ -56,14 +58,13 @@ function get_ca ($db, $year, $socid)
|
||||
if ($conf->compta->mode != 'CREANCES-DETTES') {
|
||||
$sql .= " AND f.paye = 1";
|
||||
}
|
||||
$sql .= " AND date_format(f.datef , '%Y') = $year ";
|
||||
$sql .= " AND date_format(f.datef , '%Y') = '".$year."'";
|
||||
if ($socid)
|
||||
{
|
||||
$sql .= " AND f.fk_soc = $socid";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$res = $db->fetch_object($result);
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
* \file htdocs/lib/company.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module societe
|
||||
* \ingroup societe
|
||||
* \version $Id: company.lib.php,v 1.120 2011/07/03 18:32:08 eldy Exp $
|
||||
* \version $Id: company.lib.php,v 1.122 2011/07/04 08:38:51 eldy Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -212,7 +212,7 @@ function societe_admin_prepare_head($object)
|
||||
* @param id Id or code of country
|
||||
* @param withcode 0=Return label, 1=Return code + label, 2=Return code from id, 3=Return id from code
|
||||
* @param dbtouse Database handler (using in global way may fail because of conflicts with some autoload features)
|
||||
* @param outputlangs Lang object for output translation
|
||||
* @param outputlangs Langs object for output translation
|
||||
* @param entconv 0=Return value without entities and not converted to output charset
|
||||
* @return string String with country code or translated country name
|
||||
*/
|
||||
@ -331,9 +331,9 @@ function currency_name($code_iso,$withcode=0)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne le nom traduit de la forme juridique
|
||||
* \param code Code de la forme juridique
|
||||
* \return string Nom traduit du pays
|
||||
* Retourne le nom traduit de la forme juridique
|
||||
* @param code Code de la forme juridique
|
||||
* @return string Nom traduit du pays
|
||||
*/
|
||||
function getFormeJuridiqueLabel($code)
|
||||
{
|
||||
@ -369,7 +369,7 @@ function getFormeJuridiqueLabel($code)
|
||||
/**
|
||||
* Show html area for list of projects
|
||||
* @param conf Object conf
|
||||
* @param lang Object lang
|
||||
* @param langs Object langs
|
||||
* @param db Database handler
|
||||
* @param object Third party object
|
||||
* @param backtopage Url to go once contact is created
|
||||
@ -387,7 +387,8 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
|
||||
$buttoncreate='';
|
||||
if ($conf->projet->enabled && $user->rights->projet->creer)
|
||||
{
|
||||
$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
|
||||
//$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
|
||||
$buttoncreate='<a class="addnewrecord" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").' '.img_picto($langs->trans("AddProject"),'filenew').'</a>'."\n";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
@ -465,7 +466,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
|
||||
/**
|
||||
* Show html area for list of contacts
|
||||
* @param conf Object conf
|
||||
* @param lang Object lang
|
||||
* @param langs Object langs
|
||||
* @param db Database handler
|
||||
* @param object Third party object
|
||||
* @param backtopage Url to go once contact is created
|
||||
@ -487,7 +488,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
$buttoncreate='';
|
||||
if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddContact").'</a>'."\n";
|
||||
//$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddContact").'</a>'."\n";
|
||||
$buttoncreate='<a class="addnewrecord" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddContact").' '.img_picto($langs->trans("AddContact"),'filenew').'</a>'."\n";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
@ -938,7 +940,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
/**
|
||||
* Show html area for list of subsidiaries
|
||||
* @param conf Object conf
|
||||
* @param lang Object lang
|
||||
* @param langs Object langs
|
||||
* @param db Database handler
|
||||
* @param object Third party object
|
||||
*/
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/databases/pgsql.lib.php
|
||||
* \brief Fichier de la classe permettant de gerer une base pgsql
|
||||
* \version $Id$
|
||||
* \version $Id: pgsql.lib.php,v 1.109 2011/07/04 07:36:30 eldy Exp $
|
||||
*/
|
||||
// For compatibility during upgrade
|
||||
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..');
|
||||
@ -1104,19 +1104,19 @@ class DoliDb
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
$sql .= $field_desc['type'];
|
||||
if( preg_match("/^[^\s]/i",$field_desc['value']))
|
||||
$sql .= "(".$field_desc['value'].")";
|
||||
if( preg_match("/^[^\s]/i",$field_desc['attribute']))
|
||||
$sql .= " ".$field_desc['attribute'];
|
||||
if( preg_match("/^[^\s]/i",$field_desc['null']))
|
||||
$sql .= " ".$field_desc['null'];
|
||||
if( preg_match("/^[^\s]/i",$field_desc['default']))
|
||||
if(preg_match("/null/i",$field_desc['default']))
|
||||
$sql .= " default ".$field_desc['default'];
|
||||
if ($field_desc['type'] != 'int' && preg_match("/^[^\s]/i",$field_desc['value']))
|
||||
$sql .= "(".$field_desc['value'].")";
|
||||
if (preg_match("/^[^\s]/i",$field_desc['attribute']))
|
||||
$sql .= " ".$field_desc['attribute'];
|
||||
if (preg_match("/^[^\s]/i",$field_desc['null']))
|
||||
$sql .= " ".$field_desc['null'];
|
||||
if (preg_match("/^[^\s]/i",$field_desc['default']))
|
||||
if (preg_match("/null/i",$field_desc['default']))
|
||||
$sql .= " default ".$field_desc['default'];
|
||||
else
|
||||
$sql .= " default '".$field_desc['default']."'";
|
||||
if( preg_match("/^[^\s]/i",$field_desc['extra']))
|
||||
$sql .= " ".$field_desc['extra'];
|
||||
$sql .= " default '".$field_desc['default']."'";
|
||||
if (preg_match("/^[^\s]/i",$field_desc['extra']))
|
||||
$sql .= " ".$field_desc['extra'];
|
||||
$sql .= " ".$field_position;
|
||||
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/date.lib.php
|
||||
* \brief Set of function to manipulate dates
|
||||
* \version $Id$
|
||||
* \version $Id: date.lib.php,v 1.32 2011/07/04 08:38:51 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -242,6 +242,7 @@ function dol_get_next_month($month, $year)
|
||||
/** Return previous week
|
||||
* @param day Day
|
||||
* @param week Week
|
||||
* @param month Month
|
||||
* @param year Year
|
||||
* @return array Previous year,month,day
|
||||
*/
|
||||
@ -258,6 +259,7 @@ function dol_get_prev_week($day, $week, $month, $year)
|
||||
/** Return next week
|
||||
* @param day Day
|
||||
* @param week Week
|
||||
* @param month Month
|
||||
* @param year Year
|
||||
* @return array Next year,month,day
|
||||
*/
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/files.lib.php
|
||||
* \brief Library for file managing functions
|
||||
* \version $Id$
|
||||
* \version $Id: files.lib.php,v 1.64 2011/07/05 16:10:57 hregis Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -454,11 +454,13 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
||||
* @param allowoverwrite 1=Overwrite target file if it already exists
|
||||
* @param disablevirusscan 1=Disable virus scan
|
||||
* @param uploaderrorcode Value of upload error code ($_FILES['field']['error'])
|
||||
* @param notrigger Disable all triggers
|
||||
* @return int >0 if OK, <0 or string if KO
|
||||
*/
|
||||
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0)
|
||||
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $notrigger=0)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $user, $langs;
|
||||
global $object;
|
||||
|
||||
$file_name = $dest_file;
|
||||
// If an upload error has been reported
|
||||
@ -552,6 +554,19 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
{
|
||||
if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK));
|
||||
dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
$object->src_file=$dest_file;
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('FILE_UPLOAD',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
return 1; // Success
|
||||
}
|
||||
else
|
||||
@ -568,10 +583,14 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
* @param file File to delete or mask of file to delete
|
||||
* @param disableglob Disable usage of glob like *
|
||||
* @param nophperrors Disable all PHP output errors
|
||||
* @param notrigger Disable all triggers
|
||||
* @return boolean True if file is deleted, False if error
|
||||
*/
|
||||
function dol_delete_file($file,$disableglob=0,$nophperrors=0)
|
||||
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
global $object;
|
||||
|
||||
//print "x".$file." ".$disableglob;
|
||||
$ok=true;
|
||||
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
|
||||
@ -581,7 +600,21 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0)
|
||||
{
|
||||
if ($nophperrors) $ok=@unlink($filename); // The unlink encapsulated by dolibarr
|
||||
else $ok=unlink($filename); // The unlink encapsulated by dolibarr
|
||||
if ($ok) dol_syslog("Removed file ".$filename,LOG_DEBUG);
|
||||
if ($ok)
|
||||
{
|
||||
dol_syslog("Removed file ".$filename,LOG_DEBUG);
|
||||
if (! $notrigger)
|
||||
{
|
||||
$object->src_file=$file;
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('FILE_DELETE',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
}
|
||||
}
|
||||
else dol_syslog("Failed to remove file ".$filename,LOG_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
* \file htdocs/lib/functions.lib.php
|
||||
* \brief A set of functions for Dolibarr
|
||||
* This file contains all frequently used functions.
|
||||
* \version $Id: functions.lib.php,v 1.534 2011/07/03 18:31:13 eldy Exp $
|
||||
* \version $Id: functions.lib.php,v 1.538 2011/07/04 10:33:56 eldy Exp $
|
||||
*/
|
||||
|
||||
// For compatibility during upgrade
|
||||
@ -319,19 +319,20 @@ function dol_escape_js($stringtoescape)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Returns text escaped for inclusion in HTML alt or title tags
|
||||
* \param $stringtoescape String to escape
|
||||
* \return string Escaped string
|
||||
* Returns text escaped for inclusion in HTML alt or title tags
|
||||
* @param $stringtoescape String to escape
|
||||
* @param $keepb Do not clean b tags
|
||||
* @return string Escaped string
|
||||
*/
|
||||
function dol_escape_htmltag($stringtoescape)
|
||||
function dol_escape_htmltag($stringtoescape,$keepb=0)
|
||||
{
|
||||
// escape quotes and backslashes, newlines, etc.
|
||||
$tmp=dol_html_entity_decode($stringtoescape,ENT_COMPAT,'UTF-8');
|
||||
$tmp=strtr($tmp, array('"'=>'',"\r"=>'\\r',"\n"=>'\\n',"<b>"=>'','</b>'=>''));
|
||||
if ($keepb) $tmp=strtr($tmp, array('"'=>'',"\r"=>'\\r',"\n"=>'\\n'));
|
||||
else $tmp=strtr($tmp, array('"'=>'',"\r"=>'\\r',"\n"=>'\\n',"<b>"=>'','</b>'=>''));
|
||||
return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
|
||||
}
|
||||
|
||||
|
||||
/* For backward compatiblity */
|
||||
function dolibarr_syslog($message, $level=LOG_INFO)
|
||||
{
|
||||
@ -806,6 +807,7 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$chec
|
||||
* @param year Year
|
||||
* @param gm 1=Input informations are GMT values, otherwise local to server TZ
|
||||
* @param check 0=No check on parameters (Can use day 32, etc...)
|
||||
* @param isdst Dayling saving time
|
||||
* @return timestamp Date as a timestamp, '' if error
|
||||
* @see dol_print_date, dol_stringtotime
|
||||
*/
|
||||
@ -920,11 +922,11 @@ function dol_print_size($size,$shortvalue=0,$shortunit=0)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show Url link
|
||||
* \param url Url to show
|
||||
* \param target Target for link
|
||||
* \param max Max number of characters to show
|
||||
* \return string HTML Link
|
||||
* Show Url link
|
||||
* @param url Url to show
|
||||
* @param target Target for link
|
||||
* @param max Max number of characters to show
|
||||
* @return string HTML Link
|
||||
*/
|
||||
function dol_print_url($url,$target='_blank',$max=32)
|
||||
{
|
||||
@ -941,14 +943,14 @@ function dol_print_url($url,$target='_blank',$max=32)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Show EMail link
|
||||
* \param email EMail to show (only email, without <Name of recipient>)
|
||||
* \param cid Id of contact if known
|
||||
* \param socid Id of third party if known
|
||||
* \param addlink 0=no link to create action
|
||||
* \param max Max number of characters to show
|
||||
* \param showinvalid Show warning if syntax email is wrong
|
||||
* \return string HTML Link
|
||||
* Show EMail link
|
||||
* @param email EMail to show (only email, without 'Name of recipient' before)
|
||||
* @param cid Id of contact if known
|
||||
* @param socid Id of third party if known
|
||||
* @param addlink 0=no link to create action
|
||||
* @param max Max number of characters to show
|
||||
* @param showinvalid Show warning if syntax email is wrong
|
||||
* @return string HTML Link
|
||||
*/
|
||||
function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=1)
|
||||
{
|
||||
@ -1538,7 +1540,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8')
|
||||
|
||||
|
||||
/**
|
||||
* Show a picto according to module/object (generic function)
|
||||
* Show a picto according to module or object (generic function)
|
||||
* @param alt Text of alt on image
|
||||
* @param object Objet pour lequel il faut afficher le logo (example: user, group, action, bill, contract, propal, product, ...)
|
||||
* Pour les modules externe utiliser nomimage@mymodule pour rechercher dans le repertoire "img" du module
|
||||
@ -1719,6 +1721,7 @@ function img_edit_remove($alt = "default")
|
||||
* Affiche logo editer/modifier fiche
|
||||
* @param alt Texte sur le alt de l'image
|
||||
* @param float Si il faut y mettre le style "float: right"
|
||||
* @param other Add more attributes on img
|
||||
* @return string Retourne tag img
|
||||
*/
|
||||
function img_edit($alt = "default", $float=0, $other='')
|
||||
@ -1736,6 +1739,7 @@ function img_edit($alt = "default", $float=0, $other='')
|
||||
* Affiche logo voir fiche
|
||||
* @param alt Texte sur le alt de l'image
|
||||
* @param float Si il faut y mettre le style "float: right"
|
||||
* @param other Add more attributes on img
|
||||
* @return string Retourne tag img
|
||||
*/
|
||||
function img_view($alt = "default", $float=0, $other='')
|
||||
@ -1956,6 +1960,7 @@ function img_tick($alt = "default")
|
||||
/**
|
||||
* Affiche le logo tick si allow
|
||||
* @param allow Authorise ou non
|
||||
* @param alt Alt text for img
|
||||
* @return string Retourne tag img
|
||||
*/
|
||||
function img_allow($allow,$alt='default')
|
||||
@ -1999,20 +2004,20 @@ function img_mime($file,$alt='')
|
||||
* @param infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
|
||||
* @return string String with info text
|
||||
*/
|
||||
function info_admin($texte,$infoonimgalt=0)
|
||||
function info_admin($text,$infoonimgalt=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$s='';
|
||||
if ($infoonimgalt)
|
||||
{
|
||||
$s.=img_picto($texte,'star');
|
||||
$s.=img_picto($text,'star');
|
||||
}
|
||||
else
|
||||
{
|
||||
$s.='<div class="info">';
|
||||
$s.=img_picto($langs->trans("InfoAdmin"),'star');
|
||||
$s.=' ';
|
||||
$s.=$texte;
|
||||
$s.=$text;
|
||||
$s.='</div>';
|
||||
}
|
||||
return $s;
|
||||
@ -2761,7 +2766,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
* @param file Lien
|
||||
* @param options Autres parametres d'url a propager dans les liens ("" par defaut)
|
||||
* @param nextpage Faut-il une page suivante
|
||||
* @param betweenarraows HTML Content to show between arrows
|
||||
* @param betweenarrows HTML Content to show between arrows
|
||||
*/
|
||||
function print_fleche_navigation($page,$file,$options='',$nextpage,$betweenarrows='')
|
||||
{
|
||||
@ -2782,7 +2787,7 @@ function print_fleche_navigation($page,$file,$options='',$nextpage,$betweenarrow
|
||||
* Fonction qui retourne un taux de tva formate pour visualisation
|
||||
* Utilisee dans les pdf et les pages html
|
||||
* @param rate Rate value to format (19.6 19,6 19.6% 19,6%,...)
|
||||
* @param foundpercent Add a percent % sign in output
|
||||
* @param addpercent Add a percent % sign in output
|
||||
* @param info_bits Miscellanous information on vat
|
||||
* @return string Chaine avec montant formate (19,6 ou 19,6% ou 8.5% *)
|
||||
*/
|
||||
@ -3355,7 +3360,7 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1)
|
||||
|
||||
/**
|
||||
* Replace CRLF in string with a HTML BR tag.
|
||||
* @param string2encode String to encode
|
||||
* @param stringtoencode String to encode
|
||||
* @param nl2brmode 0=Adding br before \n, 1=Replacing \n by br
|
||||
* @param forxml false=Use <br>, true=Use <br />
|
||||
* @return string String encoded
|
||||
@ -3415,6 +3420,7 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8')
|
||||
/**
|
||||
* This function is called to decode a HTML string (it decodes entities and br tags)
|
||||
* @param stringtodecode String to decode
|
||||
* @param pagecodeto Page code for result
|
||||
*/
|
||||
function dol_htmlentitiesbr_decode($stringtodecode,$pagecodeto='UTF-8')
|
||||
{
|
||||
@ -3517,19 +3523,19 @@ function dol_nboflines($s,$maxchar=0)
|
||||
|
||||
/**
|
||||
* Return nb of lines of a formated text with \n and <br>
|
||||
* @param texte Text
|
||||
* @param text Text
|
||||
* @param maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
|
||||
* @param charset Give the charset used to encode the $texte variable in memory.
|
||||
* @param charset Give the charset used to encode the $text variable in memory.
|
||||
* @return int Number of lines
|
||||
*/
|
||||
function dol_nboflines_bis($texte,$maxlinesize=0,$charset='UTF-8')
|
||||
function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
|
||||
{
|
||||
//print $texte;
|
||||
//print $text;
|
||||
$repTable = array("\t" => " ", "\n" => "<br>", "\r" => " ", "\0" => " ", "\x0B" => " ");
|
||||
$texte = strtr($texte, $repTable);
|
||||
$text = strtr($text, $repTable);
|
||||
if ($charset == 'UTF-8') { $pattern = '/(<[^>]+>)/Uu'; } // /U is to have UNGREEDY regex to limit to one html tag. /u is for UTF8 support
|
||||
else $pattern = '/(<[^>]+>)/U'; // /U is to have UNGREEDY regex to limit to one html tag.
|
||||
$a = preg_split($pattern, $texte, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
$a = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
$nblines = floor((count($a)+1)/2);
|
||||
// count possible auto line breaks
|
||||
if($maxlinesize)
|
||||
@ -3601,6 +3607,7 @@ function dol_textishtml($msg,$option=0)
|
||||
* - From $substitutionarray (oldval=>newval)
|
||||
* - From special constants (__XXX__=>f(objet->xxx)) by substitutions modules
|
||||
* @param chaine Source string in which we must do substitution
|
||||
* @param substitutionarray Array with key->val to substitute
|
||||
* @return string Output string after subsitutions
|
||||
*/
|
||||
function make_substitutions($chaine,$substitutionarray)
|
||||
@ -3655,6 +3662,7 @@ function complete_substitutions_array(&$substitutionarray,$outputlangs,$object='
|
||||
* @param date_start Start date
|
||||
* @param date_end End date
|
||||
* @param format Output format
|
||||
* @param outputlangs Output language
|
||||
*/
|
||||
function print_date_range($date_start,$date_end,$format = '',$outputlangs='')
|
||||
{
|
||||
@ -3666,6 +3674,7 @@ function print_date_range($date_start,$date_end,$format = '',$outputlangs='')
|
||||
* @param date_start Start date
|
||||
* @param date_end End date
|
||||
* @param format Output format
|
||||
* @param outputlangs Output language
|
||||
*/
|
||||
function get_date_range($date_start,$date_end,$format = '',$outputlangs='')
|
||||
{
|
||||
@ -3871,6 +3880,7 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
|
||||
|
||||
if ($iserror)
|
||||
{
|
||||
$mesgstring=preg_replace('/<\/div><div class="error">/','<br>',$mesgstring);
|
||||
$mesgstring=preg_replace('/<div class="error">/','',$mesgstring);
|
||||
$mesgstring=preg_replace('/<\/div>/','',$mesgstring);
|
||||
print get_htmloutput_mesg($mesgstring,$mesgarray,'error',$keepembedded);
|
||||
@ -3882,7 +3892,7 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
|
||||
* Print formated error messages to output (Used to show messages on html output)
|
||||
* @param mesgstring Error message
|
||||
* @param mesgarray Error messages array
|
||||
* @return keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
|
||||
* @param keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_mesg
|
||||
*/
|
||||
@ -3896,11 +3906,11 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
|
||||
* ascending (default) or descending output and uses optionally
|
||||
* natural case insensitive sorting (which can be optionally case
|
||||
* sensitive as well).
|
||||
* @param array Array to sort
|
||||
* @param array Array to sort
|
||||
* @param index
|
||||
* @param order
|
||||
* @param natsort
|
||||
* @param cas_sensitive
|
||||
* @param case_sensitive Sort is case sensitive
|
||||
* @return Sorted array
|
||||
*/
|
||||
function dol_sort_array(&$array, $index, $order='asc', $natsort, $case_sensitive)
|
||||
@ -3926,7 +3936,7 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort, $case_sensitive
|
||||
|
||||
/**
|
||||
* Check if a string is in UTF8
|
||||
* @param $Str String to check
|
||||
* @param $str String to check
|
||||
* @return boolean True if string is UTF8 or ISO compatible with UTF8, False if not (ISO with special char or Binary)
|
||||
*/
|
||||
function utf8_check($str)
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/lib/functions2.lib.php
|
||||
* \brief A set of functions for Dolibarr
|
||||
* This file contains all rare functions.
|
||||
* \version $Id$
|
||||
* \version $Id: functions2.lib.php,v 1.75 2011/07/04 08:38:51 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -632,10 +632,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
|
||||
/**
|
||||
* Check value
|
||||
*
|
||||
* @param $db Database handler
|
||||
* @param $mask Mask to use
|
||||
* @param $value
|
||||
* @param $value Value
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
function check_value($mask,$value)
|
||||
@ -723,11 +721,11 @@ function check_value($mask,$value)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Convert a binary data to string that represent hexadecimal value
|
||||
* \param bin Value to convert
|
||||
* \param pad Add 0
|
||||
* \param upper Convert to tupper
|
||||
* \return string x
|
||||
* Convert a binary data to string that represent hexadecimal value
|
||||
* @param bin Value to convert
|
||||
* @param pad Add 0
|
||||
* @param upper Convert to tupper
|
||||
* @return string x
|
||||
*/
|
||||
function binhex($bin, $pad=false, $upper=false)
|
||||
{
|
||||
@ -741,9 +739,9 @@ function binhex($bin, $pad=false, $upper=false)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Convertir de l'hexadecimal en binaire
|
||||
* \param string hexa
|
||||
* \return string bin
|
||||
* Convert an hexadecimal string into a binary string
|
||||
* @param hexa Hexadecimal string to convert (example: 'FF')
|
||||
* @return string bin
|
||||
*/
|
||||
function hexbin($hexa)
|
||||
{
|
||||
@ -757,9 +755,9 @@ function hexbin($hexa)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le numero de la semaine par rapport a une date
|
||||
* \param time Date au format 'timestamp'
|
||||
* \return int Numero de semaine
|
||||
* Retourne le numero de la semaine par rapport a une date
|
||||
* @param time Date au format 'timestamp'
|
||||
* @return int Numero de semaine
|
||||
*/
|
||||
function numero_semaine($time)
|
||||
{
|
||||
@ -838,11 +836,11 @@ function numero_semaine($time)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Convertit une masse d'une unite vers une autre unite
|
||||
* \param weight float Masse a convertir
|
||||
* \param from_unit int Unite originale en puissance de 10
|
||||
* \param to_unit int Nouvelle unite en puissance de 10
|
||||
* \return float Masse convertie
|
||||
* Convertit une masse d'une unite vers une autre unite
|
||||
* @param weight float Masse a convertir
|
||||
* @param from_unit int Unite originale en puissance de 10
|
||||
* @param to_unit int Nouvelle unite en puissance de 10
|
||||
* @return float Masse convertie
|
||||
*/
|
||||
function weight_convert($weight,&$from_unit,$to_unit)
|
||||
{
|
||||
@ -872,11 +870,12 @@ function weight_convert($weight,&$from_unit,$to_unit)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Save personnal parameter
|
||||
* \param db Handler database
|
||||
* \param user Object user
|
||||
* \param tab Tableau (cle=>valeur) des parametres a sauvegarder
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Save personnal parameter
|
||||
* @param db Handler database
|
||||
* @param conf Object conf
|
||||
* @param user Object user
|
||||
* @param tab Tableau (cle=>valeur) des parametres a sauvegarder
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
{
|
||||
@ -936,9 +935,10 @@ function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Returns formated reduction
|
||||
* \param reduction Reduction percentage
|
||||
* \return string Formated reduction
|
||||
* Returns formated reduction
|
||||
* @param reduction Reduction percentage
|
||||
* @param langs Output language
|
||||
* @return string Formated reduction
|
||||
*/
|
||||
function dol_print_reduction($reduction=0,$langs)
|
||||
{
|
||||
|
||||
@ -21,17 +21,16 @@
|
||||
* \file htdocs/lib/functions_ch.lib.php
|
||||
* \brief A set of swiss functions for Dolibarr
|
||||
* This file contains rare functions.
|
||||
* \version $Id$
|
||||
* \version $Id: functions_ch.lib.php,v 1.3 2011/07/04 08:38:51 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Return if a BVRB number is valid or not (For switzerland)
|
||||
*
|
||||
* @param string BVRB number
|
||||
* @param bvrb BVRB number
|
||||
* @return bool True if OK, false if KO
|
||||
*/
|
||||
function dol_ch_controle_bvrb ($bvrb)
|
||||
function dol_ch_controle_bvrb($bvrb)
|
||||
{
|
||||
// Init array for control
|
||||
$tableau[0][0]=0;
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* \file htdocs/lib/pdf.lib.php
|
||||
* \brief Set of functions used for PDF generation
|
||||
* \ingroup core
|
||||
* \version $Id: pdf.lib.php,v 1.95 2011/06/30 13:27:21 hregis Exp $
|
||||
* \version $Id: pdf.lib.php,v 1.96 2011/07/04 08:53:01 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -682,7 +682,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
|
||||
* Return line description translated in outputlangs and encoded in UTF8
|
||||
* @param object Object
|
||||
* @param i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hideref Hide reference
|
||||
* @param hidedesc Hide description
|
||||
* @param issupplierline Is it a line for a supplier object ?
|
||||
@ -814,7 +814,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
* Return line num
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param outputlangs Object langs for output
|
||||
*/
|
||||
function pdf_getlinenum($object,$i,$outputlangs)
|
||||
{
|
||||
@ -854,8 +854,8 @@ function pdf_getlineref($object,$i,$outputlangs)
|
||||
/**
|
||||
* Return line ref_supplier
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
*/
|
||||
function pdf_getlineref_supplier($object,$i,$outputlangs)
|
||||
{
|
||||
@ -874,8 +874,8 @@ function pdf_getlineref_supplier($object,$i,$outputlangs)
|
||||
/**
|
||||
* Return line vat rate
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -901,8 +901,8 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line unit price excluding tax
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -928,8 +928,8 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line quantity
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -958,8 +958,8 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line quantity asked
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -988,8 +988,8 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line quantity shipped
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -1018,8 +1018,8 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line keep to ship quantity
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -1048,8 +1048,8 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line remise percent
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -1080,8 +1080,8 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
|
||||
/**
|
||||
* Return line total excluding tax
|
||||
* @param object Object
|
||||
* @param $i Current line number
|
||||
* @param outputlang Object lang for output
|
||||
* @param i Current line number
|
||||
* @param outputlangs Object langs for output
|
||||
* @param hidedetails Hide value
|
||||
* 0 = no
|
||||
* 1 = yes
|
||||
@ -1115,7 +1115,7 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
* Return total quantity of products and/or services
|
||||
* @param object Object
|
||||
* @param type Type of line (all=all, 0=product, 1=service, 9=other)
|
||||
* @param outputlang Object lang for output
|
||||
* @param outputlangs Object langs for output
|
||||
*/
|
||||
function pdf_getTotalQty($object,$type='',$outputlangs)
|
||||
{
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/lib/prelevement.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module prelevement
|
||||
* \ingroup propal
|
||||
* \version $Id$
|
||||
* \version $Id: prelevement.lib.php,v 1.8 2011/07/04 09:01:38 eldy Exp $
|
||||
*
|
||||
* Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||
*/
|
||||
@ -31,8 +31,8 @@
|
||||
|
||||
/**
|
||||
* Prepare head for prelevement screen and return it
|
||||
* @param prelevement class BonPrelevement
|
||||
* @return array head
|
||||
* @param object Object BonPrelevement
|
||||
* @return array head
|
||||
*/
|
||||
function prelevement_prepare_head($object)
|
||||
{
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/lib/product.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module produit et service
|
||||
* \ingroup product
|
||||
* \version $Id$
|
||||
* \version $Id: product.lib.php,v 1.43 2011/07/04 09:01:38 eldy Exp $
|
||||
*
|
||||
* Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||
*/
|
||||
@ -262,9 +262,9 @@ function show_stats_for_company($product,$socid)
|
||||
|
||||
/**
|
||||
* Return translation label of a unit key
|
||||
* @param int Unit key (-3,0,3,98,99...)
|
||||
* @param measuring_style Style of unit: weight, volume,...
|
||||
* @return string Unit string
|
||||
* @param unit Unit key (-3,0,3,98,99...)
|
||||
* @param measuring_style Style of unit: weight, volume,...
|
||||
* @return string Unit string
|
||||
* @see load_measuring_units
|
||||
*/
|
||||
function measuring_units_string($unit,$measuring_style='')
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/lib/project.lib.php
|
||||
* \brief Functions used by project module
|
||||
* \ingroup project
|
||||
* \version $Id$
|
||||
* \version $Id: project.lib.php,v 1.68 2011/07/04 09:01:38 eldy Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
|
||||
|
||||
@ -98,7 +98,7 @@ function project_prepare_head($object)
|
||||
* \file htdocs/lib/project.lib.php
|
||||
* \brief Ensemble de fonctions de base pour le module projet
|
||||
* \ingroup societe
|
||||
* \version $Id$
|
||||
* \version $Id: project.lib.php,v 1.68 2011/07/04 09:01:38 eldy Exp $
|
||||
*/
|
||||
function task_prepare_head($object)
|
||||
{
|
||||
@ -239,14 +239,14 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* Output a task line
|
||||
* @param $inc
|
||||
* @param $parent
|
||||
* @param $lines
|
||||
* @param $level
|
||||
* @param $projectsrole
|
||||
* @param $mytask 0 or 1 to enable only if task is a task i am affected to
|
||||
* @param $tasksrole
|
||||
* @param $mytask 0 or 1 to enable only if task is a task i am affected to
|
||||
* @return $inc
|
||||
*/
|
||||
function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/security.lib.php
|
||||
* \brief Set of function used for dolibarr security
|
||||
* \version $Id$
|
||||
* \version $Id: security.lib.php,v 1.123 2011/07/04 09:01:38 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -398,7 +398,7 @@ function encodedecode_dbpassconf($level=0)
|
||||
|
||||
/**
|
||||
* Encode a string
|
||||
* @param chaine chaine de caracteres a encoder
|
||||
* @param chain chaine de caracteres a encoder
|
||||
* @return string_coded chaine de caracteres encodee
|
||||
*/
|
||||
function dol_encode($chain)
|
||||
|
||||
@ -21,19 +21,20 @@
|
||||
* \file htdocs/lib/tax.lib.php
|
||||
* \ingroup tax
|
||||
* \brief Library for tax module
|
||||
* \version $Id$
|
||||
* \version $Id: tax.lib.php,v 1.20 2011/07/04 09:01:37 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \brief Look for collectable VAT clients in the chosen year (and month)
|
||||
* \param db Database handle
|
||||
* \param y Year
|
||||
* \param date_start Start date
|
||||
* \param date_end End date
|
||||
* \param modetax 0 or 1 (option vat on debit)
|
||||
* \param direction 'sell' or 'buy'
|
||||
* \return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
|
||||
* Look for collectable VAT clients in the chosen year (and month)
|
||||
* @param db Database handle
|
||||
* @param y Year
|
||||
* @param date_start Start date
|
||||
* @param date_end End date
|
||||
* @param modetax 0 or 1 (option vat on debit)
|
||||
* @param direction 'sell' or 'buy'
|
||||
* @param m Month
|
||||
* @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
|
||||
*/
|
||||
function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction, $m=0)
|
||||
{
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
* \file htdocs/lib/treeview.lib.php
|
||||
* \ingroup core
|
||||
* \brief Libraries for tree views
|
||||
* \version $Id$
|
||||
* \version $Id: treeview.lib.php,v 1.12 2011/07/04 09:01:38 eldy Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -75,9 +75,9 @@ function is_in_subtree($fulltree,$parentid,$childid)
|
||||
|
||||
/**
|
||||
* Show picto of a tree view
|
||||
*
|
||||
* @param fulltree Array of entries in correct order
|
||||
* @param key Key of value to show picto
|
||||
* @param selected Selected value
|
||||
* @return array (0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after)
|
||||
*/
|
||||
function tree_showpad(&$fulltree,$key,$selected=0)
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
/**
|
||||
* \file htdocs/lib/usergroups.lib.php
|
||||
* \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes
|
||||
* \version $Id$
|
||||
* \version $Id: usergroups.lib.php,v 1.28 2011/07/04 09:01:38 eldy Exp $
|
||||
*/
|
||||
function user_prepare_head($object)
|
||||
{
|
||||
@ -144,8 +144,9 @@ function group_prepare_head($object)
|
||||
|
||||
/**
|
||||
* Show list of themes. Show all thumbs of themes
|
||||
* @param fuser User concerned or '' for global theme
|
||||
* @param edit 1 to add edit form
|
||||
* @param fuser User concerned or '' for global theme
|
||||
* @param edit 1 to add edit form
|
||||
* @param foruserprofile Show for user profile view
|
||||
*/
|
||||
function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* \file htdocs/main.inc.php
|
||||
* \ingroup core
|
||||
* \brief File that defines environment for Dolibarr pages only (variables not required by scripts)
|
||||
* \version $Id: main.inc.php,v 1.748 2011/07/03 13:16:46 hregis Exp $
|
||||
* \version $Id: main.inc.php,v 1.749 2011/07/04 08:53:01 eldy Exp $
|
||||
*/
|
||||
|
||||
@ini_set('memory_limit', '64M'); // This may be useless if memory is hard limited by your PHP
|
||||
@ -814,22 +814,22 @@ if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY))
|
||||
|
||||
// Functions
|
||||
|
||||
/**
|
||||
* Show HTML header HTML + BODY + Top menu + left menu + DIV
|
||||
* @param head Add optionnal head lines
|
||||
* @param title Title of web page
|
||||
* @param help_url Url links to help page
|
||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
||||
* For other external page: http://server/url
|
||||
* @param target Target to use in menu links
|
||||
* @param disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
|
||||
* @param disablehead Do not output head section
|
||||
* @param arrayofjs Array of js files to add in header
|
||||
* @param arrayofcss Array of css files to add in header
|
||||
* @param morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||
*/
|
||||
if (! function_exists("llxHeader"))
|
||||
{
|
||||
/**
|
||||
* Show HTML header HTML + BODY + Top menu + left menu + DIV
|
||||
* @param head Add optionnal head lines
|
||||
* @param title Title of web page
|
||||
* @param help_url Url links to help page
|
||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
||||
* For other external page: http://server/url
|
||||
* @param target Target to use in menu links
|
||||
* @param disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
|
||||
* @param disablehead Do not output head section
|
||||
* @param arrayofjs Array of js files to add in header
|
||||
* @param arrayofcss Array of css files to add in header
|
||||
* @param morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
|
||||
*/
|
||||
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
||||
{
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/product/stats/fiche.php
|
||||
* \ingroup product
|
||||
* \brief Page des stats produits
|
||||
* \version $Id$
|
||||
* \version $Id: fiche.php,v 1.109 2011/07/04 10:04:18 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
@ -37,6 +37,8 @@ $langs->load("bills");
|
||||
$langs->load("other");
|
||||
|
||||
$mode=isset($_GET["mode"])?$_GET["mode"]:'byunit';
|
||||
$error=0;
|
||||
$mesg='';
|
||||
|
||||
// Security check
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
@ -47,8 +49,6 @@ $fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$id,'product','','',$fieldid);
|
||||
|
||||
$mesg = '';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -135,9 +135,10 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
$dir = (!empty($conf->product->dir_temp)?$conf->product->dir_temp:$conf->service->dir_temp);
|
||||
if (! file_exists($dir.'/'.$product->id))
|
||||
{
|
||||
if (create_exdir($dir.'/'.$product->id) < 0)
|
||||
if (dol_mkdir($dir.'/'.$product->id) < 0)
|
||||
{
|
||||
$mesg = $langs->trans("ErrorCanNotCreateDir",$dir);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,44 +162,48 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
);
|
||||
|
||||
$px = new DolGraph();
|
||||
$mesg = $px->isGraphKo();
|
||||
if (! $mesg)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
foreach($graphfiles as $key => $val)
|
||||
$mesg = $px->isGraphKo();
|
||||
if (! $mesg)
|
||||
{
|
||||
if (! $graphfiles[$key]['file']) continue;
|
||||
|
||||
$graph_data = array();
|
||||
|
||||
// TODO Test si deja existant et recent, on ne genere pas
|
||||
if ($key == 'propal') $graph_data = $product->get_nb_propal($socid,$mode);
|
||||
if ($key == 'orders') $graph_data = $product->get_nb_order($socid,$mode);
|
||||
if ($key == 'invoices') $graph_data = $product->get_nb_vente($socid,$mode);
|
||||
if ($key == 'invoicessuppliers') $graph_data = $product->get_nb_achat($socid,$mode);
|
||||
if (is_array($graph_data))
|
||||
foreach($graphfiles as $key => $val)
|
||||
{
|
||||
$px->SetData($graph_data);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->SetShading(3);
|
||||
//print 'x '.$key.' '.$graphfiles[$key]['file'];
|
||||
|
||||
$px->draw($dir."/".$graphfiles[$key]['file']);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
|
||||
if (! $graphfiles[$key]['file']) continue;
|
||||
|
||||
$graph_data = array();
|
||||
|
||||
// TODO Test si deja existant et recent, on ne genere pas
|
||||
if ($key == 'propal') $graph_data = $product->get_nb_propal($socid,$mode);
|
||||
if ($key == 'orders') $graph_data = $product->get_nb_order($socid,$mode);
|
||||
if ($key == 'invoices') $graph_data = $product->get_nb_vente($socid,$mode);
|
||||
if ($key == 'invoicessuppliers') $graph_data = $product->get_nb_achat($socid,$mode);
|
||||
if (is_array($graph_data))
|
||||
{
|
||||
$px->SetData($graph_data);
|
||||
$px->SetMaxValue($px->GetCeilMaxValue()<0?0:$px->GetCeilMaxValue());
|
||||
$px->SetMinValue($px->GetFloorMinValue()>0?0:$px->GetFloorMinValue());
|
||||
$px->SetWidth($WIDTH);
|
||||
$px->SetHeight($HEIGHT);
|
||||
$px->SetHorizTickIncrement(1);
|
||||
$px->SetPrecisionY(0);
|
||||
$px->SetShading(3);
|
||||
//print 'x '.$key.' '.$graphfiles[$key]['file'];
|
||||
|
||||
$px->draw($dir."/".$graphfiles[$key]['file']);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,'Error for calculating graph on key='.$key.' - '.$product->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mesg = $langs->trans("ChartGenerated");
|
||||
}
|
||||
|
||||
$mesg = $langs->trans("ChartGenerated");
|
||||
|
||||
// Affichage graphs
|
||||
|
||||
// Show graphs
|
||||
$i=0;
|
||||
foreach($graphfiles as $key => $val)
|
||||
{
|
||||
@ -266,5 +271,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:04:18 $ - $Revision: 1.109 $');
|
||||
?>
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/projet/activity/index.php
|
||||
* \ingroup projet
|
||||
* \brief Page activite perso du module projet
|
||||
* \version $Id$
|
||||
* \version $Id: index.php,v 1.35 2011/07/04 10:56:12 eldy Exp $
|
||||
*/
|
||||
|
||||
require ("../../main.inc.php");
|
||||
@ -88,7 +88,7 @@ $sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND date_format(task_date,'%d%m%y') = ".strftime("%d%m%y",time());
|
||||
$sql.= " AND date_format(task_date,'%y-%m-%d') = '".strftime("%y-%m-%d",$now)."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
@ -124,6 +124,10 @@ print '<td align="right">'.ConvertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
// TODO Do not use date_add function to be compatible with all database
|
||||
if ($db->type != 'pgsql')
|
||||
{
|
||||
|
||||
/* Affichage de la liste des projets d'hier */
|
||||
print '<br><table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -139,9 +143,9 @@ $sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND date_format(date_add(task_date, INTERVAL 1 DAY),'%d%m%y') = ".strftime("%d%m%y",time());
|
||||
$sql.= " AND date_format(date_add(task_date, INTERVAL 1 DAY),'%y-%m-%d') = '".strftime("%y-%m-%d",$now)."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
@ -175,8 +179,15 @@ print '<td align="right">'.ConvertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
print '</td><td width="70%" valign="top" class="notopnoleft">';
|
||||
|
||||
// TODO Do not use week function to be compatible with all database
|
||||
if ($db->type != 'pgsql')
|
||||
{
|
||||
|
||||
/* Affichage de la liste des projets de la semaine */
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -192,9 +203,9 @@ $sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND week(task_date) = ".strftime("%W",time());
|
||||
$sql.= " AND week(task_date) = '".strftime("%W",time())."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
@ -228,6 +239,8 @@ print '<td align="right">'.ConvertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table><br>";
|
||||
|
||||
}
|
||||
|
||||
/* Affichage de la liste des projets du mois */
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -243,9 +256,9 @@ $sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND month(task_date) = ".strftime("%m",$now);
|
||||
$sql.= " AND date_format(task_date,'%y-%m') = '".strftime("%y-%m",$now)."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
@ -287,9 +300,9 @@ $sql.= " WHERE t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND tt.fk_task = t.rowid";
|
||||
$sql.= " AND tt.fk_user = ".$user->id;
|
||||
$sql.= " AND YEAR(task_date) = ".strftime("%Y",$now);
|
||||
$sql.= " AND YEAR(task_date) = '".strftime("%Y",$now)."'";
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title";
|
||||
|
||||
$var=false;
|
||||
$resql = $db->query($sql);
|
||||
@ -319,5 +332,5 @@ print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 10:56:12 $ - $Revision: 1.35 $');
|
||||
?>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/projet/fiche.php
|
||||
* \ingroup projet
|
||||
* \brief Project card
|
||||
* \version $Id$
|
||||
* \version $Id: fiche.php,v 1.126 2011/07/04 08:00:52 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -55,6 +55,13 @@ $result = restrictedArea($user, 'projet', $projectid);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Cancel
|
||||
if (GETPOST("cancel") && GETPOST('backtopage'))
|
||||
{
|
||||
header("Location: ".GETPOST('backtopage'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'add' && $user->rights->projet->creer)
|
||||
{
|
||||
$error=0;
|
||||
@ -270,8 +277,10 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.GETPOST('backtopage').'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$project = new Project($db);
|
||||
|
||||
@ -323,7 +332,14 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';
|
||||
print '<br><center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
if (GETPOST('backtopage'))
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</center>';
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
@ -592,5 +608,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
llxFooter('$Date: 2011/07/04 08:00:52 $ - $Revision: 1.126 $');
|
||||
?>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/public/members/new.php
|
||||
* \ingroup member
|
||||
* \brief Example of form to add a new member
|
||||
* \version $Id: new.php,v 1.37 2011/07/03 18:30:48 eldy Exp $
|
||||
* \version $Id: new.php,v 1.39 2011/07/05 08:33:34 eldy Exp $
|
||||
*
|
||||
* Note that you can add following constant to change behaviour of page
|
||||
* MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form
|
||||
@ -64,7 +64,7 @@ if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1);
|
||||
|
||||
if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
|
||||
{
|
||||
print $langs->trans("Auto subscription form for public visitors has no be enabled");
|
||||
print $langs->trans("Auto subscription form for public visitors has no been enabled");
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -159,10 +159,15 @@ if ($action == 'add')
|
||||
$error+=1;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("MorPhy"))."<br>\n";
|
||||
}
|
||||
if (!isset($_POST["nom"]) || !isset($_POST["prenom"]) || $_POST["prenom"]=='' || $_POST["nom"]=='')
|
||||
if (empty($_POST["nom"]))
|
||||
{
|
||||
$error+=1;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name"))."<br>\n";
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Lastname"))."<br>\n";
|
||||
}
|
||||
if (empty($_POST["prenom"]))
|
||||
{
|
||||
$error+=1;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Firstname"))."<br>\n";
|
||||
}
|
||||
if (GETPOST("email") && ! isValidEmail(GETPOST("email")))
|
||||
{
|
||||
@ -236,11 +241,13 @@ if ($action == 'add')
|
||||
{
|
||||
$urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=membersubscription&ref='.$adh->ref;
|
||||
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
|
||||
if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
|
||||
}
|
||||
else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
|
||||
{
|
||||
$urlback=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref='.$adh->ref;
|
||||
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
|
||||
if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -273,7 +280,7 @@ if ($action == 'added')
|
||||
print $langs->trans("NewMemberbyWeb");
|
||||
print '</center>';
|
||||
|
||||
llxFooterVierge('$Date: 2011/07/03 18:30:48 $ - $Revision: 1.37 $');
|
||||
llxFooterVierge('$Date: 2011/07/05 08:33:34 $ - $Revision: 1.39 $');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -356,7 +363,7 @@ $morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("MorPhy").' <FONT COLOR="red">*</FONT></td><td>'."\n";
|
||||
print '<tr class="morphy"><td>'.$langs->trans("MorPhy").' <FONT COLOR="red">*</FONT></td><td>'."\n";
|
||||
print $html->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
@ -450,6 +457,7 @@ if (! empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER))
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
initturnover();
|
||||
jQuery(".morphy").hide();
|
||||
jQuery("#morphy").click(function() {
|
||||
initturnover();
|
||||
});
|
||||
@ -520,5 +528,5 @@ print "<br></form>\n";
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooterVierge('$Date: 2011/07/03 18:30:48 $ - $Revision: 1.37 $');
|
||||
llxFooterVierge('$Date: 2011/07/05 08:33:34 $ - $Revision: 1.39 $');
|
||||
?>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -23,7 +23,7 @@
|
||||
* \ingroup paybox
|
||||
* \brief File to offer a way to make a payment for a particular Dolibarr entity
|
||||
* \author Laurent Destailleur
|
||||
* \version $Id$
|
||||
* \version $Id: newpayment.php,v 1.56 2011/07/05 08:29:53 eldy Exp $
|
||||
*/
|
||||
|
||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||
@ -105,19 +105,19 @@ $urlko=preg_replace('/&$/','',$urlko); // Remove last &
|
||||
if (GETPOST("action") == 'dopayment')
|
||||
{
|
||||
$PRICE=price2num(GETPOST("newamount"),'MT');
|
||||
$EMAIL=GETPOST("EMAIL");
|
||||
$email=GETPOST("email");
|
||||
|
||||
$mesg='';
|
||||
if (empty($PRICE) || ! is_numeric($PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount"));
|
||||
elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail"));
|
||||
elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL);
|
||||
elseif (empty($email)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail"));
|
||||
elseif (! isValidEMail($email)) $mesg=$langs->trans("ErrorBadEMail",$email);
|
||||
elseif (empty($FULLTAG)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode"));
|
||||
|
||||
if (empty($mesg))
|
||||
{
|
||||
dol_syslog("newpayment.php call paybox api and do redirect", LOG_DEBUG);
|
||||
|
||||
print_paybox_redirect($PRICE, $conf->monnaie, $EMAIL, $urlok, $urlko, $FULLTAG);
|
||||
print_paybox_redirect($PRICE, $conf->monnaie, $email, $urlok, $urlko, $FULLTAG);
|
||||
|
||||
session_destroy();
|
||||
exit;
|
||||
@ -243,7 +243,7 @@ if (! GETPOST("source"))
|
||||
$var=!$var;
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.GETPOST("EMAIL").'"></td></tr>'."\n";
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.GETPOST("email").'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -325,8 +325,8 @@ if (GETPOST("source") == 'order')
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
$email=$order->client->email;
|
||||
$email=(GETPOST("EMAIL")?GETPOST("EMAIL"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
$email=(GETPOST("email")?GETPOST("email"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -408,8 +408,8 @@ if (GETPOST("source") == 'invoice')
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
$email=$invoice->client->email;
|
||||
$email=(GETPOST("EMAIL")?GETPOST("EMAIL"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
$email=(GETPOST("email")?GETPOST("email"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
// Payment on contract line
|
||||
@ -579,8 +579,8 @@ if (GETPOST("source") == 'contractline')
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
$email=$contract->client->email;
|
||||
$email=(GETPOST("EMAIL")?GETPOST("EMAIL"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
$email=(GETPOST("email")?GETPOST("email"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
|
||||
}
|
||||
|
||||
@ -680,8 +680,8 @@ if (GETPOST("source") == 'membersubscription')
|
||||
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
|
||||
print ' ('.$langs->trans("ToComplete").')';
|
||||
$email=$member->client->email;
|
||||
$email=(GETPOST("EMAIL")?GETPOST("EMAIL"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
$email=(GETPOST("email")?GETPOST("email"):(isValidEmail($email)?$email:''));
|
||||
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.$email.'"></td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -716,5 +716,5 @@ html_print_paybox_footer($mysoc,$langs);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooterPayBox('$Date$ - $Revision$');
|
||||
llxFooterPayBox('$Date: 2011/07/05 08:29:53 $ - $Revision: 1.56 $');
|
||||
?>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* \file htdocs/societe/class/societe.class.php
|
||||
* \ingroup societe
|
||||
* \brief File for third party class
|
||||
* \version $Id: societe.class.php,v 1.88 2011/07/03 22:07:24 eldy Exp $
|
||||
* \version $Id: societe.class.php,v 1.89 2011/07/04 11:41:05 eldy Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
|
||||
@ -2105,6 +2105,13 @@ class Societe extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add permissions
|
||||
* @param user_id
|
||||
* @param read
|
||||
* @param write
|
||||
* @param perms
|
||||
*/
|
||||
function AddPerms($user_id, $read, $write, $perms)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perms";
|
||||
@ -2120,7 +2127,7 @@ class Societe extends CommonObject
|
||||
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet societe
|
||||
* @param id id de la societe a charger
|
||||
* @param id Id de la societe a charger
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
@ -2183,7 +2190,7 @@ class Societe extends CommonObject
|
||||
|
||||
/**
|
||||
* Return if a country is inside the EEC (European Economic Community)
|
||||
* @param boolean true = pays inside EEC, false= pays outside EEC
|
||||
* @return boolean true = pays inside EEC, false= pays outside EEC
|
||||
*/
|
||||
function isInEEC()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -23,7 +23,7 @@
|
||||
* \file htdocs/societe/document.php
|
||||
* \brief Tab for documents linked to third party
|
||||
* \ingroup societe
|
||||
* \version $Id: document.php,v 1.31 2011/07/03 13:16:46 hregis Exp $
|
||||
* \version $Id: document.php,v 1.33 2011/07/05 17:21:19 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -35,10 +35,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||
$langs->load("companies");
|
||||
$langs->load('other');
|
||||
|
||||
$mesg = "";
|
||||
$mesg='';
|
||||
|
||||
$action = GETPOST('action');
|
||||
$confirm = GETPOST('confirm');
|
||||
$socid = (GETPOST('socid') ? GETPOST('socid') : GETPOST('id'));
|
||||
|
||||
// Security check
|
||||
$socid = (GETPOST('socid') ? GETPOST('socid') : GETPOST('id'));
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
unset($_GET["action"]);
|
||||
@ -70,48 +73,54 @@ $object = new Societe($db);
|
||||
// Envoie fichier
|
||||
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
if ($object->fetch($socid))
|
||||
{
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
if (create_exdir($upload_dir) >= 0)
|
||||
{
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for company (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
|
||||
// Create mini thumbs for company (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
|
||||
}
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if (is_numeric($resupload) && $resupload < 0) // Unknown error
|
||||
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0,0,$_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
|
||||
{
|
||||
// Create small thumbs for company (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
|
||||
|
||||
// Create mini thumbs for company (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
|
||||
}
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
$langs->load("errors");
|
||||
if (is_numeric($resupload) && $resupload < 0) // Unknown error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
|
||||
}
|
||||
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
|
||||
}
|
||||
else // Known error
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Suppression fichier
|
||||
if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes')
|
||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||
{
|
||||
$file = $upload_dir . "/" . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
if ($object->fetch($socid))
|
||||
{
|
||||
$file = $upload_dir . "/" . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
dol_delete_file($file);
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -195,9 +204,9 @@ if ($socid > 0)
|
||||
/*
|
||||
* Confirmation suppression fichier
|
||||
*/
|
||||
if ($_GET['action'] == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
@ -280,6 +289,6 @@ else
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter('$Date: 2011/07/03 13:16:46 $ - $Revision: 1.31 $');
|
||||
llxFooter('$Date: 2011/07/05 17:21:19 $ - $Revision: 1.33 $');
|
||||
|
||||
?>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* \file htdocs/societe/soc.php
|
||||
* \ingroup societe
|
||||
* \brief Third party card page
|
||||
* \version $Id: soc.php,v 1.120 2011/07/02 14:51:27 eldy Exp $
|
||||
* \version $Id: soc.php,v 1.121 2011/07/04 08:00:53 eldy Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -1903,17 +1903,6 @@ else
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n";
|
||||
}
|
||||
|
||||
/*if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContact").'</a>'."\n";
|
||||
}
|
||||
*/
|
||||
|
||||
/*if ($conf->projet->enabled && $user->rights->projet->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProject").'</a>'."\n";
|
||||
}*/
|
||||
|
||||
if ($user->rights->societe->supprimer)
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
@ -1972,5 +1961,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/02 14:51:27 $ - $Revision: 1.120 $');
|
||||
llxFooter('$Date: 2011/07/04 08:00:53 $ - $Revision: 1.121 $');
|
||||
?>
|
||||
@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/user/class/user.class.php
|
||||
* \brief Fichier de la classe utilisateur
|
||||
* \version $Id: user.class.php,v 1.43 2011/06/29 10:23:32 eldy Exp $
|
||||
* \version $Id: user.class.php,v 1.44 2011/07/04 11:41:02 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||
@ -1482,7 +1482,10 @@ class User extends CommonObject
|
||||
|
||||
/**
|
||||
* Add user into a group
|
||||
* @param group id du groupe
|
||||
* @param group Id of group
|
||||
* @param entity Entity
|
||||
* @param notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function SetInGroup($group, $entity, $notrigger=0)
|
||||
{
|
||||
@ -1539,7 +1542,10 @@ class User extends CommonObject
|
||||
|
||||
/**
|
||||
* Remove a user from a group
|
||||
* @param group id du groupe
|
||||
* @param group Id of group
|
||||
* @param entity Entity
|
||||
* @param notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function RemoveFromGroup($group, $entity, $notrigger=0)
|
||||
{
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* \file htdocs/user/class/usergroup.class.php
|
||||
* \brief Fichier de la classe des groupes d'utilisateur
|
||||
* \author Rodolphe Qiedeville
|
||||
* \version $Id$
|
||||
* \version $Id: usergroup.class.php,v 1.10 2011/07/04 11:41:04 eldy Exp $
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||
@ -55,9 +55,8 @@ class UserGroup extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* \param DB Handler acces base de donnees
|
||||
* \param id Id du groupe (0 par defaut)
|
||||
* Constructor
|
||||
* @param DB Handler acces base de donnees
|
||||
*/
|
||||
function UserGroup($DB)
|
||||
{
|
||||
@ -68,9 +67,9 @@ class UserGroup extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge un objet group avec toutes ces caracteristiques (excpet ->members array)
|
||||
* \param id id du groupe a charger
|
||||
* \return int <0 si KO, >0 si OK
|
||||
* Charge un objet group avec toutes ces caracteristiques (excpet ->members array)
|
||||
* @param id id du groupe a charger
|
||||
* @return int <0 si KO, >0 si OK
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
@ -117,13 +116,13 @@ class UserGroup extends CommonObject
|
||||
|
||||
/**
|
||||
* Return array of groups objects for a particular user
|
||||
* @param usertosearch
|
||||
* @return array of groups objects
|
||||
* @param userid User id to search
|
||||
* @return array Array of groups objects
|
||||
*/
|
||||
function listGroupsForUser($userid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT g.rowid, ug.entity as usergroup_entity";
|
||||
@ -143,12 +142,12 @@ class UserGroup extends CommonObject
|
||||
$group=new UserGroup($this->db);
|
||||
$group->fetch($obj->rowid);
|
||||
$group->usergroup_entity = $obj->usergroup_entity;
|
||||
|
||||
|
||||
$ret[]=$group;
|
||||
}
|
||||
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@ -166,7 +165,7 @@ class UserGroup extends CommonObject
|
||||
function listUsersForGroup()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT u.rowid, ug.entity as usergroup_entity";
|
||||
@ -188,9 +187,9 @@ class UserGroup extends CommonObject
|
||||
|
||||
$ret[]=$user;
|
||||
}
|
||||
|
||||
|
||||
$this->db->free($result);
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
@ -524,7 +523,7 @@ class UserGroup extends CommonObject
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."usergroup");
|
||||
|
||||
if ($this->update(1) < 0) return -2;
|
||||
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
|
||||
Loading…
Reference in New Issue
Block a user