Ajout d'un module agenda et de permissions sur les actions

This commit is contained in:
Laurent Destailleur 2008-01-08 08:14:20 +00:00
parent 83d965349e
commit 71352d4143
20 changed files with 1352 additions and 994 deletions

View File

@ -39,7 +39,7 @@ $langs->load("other");
$langs->load("bills");
$langs->load("orders");
// Sécurité accés client
// Securite acces client
if ($user->societe_id > 0)
{
$action = '';
@ -49,7 +49,7 @@ if (isset($_GET["error"])) $error=$_GET["error"];
/*
* Action création de l'action
* Action creation de l'action
*
*/
if ($_POST["action"] == 'add_action')
@ -163,7 +163,7 @@ if ($_POST["action"] == 'add_action')
if ($_POST["add_webcal"] == 'on' && $conf->webcal->enabled) $actioncomm->use_webcal=1;
if ($_POST["add_phenix"] == 'on' && $conf->phenix->enabled) $actioncomm->use_phenix=1;
// On crée l'action
// On cr<EFBFBD>e l'action
$idaction=$actioncomm->add($user);
if ($idaction > 0)
@ -226,7 +226,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
}
/*
* Action mise à jour de l'action
* Action mise <EFBFBD> jour de l'action
*
*/
if ($_POST["action"] == 'update')
@ -286,7 +286,7 @@ $html = new Form($db);
/* ************************************************************************** */
/* */
/* Affichage fiche en mode création */
/* Affichage fiche en mode cr<EFBFBD>ation */
/* */
/* ************************************************************************** */
@ -337,7 +337,7 @@ if ($_GET["action"] == 'create')
}
print '</td></tr>';
// Si la societe est imposée, on propose ces contacts
// Si la societe est impos<EFBFBD>e, on propose ces contacts
if ($_REQUEST["socid"])
{
$contactid = $_REQUEST["contactid"]?$_REQUEST["contactid"]:'';
@ -471,7 +471,7 @@ if ($_GET["action"] == 'create')
}
print '</td></tr>';
// Si la societe est imposée, on propose ces contacts
// Si la societe est impos<EFBFBD>e, on propose ces contacts
if ($_REQUEST["socid"])
{
print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>';
@ -573,7 +573,7 @@ if ($_GET["id"])
$act = new ActionComm($db);
$act->fetch($_GET["id"]);
$res=$act->societe->fetch($act->societe->id);
$res=$act->author->fetch(); // Le paramètre est le login, hors seul l'id est chargé.
$res=$act->author->fetch(); // Le param<EFBFBD>tre est le login, hors seul l'id est charg<72>.
$res=$act->contact->fetch($act->contact->id);
/*
@ -654,7 +654,7 @@ if ($_GET["id"])
// Etat
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3"><input name="percentage" value="'.$act->percentage.'" size="4">%</td></tr>';
// Objet lié
// Objet li<EFBFBD>
if ($act->objet_url)
{
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
@ -741,7 +741,7 @@ if ($_GET["id"])
print $act->getLibStatut(4);
print '</td></tr>';
// Objet lié
// Objet li<EFBFBD>
if ($act->objet_url)
{
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
@ -784,14 +784,14 @@ llxFooter('$Date$ - $Revision$');
/**
\brief Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier
\return int Retourne le nombre de lignes ajoutées
\return int Retourne le nombre de lignes ajout<EFBFBD>es
*/
function add_row_for_calendar_link()
{
global $conf,$langs,$user;
$nbtr=0;
// Lien avec calendrier si module activé
// Lien avec calendrier si module activ<EFBFBD>
if ($conf->webcal->enabled)
{
if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never')

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
@ -46,7 +46,7 @@ if ($conf->fichinter->enabled) $langs->load("interventions");
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
// Sécurité d'accès client et commerciaux
// S<EFBFBD>curit<EFBFBD> d'acc<63>s client et commerciaux
$socid = restrictedArea($user, 'societe', $socid);
$sortorder=$_GET["sortorder"];
@ -64,7 +64,7 @@ if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer)
$societe = new Societe($db, $_GET["socid"]);
$societe->attribute_prefix($db, $_GET["socid"]);
}
// conditions de règlement
// conditions de r<EFBFBD>glement
if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer)
{
@ -75,7 +75,7 @@ if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer)
$result = $db->query($sql);
if (! $result) dolibarr_print_error($result);
}
// mode de règlement
// mode de r<EFBFBD>glement
if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
{
$societe = new Societe($db, $_GET["socid"]);
@ -85,7 +85,7 @@ if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
$result = $db->query($sql);
if (! $result) dolibarr_print_error($result);
}
// assujétissement à la TVA
// assuj<EFBFBD>tissement <20> la TVA
if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer)
{
$societe = new Societe($db, $_GET["socid"]);
@ -192,14 +192,14 @@ if ($socid > 0)
print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$objsoc->url\" target=\"_blank\">".$objsoc->url."</a>&nbsp;</td></tr>";
// Assujeti à TVA ou pas
// Assujeti <EFBFBD> TVA ou pas
print '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($objsoc->tva_assuj);
print '</td>';
print '</tr>';
// Conditions de réglement par défaut
// Conditions de r<EFBFBD>glement par d<>faut
$langs->load('bills');
$html = new Form($db);
print '<tr><td nowrap>';
@ -220,7 +220,7 @@ if ($socid > 0)
print "</td>";
print '</tr>';
// Mode de règlement
// Mode de r<EFBFBD>glement
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('PaymentMode');
@ -239,7 +239,7 @@ if ($socid > 0)
print "</td>";
print '</tr>';
// Réductions relative (Remises-Ristournes-Rabbais)
// R<EFBFBD>ductions relative (Remises-Ristournes-Rabbais)
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans("CustomerRelativeDiscountShort");
@ -252,7 +252,7 @@ if ($socid > 0)
print '</td><td colspan="3">'.($objsoc->remise_client?$objsoc->remise_client.'%':$langs->trans("DiscountNone")).'</td>';
print '</tr>';
// Réductions absolues (Remises-Ristournes-Rabbais)
// R<EFBFBD>ductions absolues (Remises-Ristournes-Rabbais)
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding">';
print '<tr><td nowrap>';
@ -329,7 +329,7 @@ if ($socid > 0)
print '<td valign="top" width="50%" class="notopnoleftnoright">';
// Nbre max d'éléments des petites listes
// Nbre max d'<EFBFBD>l<EFBFBD>ments des petites listes
$MAXLIST=4;
// Lien recap
@ -536,7 +536,7 @@ if ($socid > 0)
}
/*
* Derniers projets associés
* Derniers projets associ<EFBFBD>s
*/
if ($conf->projet->enabled)
{
@ -609,8 +609,11 @@ if ($socid > 0)
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$objsoc->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a>';
}
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$objsoc->id.'">'.$langs->trans("AddAction").'</a>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$objsoc->id.'">'.$langs->trans("AddAction").'</a>';
}
if ($user->rights->societe->contact->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$objsoc->id.'&amp;action=create">'.$langs->trans("AddContact").'</a>';
@ -636,7 +639,10 @@ if ($socid > 0)
print '<td>'.$langs->trans("Poste").'</td><td colspan="2">'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td>&nbsp;</td>";
print '<td>&nbsp;</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td>&nbsp;</td>';
}
print "</tr>";
$sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note ";
@ -670,7 +676,7 @@ if ($socid > 0)
{
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&amp;socid='.$objsoc->id.'&amp;call='.$obj->phone.'">';
print img_phone_out("Appel émis") ;
print img_phone_out("Appel emis") ;
print '</td><td>';
}
else
@ -678,19 +684,39 @@ if ($socid > 0)
print '<td colspan="2">';
}
print '<a href="action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">'.dolibarr_print_phone($obj->fax).'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">'.$obj->email.'</a>&nbsp;</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
print dolibarr_print_phone($obj->phone);
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
print dolibarr_print_phone($obj->fax);
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
print $obj->email;
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td align="center">';
print "<a href=\"../contact/fiche.php?action=edit&amp;id=".$obj->rowid."\">";
print img_edit();
print '</a></td>';
print '<td align="center"><a href="action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td align="center"><a href="action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>';
}
print "</tr>\n";
$i++;
}
@ -701,270 +727,245 @@ if ($socid > 0)
/*
* Listes des actions a faire
*
*/
print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right">&nbsp;</td>';
print '</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, a.fk_contact,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$objsoc->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent < 100";
$sql.= " ORDER BY a.datep DESC, a.id DESC";
dolibarr_syslog("comm/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
if ($conf->agenda->enabled)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
if ($num)
{
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right">&nbsp;</td>';
print '</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, a.fk_contact,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$objsoc->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent < 100";
$sql.= " ORDER BY a.datep DESC, a.id DESC";
dolibarr_syslog("comm/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
if ($num)
{
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
print '<td width="30" align="center">'.strftime("%Y",$obj->dp)."</td>\n";
$oldyear = strftime("%Y",$obj->dp);
}
if ($oldmonth == strftime("%Y%b",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">' .strftime("%b",$obj->dp)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->dp);
}
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
// Picto warning
print '<td width="16">';
if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
else print '&nbsp;';
print '</td>';
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
}
print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
print '<td width="80" nowrap="nowrap">';
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
print $userstatic->getLoginUrl(1);
print '</td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
}
else
{
// Aucun action à faire
}
$db->free($result);
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
// Picto warning
print '<td width="16">';
if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
else print '&nbsp;';
print '</td>';
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
}
print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
print '<td width="80" nowrap="nowrap">';
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
print $userstatic->getLoginUrl(1);
print '</td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
}
else
{
// Aucun action a faire
}
$db->free($result);
}
else
{
dolibarr_print_error($db);
}
print "</table>";
print "<br>";
}
else
{
dolibarr_print_error($db);
}
print "</table>";
print "<br>";
/*
* Listes des actions effectuees
*/
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>';
print '</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$objsoc->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("comm/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
if ($conf->agenda->enabled)
{
$i = 0 ;
$num = $db->num_rows($result);
$oldyear='';
$oldmonth='';
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
// Champ date
if ($oldyear == strftime("%Y",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>';
print '</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$objsoc->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("comm/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$oldyear='';
$oldmonth='';
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
// Champ date
print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">'.strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
// Picto
print '<td width="16">&nbsp;</td>';
// Espace
print '<td width="30">&nbsp;</td>';
// Action
print '<td>';
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print $actionstatic->getNomUrl(1,16);
print '</td>';
// Objet lié
print '<td>';
if ($obj->propalrowid)
{
print '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowPropal"),"propal");
print $langs->trans("Propal");
print '</a>';
}
if ($obj->fk_facture)
{
$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$obj->fk_facture;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'compta');
}
else print '&nbsp;';
print '</td>';
// Libellé
print '<td>'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td nowrap="nowrap" width="80">';
$userstatic->id=$obj->rowid;
$userstatic->login=$obj->login;
print $userstatic->getLoginUrl(1);
print '</td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
// Picto
print '<td width="16">&nbsp;</td>';
// Espace
print '<td width="30">&nbsp;</td>';
// Action
print '<td>';
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print $actionstatic->getNomUrl(1,16);
print '</td>';
// Objet lie
print '<td>';
if ($obj->propalrowid)
{
print '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowPropal"),"propal");
print $langs->trans("Propal");
print '</a>';
}
if ($obj->fk_facture)
{
$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$obj->fk_facture;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'compta');
}
else print '&nbsp;';
print '</td>';
// Libelle
print '<td>'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td nowrap="nowrap" width="80">';
$userstatic->id=$obj->rowid;
$userstatic->login=$obj->login;
print $userstatic->getLoginUrl(1);
print '</td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
}
else
{
dolibarr_print_error($db);
}
print "</table><br>";
}
else
{
dolibarr_print_error($db);
}
print "</table><br>";
}
else
{

View File

@ -1701,51 +1701,54 @@ if ($_GET['propalid'] > 0)
print '</td><td valign="top" width="50%">';
/*
* Liste des actions propres <EFBFBD> la propal
* Liste des actions propres a la propal
*/
$sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.propalrowid = '.$propal->id ;
if ($socid) $sql .= ' AND a.fk_soc = '.$socid;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num)
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
$sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.propalrowid = '.$propal->id ;
if ($socid) $sql .= ' AND a.fk_soc = '.$socid;
$resql = $db->query($sql);
if ($resql)
{
print_titre($langs->trans('ActionsOnPropal'));
$i = 0;
$total = 0;
$var=true;
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
while ($i < $num)
$num = $db->num_rows($resql);
if ($num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da)."</td>\n";
print '<td>'.stripslashes($objp->label).'</td>';
$authoract = new User($db);
$authoract->id = $objp->fk_user_author;
$authoract->fetch('');
print '<td>'.$authoract->login.'</td>';
print "</tr>\n";
$i++;
print_titre($langs->trans('ActionsOnPropal'));
$i = 0;
$total = 0;
$var=true;
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da)."</td>\n";
print '<td>'.stripslashes($objp->label).'</td>';
$authoract = new User($db);
$authoract->id = $objp->fk_user_author;
$authoract->fetch('');
print '<td>'.$authoract->login.'</td>';
print "</tr>\n";
$i++;
}
print '</table>';
}
print '</table>';
}
}
else
{
dolibarr_print_error($db);
}
else
{
dolibarr_print_error($db);
}
}
print '</td></tr></table>';
print '</td></tr></table>';
/*

View File

@ -214,8 +214,10 @@ if ($socid > 0)
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$societe->id.'&amp;action=create">'.$langs->trans("AddContact").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'&afaire=1">'.$langs->trans("AddAction").'</a>';
if ($conf->agenda->enabled)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'&afaire=1">'.$langs->trans("AddAction").'</a>';
}
if ($conf->propal->enabled && defined("MAIN_MODULE_PROPALE") && MAIN_MODULE_PROPALE && $user->rights->propale->creer)
{
@ -249,7 +251,10 @@ if ($socid > 0)
print '<td>'.$langs->trans("Poste").'</td><td>'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td align=\"center\">&nbsp;</td>";
print '<td>&nbsp;</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td>&nbsp;</td>';
}
print "</tr>";
$sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note";
@ -276,18 +281,35 @@ if ($socid > 0)
}
print '</td>';
print '<td>'.$obj->poste.'&nbsp;</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->phone;
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print $obj->phone;
if (strlen($obj->phone) && $user->clicktodial_enabled == 1)
{
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&amp;socid='.$societe->id.'&amp;call='.$obj->phone.'">';
print img_phone_out("Appel émis") ;
}
print '</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '</td>';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print $obj->fax;
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print $obj->email;
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td align="center">';
if ($user->rights->societe->contact->creer)
@ -300,10 +322,14 @@ if ($socid > 0)
print '</td>';
print '<td align="center"><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td align="center">';
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>';
}
print "</tr>\n";
$i++;
$tag = !$tag;

View File

@ -162,57 +162,60 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
*/
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, a.fk_user_author, a.percent,";
$sql.= " c.code, c.libelle,";
$sql.= " s.nom as sname, s.rowid";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE c.id = a.fk_action AND a.percent < 100 AND s.rowid = a.fk_soc AND a.fk_user_action = ".$user->id;
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql .= " ORDER BY a.datea DESC";
$resql=$db->query($sql);
if ($resql)
if ($conf->agenda->enabled)
{
$num = $db->num_rows($resql);
if ($num > 0)
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, a.fk_user_author, a.percent,";
$sql.= " c.code, c.libelle,";
$sql.= " s.nom as sname, s.rowid";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE c.id = a.fk_action AND a.percent < 100 AND s.rowid = a.fk_soc AND a.fk_user_action = ".$user->id;
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql .= " ORDER BY a.datea DESC";
$resql=$db->query($sql);
if ($resql)
{
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("ActionsToDo").'</td>';
print "</tr>\n";
$i = 0;
while ($i < $num )
$num = $db->num_rows($resql);
if ($num > 0)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]><td>".dolibarr_print_date($obj->da)."</td>";
// Action
$transcode=$langs->trans("Action".$obj->code);
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id."\">".img_object($langs->trans("ShowAction"),"task").' '.$libelle.'</a></td>';
// Tiers
print '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->sname.'</a></td>';
$i++;
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("ActionsToDo").'</td>';
print "</tr>\n";
$i = 0;
while ($i < $num )
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]><td>".dolibarr_print_date($obj->da)."</td>";
// Action
$transcode=$langs->trans("Action".$obj->code);
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id."\">".img_object($langs->trans("ShowAction"),"task").' '.$libelle.'</a></td>';
// Tiers
print '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->sname.'</a></td>';
$i++;
}
print "</table><br>";
}
print "</table><br>";
$db->free($resql);
}
else
{
dolibarr_print_error($db);
}
$db->free($resql);
}
else
{
dolibarr_print_error($db);
}
/*
* Dernières propales ouvertes
* Dernieres propales ouvertes
*
*/
if ($conf->propal->enabled && $user->rights->propale->lire)
@ -263,7 +266,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
}
/*
* Sociétés à contacter
* Soci<EFBFBD>t<EFBFBD>s <EFBFBD> contacter
*
*/
$sql = "SELECT s.nom, s.rowid";

