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("bills");
$langs->load("orders"); $langs->load("orders");
// Sécurité accés client // Securite acces client
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $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') 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_webcal"] == 'on' && $conf->webcal->enabled) $actioncomm->use_webcal=1;
if ($_POST["add_phenix"] == 'on' && $conf->phenix->enabled) $actioncomm->use_phenix=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); $idaction=$actioncomm->add($user);
if ($idaction > 0) 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') 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>'; 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"]) if ($_REQUEST["socid"])
{ {
$contactid = $_REQUEST["contactid"]?$_REQUEST["contactid"]:''; $contactid = $_REQUEST["contactid"]?$_REQUEST["contactid"]:'';
@ -471,7 +471,7 @@ if ($_GET["action"] == 'create')
} }
print '</td></tr>'; 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"]) if ($_REQUEST["socid"])
{ {
print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>'; print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>';
@ -573,7 +573,7 @@ if ($_GET["id"])
$act = new ActionComm($db); $act = new ActionComm($db);
$act->fetch($_GET["id"]); $act->fetch($_GET["id"]);
$res=$act->societe->fetch($act->societe->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); $res=$act->contact->fetch($act->contact->id);
/* /*
@ -654,7 +654,7 @@ if ($_GET["id"])
// Etat // 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>'; 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) if ($act->objet_url)
{ {
print '<tr><td>'.$langs->trans("LinkedObject").'</td>'; print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
@ -741,7 +741,7 @@ if ($_GET["id"])
print $act->getLibStatut(4); print $act->getLibStatut(4);
print '</td></tr>'; print '</td></tr>';
// Objet lié // Objet li<EFBFBD>
if ($act->objet_url) if ($act->objet_url)
{ {
print '<tr><td>'.$langs->trans("LinkedObject").'</td>'; 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 \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() function add_row_for_calendar_link()
{ {
global $conf,$langs,$user; global $conf,$langs,$user;
$nbtr=0; $nbtr=0;
// Lien avec calendrier si module activé // Lien avec calendrier si module activ<EFBFBD>
if ($conf->webcal->enabled) if ($conf->webcal->enabled)
{ {
if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never') if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never')

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.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"]:''; $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); $socid = restrictedArea($user, 'societe', $socid);
$sortorder=$_GET["sortorder"]; $sortorder=$_GET["sortorder"];
@ -64,7 +64,7 @@ if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer)
$societe = new Societe($db, $_GET["socid"]); $societe = new Societe($db, $_GET["socid"]);
$societe->attribute_prefix($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) if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer)
{ {
@ -75,7 +75,7 @@ if ($_POST["action"] == 'setconditions' && $user->rights->societe->creer)
$result = $db->query($sql); $result = $db->query($sql);
if (! $result) dolibarr_print_error($result); if (! $result) dolibarr_print_error($result);
} }
// mode de règlement // mode de r<EFBFBD>glement
if ($_POST["action"] == 'setmode' && $user->rights->societe->creer) if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
{ {
$societe = new Societe($db, $_GET["socid"]); $societe = new Societe($db, $_GET["socid"]);
@ -85,7 +85,7 @@ if ($_POST["action"] == 'setmode' && $user->rights->societe->creer)
$result = $db->query($sql); $result = $db->query($sql);
if (! $result) dolibarr_print_error($result); if (! $result) dolibarr_print_error($result);
} }
// assujétissement à la TVA // assuj<EFBFBD>tissement <20> la TVA
if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer) if ($_POST["action"] == 'setassujtva' && $user->rights->societe->creer)
{ {
$societe = new Societe($db, $_GET["socid"]); $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>"; 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 '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">'; print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($objsoc->tva_assuj); print yn($objsoc->tva_assuj);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Conditions de réglement par défaut // Conditions de r<EFBFBD>glement par d<>faut
$langs->load('bills'); $langs->load('bills');
$html = new Form($db); $html = new Form($db);
print '<tr><td nowrap>'; print '<tr><td nowrap>';
@ -220,7 +220,7 @@ if ($socid > 0)
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';
// Mode de règlement // Mode de r<EFBFBD>glement
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
@ -239,7 +239,7 @@ if ($socid > 0)
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';
// Réductions relative (Remises-Ristournes-Rabbais) // R<EFBFBD>ductions relative (Remises-Ristournes-Rabbais)
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans("CustomerRelativeDiscountShort"); 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 '</td><td colspan="3">'.($objsoc->remise_client?$objsoc->remise_client.'%':$langs->trans("DiscountNone")).'</td>';
print '</tr>'; print '</tr>';
// Réductions absolues (Remises-Ristournes-Rabbais) // R<EFBFBD>ductions absolues (Remises-Ristournes-Rabbais)
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding">'; print '<table width="100%" class="nobordernopadding">';
print '<tr><td nowrap>'; print '<tr><td nowrap>';
@ -329,7 +329,7 @@ if ($socid > 0)
print '<td valign="top" width="50%" class="notopnoleftnoright">'; 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; $MAXLIST=4;
// Lien recap // Lien recap
@ -536,7 +536,7 @@ if ($socid > 0)
} }
/* /*
* Derniers projets associés * Derniers projets associ<EFBFBD>s
*/ */
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
@ -609,7 +609,10 @@ 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.'/fichinter/fiche.php?socid='.$objsoc->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</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>'; 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) if ($user->rights->societe->contact->creer)
{ {
@ -636,7 +639,10 @@ if ($socid > 0)
print '<td>'.$langs->trans("Poste").'</td><td colspan="2">'.$langs->trans("Tel").'</td>'; 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>'.$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 '<td>&nbsp;</td>';
}
print "</tr>"; print "</tr>";
$sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note "; $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 '<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 '<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>'; print '</td><td>';
} }
else else
@ -678,18 +684,38 @@ if ($socid > 0)
print '<td colspan="2">'; 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>'; if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
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 '<a href="action/fiche.php?action=create&actioncode=AC_TEL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">';
print '<td><a href="action/fiche.php?action=create&actioncode=AC_EMAIL&contactid='.$obj->rowid.'&socid='.$objsoc->id.'">'.$obj->email.'</a>&nbsp;</td>'; 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 '<td align="center">';
print "<a href=\"../contact/fiche.php?action=edit&amp;id=".$obj->rowid."\">"; print "<a href=\"../contact/fiche.php?action=edit&amp;id=".$obj->rowid."\">";
print img_edit(); print img_edit();
print '</a></td>'; 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 '<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 img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';
}
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
@ -701,8 +727,9 @@ if ($socid > 0)
/* /*
* Listes des actions a faire * Listes des actions a faire
*
*/ */
if ($conf->agenda->enabled)
{
print_titre($langs->trans("ActionsOnCompany")); print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
@ -741,25 +768,11 @@ if ($socid > 0)
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print "<tr $bc[$var]>"; 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"; print '<td width="30" align="center">'.strftime("%Y",$obj->dp)."</td>\n";
$oldyear = strftime("%Y",$obj->dp); $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"; print '<td width="30" align="center">' .strftime("%b",$obj->dp)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->dp); $oldmonth = strftime("%Y%b",$obj->dp);
}
print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n"; print '<td width="20">'.strftime("%d",$obj->dp)."</td>\n";
print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>'; print '<td width="30" nowrap="nowrap">'.strftime("%H:%M",$obj->dp).'</td>';
@ -818,7 +831,7 @@ if ($socid > 0)
} }
else else
{ {
// Aucun action à faire // Aucun action a faire
} }
$db->free($result); $db->free($result);
@ -830,11 +843,13 @@ if ($socid > 0)
print "</table>"; print "</table>";
print "<br>"; print "<br>";
}
/* /*
* Listes des actions effectuees * Listes des actions effectuees
*/ */
if ($conf->agenda->enabled)
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; 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 '<td colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$objsoc->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a></td>';
@ -873,25 +888,10 @@ if ($socid > 0)
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Champ date // Champ date
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"; print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da); $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"; print '<td width="30" align="center">'.strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da); $oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n"; print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n"; print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
@ -909,7 +909,7 @@ if ($socid > 0)
print $actionstatic->getNomUrl(1,16); print $actionstatic->getNomUrl(1,16);
print '</td>'; print '</td>';
// Objet lié // Objet lie
print '<td>'; print '<td>';
if ($obj->propalrowid) if ($obj->propalrowid)
{ {
@ -927,7 +927,7 @@ if ($socid > 0)
else print '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';
// Libellé // Libelle
print '<td>'.$obj->label.'</td>'; print '<td>'.$obj->label.'</td>';
// Contact pour cette action // Contact pour cette action
@ -965,6 +965,7 @@ if ($socid > 0)
} }
print "</table><br>"; print "</table><br>";
}
} }
else else
{ {

View File

@ -1701,8 +1701,10 @@ if ($_GET['propalid'] > 0)
print '</td><td valign="top" width="50%">'; print '</td><td valign="top" width="50%">';
/* /*
* Liste des actions propres <EFBFBD> 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 = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.propalrowid = '.$propal->id ; $sql .= ' WHERE a.propalrowid = '.$propal->id ;
@ -1744,6 +1746,7 @@ if ($_GET['propalid'] > 0)
{ {
dolibarr_print_error($db); 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.'/contact/fiche.php?socid='.$societe->id.'&amp;action=create">'.$langs->trans("AddContact").'</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>'; 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) 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("Poste").'</td><td>'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>'; print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td align=\"center\">&nbsp;</td>"; print "<td align=\"center\">&nbsp;</td>";
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
}
print "</tr>"; print "</tr>";
$sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note";
@ -276,17 +281,34 @@ if ($socid > 0)
} }
print '</td>'; print '</td>';
print '<td>'.$obj->poste.'&nbsp;</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) 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 '<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 img_phone_out("Appel émis") ;
} }
print '</a></td>'; if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
print '</a>';
print '</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>';
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 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">'; print '<td align="center">';
@ -300,9 +322,13 @@ if ($socid > 0)
print '</td>'; 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.'">'; 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 img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';
}
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -162,19 +162,21 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
*/ */
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; 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,"; if ($conf->agenda->enabled)
$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)
{ {
$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)
{
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num > 0) if ($num > 0)
{ {
@ -205,14 +207,15 @@ if ($resql)
print "</table><br>"; print "</table><br>";
} }
$db->free($resql); $db->free($resql);
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
}
} }
/* /*
* Dernières propales ouvertes * Dernieres propales ouvertes
* *
*/ */
if ($conf->propal->enabled && $user->rights->propale->lire) 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"; $sql = "SELECT s.nom, s.rowid";

