Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-02-17 01:48:59 +01:00
commit 88e0123a05
33 changed files with 328 additions and 204 deletions

View File

@ -61,12 +61,13 @@ class Mailing extends CommonObject
/** /**
* \brief Constructeur de la classe * Constructor
* \param DB handler acces base de donnees *
* @param DoliDb $db Database handler
*/ */
function Mailing($DB) function Mailing($db)
{ {
$this->db = $DB ; $this->db = $db;
// List of language codes for status // List of language codes for status
$this->statuts[0] = 'MailingStatusDraft'; $this->statuts[0] = 'MailingStatusDraft';

View File

@ -240,6 +240,8 @@ print $form->select_users($userid,'userid',1);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0); print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -78,14 +78,14 @@ print "</form></table><br>\n";
* Statistics * Statistics
*/ */
$sql = "SELECT count(cf.rowid), c.fk_statut, c.facture"; $sql = "SELECT count(c.rowid), c.fk_statut, c.facture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.entity = ".$conf->entity;
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY c.fk_statut, c.facture"; $sql.= " GROUP BY c.fk_statut, c.facture";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)

View File

@ -260,6 +260,8 @@ print $form->select_users($userid,'userid',1);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0); print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';

View File

@ -224,6 +224,8 @@ print $form->select_users($userid,'userid',1);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0); print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';

View File

@ -239,6 +239,8 @@ print $form->select_users($userid,'userid',1);
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0); print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';

View File