View File

@ -1841,51 +1841,54 @@ else
print '</td><td valign="top" width="50%">';
/*
* Liste des actions propres <EFBFBD> la commande
* Liste des actions propres a la commande
*/
$sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.fk_commande = '.$commande->id ;
if ($socid) $sql .= ' AND a.fk_soc = '.$socid;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num)
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
$sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.fk_commande = '.$commande->id ;
if ($socid) $sql .= ' AND a.fk_soc = '.$socid;
$resql = $db->query($sql);
if ($resql)
{
//print '<br>';
print_titre($langs->trans('ActionsOnOrder'));
$i = 0;
$total = 0;
$var=true;
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
while ($i < $num)
$num = $db->num_rows($resql);
if ($num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da)."</td>\n";
print '<td>'.stripslashes($objp->label).'</td>';
$authoract = new User($db);
$authoract->id = $objp->fk_user_author;
$authoract->fetch('');
print '<td>'.$authoract->login.'</td>';
print "</tr>\n";
$i++;
//print '<br>';
print_titre($langs->trans('ActionsOnOrder'));
$i = 0;
$total = 0;
$var=true;
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da)."</td>\n";
print '<td>'.stripslashes($objp->label).'</td>';
$authoract = new User($db);
$authoract->id = $objp->fk_user_author;
$authoract->fetch('');
print '<td>'.$authoract->login.'</td>';
print "</tr>\n";
$i++;
}
print '</table>';
}
print '</table>';
}
}
else
{
dolibarr_print_error($db);
}
else
{
dolibarr_print_error($db);
}
}
print '</td></tr></table>';

