cvsimport

This commit is contained in:
Regis Houssin 2011-09-21 15:02:10 +00:00
commit d647e8040e
45 changed files with 5951 additions and 6220 deletions

View File

@ -105,7 +105,7 @@ INLINE_INHERITED_MEMB = NO
# path before files name in the file list and in the header files. If set # path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used. # to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = YES FULL_PATH_NAMES = NO
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is # can be used to strip a user-defined part of the path. Stripping is
@ -114,7 +114,7 @@ FULL_PATH_NAMES = YES
# If left blank the directory from which doxygen is run is used as the # If left blank the directory from which doxygen is run is used as the
# path to strip. # path to strip.
STRIP_FROM_PATH = "/var/lib/hudson/jobs/dolibarr-develop/workspace" STRIP_FROM_PATH = ""
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells # the path mentioned in the documentation of a class, which tells

View File

@ -40,7 +40,7 @@ accessforbidden();
$typeconst=array('yesno','texte','chaine'); $typeconst=array('yesno','texte','chaine');
$action = getpost("action"); $action = GETPOST("action");
// Action mise a jour ou ajout d'une constante // Action mise a jour ou ajout d'une constante

View File

@ -28,10 +28,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
$langs->load("admin"); $langs->load("admin");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$action = GETPOST("action");
$action = getpost("action");
/* /*
* Actions * Actions

View File

@ -28,8 +28,7 @@ require_once(DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php');
$langs->load("admin"); $langs->load("admin");
$langs->load("errors"); $langs->load("errors");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$action = GETPOST("action"); $action = GETPOST("action");
$value = GETPOST("value"); $value = GETPOST("value");

View File

@ -27,15 +27,15 @@ require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php");
$langs->load("admin"); $langs->load("admin");
$langs->load("donations"); $langs->load("donations");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$typeconst=array('yesno','texte','chaine'); $typeconst=array('yesno','texte','chaine');
/* /*
* Action * Action
*/ */
if ($_GET["action"] == 'specimen') if ($_GET["action"] == 'specimen')
{ {
$modele=$_GET["module"]; $modele=$_GET["module"];

View File

@ -30,8 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$langs->load("admin"); $langs->load("admin");
$langs->load("fckeditor"); $langs->load("fckeditor");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
// Constante et traduction de la description du module // Constante et traduction de la description du module
$modules = array( $modules = array(
@ -67,7 +66,6 @@ $picto = array(
* Actions * Actions
*/ */
foreach($modules as $const => $desc) foreach($modules as $const => $desc)
{ {
if ($_GET["action"] == 'activate_'.strtolower($const)) if ($_GET["action"] == 'activate_'.strtolower($const))

View File

@ -48,7 +48,7 @@ $value = GETPOST("value");
if ($action == 'updateMask') if ($action == 'updateMask')
{ {
$maskconst=GETPOST("maskconst"); $maskconst=GETPOST("maskconst");
$maskvalue=getpost("maskvalue"); $maskvalue=GETPOST("maskvalue");
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;

View File

@ -42,7 +42,7 @@ if ($action == 'set')
{ {
$error=0; $error=0;
$gimcdf= getpost("GEOIPMAXMIND_COUNTRY_DATAFILE"); $gimcdf= GETPOST("GEOIPMAXMIND_COUNTRY_DATAFILE");
if (! $gimcdf && ! file_exists($gimcdf)) if (! $gimcdf && ! file_exists($gimcdf))
{ {

View File

@ -30,10 +30,13 @@ $langs->load("admin");
$langs->load("users"); $langs->load("users");
$langs->load("other"); $langs->load("other");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
/*
* Actions
*/
if ($_GET["action"] == 'add') if ($_GET["action"] == 'add')
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1"; $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1";

View File

@ -33,11 +33,15 @@ $langs->load("admin");
$langs->load("withdrawals"); $langs->load("withdrawals");
// Security check // Security check
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$action = GETPOST("action"); $action = GETPOST("action");
/*
* Actions
*/
if ($action == "set") if ($action == "set")
{ {
$db->begin(); $db->begin();
@ -101,6 +105,7 @@ if ($action == "deletenotif")
exit; exit;
} }
/* /*
* View * View
*/ */

View File

@ -31,8 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$langs->load("admin"); $langs->load("admin");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$action=GETPOST("action"); $action=GETPOST("action");
$value=GETPOST("value"); $value=GETPOST("value");

View File

@ -29,10 +29,9 @@ $langs->load("admin");
$langs->load("stocks"); $langs->load("stocks");
// Securit check // Securit check
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$action = getpost("action"); $action = GETPOST("action");
/* /*

View File

@ -26,8 +26,7 @@
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$langs->load("admin"); $langs->load("admin");
$langs->load("other"); $langs->load("other");
@ -37,6 +36,7 @@ $action = GETPOST("action");
/* /*
* Actions * Actions
*/ */
if ($action== 'setlevel') if ($action== 'setlevel')
{ {
$level = GETPOST("level"); $level = GETPOST("level");

View File

@ -29,8 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
$langs->load('admin'); $langs->load('admin');
if (!$user->admin) if (!$user->admin) accessforbidden();
accessforbidden();
$action = GETPOST("action"); $action = GETPOST("action");

View File

@ -1,4 +1,4 @@
<?PHP <?PHP
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2011 Auguria <anthony.poiret@auguria.net> /* Copyright (C) 2011 Auguria <anthony.poiret@auguria.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -28,7 +28,7 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
/** /**
* \class Don * \class Don
* \brief Classe permettant la gestion des dons * \brief Class to manage donations
*/ */
class Don extends CommonObject class Don extends CommonObject
{ {
@ -56,8 +56,9 @@ class Don extends CommonObject
var $projet; var $projet;
/** /**
* \brief Constructeur * Constructor
* \param DB Handler d'acces base *
* @param DoliDB $DB Database handler
*/ */
function Don($DB) function Don($DB)
{ {
@ -79,9 +80,10 @@ class Don extends CommonObject
/** /**
* \brief Retourne le libelle du statut d'un don (brouillon, validee, abandonnee, payee) * Retourne le libelle du statut d'un don (brouillon, validee, abandonnee, payee)
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long *
* \return string Libelle * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Libelle
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -89,10 +91,11 @@ class Don extends CommonObject
} }
/** /**
* \brief Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* \param statut Id statut *
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $statut Id statut
* \return string Libelle du statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
@ -195,8 +198,10 @@ class Don extends CommonObject
/** /**
* Check params
* *
* * @param int $minimum Minimum
* @return int 0 if KO, >0 if OK
*/ */
function check($minimum=0) function check($minimum=0)
{ {
@ -238,7 +243,8 @@ class Don extends CommonObject
$this->amount = trim($this->amount); $this->amount = trim($this->amount);
$map = range(0,9); $map = range(0,9);
for ($i = 0; $i < dol_strlen($this->amount); $i++) $len=dol_strlen($this->amount);
for ($i = 0; $i < $len; $i++)
{ {
if (!isset($map[substr($this->amount, $i, 1)] )) if (!isset($map[substr($this->amount, $i, 1)] ))
{ {
@ -280,7 +286,8 @@ class Don extends CommonObject
/** /**
* Create donation record into database * Create donation record into database
* @param user Objet utilisateur qui cree le don *
* @param User $user Objet utilisateur qui cree le don
* @return int Id don cree si ok, <0 si ko * @return int Id don cree si ok, <0 si ko
* TODO add numbering module for Ref * TODO add numbering module for Ref
*/ */
@ -349,7 +356,8 @@ class Don extends CommonObject
/** /**
* Update a donation record * Update a donation record
* @param user Objet utilisateur qui met a jour le don *
* @param User $user Objet utilisateur qui met a jour le don
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function update($user) function update($user)
@ -390,7 +398,8 @@ class Don extends CommonObject
/** /**
* Delete a donation * Delete a donation
* @param rowid Id of donation to delete *
* @param int $rowid Id of donation to delete
*/ */
function delete($rowid) function delete($rowid)
{ {
@ -418,8 +427,9 @@ class Don extends CommonObject
/** /**
* Load donation from database * Load donation from database
* @param rowid Id of donation to load *
* @param ref Ref of donation to load * @param int $rowid Id of donation to load
* @param string $ref Ref of donation to load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid,$ref='') function fetch($rowid,$ref='')
@ -481,8 +491,9 @@ class Don extends CommonObject
/** /**
* Valide une promesse de don * Valide une promesse de don
* @param rowid id du don a modifier *
* @param userid utilisateur qui valide la promesse * @param int $rowid id du don a modifier
* @param int $userid utilisateur qui valide la promesse
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function valid_promesse($rowid, $userid) function valid_promesse($rowid, $userid)
@ -512,8 +523,9 @@ class Don extends CommonObject
/** /**
* Classe le don comme paye, le don a ete recu * Classe le don comme paye, le don a ete recu
* @param rowid id du don a modifier *
* @param modepaiementd mode de paiement * @param int $rowid id du don a modifier
* @param int $modepaiementd mode de paiement
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function set_paye($rowid, $modepaiement='') function set_paye($rowid, $modepaiement='')
@ -548,7 +560,8 @@ class Don extends CommonObject
/** /**
* Classe le don comme encaisse * Classe le don comme encaisse
* @param rowid id du don a modifier *
* @param int $rowid id du don a modifier
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function set_encaisse($rowid) function set_encaisse($rowid)
@ -578,7 +591,8 @@ class Don extends CommonObject
/** /**
* Set donation sto status canceled * Set donation sto status canceled
* @param rowid id du don a modifier *
* @param int $rowid id du don a modifier
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function set_cancel($rowid) function set_cancel($rowid)
@ -606,8 +620,10 @@ class Don extends CommonObject
} }
/** /**
* \brief Somme des dons * Somme des dons
* \param param 1=promesses de dons validees , 2=xxx, 3=encaisses *
* @param string $param 1=promesses de dons validees , 2=xxx, 3=encaisses
* @return int Summ of donations
*/ */
function sum_donations($param) function sum_donations($param)
{ {
@ -632,9 +648,10 @@ class Don extends CommonObject
/** /**
* \brief Return clicable name (with picto eventually) * Return clicable name (with picto eventually)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* \return string Chaine avec URL * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0) function getNomUrl($withpicto=0)
{ {
@ -657,9 +674,10 @@ class Don extends CommonObject
/** /**
* Return full name (civility+' '+name+' '+lastname) * Return full name (civility+' '+name+' '+lastname)
* @param langs Language object for translation of civility *
* @param option 0=No option, 1=Add civility * @param Translate $langs Language object for translation of civility
* @param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname * @param int $option 0=No option, 1=Add civility
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname
* @return string String with full name * @return string String with full name
*/ */
function getFullName($langs,$option=0,$nameorder=-1) function getFullName($langs,$option=0,$nameorder=-1)

View File

@ -305,8 +305,7 @@ class BonPrelevement extends CommonObject
} }
else else
{ {
dol_syslog("BonPrelevement::Fetch Erreur "); dol_syslog("BonPrelevement::Fetch Erreur sql=".$sql, LOG_ERR);
dol_syslog($sql);
return -2; return -2;
} }
} }
@ -966,11 +965,8 @@ class BonPrelevement extends CommonObject
$sql.= " WHERE rowid = ".$fac[1]; $sql.= " WHERE rowid = ".$fac[1];
dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG); dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql)) $resql=$this->db->query($sql);
{ if (! $resql)
}
else
{ {
$error++; $error++;
dol_syslog("Erreur mise a jour des demandes"); dol_syslog("Erreur mise a jour des demandes");

View File

@ -1,353 +0,0 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/stats/comp.php
* \ingroup commercial
* TODO Remove or add page in menus
*/
require('../../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/lib/accountancy.lib.php");
// Security check
if ($user->societe_id > 0)
{
$socid = $user->societe_id;
}
function propals ($db, $year, $month)
{
global $bc,$langs,$conf;
$sql = "SELECT s.nom, s.rowid as socid, p.rowid as propalid, p.price, p.ref, p.datep as dp, p.fk_statut as statutid, c.label as statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."c_propalst as c";
$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)";
// 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);
$num = $db->num_rows($result);
$i = 0;
print "<table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<tr class=\"liste_titre\"><td colspan=\"5\"><b>Propal</b></td></tr>";
$oldstatut = -1;
$subtotal = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
if ($objp->statut <> $oldstatut ) {
$oldstatut = $objp->statut;
if ($i > 0) {
print "<tr><td align=\"right\" colspan=\"4\">".$langs->trans("Total").": <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
}
$subtotal = 0;
print "<tr class=\"liste_titre\">";
print "<td>Societe</td>";
print "<td>".$langs->trans("Ref")."</td>";
print "<td align=\"right\">".$langs->trans("Date")."</td>";
print "<td align=\"right\">".$langs->trans("Price")."</td>";
print "<td align=\"center\">".$langs->trans("Status")."</td>";
print "</tr>\n";
$var=True;
}
$var=!$var;
print "<tr $bc[$var]>";
print "<td><a href=\"comp.php?socid=".$objp->socid."\">".$objp->nom."</a></td>\n";
print "<td><a href=\"".DOL_URL_ROOT."/comm/propal.php?id=".$objp->propalid."\">".$objp->ref."</a></td>\n";
print "<td align=\"right\">".dol_print_date($db->jdate($objp->dp))."</td>\n";
print "<td align=\"right\">".price($objp->price)."</td>\n";
print "<td align=\"center\">".$objp->statut."</td>\n";
print "</tr>\n";
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print "<tr><td align=\"right\" colspan=\"4\">".$langs->trans("Total").": <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
print "<tr>";
print "<td colspan=\"3\" align=\"right\"><b>".$langs->trans("Total").": ".price($total)."</b></td>";
print "<td align=\"left\"><b>".$langs->trans("Currency".$conf->monnaie)."</b></td></tr>";
print "</table>";
$db->free();
}
function factures ($db, $year, $month, $paye)
{
global $bc,$conf;
$sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.total, f.datef as df, f.paye, f.rowid as facid ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ",".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.fk_statut = 1";
$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 round(date_format(f.datef, '%m')) = ".$month;
$sql.= " ORDER BY f.datef DESC ";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
if ($num > 0)
{
$i = 0;
print "<table class=\"noborder\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
print "<tr class=\"liste_titre\"><td colspan=\"5\"><b>Factures</b></td></tr>";
print "<tr class=\"liste_titre\">";
print "<td>Societe</td>";
print "<td>Num</td>";
print "<td align=\"right\">Date</td>";
print "<td align=\"right\">Montant</td>";
print "<td align=\"right\">Pay<61></td>";
print "</tr>\n";
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
print "<td><a href=\"comp.php?socid=".$objp->socid."\">".$objp->nom."</a></td>\n";
print "<td><a href=\"../facture.php?facid=".$objp->facid."\">".$objp->facnumber."</a></td>\n";
if ($objp->df > 0 )
{
print "<td align=\"right\">".dol_print_date($db->jdate($objp->df))."</td>\n";
}
else
{
print "<td align=\"right\"><b>!!!</b></td>\n";
}
print "<td align=\"right\">".price($objp->total)."</td>\n";
$payes[1] = "oui";
$payes[0] = "<b>non</b>";
print "<td align=\"right\">".$payes[$objp->paye]."</td>\n";
print "</tr>\n";
$total = $total + $objp->total;
$i++;
}
print "<tr><td colspan=\"4\" align=\"right\">";
print "<b>Total : ".price($total)."</b></td><td></td></tr>";
print "</table>";
$db->free();
}
}
else
{
print $db->error();
}
}
function pt ($db, $sql, $year)
{
global $bc, $langs;
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0; $total = 0 ;
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<tr class=\"liste_titre\">";
print '<td>'.$langs->trans("Month").'</td>';
print "<td align=\"right\">Montant</td></tr>\n";
$var=True;
$month = 1 ;
while ($i < $num) {
$obj = $db->fetch_object($result);
$var=!$var;
if ($obj->dm > $month ) {
for ($b = $month ; $b < $obj->dm ; $b++) {
print "<tr $bc[$var]>";
print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
print "<td align=\"right\">0</td>\n";
print "</tr>\n";
$var=!$var;
$ca[$b] = 0;
}
}
if ($obj->sum > 0) {
print "<tr $bc[$var]>";
print "<td><a href=\"comp.php?details=1&year=$year&month=$obj->dm\">";
print dol_print_date(dol_mktime(12,0,0,$obj->dm, 1, $year),"%b")."</td>\n";
print "<td align=\"right\">".price($obj->sum)."</td>\n";
print "</TR>\n";
$month = $obj->dm + 1;
$ca[$obj->dm] = $obj->sum;
$total = $total + $obj->sum;
}
$i++;
}
if ($num) {
$beg = $obj->dm;
} else {
$beg = 0 ;
}
if ($beg <= 12 ) {
for ($b = $beg + 1 ; $b < 13 ; $b++) {
$var=!$var;
print "<tr $bc[$var]>";
print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
print "<td align=\"right\">0</td>\n";
print "</tr>\n";
$ca[$b] = 0;
}
}
print "<tr class=\"total\"><td align=\"right\">Total :</td><td align=\"right\"><b>".price($total)."</b></td></tr>";
print "</table>";
$db->free();
return $ca;
} else {
print $db->error();
}
}
function ppt ($db, $year, $socid)
{
global $bc,$conf,$langs;
print "<table width=\"100%\">";
print '<tr class="liste_titre"><td align="center" valign="top" width="30%">';
print "CA Previsionnel base sur les propal $year";
print "</td><td align=\"center\" valign=\"top\">CA Realise $year</td>";
print "<td align=\"center\" valign=\"top\">Delta $year</td></tr>";
print '<tr><td valign="top" align="center" width="30%">';
$sql = "SELECT sum(p.price) as sum, round(date_format(p.datep,'%m')) as dm";
$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."'";
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
$sql.= " GROUP BY dm";
$prev = pt($db, $sql, $year);
print "</td><td valign=\"top\" width=\"30%\">";
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$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."'";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$sql.= " GROUP BY dm";
$ca = pt($db, $sql, $year);
print "</td><td valign=\"top\" width=\"30%\">";
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<tr class=\"liste_titre\">";
print '<td>'.$langs->trans("Month").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>';
print "</tr>\n";
$var = 1 ;
for ($b = 1 ; $b <= 12 ; $b++)
{
$var=!$var;
$delta = $ca[$b] - $prev[$b];
$deltat = $deltat + $delta ;
print "<tr $bc[$var]>";
print "<td>".dol_print_date(dol_mktime(12,0,0,$b, 1, $year),"%b")."</td>\n";
print "<td align=\"right\">".price($delta)."</td>\n";
print "</tr>\n";
}
$ayear = $year - 1;
$acat = get_ca($db, $ayear, $socid) - get_ca_propal($db, $ayear, $socid);
print "<tr class=\"total\"><td align=\"right\">Total :</td><td align=\"right\">".price($deltat)."</td></tr>";
print "<tr class=\"total\"><td align=\"right\">Rappel $ayear :</td><td align=\"right\">".price($acat)."</td></tr>";
print "<tr class=\"total\"><td align=\"right\">Soit :</td><td align=\"right\"><b>".price($acat+$deltat)."</b></td></tr>";
print "</table>";
print "</td></tr></table>";
}
/*
* View
*/
llxHeader();
$cyear = isset($_GET["year"])?$_GET["year"]:0;
if (! $cyear) { $cyear = strftime ("%Y", time()); }
print_fiche_titre("Chiffre d'Affaire transform<72> (pr<70>vu-r<>alis<69>)",($cyear?"<a href='comp.php?year=".($cyear-1)."'>".img_previous()."</a> Ann<6E>e $cyear <a href='comp.php?year=".($cyear+1)."'>".img_next()."</a>":""));
ppt($db, $cyear, $socid);
if ($details == 1)
{
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr><td valign=\"top\" width=\"50%\">";
factures ($db, $year, $month, 1);
print "</td><td valign=\"top\" width=\"50%\">";
propals ($db, $year, $month);
print "</td></tr></table>";
}
$db->close();
llxFooter();
?>

View File

@ -41,10 +41,10 @@ $langs->load("bills");
$langs->load("products"); $langs->load("products");
$action=GETPOST('action'); $action=GETPOST('action');
// Security check
$socid = GETPOST("socid"); $socid = GETPOST("socid");
$contratid = GETPOST("id"); $contratid = GETPOST("id");
// Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'contrat',$contratid,'contrat'); $result=restrictedArea($user,'contrat',$contratid,'contrat');

View File

@ -55,13 +55,16 @@ class DolCookie
/** /**
* Encrypt en create the cookie * Encrypt en create the cookie
*
* @return void
*/ */
function cryptCookie() function cryptCookie()
{ {
if (!empty($this->myKey)) if (!empty($this->myKey))
{ {
$valuecrypt = base64_encode($this->myValue); $valuecrypt = base64_encode($this->myValue);
for ($f=0 ; $f<=dol_strlen($valuecrypt)-1; $f++) $max=dol_strlen($valuecrypt)-1;
for ($f=0 ; $f <= $max; $f++)
{ {
$this->cookie .= intval(ord($valuecrypt[$f]))*$this->myKey."|"; $this->cookie .= intval(ord($valuecrypt[$f]))*$this->myKey."|";
} }
@ -76,6 +79,8 @@ class DolCookie
/** /**
* Decrypt the cookie * Decrypt the cookie
*
* @return void
*/ */
function decryptCookie() function decryptCookie()
{ {
@ -106,6 +111,7 @@ class DolCookie
* @param string $path Path of cookie * @param string $path Path of cookie
* @param string $domaine Domain name * @param string $domaine Domain name
* @param int $secure 0 or 1 * @param int $secure 0 or 1
* @return void
*/ */
function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0) function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
{ {

View File

@ -30,7 +30,8 @@
/** /**
* Encode a string for vCard * Encode a string for vCard
* *
* @param string String to encode * @param string $string String to encode
* @return string String encoded
*/ */
function encode($string) function encode($string)
{ {
@ -42,8 +43,9 @@ function encode($string)
* Taken from php documentation comments * Taken from php documentation comments
* No more used * No more used
* *
* @param input String * @param string $input String
* @param line_max Max length of lines * @param int $line_max Max length of lines
* @return string Encoded string
*/ */
function dol_quoted_printable_encode($input, $line_max=76) function dol_quoted_printable_encode($input, $line_max=76)
{ {
@ -98,10 +100,12 @@ class vCard
/** /**
* mise en forme du numero de telephone * mise en forme du numero de telephone
* *
* @param number numero de telephone * @param int $number numero de telephone
* @param type * @param string $type Type
* @return void
*/ */
function setPhoneNumber($number, $type="") { function setPhoneNumber($number, $type="")
{
// type may be PREF | WORK | HOME | VOICE | FAX | MSG | CELL | PAGER | BBS | CAR | MODEM | ISDN | VIDEO or any senseful combination, e.g. "PREF;WORK;VOICE" // type may be PREF | WORK | HOME | VOICE | FAX | MSG | CELL | PAGER | BBS | CAR | MODEM | ISDN | VIDEO or any senseful combination, e.g. "PREF;WORK;VOICE"
$key = "TEL"; $key = "TEL";
if ($type!="") $key .= ";".$type; if ($type!="") $key .= ";".$type;
@ -113,32 +117,38 @@ class vCard
* mise en forme de la photo * mise en forme de la photo
* warning NON TESTE ! * warning NON TESTE !
* *
* @param type * @param string $type Type
* @param photo * @param string $photo Photo
* @return void
*/ */
function setPhoto($type, $photo) { // $type = "GIF" | "JPEG" function setPhoto($type, $photo)
{ // $type = "GIF" | "JPEG"
$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo); $this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
} }
/** /**
* mise en forme du nom formate * mise en forme du nom formate
* *
* @param name * @param string $name Name
* @return void
*/ */
function setFormattedName($name) { function setFormattedName($name)
{
$this->properties["FN;CHARSET=".$this->encoding] = encode($name); $this->properties["FN;CHARSET=".$this->encoding] = encode($name);
} }
/** /**
* mise en forme du nom complet * mise en forme du nom complet
* *
* @param family * @param string $family Family
* @param first * @param string $first First
* @param additional * @param string $additional Additionnal
* @param prefix * @param string $prefix Prefix
* @param suffix * @param string $suffix Suffix
* @return void
*/ */
function setName($family="", $first="", $additional="", $prefix="", $suffix="") { function setName($family="", $first="", $additional="", $prefix="", $suffix="")
{
$this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); $this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix);
$this->filename = "$first%20$family.vcf"; $this->filename = "$first%20$family.vcf";
if ($this->properties["FN"]=="") $this->setFormattedName(trim("$prefix $first $additional $family $suffix")); if ($this->properties["FN"]=="") $this->setFormattedName(trim("$prefix $first $additional $family $suffix"));
@ -147,32 +157,37 @@ class vCard
/** /**
* mise en forme de l'anniversaire * mise en forme de l'anniversaire
* *
* @param date * @param timestamp $date Date
* @return void
*/ */
function setBirthday($date) { // $date format is YYYY-MM-DD function setBirthday($date)
{ // $date format is YYYY-MM-DD
$this->properties["BDAY"] = $date; $this->properties["BDAY"] = $date;
} }
/** /**
* mise en forme de l'adresse * mise en forme de l'adresse
* *
* @param postoffice * @param string $postoffice Postoffice
* @param extended * @param string $extended Extended
* @param street * @param string $street Street
* @param city * @param string $city City
* @param region * @param string $region Region
* @param zip * @param string $zip Zip
* @param country * @param string $country Country
* @param type * @param string $type Type
* @return void
*/ */
function setAddress($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") { function setAddress($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL")
{
// $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL" // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
$key = "ADR"; $key = "ADR";
if ($type!="") $key.= ";$type"; if ($type!="") $key.= ";$type";
$key.= ";CHARSET=".$this->encoding; $key.= ";CHARSET=".$this->encoding;
$this->properties[$key] = encode($name).";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country); $this->properties[$key] = encode($name).";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country);
if ($this->properties["LABEL;$type;CHARSET=".$this->encoding] == "") { if ($this->properties["LABEL;$type;CHARSET=".$this->encoding] == "")
{
//$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type); //$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type);
} }
} }
@ -180,14 +195,15 @@ class vCard
/** /**
* mise en forme du label * mise en forme du label
* *
* @param postoffice * @param string $postoffice Postoffice
* @param extended * @param string $extended Extended
* @param street * @param string $street Street
* @param city * @param string $city City
* @param region * @param string $region Region
* @param zip * @param string $zip Zip
* @param country * @param string $country Country
* @param type * @param string $type Type
* @return void
*/ */
function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") { function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") {
$label = ""; $label = "";
@ -205,28 +221,34 @@ class vCard
/** /**
* mise en forme de l'email * mise en forme de l'email
* *
* @param address EMail * @param string $address EMail
* @param type Vcard type * @param string $type Vcard type
* @return void
*/ */
function setEmail($address,$type="internet,pref") { function setEmail($address,$type="internet,pref")
{
$this->properties["EMAIL;TYPE=".$type] = $address; $this->properties["EMAIL;TYPE=".$type] = $address;
} }
/** /**
* mise en forme de la note * mise en forme de la note
* *
* @param note * @param string $note Note
* @return void
*/ */
function setNote($note) { function setNote($note)
{
$this->properties["NOTE;CHARSET=".$this->encoding] = encode($note); $this->properties["NOTE;CHARSET=".$this->encoding] = encode($note);
} }
/** /**
* mise en forme de la fonction * mise en forme de la fonction
* *
* @param title * @param string $title Title
* @return void
*/ */
function setTitle($title) { function setTitle($title)
{
$this->properties["TITLE;CHARSET=".$this->encoding] = encode($title); $this->properties["TITLE;CHARSET=".$this->encoding] = encode($title);
} }
@ -234,9 +256,11 @@ class vCard
/** /**
* mise en forme de la societe * mise en forme de la societe
* *
* @param org * @param string $org Org
* @return void
*/ */
function setOrg($org) { function setOrg($org)
{
$this->properties["ORG;CHARSET=".$this->encoding] = encode($org); $this->properties["ORG;CHARSET=".$this->encoding] = encode($org);
} }
@ -244,9 +268,11 @@ class vCard
/** /**
* mise en forme du logiciel generateur * mise en forme du logiciel generateur
* *
* @param prodid * @param string $prodid Prodid
* @return void
*/ */
function setProdId($prodid) { function setProdId($prodid)
{
$this->properties["PRODID;CHARSET=".$this->encoding] = encode($prodid); $this->properties["PRODID;CHARSET=".$this->encoding] = encode($prodid);
} }
@ -254,9 +280,11 @@ class vCard
/** /**
* mise en forme du logiciel generateur * mise en forme du logiciel generateur
* *
* @param uid * @param string $uid Uid
* @return void
*/ */
function setUID($uid) { function setUID($uid)
{
$this->properties["UID;CHARSET=".$this->encoding] = encode($uid); $this->properties["UID;CHARSET=".$this->encoding] = encode($uid);
} }
@ -264,10 +292,12 @@ class vCard
/** /**
* mise en forme de l'url * mise en forme de l'url
* *
* @param url * @param string $url URL
* @param type * @param string $type Type
* @return void
*/ */
function setURL($url, $type="") { function setURL($url, $type="")
{
// $type may be WORK | HOME // $type may be WORK | HOME
$key = "URL"; $key = "URL";
if ($type!="") $key.= ";$type"; if ($type!="") $key.= ";$type";
@ -276,12 +306,16 @@ class vCard
/** /**
* permet d'obtenir une vcard * permet d'obtenir une vcard
*
* @return void
*/ */
function getVCard() { function getVCard()
{
$text = "BEGIN:VCARD\r\n"; $text = "BEGIN:VCARD\r\n";
//$text.= "VERSION:3.0\r\n"; //$text.= "VERSION:3.0\r\n";
$text.= "VERSION:2.1\r\n"; $text.= "VERSION:2.1\r\n";
foreach($this->properties as $key => $value) { foreach($this->properties as $key => $value)
{
$text.= "$key:$value\r\n"; $text.= "$key:$value\r\n";
} }
$text.= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n"; $text.= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n";
@ -292,9 +326,13 @@ class vCard
/** /**
* permet d'obtenir le nom de fichier * permet d'obtenir le nom de fichier
*
* @return string Filename
*/ */
function getFileName() { function getFileName()
{
return $this->filename; return $this->filename;
} }
} }
?> ?>

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>

View File

@ -40,23 +40,35 @@ function check_authentication($authentication,&$error,&$errorcode,&$errorlabel)
$error++; $error++;
$errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup'; $errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup';
} }
if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity']))
{
$error++;
$errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or filled with numeric id of instance if multicompany module is used).";
}
if (! $error) if (! $error)
{ {
$result=$fuser->fetch('',$authentication['login'],'',0); $result=$fuser->fetch('',$authentication['login'],'',0);
if ($result <= 0) $error++; if ($result <= 0) $error++;
// TODO Check password // Validation of login with a third party login module method
if (! $error)
{
$test=true;
if (is_array($conf->login_method_modules) && !empty($conf->login_method_modules))
{
$login = getLoginMethod($authentication['login'],$authentication['password'],$authentication['entity']);
if ($login) $test=false;
}
if ($test) $error++;
}
if ($error) if ($error)
{ {
$errorcode='BAD_CREDENTIALS'; $errorlabel='Bad value for login or password'; $errorcode='BAD_CREDENTIALS'; $errorlabel='Bad value for login or password';
} }
} }
if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity']))
{
$error++;
$errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used).";
}
return $fuser; return $fuser;
} }

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.org> /* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
* *

View File

@ -51,6 +51,9 @@ class ActionsCardCompany extends ActionsCardCommon
/** /**
* Return the title of card * Return the title of card
*
* @param string $action Action code
* @return string Title
*/ */
private function getTitle($action) private function getTitle($action)
{ {
@ -70,6 +73,7 @@ class ActionsCardCompany extends ActionsCardCommon
* Execute actions * Execute actions
* *
* @param int $socid Id of object (may be empty for creation) * @param int $socid Id of object (may be empty for creation)
* @return int <0 if KO, >0 if OK
*/ */
function doActions($socid) function doActions($socid)
{ {
@ -82,6 +86,7 @@ class ActionsCardCompany extends ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates) * Assign custom values for canvas (for example into this->tpl to be used by templates)
* *
* @param string $action Type of action * @param string $action Type of action
* @return void
*/ */
function assign_values($action) function assign_values($action)
{ {
@ -208,13 +213,14 @@ class ActionsCardCompany extends ActionsCardCommon
/** /**
* Check permissions of a user to show a page and an object. Check read permission * Check permissions of a user to show a page and an object. Check read permission
* If $_REQUEST['action'] defined, we also check write permission. * If $_REQUEST['action'] defined, we also check write permission.
* @param user User to check *
* @param features Features to check (in most cases, it's module name) * @param User $user User to check
* @param objectid Object ID if we want to check permission on a particular record (optionnal) * @param string $features Features to check (in most cases, it's module name)
* @param dbtablename Table name where object is stored. Not used if objectid is null (optionnal) * @param int $objectid Object ID if we want to check permission on a particular record (optionnal)
* @param feature2 Feature to check (second level of permission) * @param string $dbtablename Table name where object is stored. Not used if objectid is null (optionnal)
* @param dbt_keyfield Field name for socid foreign key if not fk_soc. (optionnal) * @param string $feature2 Feature to check (second level of permission)
* @param dbt_select Field name for select if not rowid. (optionnal) * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. (optionnal)
* @param string $dbt_select Field name for select if not rowid. (optionnal)
* @return int 1 * @return int 1
*/ */
function restrictedArea($user, $features='societe', $objectid=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') function restrictedArea($user, $features='societe', $objectid=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')

View File

@ -51,6 +51,9 @@ class ActionsCardIndividual extends ActionsCardCommon
/** /**
* Return the title of card * Return the title of card
*
* @param string $action Action code
* @return string Title
*/ */
private function getTitle($action) private function getTitle($action)
{ {
@ -70,6 +73,7 @@ class ActionsCardIndividual extends ActionsCardCommon
* Execute actions * Execute actions
* *
* @param int $socid Id of object (may be empty for creation) * @param int $socid Id of object (may be empty for creation)
* @return int <0 if KO, >0 if OK
*/ */
function doActions($socid) function doActions($socid)
{ {
@ -82,6 +86,7 @@ class ActionsCardIndividual extends ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates) * Assign custom values for canvas (for example into this->tpl to be used by templates)
* *
* @param string $action Type of action * @param string $action Type of action
* @return void
*/ */
function assign_values($action) function assign_values($action)
{ {
@ -107,13 +112,14 @@ class ActionsCardIndividual extends ActionsCardCommon
/** /**
* Check permissions of a user to show a page and an object. Check read permission * Check permissions of a user to show a page and an object. Check read permission
* If $_REQUEST['action'] defined, we also check write permission. * If $_REQUEST['action'] defined, we also check write permission.
* @param user User to check *
* @param features Features to check (in most cases, it's module name) * @param User $user User to check
* @param objectid Object ID if we want to check permission on a particular record (optionnal) * @param string $features Features to check (in most cases, it's module name)
* @param dbtablename Table name where object is stored. Not used if objectid is null (optionnal) * @param int $objectid Object ID if we want to check permission on a particular record (optionnal)
* @param feature2 Feature to check (second level of permission) * @param string $dbtablename Table name where object is stored. Not used if objectid is null (optionnal)
* @param dbt_keyfield Field name for socid foreign key if not fk_soc. (optionnal) * @param string $feature2 Feature to check (second level of permission)
* @param dbt_select Field name for select if not rowid. (optionnal) * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. (optionnal)
* @param string $dbt_select Field name for select if not rowid. (optionnal)
* @return int 1 * @return int 1
*/ */
function restrictedArea($user, $features='societe', $objectid=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') function restrictedArea($user, $features='societe', $objectid=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
/* /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
* *

View File

@ -1,4 +1,4 @@
<?php <?php
/* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2009-2010 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