@ -1559,9 +1559,9 @@ class ContratLigne
/** /**
* Constructeur d'objets ligne de contrat * Constructor
* *
* @param DoliDB $db Database access handler * @param DoliDb $db Database handler
*/ */
function ContratLigne($db) function ContratLigne($db)
{ {

View File

@ -23,8 +23,7 @@
/** /**
* \class MenuSmart * Class to manage smartphone menu smartphone (for internal users)
* \brief Class to manage smartphone menu smartphone (for internal users)
*/ */
class MenuSmart { class MenuSmart {
@ -35,8 +34,9 @@ class MenuSmart {
/** /**
* Constructeur * Constructor
* @param db Database handler *
* @param DoliDb $db Database handler
*/ */
function MenuSmart($db) function MenuSmart($db)
{ {
@ -46,7 +46,9 @@ class MenuSmart {
/** /**
* Show menu * Show menu
* @param limitmenuto To limit menu to a top or left menu value *
* @param string $limitmenuto To limit menu to a top or left menu value
* @return void
*/ */
function showmenu($limitmenuto) function showmenu($limitmenuto)
{ {

View File

@ -42,8 +42,9 @@ class MenuTop {
/** /**
* Constructeur * Constructor
* @param db Database access handler *
* @param DoliDb $db Database handler
*/ */
function MenuTop($db) function MenuTop($db)
{ {
@ -52,7 +53,9 @@ class MenuTop {
/** /**
* Show menu * Show menu
*
* @return void
*/ */
function showmenu() function showmenu()
{ {
@ -65,8 +68,7 @@ class MenuTop {
/** /**
* \class MenuLeft * Classe permettant la gestion du menu du gauche Auguria
* \brief Classe permettant la gestion du menu du gauche Auguria
*/ */
class MenuLeft { class MenuLeft {

View File

@ -42,8 +42,9 @@ class MenuTop {
/** /**
* \brief Constructeur * Constructor
* \param db Database access handler *
* @param DoliDb $db Database handler
*/ */
function MenuTop($db) function MenuTop($db)
{ {
@ -53,7 +54,9 @@ class MenuTop {
/** /**
* Show menu * Show menu
*
* @return void
*/ */
function showmenu() function showmenu()
{ {
@ -66,8 +69,7 @@ class MenuTop {
/** /**
* \class MenuLeft * Classe permettant la gestion du menu du gauche Auguria
* \brief Classe permettant la gestion du menu du gauche Auguria
*/ */
class MenuLeft { class MenuLeft {

View File

@ -40,8 +40,9 @@ class MenuTop {
/** /**
* Constructeur * Constructor
* @param db Handler d'acces base de donnee *
* @param DoliDb $db Database handler
*/ */
function MenuTop($db) function MenuTop($db)
{ {
@ -50,7 +51,9 @@ class MenuTop {
/** /**
* Show menu * Show menu
*
* @return void
*/ */
function showmenu() function showmenu()
{ {

View File

@ -28,8 +28,7 @@
/** /**
* \class MenuTop * Class to manage top menu Eldy (for external users)
* \brief Class to manage top menu Eldy (for external users)
*/ */
class MenuTop { class MenuTop {
@ -40,8 +39,9 @@ class MenuTop {
/** /**
* Constructeur * Constructor
* @param db Handler d'acces base de donnee *
* @param DoliDb $db Database handler
*/ */
function MenuTop($db) function MenuTop($db)
{ {
@ -50,7 +50,9 @@ class MenuTop {
/** /**
* Show menu * Show menu
*
* @return void
*/ */
function showmenu() function showmenu()
{ {
@ -63,8 +65,7 @@ class MenuTop {
/** /**
* \class MenuLeft * Classe permettant la gestion du menu du gauche Eldy
* \brief Classe permettant la gestion du menu du gauche Eldy
*/ */
class MenuLeft { class MenuLeft {

View File

@ -30,18 +30,16 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
/** /**
* \class pdf_edison * Classe permettant de generer les commandes au modele Edison
* \brief Classe permettant de generer les commandes au modele Edison
*/ */
class pdf_edison extends ModelePDFCommandes class pdf_edison extends ModelePDFCommandes
{ {
var $emetteur; // Objet societe qui emet var $emetteur; // Objet societe qui emet
/** /**
* Constructeur * Constructor
* *
* @param DoliDb $db Database access handler * @param DoliDb $db Database access handler
*/ */
function pdf_edison($db=0) function pdf_edison($db=0)
{ {

View File

@ -27,15 +27,15 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
/** /**
\class html_cerfafr * Class to generate document for subscriptions
\brief Classe permettant de generer les propales au modele Azur */
*/
class html_cerfafr extends ModeleDon class html_cerfafr extends ModeleDon
{ {
/** /**
\brief Constructeur * Constructor
\param db Handler acces base de donnees *
*/ * @param DoliDb $db Database handler
*/
function html_cerfafr($db) function html_cerfafr($db)
{ {
global $conf,$langs; global $conf,$langs;
@ -49,9 +49,11 @@ class html_cerfafr extends ModeleDon
} }
/** \brief Return if a module can be used or not /**
* \return boolean true if module can be used * Return if a module can be used or not
*/ *
* @return boolean true if module can be used
*/
function isEnabled() function isEnabled()
{ {
return true; return true;
@ -60,9 +62,10 @@ class html_cerfafr extends ModeleDon
/** /**
* Write the object to document file to disk * Write the object to document file to disk
* @param don Donation object *
* @param outputlangs Lang object for output language * @param Don $don Donation object
* @return int >0 if OK, <0 if KO * @param Translate $outputlangs Lang object for output language
* @return int >0 if OK, <0 if KO
*/ */
function write_file($don,$outputlangs) function write_file($don,$outputlangs)
{ {
@ -155,10 +158,7 @@ class html_cerfafr extends ModeleDon
} }
$this->error=$langs->trans("ErrorUnknown"); $this->error=$langs->trans("ErrorUnknown");
return 0; // Erreur par defaut return 0; // Erreur par defaut
} }
} }
?> ?>

View File

@ -30,8 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
/** /**
* \class ModeleDon * Parent class of subscription templates
* \brief Classe mere des modeles de dons
*/ */
abstract class ModeleDon extends CommonDocGenerator abstract class ModeleDon extends CommonDocGenerator
{ {
@ -59,23 +58,26 @@ abstract class ModeleDon extends CommonDocGenerator
/** /**
* \class ModeleNumRefDons * Parent class of donation numbering templates
* \brief Classe mere des modeles de numerotation des references des dons
*/ */
abstract class ModeleNumRefDons abstract class ModeleNumRefDons
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not /**
* \return boolean true if module can be used * Return if a module can be used or not
*
* @return boolean true if module can be used
*/ */
function isEnabled() function isEnabled()
{ {
return true; return true;
} }
/** \brief Renvoi la description par defaut du modele de num<EFBFBD>rotation /**
* \return string Texte descripif * Renvoi la description par defaut du modele de numerotation
*
* @return string Texte descripif
*/ */
function info() function info()
{ {
@ -84,8 +86,10 @@ abstract class ModeleNumRefDons
return $langs->trans("NoDescription"); return $langs->trans("NoDescription");
} }
/** \brief Renvoi un exemple de numerotation /**
* \return string Example * Renvoi un exemple de numerotation
*
* @return string Example
*/ */
function getExample() function getExample()
{ {
@ -94,17 +98,21 @@ abstract class ModeleNumRefDons
return $langs->trans("NoExample"); return $langs->trans("NoExample");
} }
/** \brief Test si les numeros deja en vigueur dans la base ne provoquent pas d /**
* de conflits qui empechera cette numerotation de fonctionner. * Test si les numeros deja en vigueur dans la base ne provoquent pas d
* \return boolean false si conflit, true si ok * de conflits qui empechera cette numerotation de fonctionner.
*
* @return boolean false si conflit, true si ok
*/ */
function canBeActivated() function canBeActivated()
{ {
return true; return true;
} }
/** \brief Renvoi prochaine valeur attribuee /**
* \return string Valeur * Renvoi prochaine valeur attribuee
*
* @return string Valeur
*/ */
function getNextValue() function getNextValue()
{ {
@ -112,8 +120,10 @@ abstract class ModeleNumRefDons
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
} }
/** \brief Renvoi version du module numerotation /**
* \return string Valeur * Renvoi version du module numerotation
*
* @return string Valeur
*/ */
function getVersion() function getVersion()
{ {
@ -129,13 +139,14 @@ abstract class ModeleNumRefDons
/** /**
* \brief Cree un don sur disque en fonction du modele de DON_ADDON_PDF * Cree un don sur disque en fonction du modele de DON_ADDON_PDF
* \param db objet base de donnee *
* \param id id du don e creer * @param DoliDB $db Databse handler
* \param message message * @param int $id Id donation
* \param modele force le modele a utiliser ('' par defaut) * @param string $message Message
* \param outputlangs objet lang a utiliser pour traduction * @param string $modele Force le modele a utiliser ('' par defaut)
* \return int 0 si KO, 1 si OK * @param Translate $outputlangs Object langs
* @return int 0 if KO, 1 if OK
*/ */
function don_create($db, $id, $message, $modele, $outputlangs) function don_create($db, $id, $message, $modele, $outputlangs)
{ {

View File

@ -27,8 +27,7 @@
require_once(DOL_DOCUMENT_ROOT ."/core/modules/fichinter/modules_fichinter.php"); require_once(DOL_DOCUMENT_ROOT ."/core/modules/fichinter/modules_fichinter.php");
/** /**
* \class mod_arctic * Class to manage numbering of intervention cards with rule Artic.
* \brief Class to manage numbering of intervention cards with rule Artic.
*/ */
class mod_arctic extends ModeleNumRefFicheinter class mod_arctic extends ModeleNumRefFicheinter
{ {
@ -36,15 +35,20 @@ class mod_arctic extends ModeleNumRefFicheinter
var $error = ''; var $error = '';
var $nom = 'Artic'; var $nom = 'Artic';
/** \brief Constructeur /**
*/ * Constructor
*
* @param DoliDb $db Database handler
*/
function mod_arctic() function mod_arctic()
{ {
$this->nom = "arctic"; $this->nom = "arctic";
} }
/** \brief Renvoi la description du modele de numerotation /**
* \return string Texte descripif * Renvoi la description du modele de numerotation
*
* @return string Texte descripif
*/ */
function info() function info()
{ {
@ -81,8 +85,10 @@ class mod_arctic extends ModeleNumRefFicheinter
return $texte; return $texte;
} }
/** \brief Renvoi un exemple de numerotation /**
* \return string Example * Renvoi un exemple de numerotation
*
* @return string Example
*/ */
function getExample() function getExample()
{ {
@ -100,11 +106,13 @@ class mod_arctic extends ModeleNumRefFicheinter
return $numExample; return $numExample;
} }
/** \brief Renvoi prochaine valeur attribuee /**
* \param objsoc Objet societe * Renvoi prochaine valeur attribuee
* \param ficheinter Object ficheinter *
* \return string Valeur * @param Societe $objsoc Objet societe
*/ * @param Ficheinter $object Object ficheinter
* @return string Valeur
*/
function getNextValue($objsoc=0,$object='') function getNextValue($objsoc=0,$object='')
{ {
global $db,$conf; global $db,$conf;
@ -126,11 +134,13 @@ class mod_arctic extends ModeleNumRefFicheinter
} }
/** \brief Return next free value /**
* \param objsoc Object third party * Return next free value
* \param objforref Object for number to search *
* \return string Next free value * @param Societe $objsoc Object third party
*/ * @param Object $objforref Object for number to search
* @return string Next free value
*/
function getNumRef($objsoc,$objforref) function getNumRef($objsoc,$objforref)
{ {
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);

View File

@ -25,8 +25,7 @@
require_once(DOL_DOCUMENT_ROOT ."/core/modules/fichinter/modules_fichinter.php"); require_once(DOL_DOCUMENT_ROOT ."/core/modules/fichinter/modules_fichinter.php");
/** /**
* \class mod_pacific * Class to manage numbering of intervention cards with rule Pacific.
* \brief Class to manage numbering of intervention cards with rule Pacific.
*/ */
class mod_pacific extends ModeleNumRefFicheinter class mod_pacific extends ModeleNumRefFicheinter
{ {
@ -36,8 +35,10 @@ class mod_pacific extends ModeleNumRefFicheinter
var $nom = 'pacific'; var $nom = 'pacific';
/** \brief Return description of numbering module /**
* \return string Text with description * Return description of numbering module
*
* @return string Text with description
*/ */
function info() function info()
{ {
@ -45,17 +46,21 @@ class mod_pacific extends ModeleNumRefFicheinter
return $langs->trans("SimpleNumRefModelDesc",$this->prefix); return $langs->trans("SimpleNumRefModelDesc",$this->prefix);
} }
/** \brief Renvoi un exemple de numerotation /**
* \return string Example * Renvoi un exemple de numerotation
*
* @return string Example
*/ */
function getExample() function getExample()
{ {
return $this->prefix."0501-0001"; return $this->prefix."0501-0001";
} }
/** \brief Test si les numeros deja en vigueur dans la base ne provoquent pas de /**
* de conflits qui empechera cette numerotation de fonctionner. * Test si les numeros deja en vigueur dans la base ne provoquent pas de
* \return boolean false si conflit, true si ok * de conflits qui empechera cette numerotation de fonctionner.
*
* @return boolean false si conflit, true si ok
*/ */
function canBeActivated() function canBeActivated()
{ {
@ -89,10 +94,12 @@ class mod_pacific extends ModeleNumRefFicheinter
} }
} }
/** \brief Renvoi prochaine valeur attribuee /**
* \param objsoc Objet societe * Renvoi prochaine valeur attribuee
* \param ficheinter Object ficheinter *
* \return string Valeur * @param objsoc Objet societe
* @param ficheinter Object ficheinter
* @return string Valeur
*/ */
function getNextValue($objsoc=0,$object='') function getNextValue($objsoc=0,$object='')
{ {
@ -121,10 +128,12 @@ class mod_pacific extends ModeleNumRefFicheinter
return $this->prefix.$yymm."-".$num; return $this->prefix.$yymm."-".$num;
} }
/** \brief Return next free value /**
* \param objsoc Object third party * Return next free value
* \param objforref Object for number to search *
* \return string Next free value * @param Societe $objsoc Object third party
* @param Object $objforref Object for number to search
* @return string Next free value
*/ */
function getNumRef($objsoc,$objforref) function getNumRef($objsoc,$objforref)
{ {

View File

@ -27,8 +27,7 @@ require_once(DOL_DOCUMENT_ROOT ."/core/modules/import/modules_import.php");
/** /**
* \class ImportCsv * Class to import CSV files
* \brief Class to import CSV files
*/ */
class ImportCsv extends ModeleImports class ImportCsv extends ModeleImports
{ {
@ -529,6 +528,9 @@ class ImportCsv extends ModeleImports
/** /**
* Clean a string from separator * Clean a string from separator
*
* @param string $value Remove separator
* @return string String without separator
*/ */
function cleansep($value) function cleansep($value)
{ {

View File

@ -42,7 +42,7 @@ class ModeleImports
/** /**
* \brief Constructeur * Constructor
*/ */
function ModeleImports() function ModeleImports()
{ {

View File

@ -27,8 +27,7 @@ require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/modules_project.php");
/** /**
* \class mod_project_simple * Class to manage the numbering module Simple for project references
* \brief Class to manage the numbering module Simple for project references
*/ */
class mod_project_simple extends ModeleNumRefProjects class mod_project_simple extends ModeleNumRefProjects
{ {
@ -38,8 +37,10 @@ class mod_project_simple extends ModeleNumRefProjects
var $nom = "Simple"; var $nom = "Simple";
/** \brief Return description of numbering module /**
* \return string Text with description * Return description of numbering module
*
* @return string Text with description
*/ */
function info() function info()
{ {
@ -48,8 +49,10 @@ class mod_project_simple extends ModeleNumRefProjects
} }
/** \brief Return an example of numbering module values /**
* \return string Example * Return an example of numbering module values
*
* @return string Example
*/ */
function getExample() function getExample()
{ {
@ -57,9 +60,10 @@ class mod_project_simple extends ModeleNumRefProjects
} }
/** \brief Test si les numeros deja en vigueur dans la base ne provoquent pas de /** Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner. * de conflits qui empechera cette numerotation de fonctionner.
* \return boolean false si conflit, true si ok *
* @return boolean false si conflit, true si ok
*/ */
function canBeActivated() function canBeActivated()
{ {
@ -92,10 +96,11 @@ class mod_project_simple extends ModeleNumRefProjects
/** /**
* \brief Return next value * Return next value
* \param objsoc Object third party *
* \param project Object project * @param Societe $objsoc Object third party
* \return string Value if OK, 0 if KO * @param Project $project Object project
* @return string Value if OK, 0 if KO
*/ */
function getNextValue($objsoc=0,$project='') function getNextValue($objsoc=0,$project='')
{ {
@ -132,10 +137,12 @@ class mod_project_simple extends ModeleNumRefProjects
} }
/** \brief Return next reference not yet used as a reference /**
* \param objsoc Object third party * Return next reference not yet used as a reference
* \param project Object project *
* \return string Next not used reference * @param Societe $objsoc Object third party
* @param Project $project Object project
* @return string Next not used reference
*/ */
function project_get_num($objsoc=0,$project='') function project_get_num($objsoc=0,$project='')
{ {

View File

@ -26,8 +26,7 @@ require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/modules_project.php");
/** /**
* \class mod_project_universal * Classe du modele de numerotation de reference de projet Universal
* \brief Classe du modele de numerotation de reference de projet Universal
*/ */
class mod_project_universal extends ModeleNumRefProjects class mod_project_universal extends ModeleNumRefProjects
{ {
@ -37,8 +36,9 @@ class mod_project_universal extends ModeleNumRefProjects
/** /**
* \brief Renvoi la description du modele de numerotation * Renvoi la description du modele de numerotation
* \return string Texte descripif *
* @return string Texte descripif
*/ */
function info() function info()
{ {
@ -77,8 +77,9 @@ class mod_project_universal extends ModeleNumRefProjects
} }
/** /**
* \brief Renvoi un exemple de numerotation * Renvoi un exemple de numerotation
* \return string Example *
* @return string Example
*/ */
function getExample() function getExample()
{ {
@ -97,10 +98,11 @@ class mod_project_universal extends ModeleNumRefProjects
} }
/** /**
* \brief Return next value * Return next value
* \param objsoc Object third party *
* \param project Object project * @param Societe $objsoc Object third party
* \return string Value if OK, 0 if KO * @param Project $project Object project
* @return string Value if OK, 0 if KO
*/ */
function getNextValue($objsoc=0,$project='') function getNextValue($objsoc=0,$project='')
{ {
@ -124,10 +126,12 @@ class mod_project_universal extends ModeleNumRefProjects
} }
/** \brief Return next reference not yet used as a reference /**
* \param objsoc Object third party * Return next reference not yet used as a reference
* \param project Object project *
* \return string Next not used reference * @param Societe $objsoc Object third party
* @param Project $project Object project
* @return string Next not used reference
*/ */
function project_get_num($objsoc=0,$project='') function project_get_num($objsoc=0,$project='')
{ {

View File

@ -26,8 +26,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commondocgenerator.class.php");
/** /**
* \class ModelePDFProjects * Parent class for projects models
* \brief Parent class for projects models
*/ */
abstract class ModelePDFProjects extends CommonDocGenerator abstract class ModelePDFProjects extends CommonDocGenerator
{ {
@ -35,8 +34,9 @@ abstract class ModelePDFProjects extends CommonDocGenerator
/** /**
* \brief Return list of active generation modules * Return list of active generation modules
* \param $db Database handler *
* @param DoliDB $db Database handler
*/ */
function liste_modeles($db) function liste_modeles($db)
{ {
@ -55,16 +55,16 @@ abstract class ModelePDFProjects extends CommonDocGenerator
/** /**
* \class ModeleNumRefProjects * Classe mere des modeles de numerotation des references de projets
* \brief Classe mere des modeles de numerotation des references de projets
*/ */
abstract class ModeleNumRefProjects abstract class ModeleNumRefProjects
{ {
var $error=''; var $error='';
/** /**
* \brief Return if a module can be used or not * Return if a module can be used or not
* \return boolean true if module can be used *
* @return boolean true if module can be used
*/ */
function isEnabled() function isEnabled()
{ {
@ -72,8 +72,9 @@ abstract class ModeleNumRefProjects
} }
/** /**
* \brief Renvoi la description par defaut du modele de numerotation * Renvoi la description par defaut du modele de numerotation
* \return string Texte descripif *
* @return string Texte descripif
*/ */
function info() function info()
{ {
@ -83,8 +84,9 @@ abstract class ModeleNumRefProjects
} }
/** /**
* \brief Renvoi un exemple de numerotation * Renvoi un exemple de numerotation
* \return string Example *
* @return string Example
*/ */
function getExample() function getExample()
{ {
@ -94,9 +96,10 @@ abstract class ModeleNumRefProjects
} }
/** /**
* \brief Test si les numeros deja en vigueur dans la base ne provoquent pas de * Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner. * de conflits qui empechera cette numerotation de fonctionner.
* \return boolean false si conflit, true si ok *
* @return boolean false si conflit, true si ok
*/ */
function canBeActivated() function canBeActivated()
{ {
@ -104,8 +107,9 @@ abstract class ModeleNumRefProjects
} }
/** /**
* \brief Renvoi prochaine valeur attribuee * Renvoi prochaine valeur attribuee
* \return string Valeur *
* @return string Valeur
*/ */
function getNextValue() function getNextValue()
{ {
@ -114,8 +118,9 @@ abstract class ModeleNumRefProjects
} }
/** /**
* \brief Renvoi version du module numerotation * Renvoi version du module numerotation
* \return string Valeur *
* @return string Valeur
*/ */
function getVersion() function getVersion()
{ {
@ -131,12 +136,13 @@ abstract class ModeleNumRefProjects
/** /**
* Create object on disk * Create object on disk
* @param db objet base de donnee *
* @param object object project * @param DoliDB $db objet base de donnee
* @param model force le modele a utiliser ('' to not force) * @param Object $object object project
* @param outputlangs objet lang a utiliser pour traduction * @param string $model force le modele a utiliser ('' to not force)
* @return int 0 si KO, 1 si OK * @param Translate $outputlangs objet lang a utiliser pour traduction
* @return int 0 if KO, 1 if OK
*/ */
function project_pdf_create($db, $object, $model,$outputlangs) function project_pdf_create($db, $object, $model,$outputlangs)
{ {

View File

@ -31,8 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
/** /**
* \class doc_generic_iproposal_odt * Class to build documents using ODF templates generator
* \brief Class to build documents using ODF templates generator
*/ */
class doc_generic_proposal_odt extends ModelePDFPropales class doc_generic_proposal_odt extends ModelePDFPropales
{ {

View File

@ -27,14 +27,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
/** /**
* \class pdf_paiement * Classe permettant de generer les rapports de paiement
* \brief Classe permettant de generer les rapports de paiement
*/ */
class pdf_paiement class pdf_paiement
{ {
/** /**
* \brief Constructeur * Constructor
* \param db handler acces base de donnee *
* @param DoliDb $db Database handler
*/ */
function pdf_paiement($db) function pdf_paiement($db)
{ {
@ -66,11 +66,12 @@ class pdf_paiement
/** /**
* \brief Fonction generant le rapport sur le disque * Fonction generant la rapport sur le disque
* \param _dir repertoire *
* \param month mois du rapport * @param string $_dir repertoire
* \param year annee du rapport * @param int $month mois du rapport
* \param outputlangs Lang output object * @param int $year annee du rapport
* @param string $outputlangs Lang output object
*/ */
function write_file($_dir, $month, $year, $outputlangs) function write_file($_dir, $month, $year, $outputlangs)
{ {
@ -127,7 +128,7 @@ class pdf_paiement
$sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
$sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; $sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
dol_syslog("pdf_paiement::write_file sql=".$sql); dol_syslog(get_class($this)."::write_file sql=".$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
@ -263,7 +264,13 @@ class pdf_paiement
/** /**
* Output body
* *
* @param PDF &$pdf PDF object
* @param string $page Page
* @param array $lines Array of lines
* @param Translate $langs Object langs
* @return void
*/ */
function Body(&$pdf, $page, $lines, $outputlangs) function Body(&$pdf, $page, $lines, $outputlangs)
{ {

View File

@ -3285,6 +3285,7 @@ function migrate_mode_reglement($db,$langs,$conf)
'code' => array('VAD','TRA','LCR','FAC','PRO'), 'code' => array('VAD','TRA','LCR','FAC','PRO'),
'tables' => array('commande_fournisseur','commande','facture_rec','facture','propal') 'tables' => array('commande_fournisseur','commande','facture_rec','facture','propal')
); );
$count=0;
foreach($elements['old_id'] as $key => $old_id) foreach($elements['old_id'] as $key => $old_id)
{ {
@ -3303,6 +3304,8 @@ function migrate_mode_reglement($db,$langs,$conf)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num) if ($num)
{ {
$count++;
$db->begin(); $db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET "; $sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET ";
@ -3344,13 +3347,12 @@ function migrate_mode_reglement($db,$langs,$conf)
$db->rollback(); $db->rollback();
} }
} }
else
{
print $langs->trans('AlreadyDone')."<br>\n";
}
} }
} }
if ($count == 0) print $langs->trans('AlreadyDone')."<br>\n";
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -16,3 +16,4 @@ PAYPAL_ADD_PAYMENT_URL=Add the url of Paypal payment when you send a document by
PAYPAL_IPN_MAIL_ADDRESS=E-mail address for the instant notification of payment (IPN) PAYPAL_IPN_MAIL_ADDRESS=E-mail address for the instant notification of payment (IPN)
PredefinedMailContentSendOrderWithPaypalLink=You will find here the order __ORDERREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n PredefinedMailContentSendOrderWithPaypalLink=You will find here the order __ORDERREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n
PredefinedMailContentSendInvoiceWithPaypalLink=You will find here the invoice __FACREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n PredefinedMailContentSendInvoiceWithPaypalLink=You will find here the invoice __FACREF__\n\nYou can click on the secure link below to make your payment via PayPal\n\n%s\n\nSincerely\n\n
YouAreCurrentlyInSandboxMode=You are currently in the "sandbox" mode

View File

@ -16,3 +16,4 @@ PAYPAL_ADD_PAYMENT_URL=Ajouter l'url de paiement Paypal lors de l'envoi d'un doc
PAYPAL_IPN_MAIL_ADDRESS=Adresse e-mail pour les notifications instantanées de paiement (IPN) PAYPAL_IPN_MAIL_ADDRESS=Adresse e-mail pour les notifications instantanées de paiement (IPN)
PredefinedMailContentSendOrderWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la commande __ORDERREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n PredefinedMailContentSendOrderWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la commande __ORDERREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n
PredefinedMailContentSendInvoiceWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la facture __FACREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n PredefinedMailContentSendInvoiceWithPaypalLink=Bonjour\nVeuillez trouver ci-joint la facture __FACREF__\n\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\nCordialement\n\n
YouAreCurrentlyInSandboxMode=Vous êtes actuellement dans le mode "sandbox"

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org> * Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -55,6 +55,28 @@ function llxHeaderPaypal($title, $head = "")
print '.CTableRow2 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #FFFFFF; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}'; print '.CTableRow2 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #FFFFFF; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
print '</style>'; print '</style>';
} }
if ($conf->use_javascript_ajax)
{
print '<!-- Includes for JQuery (Ajax library) -->'."\n";
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" />'."\n"; // JNotify
// Output standard javascript links
$ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) {
$ext='.jgz';
} // mini='_mini', ext='.gz'
// JQuery. Must be before other includes
print '<!-- Includes JS for JQuery -->'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
// jQuery jnotify
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/jnotify.js"></script>'."\n";
}
}
print "</head>\n"; print "</head>\n";
print '<body style="margin: 20px;">'."\n"; print '<body style="margin: 20px;">'."\n";
} }
@ -207,7 +229,11 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
if ($type == 'free') if ($type == 'free')
{ {
$out=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':''); $out=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':'');
if (! empty($conf->global->PAYPAL_SECURITY_TOKEN)) $out.='&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN; if (! empty($conf->global->PAYPAL_SECURITY_TOKEN))
{
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
else $out.='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
}
} }
if ($type == 'order') if ($type == 'order')
{ {

View File

@ -1022,7 +1022,7 @@ class Product extends CommonObject
if ($id) $sql.= " WHERE rowid = '".$id."'"; if ($id) $sql.= " WHERE rowid = '".$id."'";
else else
{ {
$sql.= " WHERE p.entity IN (".getEntity($this->element, 1).")"; $sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
if ($ref) $sql.= " AND ref = '".$this->db->escape($ref)."'"; if ($ref) $sql.= " AND ref = '".$this->db->escape($ref)."'";
else if ($ref_ext) $sql.= " AND ref_ext = '".$this->db->escape($ref_ext)."'"; else if ($ref_ext) $sql.= " AND ref_ext = '".$this->db->escape($ref_ext)."'";
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -236,6 +236,10 @@ if (GETPOST("action") == 'dopayment')
llxHeaderPaypal($langs->trans("PaymentForm")); llxHeaderPaypal($langs->trans("PaymentForm"));
if (! empty($PAYPAL_API_SANDBOX))
{
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode'),'','warning');
}
// Common variables // Common variables
$creditor=$mysoc->name; $creditor=$mysoc->name;

View File

@ -2019,7 +2019,7 @@ class Societe extends CommonObject
// Verifie SIRET si pays FR // Verifie SIRET si pays FR
if ($idprof == 2 && $soc->country_code == 'FR') if ($idprof == 2 && $soc->country_code == 'FR')
{ {
$chaine=trim($this->idprof1); $chaine=trim($this->idprof2);
$chaine=preg_replace('/(\s)/','',$chaine); $chaine=preg_replace('/(\s)/','',$chaine);
if (dol_strlen($chaine) != 14) return -1; if (dol_strlen($chaine) != 14) return -1;

View File

@ -266,6 +266,24 @@ class SocieteTest extends PHPUnit_Framework_TestCase
print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n";
$this->assertNotEquals($localobject->date_creation, ''); $this->assertNotEquals($localobject->date_creation, '');
$localobject->idprof1=493861496;
$localobject->idprof2=49386149600021;
$result=$localobject->id_prof_check(1,$localobject);
print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0);
$result=$localobject->id_prof_check(2,$localobject);
print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0);
$localobject->idprof1='id1ko';
$localobject->idprof2='id2ko';
$result=$localobject->id_prof_check(1,$localobject);
print __METHOD__." result=".$result."\n";
$this->assertGreaterThan($result, 0);
$result=$localobject->id_prof_check(2,$localobject);
print __METHOD__." result=".$result."\n";
$this->assertGreaterThan($result, 0);
return $localobject->id; return $localobject->id;
} }