View File

@ -2949,49 +2949,51 @@ else
/*
* Liste des actions propres à la facture
*/
$sql = 'SELECT a.id, '.$db->pdate('a.datea').' as da, a.label, a.note,';
$sql.= ' u.login';
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a, '.MAIN_DB_PREFIX.'user as u';
$sql.= ' WHERE a.fk_user_author = u.rowid';
$sql.= ' AND a.fk_action in (9,10)';
$sql.= ' AND a.fk_soc = '.$fac->socid ;
$sql.= ' AND a.fk_facture = '.$fac->id;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num)
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
$sql = 'SELECT a.id, '.$db->pdate('a.datea').' as da, a.label, a.note,';
$sql.= ' u.login';
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a, '.MAIN_DB_PREFIX.'user as u';
$sql.= ' WHERE a.fk_user_author = u.rowid';
$sql.= ' AND a.fk_action in (9,10)';
$sql.= ' AND a.fk_soc = '.$fac->socid ;
$sql.= ' AND a.fk_facture = '.$fac->id;
$resql = $db->query($sql);
if ($resql)
{
print '<br>';
print_titre($langs->trans('ActionsOnBill'));
$i = 0; $total = 0;
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
$var=True;
while ($i < $num)
$num = $db->num_rows($resql);
if ($num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da,'day').'</td>';
print '<td>'.$objp->label.'</td>';
print '<td>'.$objp->login.'</td>';
print '</tr>';
$i++;
print '<br>';
print_titre($langs->trans('ActionsOnBill'));
$i = 0; $total = 0;
print '<table class="border" width="100%">';
print '<tr '.$bc[$var].'><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Action').'</td><td>'.$langs->trans('By').'</td></tr>';
print "\n";
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da,'day').'</td>';
print '<td>'.$objp->label.'</td>';
print '<td>'.$objp->login.'</td>';
print '</tr>';
$i++;
}
print '</table>';
}
print '</table>';
}
else
{
dolibarr_print_error($db);
}
}
else
{
dolibarr_print_error($db);
}
print '</td></tr></table>';