View File

@ -1841,8 +1841,10 @@ else
print '</td><td valign="top" width="50%">'; print '</td><td valign="top" width="50%">';
/* /*
* Liste des actions propres <EFBFBD> la commande * Liste des actions propres a la commande
*/ */
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
$sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ; $sql = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.fk_commande = '.$commande->id ; $sql .= ' WHERE a.fk_commande = '.$commande->id ;
@ -1885,6 +1887,7 @@ else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
}
print '</td></tr></table>'; print '</td></tr></table>';

View File

@ -2949,6 +2949,8 @@ else
/* /*
* Liste des actions propres à la facture * Liste des actions propres à la facture
*/ */
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
$sql = 'SELECT a.id, '.$db->pdate('a.datea').' as da, a.label, a.note,'; $sql = 'SELECT a.id, '.$db->pdate('a.datea').' as da, a.label, a.note,';
$sql.= ' u.login'; $sql.= ' u.login';
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a, '.MAIN_DB_PREFIX.'user as u'; $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a, '.MAIN_DB_PREFIX.'user as u';
@ -2991,7 +2993,7 @@ else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
}
print '</td></tr></table>'; 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("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>"; 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 '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">'; print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($societe->tva_assuj); 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 '</td><td colspan="3">'.($societe->remise_client?price2num($societe->remise_client,'MT').'%':$langs->trans("DiscountNone")).'</td>';
print '</tr>'; print '</tr>';
// Réductions (Remises-Ristournes-Rabbais) // R<EFBFBD>ductions (Remises-Ristournes-Rabbais)
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding">'; print '<table width="100%" class="nobordernopadding">';
print '<tr><td nowrap>'; print '<tr><td nowrap>';
@ -219,7 +219,7 @@ if ($socid > 0)
print '<td valign="top" width="50%" class="notopnoleftnoright">'; 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; $MAXLIST=5;
$tableaushown=1; $tableaushown=1;
@ -300,7 +300,7 @@ if ($socid > 0)
} }
/* /*
* Derniers projets associés * Derniers projets associ<EFBFBD>s
*/ */
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
@ -354,7 +354,7 @@ if ($socid > 0)
if ($user->societe_id == 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) { if ($societe->client != 0 && $conf->facture->enabled && $user->rights->facture->creer) {
$langs->load("bills"); $langs->load("bills");
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/facture.php?action=create&socid=$societe->id\">".$langs->trans("AddBill")."</a>"; print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/facture.php?action=create&socid=$societe->id\">".$langs->trans("AddBill")."</a>";
@ -366,7 +366,10 @@ if ($socid > 0)
} }
} }
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>'; 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) if ($user->rights->societe->contact->creer)
{ {
@ -388,7 +391,10 @@ if ($socid > 0)
print '<td>'.$langs->trans("Poste").'</td><td>'.$langs->trans("Tel").'</td>'; print '<td>'.$langs->trans("Poste").'</td><td>'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>'; print '<td>'.$langs->trans("Fax").'</td><td>'.$langs->trans("EMail").'</td>';
print "<td align=\"center\">&nbsp;</td>"; print "<td align=\"center\">&nbsp;</td>";
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
}
print "</tr>"; print "</tr>";
$sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note";
@ -415,10 +421,27 @@ if ($socid > 0)
} }
print '</td>'; print '</td>';
print '<td>'.$obj->poste.'&nbsp;</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>';
print '<td><a href="../comm/action/fiche.php?action=create&actioncode=AC_FAX&contactid='.$obj->rowid.'&socid='.$societe->id.'">'.$obj->fax.'</a>&nbsp;</td>'; if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
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 '<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">'; print '<td align="center">';
if ($user->rights->societe->contact->creer) if ($user->rights->societe->contact->creer)
@ -431,10 +454,12 @@ if ($socid > 0)
print '</td>'; print '</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 '<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 img_object($langs->trans("Rendez-Vous"),"action");
print '</a></td>'; print '</a></td>';
}
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
$tag = !$tag; $tag = !$tag;
@ -448,6 +473,8 @@ if ($socid > 0)
* Listes des actions a faire * Listes des actions a faire
* *
*/ */
if ($conf->agenda->enabled)
{
print_titre($langs->trans("ActionsOnCompany")); print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -563,10 +590,13 @@ if ($socid > 0)
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print "</table><br>"; print "</table><br>";
}
/* /*
* Listes des actions effectuées * Listes des actions effectuees
*/ */
if ($conf->agenda->enabled)
{
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">'; 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 colspan="12"><a href="'.DOL_URL_ROOT.'/comm/action/index.php?socid='.$societe->id.'&amp;status=done">'.$langs->trans("ActionsDoneShort").'</a>';
@ -633,7 +663,7 @@ if ($socid > 0)
print $actionstatic->getNomUrl(1,16); print $actionstatic->getNomUrl(1,16);
print '</td>'; print '</td>';
// Objet lié // Objet li<6C>
print '<td>'; print '<td>';
if ($obj->propalrowid) if ($obj->propalrowid)
{ {
@ -651,7 +681,7 @@ if ($socid > 0)
else print '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';
// Libellé // Libell<6C>
print "<td>$obj->label</td>"; print "<td>$obj->label</td>";
// Contact pour cette action // Contact pour cette action
@ -684,6 +714,7 @@ if ($socid > 0)
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print "</table><br>"; print "</table><br>";
}
} }
else else
{ {

View File

@ -49,7 +49,7 @@ if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.datep"; if (! $sortfield) $sortfield="p.datep";
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
// Sécurité accés client // S<EFBFBD>curit<EFBFBD> acc<63>s client
$user->getrights('facture'); $user->getrights('facture');
$module='propale'; $module='propale';
if (! empty($_GET["socid"])) if (! empty($_GET["socid"]))
@ -65,7 +65,7 @@ else if (! empty($_GET["propalid"]))
$dbtable='propal'; $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); $socid = restrictedArea($user, $module, $objectid, $dbtable);
@ -77,7 +77,7 @@ $socid = restrictedArea($user, $module, $objectid, $dbtable);
if ($_GET["action"] == 'setstatut') 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 = new Propal($db);
$propal->id = $_GET["propalid"]; $propal->id = $_GET["propalid"];
@ -163,7 +163,7 @@ if ($_GET["propalid"] > 0)
$rowspan=8; $rowspan=8;
// Société // Soci<EFBFBD>t<EFBFBD>
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';
// Ligne info remises tiers // Ligne info remises tiers
@ -203,7 +203,7 @@ if ($_GET["propalid"] > 0)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Conditions et modes de réglement // Conditions et modes de r<EFBFBD>glement
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
@ -486,7 +486,7 @@ if ($_GET["propalid"] > 0)
print '<table width="100%"><tr><td width="50%" valign="top">'; 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); $filename=sanitize_string($propal->ref);
$filedir=$conf->propal->dir_output . "/" . 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) 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 = 'SELECT id, '.$db->pdate('a.datea'). ' as da, label, note, fk_user_author' ;
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql .= ' WHERE a.fk_soc = '.$societe->id.' AND a.propalrowid = '.$propal->id ; $sql .= ' WHERE a.fk_soc = '.$societe->id.' AND a.propalrowid = '.$propal->id ;
@ -638,7 +640,7 @@ if ($_GET["propalid"] > 0)
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
}
print '</td></tr></table>'; print '</td></tr></table>';
@ -672,7 +674,7 @@ else
$sql.= " WHERE p.fk_soc = s.rowid"; $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 (!$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 ($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 ($month > 0)
{ {
if ($year > 0) if ($year > 0)

View File

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

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -34,7 +34,7 @@ $langs->load("companies");
$langs->load("suppliers"); $langs->load("suppliers");
// Sécurité accés client // S<EFBFBD>curit<EFBFBD> acc<63>s client
$socid=''; $socid='';
if ($_GET["socid"]) { $socid=$_GET["socid"]; } if ($_GET["socid"]) { $socid=$_GET["socid"]; }
if ($user->societe_id > 0) if ($user->societe_id > 0)
@ -80,9 +80,9 @@ if ($type == "f") {
$titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartySuppliers").')'; $titre=$langs->trans("ListOfContacts").' ('.$langs->trans("ThirdPartySuppliers").')';
$urlfiche="fiche.php"; $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 == 'mail') { $text=" (Vue EMail)"; }
if ($view == 'recent') { $text=" (Récents)"; } if ($view == 'recent') { $text=" (R<EFBFBD>cents)"; }
$titre = $titre." $text"; $titre = $titre." $text";
if ($_POST["button_removefilter"]) if ($_POST["button_removefilter"])
@ -225,9 +225,12 @@ if ($result)
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_societe" size="14" value="'.$search_societe.'">'; print '<input class="flat" type="text" name="search_societe" size="14" value="'.$search_societe.'">';
print '</td>'; print '</td>';
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
{
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
}
if ($_GET["view"] == 'phone') if ($_GET["view"] == 'phone')
{ {
@ -285,7 +288,10 @@ if ($result)
} }
print '</td>'; print '</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>'; 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') if ($_GET["view"] == 'phone')
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -42,7 +42,7 @@ $langs->load('orders');
$langs->load('companies'); $langs->load('companies');
$langs->load('commercial'); $langs->load('commercial');
// Sécurité accés client // S<EFBFBD>curit<EFBFBD> acc<63>s client
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id > 0) 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("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>"; 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 '<tr>';
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">'; print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($societe->tva_assuj); print yn($societe->tva_assuj);
@ -143,7 +143,7 @@ if ( $societe->fetch($socid) )
print '<br>'; print '<br>';
/* /*
* Liste des commandes associées * Liste des commandes associ<EFBFBD>es
*/ */
$orderstatic = new CommandeFournisseur($db); $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; $MAXLIST=5;
@ -287,7 +287,10 @@ 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.'/fourn/facture/fiche.php?action=create&socid='.$societe->id.'">'.$langs->trans("AddBill").'</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>'; 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) if ($user->rights->societe->contact->creer)
{ {
@ -366,8 +369,10 @@ if ( $societe->fetch($socid) )
/* /*
* Listes des actions a faire * Listes des actions a faire
* * \TODO Mutualise ce code avec page compta et client de tiers
*/ */
if ($conf->agenda->enabled)
{
print_titre($langs->trans("ActionsOnCompany")); print_titre($langs->trans("ActionsOnCompany"));
print '<table width="100%" class="noborder">'; 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>'; 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>';
@ -475,10 +480,13 @@ if ( $societe->fetch($socid) )
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print "</table><br>"; print "</table><br>";
}
/* /*
* Listes des actions effectuées * Listes des actions effectuees
*/ */
if ($conf->agenda->enabled)
{
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">'; 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>'; 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>';
@ -594,7 +602,7 @@ if ( $societe->fetch($socid) )
print "</table>"; print "</table>";
}
} }
else else
{ {

View File

@ -68,7 +68,7 @@ class box_actions extends ModeleBoxes {
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max)); $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 = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp , a.percent as percentage,";
$sql.= " ta.code,"; $sql.= " ta.code,";

View File

@ -65,7 +65,7 @@ class MenuLeft {
if (! session_id()) { if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name); session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte session_start();
} }
$user->getrights(""); $user->getrights("");
@ -104,7 +104,7 @@ class MenuLeft {
} }
$newmenu = new Menu(); $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 * On definit newmenu en fonction de mainmenu et leftmenu
@ -290,11 +290,14 @@ class MenuLeft {
$newmenu->add_submenu(DOL_URL_ROOT."/contact/index.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); $newmenu->add_submenu(DOL_URL_ROOT."/contact/index.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire);
// Actions // Actions
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions", $langs->trans("Actions"), 0, $user->rights->societe->lire); if ($conf->agenda->enabled)
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); $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."/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."/societe.php?leftmenu=actions", $langs->trans("NewAction"), 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->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->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 // Propal
if ($conf->propal->enabled) if ($conf->propal->enabled)
@ -685,6 +688,21 @@ 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 * Menu PROJETS

View File

@ -63,7 +63,7 @@ class MenuLeft {
if (! session_id()) { if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name); session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte session_start();
} }
$user->getrights(""); $user->getrights("");
@ -103,7 +103,7 @@ class MenuLeft {
$newmenu = new Menu(); $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 * On definit newmenu en fonction de mainmenu et leftmenu
@ -275,11 +275,14 @@ class MenuLeft {
*/ */
// Actions // Actions
/* /*
$newmenu->add(DOL_URL_ROOT."/comm/action/index.php?leftmenu=actions", $langs->trans("Actions"), 0, $user->rights->societe->lire); if ($conf->agenda->enabled)
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); $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."/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."/societe.php?leftmenu=actions", $langs->trans("NewAction"), 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->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->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 // Propal
if ($conf->propal->enabled) 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 * Menu PROJETS
*/ */

View File

@ -1,5 +1,5 @@
<?php <?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> * Copyright (C) 2007 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -21,14 +21,14 @@
/** /**
\file htdocs/includes/menus/barre_top/eldy_backoffice.php \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$ \version $Revision$
\remarks La construction d'un gestionnaire pour le menu du haut est simple: \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 Toutes les entr<EFBFBD>es de menu <EFBFBD> faire apparaitre dans la barre du haut
\remarks doivent être affichées par <a class="tmenu" href="...?mainmenu=...">...</a> \remarks doivent <EFBFBD>tre affich<EFBFBD>es par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut éventuellement ajouter l'attribut id="sel" dans la balise <a> \remarks On peut <EFBFBD>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 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 * \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) function MenuTop($db)
{ {
@ -66,19 +66,19 @@ class MenuTop {
if (! session_id()) { if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name); session_name("DOLSESSID_".$dolibarr_main_db_name);
session_start(); // En mode authentification PEAR, la session a déjà été ouverte session_start();
} }
$user->getrights(""); $user->getrights("");
// On récupère mainmenu // On recupere mainmenu
if (isset($_GET["mainmenu"])) { if (isset($_GET["mainmenu"])) {
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
$mainmenu=$_GET["mainmenu"]; $mainmenu=$_GET["mainmenu"];
$_SESSION["mainmenu"]=$mainmenu; $_SESSION["mainmenu"]=$mainmenu;
$_SESSION["leftmenuopened"]=""; $_SESSION["leftmenuopened"]="";
} else { } 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"]; $mainmenu=$_SESSION["mainmenu"];
} }
@ -212,6 +212,28 @@ class MenuTop {
print '<td class="tmenu"><font class="tmenudisabled">'.$langs->trans("MenuFinancial").'</font></td>'; 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 // Projects
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {

View File

@ -1,5 +1,5 @@
<?php <?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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,14 +20,14 @@
/** /**
\file htdocs/includes/menus/barre_top/eldy_frontoffice.php \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$ \version $Revision$
\remarks La construction d'un gestionnaire pour le menu du haut est simple: \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 Toutes les entr<EFBFBD>es de menu <EFBFBD> faire apparaitre dans la barre du haut
\remarks doivent être affichées par <a class="tmenu" href="...?mainmenu=...">...</a> \remarks doivent <EFBFBD>tre affich<EFBFBD>es par <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks On peut éventuellement ajouter l'attribut id="sel" dans la balise <a> \remarks On peut <EFBFBD>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 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 * \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) function MenuTop($db)
{ {
@ -65,19 +65,19 @@ class MenuTop {
if (! session_id()) { if (! session_id()) {
session_name("DOLSESSID_".$dolibarr_main_db_name); 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(""); $user->getrights("");
// On récupère mainmenu // On r<EFBFBD>cup<EFBFBD>re mainmenu
if (isset($_GET["mainmenu"])) { if (isset($_GET["mainmenu"])) {
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
$mainmenu=$_GET["mainmenu"]; $mainmenu=$_GET["mainmenu"];
$_SESSION["mainmenu"]=$mainmenu; $_SESSION["mainmenu"]=$mainmenu;
$_SESSION["leftmenuopened"]=""; $_SESSION["leftmenuopened"]="";
} else { } 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"]; $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 // Where pour la liste des droits a ajouter
$whereforadd="id=".$rid; $whereforadd="id=".$rid;
// Ajout des droits induits // Ajout des droits induits
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND subperms='lire')"; if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
if ($perms) $whereforadd.=" OR (module='$module' AND perms='lire' AND subperms IS NULL)"; else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
} }
else { else {
// On a pas demande un droit en particulier mais une liste de droits // 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 // Where pour la liste des droits a supprimer
$wherefordel="id=".$rid; $wherefordel="id=".$rid;
// Suppression des droits induits // Suppression des droits induits
if ($subperms=='lire') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)"; if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
if ($perms=='lire') $wherefordel.=" OR (module='$module')"; if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
} }
else { else {
// On a demande suppression d'un droit sur la base d'un nom de module ou perms // 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 = new User($db,$_GET["id"]);
$edituser->addrights($_GET["rights"],$module); $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) if ($_GET["id"] == $user->id)
{ {
$user->clearrights(); $user->clearrights();
@ -65,7 +65,7 @@ if ($_GET["action"] == 'delrights' && $caneditperms)
$edituser = new User($db,$_GET["id"]); $edituser = new User($db,$_GET["id"]);
$edituser->delrights($_GET["rights"],$module); $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) if ($_GET["id"] == $user->id)
{ {
$user->clearrights(); $user->clearrights();
@ -242,7 +242,7 @@ if ($result)
$oldmod = $obj->module; $oldmod = $obj->module;
$var = !$var; $var = !$var;
// Rupture détectée, on récupère objMod // Rupture detectee, on recupere objMod
$objMod=$modules[$obj->module]; $objMod=$modules[$obj->module];
$picto=($objMod->picto?$objMod->picto:'generic'); $picto=($objMod->picto?$objMod->picto:'generic');