New: early development of multi-company module

This commit is contained in:
Regis Houssin 2009-05-08 16:31:11 +00:00
parent a59d65b6ea
commit b77489a414
3 changed files with 16 additions and 7 deletions

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
* 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
@ -216,8 +216,12 @@ $sql.= ' '.$db->pdate('a.datea2').' as datea2,';
$sql.= ' a.percent,';
$sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,';
$sql.= ' ca.code';
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a, '.MAIN_DB_PREFIX.'c_actioncomm as ca';
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql.= ', '.MAIN_DB_PREFIX.'c_actioncomm as ca';
$sql.= ', '.MAIN_DB_PREFIX.'user as u';
$sql.= ' WHERE a.fk_action = ca.id';
$sql.= ' AND a.fk_user_author = u.rowid';
$sql.= ' AND u.entity = '.$conf->entity;
if ($_GET["action"] == 'show_day')
{
$sql.= ' AND datep BETWEEN '.$db->idate(dol_mktime(0,0,0,$month,$_GET["day"],$year));
@ -312,6 +316,7 @@ if ($showbirthday)
$sql = 'SELECT sp.rowid, sp.name, sp.firstname, sp.birthday';
$sql.= ' FROM '.MAIN_DB_PREFIX.'socpeople as sp';
$sql.= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.$user->id.'))';
$sql.= ' AND sp.entity = '.$conf->entity;
if ($_GET["action"] == 'show_day')
{
$sql.= ' AND MONTH(birthday) = '.$month;
@ -322,7 +327,7 @@ if ($showbirthday)
$sql.= ' AND MONTH(birthday) = '.$month;
}
// Sort on date
$sql .= ' ORDER BY birthday';
$sql.= ' ORDER BY birthday';
//print $sql;
$resql=$db->query($sql);

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* 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
@ -133,8 +133,8 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0)
if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd;
$sql.= ")";
}
$sql .= " ORDER BY ".$sortfield." ".$sortorder;
$sql .= $db->plimit( $limit + 1, $offset);
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
$sql.= $db->plimit( $limit + 1, $offset);
//print $sql;
dol_syslog("comm/action/listactions.php sql=".$sql);

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2009 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
@ -66,7 +67,10 @@ $sql = "SELECT count(*) as cc, date_format(a.datep, '%m/%Y') as df";
$sql.= ", date_format(a.datep, '%m') as month";
$sql.= ", date_format(a.datep, '%Y') as year";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " WHERE percent = 100";
$sql.= ", ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE a.fk_user_author = u.rowid";
$sql.= " AND u.entity = ".$conf->entity;
$sql.= " AND percent = 100";
$sql.= " GROUP BY date_format(a.datep, '%m/%Y') ";
$sql.= " ORDER BY a.datep DESC";
$sql.= $db->plimit($limit+1,$offset);