View File

@ -164,7 +164,7 @@ if ($socid > 0)
print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dolibarr_print_phone($societe->tel,$societe->pays_code).'&nbsp;</td><td>'.$langs->trans("Fax").'</td><td>'.dolibarr_print_phone($societe->fax,$societe->pays_code).'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\" target=\"_blank\">$societe->url</a>&nbsp;</td></tr>";
// Assujeti à TVA ou pas
// Assujeti <EFBFBD> TVA ou pas
print '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($societe->tva_assuj);
@ -191,7 +191,7 @@ if ($socid > 0)
print '</td><td colspan="3">'.($societe->remise_client?price2num($societe->remise_client,'MT').'%':$langs->trans("DiscountNone")).'</td>';
print '</tr>';
// Réductions (Remises-Ristournes-Rabbais)
// R<EFBFBD>ductions (Remises-Ristournes-Rabbais)
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding">';
print '<tr><td nowrap>';
@ -219,7 +219,7 @@ if ($socid > 0)
print '<td valign="top" width="50%" class="notopnoleftnoright">';
// Nbre max d'éléments des petites listes
// Nbre max d'<EFBFBD>l<EFBFBD>ments des petites listes
$MAXLIST=5;
$tableaushown=1;
@ -300,7 +300,7 @@ if ($socid > 0)
}
/*
* Derniers projets associés
* Derniers projets associ<EFBFBD>s
*/
if ($conf->projet->enabled)
{
@ -354,7 +354,7 @@ if ($socid > 0)
if ($user->societe_id == 0)
{
// Si société cliente ou prospect, on affiche bouton "Créer facture client"
// Si soci<EFBFBD>t<EFBFBD> cliente ou prospect, on affiche bouton "Cr<43>er facture client"
if ($societe->client != 0 && $conf->facture->enabled && $user->rights->facture->creer) {
$langs->load("bills");
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/facture.php?action=create&socid=$societe->id\">".$langs->trans("AddBill")."</a>";
@ -366,8 +366,11 @@ if ($socid > 0)
}
}
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
}
if ($user->rights->societe->contact->creer)
{
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&amp;action=create\">".$langs->trans("AddContact")."</a>";
@ -388,7 +391,10 @@ if ($socid > 0)
print '<td>'.$langs->trans("Poste").'</td><td>'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td align=\"center\">&nbsp;</td>";
print '<td>&nbsp;</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td>&nbsp;</td>';
}
print "</tr>";
$sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note";
@ -415,11 +421,28 @@ if ($socid > 0)
}
print '</td>';
print '<td>'.$obj->poste.'&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->phone.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>';
print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->email.'</a>&nbsp;</td>';
print '<td align="center">';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="../comm/action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print $obj->phone;
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="../comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print $obj->fax;
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '<a href="../comm/action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print $obj->email;
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '&nbsp;</td>';
print '<td align="center">';
if ($user->rights->societe->contact->creer)
{
@ -431,10 +454,12 @@ if ($socid > 0)
print '</td>';
print '<td align="center"><a href="../comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td align="center"><a href="../comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$societe->id.'">';
print img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>';
}
print "</tr>\n";
$i++;
$tag = !$tag;
@ -448,242 +473,248 @@ if ($socid > 0)
* Listes des actions a faire
*
*/
print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right">&nbsp;</td>';
print '</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, a.fk_contact,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent < 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("compta/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
if ($conf->agenda->enabled)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">'.strftime("%Y",$obj->dp)."</td>\n";
$oldyear = strftime("%Y",$obj->dp);
}
if ($oldmonth == strftime("%Y%b",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">' .strftime("%b",$obj->dp)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->dp);
}
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
// Picto warning
print '<td width="16">';
if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
else print '&nbsp;';
print '</td>';
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
}
print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td width="50" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right">&nbsp;</td>';
print '</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, a.fk_contact,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent < 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("compta/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">'.strftime("%Y",$obj->dp)."</td>\n";
$oldyear = strftime("%Y",$obj->dp);
}
if ($oldmonth == strftime("%Y%b",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">' .strftime("%b",$obj->dp)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->dp);
}
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
// Picto warning
print '<td width="16">';
if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
else print '&nbsp;';
print '</td>';
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print '<td>'.$actionstatic->getNomUrl(1,16).'</td>';
}
print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td width="50" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
}
else
{
dolibarr_print_error($db);
}
print "</table><br>";
}
else
{
dolibarr_print_error($db);
}
print "</table><br>";
/*
* Listes des actions effectuées
* Listes des actions effectuees
*/
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a>';
print '</td></tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("compta/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
if ($conf->agenda->enabled)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS) {
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS) {
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
// Picto
print '<td width="16">&nbsp;</td>';
// Espace
print '<td width="30">&nbsp;</td>';
// Action
print '<td>';
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print $actionstatic->getNomUrl(1,16);
print '</td>';
// Objet lié
print '<td>';
if ($obj->propalrowid)
{
print '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowPropal"),"propal");
print $langs->trans("Propal");
print '</a>';
}
if ($obj->fk_facture)
{
$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$obj->rowid;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'compta');
}
else print '&nbsp;';
print '</td>';
// Libellé
print "<td>$obj->label</td>";
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td nowrap="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a>';
print '</td></tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " ".$db->pdate("a.datep")." as dp,";
$sql.= " ".$db->pdate("a.datea")." as da,";
$sql.= " a.percent,";
$sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
dolibarr_syslog("compta/fiche.php sql=".$sql);
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS) {
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS) {
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
// Picto
print '<td width="16">&nbsp;</td>';
// Espace
print '<td width="30">&nbsp;</td>';
// Action
print '<td>';
$actionstatic->code=$obj->acode;
$actionstatic->libelle=$obj->libelle;
$actionstatic->id=$obj->id;
print $actionstatic->getNomUrl(1,16);
print '</td>';
// Objet li<6C>
print '<td>';
if ($obj->propalrowid)
{
print '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowPropal"),"propal");
print $langs->trans("Propal");
print '</a>';
}
if ($obj->fk_facture)
{
$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$obj->rowid;
$facturestatic->type=$obj->type;
print $facturestatic->getNomUrl(1,'compta');
}
else print '&nbsp;';
print '</td>';
// Libell<6C>
print "<td>$obj->label</td>";
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td nowrap="nowrap" width="50"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
}
else
{
dolibarr_print_error($db);
}
print "</table><br>";
}
else
{
dolibarr_print_error($db);
}
print "</table><br>";
}
else
{

View File

@ -49,7 +49,7 @@ if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.datep";
if ($page == -1) { $page = 0 ; }
// Sécurité accés client
// S<EFBFBD>curit<EFBFBD> acc<63>s client
$user->getrights('facture');
$module='propale';
if (! empty($_GET["socid"]))
@ -65,7 +65,7 @@ else if (! empty($_GET["propalid"]))
$dbtable='propal';
}
// Sécurité d'accès client et commerciaux
// S<EFBFBD>curit<EFBFBD> d'acc<63>s client et commerciaux
$socid = restrictedArea($user, $module, $objectid, $dbtable);
@ -77,7 +77,7 @@ $socid = restrictedArea($user, $module, $objectid, $dbtable);
if ($_GET["action"] == 'setstatut')
{
/*
* Classée la facture comme facturée
* Class<EFBFBD>e la facture comme factur<EFBFBD>e
*/
$propal = new Propal($db);
$propal->id = $_GET["propalid"];
@ -163,7 +163,7 @@ if ($_GET["propalid"] > 0)
$rowspan=8;
// Société
// Soci<EFBFBD>t<EFBFBD>
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';
// Ligne info remises tiers
@ -203,7 +203,7 @@ if ($_GET["propalid"] > 0)
print '</td>';
print '</tr>';
// Conditions et modes de réglement
// Conditions et modes de r<EFBFBD>glement
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort');
@ -486,7 +486,7 @@ if ($_GET["propalid"] > 0)
print '<table width="100%"><tr><td width="50%" valign="top">';
/*
* Documents générés
* Documents g<EFBFBD>n<EFBFBD>r<EFBFBD>s
*/
$filename=sanitize_string($propal->ref);
$filedir=$conf->propal->dir_output . "/" . sanitize_string($propal->ref);
@ -500,7 +500,7 @@ if ($_GET["propalid"] > 0)
/*
* Commandes rattachées
* Commandes rattach<EFBFBD>es
*/
if($conf->commande->enabled)
{
@ -596,8 +596,10 @@ if ($_GET["propalid"] > 0)
/*
* Liste des actions propres à la propal
* Liste des actions propres a la propal
*/
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
$sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.fk_soc = '.$societe->id.' AND a.propalrowid = '.$propal->id ;
@ -622,7 +624,7 @@ if ($_GET["propalid"] > 0)
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$objp->id.'">'.img_object($langs->trans('ShowTask'),'task').' '.$objp->id.'</a></td>';
print '<td>'.dolibarr_print_date($objp->da,'dayhour')."</td>\n";
print '<td>'.dolibarr_print_date($objp->da,'dayhour')."</td>\n";
print '<td>'.stripslashes($objp->label).'</td>';
$authoract = new User($db);
$authoract->id = $objp->fk_user_author;
@ -638,7 +640,7 @@ if ($_GET["propalid"] > 0)
{
dolibarr_print_error($db);
}
}
print '</td></tr></table>';
@ -672,7 +674,7 @@ else
$sql.= " WHERE p.fk_soc = s.rowid";
if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql .= " AND s.rowid = ".$socid;
if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons séparé par virgules
if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons s<EFBFBD>par<EFBFBD> par virgules
if ($month > 0)
{
if ($year > 0)

View File

@ -151,6 +151,9 @@ class Conf
* Chargement d'include selon etat activation des modules
*/
// Module agenda
$this->agenda->enabled=defined('MAIN_MODULE_AGENDA')?MAIN_MODULE_AGENDA:0;
// Module bookmark4u
$this->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0;

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@ -34,7 +34,7 @@ $langs->load("companies");
$langs->load("suppliers");
// Sécurité accés client
// S<EFBFBD>curit<EFBFBD> acc<63>s client
$socid='';
if ($_GET["socid"]) { $socid=$_GET["socid"]; }
if ($user->societe_id > 0)
@ -80,9 +80,9 @@ if ($type == "f") {
$titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartySuppliers").')';
$urlfiche="fiche.php";
}
if ($view == 'phone') { $text="( Vue Téléphones)"; }
if ($view == 'phone') { $text="( Vue T<EFBFBD>l<EFBFBD>phones)"; }
if ($view == 'mail') { $text=" (Vue EMail)"; }
if ($view == 'recent') { $text=" (Récents)"; }
if ($view == 'recent') { $text=" (R<EFBFBD>cents)"; }
$titre = $titre." $text";
if ($_POST["button_removefilter"])
@ -225,10 +225,13 @@ if ($result)
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_societe" size="14" value="'.$search_societe.'">';
print '</td>';
print '<td class="liste_titre">';
print '&nbsp;';
print '</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td class="liste_titre">';
print '&nbsp;';
print '</td>';
}
if ($_GET["view"] == 'phone')
{
print '<td class="liste_titre">';
@ -285,8 +288,11 @@ if ($result)
}
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;actioncode=AC_TEL&amp;contactid='.$obj->cidp.'&amp;socid='.$obj->socid.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;actioncode=AC_TEL&amp;contactid='.$obj->cidp.'&amp;socid='.$obj->socid.'">'.dolibarr_print_phone($obj->phone).'</a>&nbsp;</td>';
}
if ($_GET["view"] == 'phone')
{
print '<td>'.dolibarr_print_phone($obj->phone_mobile,$obj->fp_pays).'&nbsp;</td>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2003 <EFBFBD>ric Seigne <erics@rycks.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@ -42,7 +42,7 @@ $langs->load('orders');
$langs->load('companies');
$langs->load('commercial');
// Sécurité accés client
// S<EFBFBD>curit<EFBFBD> acc<63>s client
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id > 0)
{
@ -118,7 +118,7 @@ if ( $societe->fetch($socid) )
print '<tr><td>'.$langs->trans("Phone").'</td><td>'.dolibarr_print_phone($societe->tel).'&nbsp;</td><td>'.$langs->trans("Fax").'</td><td>'.dolibarr_print_phone($societe->fax).'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\">$societe->url</a>&nbsp;</td></tr>";
// Assujeti à TVA ou pas
// Assujeti <EFBFBD> TVA ou pas
print '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($societe->tva_assuj);
@ -143,7 +143,7 @@ if ( $societe->fetch($socid) )
print '<br>';
/*
* Liste des commandes associées
* Liste des commandes associ<EFBFBD>es
*/
$orderstatic = new CommandeFournisseur($db);
@ -200,7 +200,7 @@ if ( $societe->fetch($socid) )
/*
* Liste des factures associées
* Liste des factures associ<EFBFBD>es
*/
$MAXLIST=5;
@ -287,8 +287,11 @@ if ( $societe->fetch($socid) )
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?action=create&socid='.$societe->id.'">'.$langs->trans("AddBill").'</a>';
}
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$societe->id.'">'.$langs->trans("AddAction").'</a>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$societe->id.'">'.$langs->trans("AddAction").'</a>';
}
if ($user->rights->societe->contact->creer)
{
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid."&amp;action=create\">".$langs->trans("AddContact")."</a>";
@ -365,236 +368,241 @@ if ( $societe->fetch($socid) )
print '<br>';
/*
* Listes des actions a faire
*
* Listes des actions a faire
* \TODO Mutualise ce code avec page compta et client de tiers
*/
print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre"><td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right">&nbsp;</td></tr>';
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login,";
$sql.= " a.propalrowid, a.fk_user_author, a.fk_contact, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent < 100";
$sql.= " ORDER BY a.datep DESC, a.id DESC";
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
if ($conf->agenda->enabled)
{
print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre"><td colspan="11"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=todo">'.$langs->trans("ActionsToDoShort").'</a></td><td align="right">&nbsp;</td></tr>';
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login,";
$sql.= " a.propalrowid, a.fk_user_author, a.fk_contact, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent < 100";
$sql.= " ORDER BY a.datep DESC, a.id DESC";
$result=$db->query($sql);
if ($result)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
print '<td width="30" align="center">|</td>';
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">'.strftime("%Y",$obj->dp)."</td>\n";
$oldyear = strftime("%Y",$obj->dp);
}
if ($oldmonth == strftime("%Y%b",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">' .strftime("%b",$obj->dp)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->dp);
}
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
// Picto warning
print '<td width="16">';
if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
else print '&nbsp;';
print '</td>';
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
else
{
print '<td width="30" align="center">'.strftime("%Y",$obj->dp)."</td>\n";
$oldyear = strftime("%Y",$obj->dp);
}
if ($oldmonth == strftime("%Y%b",$obj->dp) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">' .strftime("%b",$obj->dp)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->dp);
}
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
// Picto warning
print '<td width="16">';
if (date("U",$obj->dp) < time()) print ' '.img_warning("Late");
else print '&nbsp;';
print '</td>';
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
$db->free($result);
} else {
dolibarr_print_error($db);
}
$db->free($result);
} else {
dolibarr_print_error($db);
}
print "</table><br>";
print "</table><br>";
}
/*
* Listes des actions effectuées
* Listes des actions effectuees
*/
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td></tr>';
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,";
$sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
if ($conf->agenda->enabled)
{
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td></tr>';
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,";
$sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle,";
$sql.= " u.login, u.rowid,";
$sql.= " sp.name, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE a.fk_soc = ".$societe->id;
$sql.= " AND u.rowid = a.fk_user_author";
$sql.= " AND c.id=a.fk_action AND a.percent = 100";
$sql.= " ORDER BY a.datea DESC, a.id DESC";
$result=$db->query($sql);
if ($result)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
// Picto
print '<td width="16">&nbsp;</td>';
// Espace
print '<td width="30">&nbsp;</td>';
// Action
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a>';
print '</td>';
// Objet lie
print '<td>';
if ($obj->propalrowid)
{
print '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowPropal"),"propal");
print $langs->trans("Propal");
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) && !$conf->global->COMPANY_VIEW_FULL_DATE_ACTIONS)
{
print '<td width="30" align="center">|</td>';
} else {
print '<td width="30" align="center">'.strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
// Picto
print '<td width="16">&nbsp;</td>';
// Espace
print '<td width="30">&nbsp;</td>';
// Action
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a>';
print '</td>';
// Objet lie
print '<td>';
if ($obj->propalrowid)
{
print '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowPropal"),"propal");
print $langs->trans("Propal");
print '</a>';
}
if ($obj->fk_facture)
{
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->fk_facture.'">'.img_object($langs->trans("ShowBill"),"bill");
print $langs->trans("Invoice");
print '</a>';
}
else print '&nbsp;';
print '</td>';
// Libelle
print "<td>$obj->label</td>";
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
}
if ($obj->fk_facture)
{
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->fk_facture.'">'.img_object($langs->trans("ShowBill"),"bill");
print $langs->trans("Invoice");
print '</a>';
}
else print '&nbsp;';
print '</td>';
// Libelle
print "<td>$obj->label</td>";
// Contact pour cette action
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print '<td>'.$contactstatic->getNomUrl(1).'</td>';
}
else
{
print '<td>&nbsp;</td>';
}
// Auteur
print '<td width="80" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
// Statut
print '<td nowrap="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
print "</tr>\n";
$i++;
$db->free();
}
$db->free();
}
else
{
dolibarr_print_error($db);
}
print "</table>";
else
{
dolibarr_print_error($db);
}
print "</table>";
}
}
else
{

View File

@ -68,7 +68,7 @@ class box_actions extends ModeleBoxes {
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max));
if ($user->rights->commercial->main->lire)
if ($user->rights->agenda->myactions->read)
{
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp , a.percent as percentage,";
$sql.= " ta.code,";

View File

@ -65,7 +65,7 @@ class MenuLeft {
if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte
session_start();
}
$user->getrights("");
@ -104,7 +104,7 @@ class MenuLeft {
}
$newmenu = new Menu();
$overwritemenufor=array('home','companies','members','products','suppliers','commercial','accountancy','project','tools');
$overwritemenufor=array('home','companies','members','products','suppliers','commercial','accountancy','agenda','project','tools');
/**
* On definit newmenu en fonction de mainmenu et leftmenu
@ -290,12 +290,15 @@ class MenuLeft {
$newmenu->add_submenu(DOL_URL_ROOT."/contact/index.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire);
// Actions
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions", $langs->trans("Actions"), 0, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/societe.php?leftmenu=actions", $langs->trans("NewAction"), 1, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;status=todo", $langs->trans("MenuToDoActions"), 1, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;time=today", $langs->trans("Today"), 1, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=actions", $langs->trans("Reportings"), 1, $user->rights->societe->lire);
if ($conf->agenda->enabled)
{
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions", $langs->trans("Agenda"), 0, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/societe.php?leftmenu=actions", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;status=todo", $langs->trans("MenuToDoActions"), 1, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;time=today", $langs->trans("Today"), 1, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=actions", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read);
}
// Propal
if ($conf->propal->enabled)
{
@ -685,7 +688,22 @@ class MenuLeft {
}
/*
* Menu AGENDA
*/
if ($mainmenu == 'agenda')
{
// Actions
if ($conf->agenda->enabled)
{
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda", $langs->trans("Agenda"), 0, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/societe.php?leftmenu=agenda", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda&amp;status=todo", $langs->trans("MenuToDoActions"), 1, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda&amp;time=today", $langs->trans("Today"), 1, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read);
}
}
/*
* Menu PROJETS
*/

View File

@ -63,7 +63,7 @@ class MenuLeft {
if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte
session_start();
}
$user->getrights("");
@ -103,7 +103,7 @@ class MenuLeft {
$newmenu = new Menu();
$overwritemenufor=array('home','companies','members','products','suppliers','commercial','accountancy','project','tools');
$overwritemenufor=array('home','companies','members','products','suppliers','commercial','accountancy','agenda','project','tools');
/**
* On definit newmenu en fonction de mainmenu et leftmenu
@ -275,11 +275,14 @@ class MenuLeft {
*/
// Actions
/*
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions", $langs->trans("Actions"), 0, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/societe.php?leftmenu=actions", $langs->trans("NewAction"), 1, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;status=todo", $langs->trans("MenuToDoActions"), 1, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;time=today", $langs->trans("Today"), 1, $user->rights->societe->lire);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=actions", $langs->trans("Reportings"), 1, $user->rights->societe->lire);
if ($conf->agenda->enabled)
{
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions", $langs->trans("Agenda"), 0, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/societe.php?leftmenu=actions", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;status=todo", $langs->trans("MenuToDoActions"), 1, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions&amp;time=today", $langs->trans("Today"), 1, $user->rights->agenda->myactions->read);
if ($leftmenu=="actions") $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=actions", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read);
}
*/
// Propal
if ($conf->propal->enabled)
@ -659,6 +662,24 @@ class MenuLeft {
}
/*
* Menu AGENDA
*/
/*
if ($mainmenu == 'agenda')
{
// Actions
if ($conf->agenda->enabled)
{
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda", $langs->trans("Agenda"), 0, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/societe.php?leftmenu=agenda", $langs->trans("NewAction"), 1, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda&amp;status=todo", $langs->trans("MenuToDoActions"), 1, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?leftmenu=agenda&amp;time=today", $langs->trans("Today"), 1, $user->rights->agenda->myactions->read);
$newmenu->add_submenu(DOL_URL_ROOT."/comm/action/rapport/index.php?leftmenu=agenda", $langs->trans("Reportings"), 1, $user->rights->agenda->myactions->read);
}
}
*/
/*
* Menu PROJETS
*/

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -21,14 +21,14 @@
/**
\file htdocs/includes/menus/barre_top/eldy_backoffice.php
\brief Gestionnaire nommé eldy du menu du haut
\brief Gestionnaire nomm<EFBFBD> eldy du menu du haut
\version $Revision$
\remarks La construction d'un gestionnaire pour le menu du haut est simple:
\remarks Toutes les entrées de menu à faire apparaitre dans la barre du haut
\remarks doivent être affichées par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut éventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entrée du menu qui est sélectionnée.
\remarks Toutes les entr<EFBFBD>es de menu <EFBFBD> faire apparaitre dans la barre du haut
\remarks doivent <EFBFBD>tre affich<EFBFBD>es par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut <EFBFBD>ventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entr<EFBFBD>e du menu qui est s<EFBFBD>lectionn<EFBFBD>e.
*/
@ -45,7 +45,7 @@ class MenuTop {
/**
* \brief Constructeur
* \param db Handler d'accès base de donnée
* \param db Handler d'acc<EFBFBD>s base de donn<EFBFBD>e
*/
function MenuTop($db)
{
@ -66,19 +66,19 @@ class MenuTop {
if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte
session_start();
}
$user->getrights("");
// On récupère mainmenu
// On recupere mainmenu
if (isset($_GET["mainmenu"])) {
// On sauve en session le menu principal choisi
$mainmenu=$_GET["mainmenu"];
$_SESSION["mainmenu"]=$mainmenu;
$_SESSION["leftmenuopened"]="";
} else {
// On va le chercher en session si non défini par le lien
// On va le chercher en session si non defini par le lien
$mainmenu=$_SESSION["mainmenu"];
}
@ -212,6 +212,28 @@ class MenuTop {
print '<td class="tmenu"><font class="tmenudisabled">'.$langs->trans("MenuFinancial").'</font></td>';
}
// Agenda
if ($conf->agenda->enabled)
{
$langs->load("commercial");
$langs->load("agenda");
$class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "agenda")
{
$class='class="tmenu" id="sel"';
}
else
{
$class = 'class="tmenu"';
}
if ($user->rights->agenda->myactions->read || $user->rights->agenda->allactions->read)
print '<td class="tmenu"><a '.$class.' href="'.DOL_URL_ROOT.'/comm/action/index.php?mainmenu=agenda&amp;leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("Agenda").'</a></td>';
else
print '<td class="tmenu"><font class="tmenudisabled">'.$langs->trans("Agenda").'</font></td>';
}
// Projects
if ($conf->projet->enabled)
{

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -20,14 +20,14 @@
/**
\file htdocs/includes/menus/barre_top/eldy_frontoffice.php
\brief Gestionnaire nommé eldy du menu du haut
\brief Gestionnaire nomm<EFBFBD> eldy du menu du haut
\version $Revision$
\remarks La construction d'un gestionnaire pour le menu du haut est simple:
\remarks Toutes les entrées de menu à faire apparaitre dans la barre du haut
\remarks doivent être affichées par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut éventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entrée du menu qui est sélectionnée.
\remarks Toutes les entr<EFBFBD>es de menu <EFBFBD> faire apparaitre dans la barre du haut
\remarks doivent <EFBFBD>tre affich<EFBFBD>es par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut <EFBFBD>ventuellement ajouter l'attribut id="sel" dans la balise <a>
\remarks quand il s'agit de l'entr<EFBFBD>e du menu qui est s<EFBFBD>lectionn<EFBFBD>e.
*/
@ -44,7 +44,7 @@ class MenuTop {
/**
* \brief Constructeur
* \param db Handler d'accès base de donnée
* \param db Handler d'acc<EFBFBD>s base de donn<EFBFBD>e
*/
function MenuTop($db)
{
@ -65,19 +65,19 @@ class MenuTop {
if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte
session_start(); // En mode authentification PEAR, la session a d<EFBFBD>j<EFBFBD> <20>t<EFBFBD> ouverte
}
$user->getrights("");
// On récupère mainmenu
// On r<EFBFBD>cup<EFBFBD>re mainmenu
if (isset($_GET["mainmenu"])) {
// On sauve en session le menu principal choisi
$mainmenu=$_GET["mainmenu"];
$_SESSION["mainmenu"]=$mainmenu;
$_SESSION["leftmenuopened"]="";
} else {
// On va le chercher en session si non défini par le lien
// On va le chercher en session si non d<EFBFBD>fini par le lien
$mainmenu=$_SESSION["mainmenu"];
}

View File

@ -0,0 +1,209 @@
<?php
/* Copyright (C) 2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
/**
\defgroup adherent Module adherents
\brief Module pour gerer les adherents d'une association
*/
/**
\file htdocs/includes/modules/modAgenda.class.php
\ingroup agenda
\brief Fichier de description et activation du module agenda
*/
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
/**
\class modAdherent
\brief Classe de description et activation du module Adherent
*/
class modAgenda extends DolibarrModules
{
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'acc<EFBFBD>s base
*/
function modAgenda($DB)
{
$this->db = $DB;
$this->id = 'agenda'; // Same value xxx than in file modXxx.class.php file
$this->numero = 2400;
$this->family = "projects";
$this->name = "Agenda";
$this->description = "Gestion de l'agenda et des actions";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_AGENDA';
$this->special = 0;
$this->picto='calendar';
// Dir
//----
$this->dirs = array();
// Config pages
//-------------
$this->config_page_url = array();
// Dependances
//------------
$this->depends = array();
$this->requiredby = array();
$this->langfiles = array("companies");
// Constantes
//-----------
$this->const = array();
// Boites
//-------
$this->boxes = array();
// Permissions
//------------
$this->rights = array();
$this->rights_class = 'agenda';
$r=0;
// $this->rights[$r][0] Id permission (unique tous modules confondus)
// $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission)
// $this->rights[$r][2] Non utilise
// $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut
// $this->rights[$r][4] Niveau 1 pour nommer permission dans code
// $this->rights[$r][5] Niveau 2 pour nommer permission dans code
$r++;
$this->rights[$r][0] = 2401;
$this->rights[$r][1] = 'Lire les actions liees a son compte';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'myactions';
$this->rights[$r][5] = 'read';
$r++;
$this->rights[$r][0] = 2402;
$this->rights[$r][1] = 'Creer/modifier/supprimer les actions liees a son compte';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'myactions';
$this->rights[$r][5] = 'create';
$r++;
$this->rights[$r][0] = 2403;
$this->rights[$r][1] = 'Lire les actions des autres';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'allactions';
$this->rights[$r][5] = 'read';
$r++;
$this->rights[$r][0] = 2405;
$this->rights[$r][1] = 'Creer/modifier/supprimer les actions pour les autres';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'allactions';
$this->rights[$r][5] = 'create';
// Exports
//--------
$r=0;
// $this->export_code[$r] Code unique identifiant l'export (tous modules confondus)
// $this->export_label[$r] Libelle par defaut si traduction de cle "ExportXXX" non trouvee (XXX = Code)
// $this->export_fields_sql[$r] Liste des champs exportables en codif sql
// $this->export_fields_name[$r] Liste des champs exportables en codif traduction
// $this->export_sql[$r] Requete sql qui offre les donnees a l'export
// $this->export_permission[$r] Liste des codes permissions requis pour faire l'export
$r++;
$this->export_code[$r]=$this->id.'_'.$r;
$this->export_label[$r]='Adherents et adhesions';
$this->export_fields_array[$r]=array('a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'MorPhy','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
$this->export_entities_array[$r]=array('a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
$this->export_alias_array[$r]=array('a.nom'=>"lastname",'a.prenom'=>"firstname",'a.login'=>"login",'a.morphy'=>'morphy','a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.phone'=>"phone",'a.phone_perso'=>"phone_perso",'a.phone_mobile'=>"phone_mobile",'a.email'=>"email",'a.naiss'=>"birthday",'a.statut'=>"status",'a.photo'=>'photo','a.note'=>'note','a.datec'=>'datec','a.datevalid'=>'datevalid','a.tms'=>'datem','a.datefin'=>'dateend','ta.rowid'=>'type_id','ta.libelle'=>'type_label','c.dateadh'=>'date_subscription','c.cotisation'=>'amount_subscription');
// On complete avec champs options
$sql='SELECT name, label FROM '.MAIN_DB_PREFIX.'adherent_options_label';
$resql=$this->db->query($sql);
while ($obj=$this->db->fetch_object($resql))
{
$fieldname='ao.'.$obj->name;
$fieldlabel=ucfirst($obj->label);
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_entities_array[$r][$fieldname]='member';
$this->export_alias_array[$r][$fieldname]='opt_'.$obj->name;
}
// Fin complement
$this->export_sql[$r]="select distinct ";
$i=0;
foreach ($this->export_alias_array[$r] as $key => $value)
{
if ($i > 0) $this->export_sql[$r].=', ';
else $i++;
$this->export_sql[$r].=$key.' as '.$value;
}
$this->export_sql[$r].=' from ('.MAIN_DB_PREFIX.'adherent as a, '.MAIN_DB_PREFIX.'adherent_type as ta)';
$this->export_sql[$r].=' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_options as ao ON a.rowid = ao.adhid';
$this->export_sql[$r].=' LEFT JOIN '.MAIN_DB_PREFIX.'cotisation as c ON c.fk_adherent = a.rowid';
$this->export_sql[$r].=' WHERE a.fk_adherent_type = ta.rowid';
$this->export_permission[$r]=array(array("adherent","export"));
}
/**
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module.
* Definit egalement les repertoires de donnees a creer pour ce module.
*/
function init()
{
global $conf;
// Permissions
$this->remove();
// Dir
$this->dirs[0] = $conf->adherent->dir_output;
$this->dirs[1] = $conf->adherent->dir_output."/photos";
$this->dirs[2] = $conf->adherent->dir_export;
$sql = array();
return $this->_init($sql);
}
/**
* \brief Fonction appelee lors de la desactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
*/
function remove()
{
$sql = array();
return $this->_remove($sql);
}
}
?>

View File

@ -318,8 +318,8 @@ class User extends CommonObject
// Where pour la liste des droits a ajouter
$whereforadd="id=".$rid;
// Ajout des droits induits
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND subperms='lire')";
if ($perms) $whereforadd.=" OR (module='$module' AND perms='lire' AND subperms IS NULL)";
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
}
else {
// On a pas demande un droit en particulier mais une liste de droits
@ -412,8 +412,8 @@ class User extends CommonObject
// Where pour la liste des droits a supprimer
$wherefordel="id=".$rid;
// Suppression des droits induits
if ($subperms=='lire') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
if ($perms=='lire') $wherefordel.=" OR (module='$module')";
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
}
else {
// On a demande suppression d'un droit sur la base d'un nom de module ou perms

View File

@ -52,7 +52,7 @@ if ($_GET["action"] == 'addrights' && $caneditperms)
$edituser = new User($db,$_GET["id"]);
$edituser->addrights($_GET["rights"],$module);
// Si on a touché à ces propres droits, on recharge
// Si on a touche a ses propres droits, on recharge
if ($_GET["id"] == $user->id)
{
$user->clearrights();
@ -65,7 +65,7 @@ if ($_GET["action"] == 'delrights' && $caneditperms)
$edituser = new User($db,$_GET["id"]);
$edituser->delrights($_GET["rights"],$module);
// Si on a touché à ces propres droits, on recharge
// Si on a touche a ses propres droits, on recharge
if ($_GET["id"] == $user->id)
{
$user->clearrights();
@ -242,7 +242,7 @@ if ($result)
$oldmod = $obj->module;
$var = !$var;
// Rupture détectée, on récupère objMod
// Rupture detectee, on recupere objMod
$objMod=$modules[$obj->module];
$picto=($objMod->picto?$objMod->picto:'generic');