diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php new file mode 100644 index 00000000000..973762b780c --- /dev/null +++ b/htdocs/adherents/agenda.php @@ -0,0 +1,166 @@ + + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/adherents/agenda.php + * \ingroup member + * \brief Page of members events + */ + +require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); +require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); + +$langs->load("companies"); +$langs->load("members"); + +$mesg=isset($_GET["mesg"])?'
'.$_GET["mesg"].'
':''; + +$id = GETPOST("id"); + +// Security check +if (! $user->rights->adherent->lire) accessforbidden(); + +$object = new Adherent($db); +$result=$object->fetch($id); +if ($result > 0) +{ + $adht = new AdherentType($db); + $result=$adht->fetch($object->typeid); +} + + +/* + * Actions + */ + +// None + + + +/* + * View + */ + +$contactstatic = new Contact($db); + +$form = new Form($db); + +/* + * Fiche categorie de client et/ou fournisseur + */ +if ($id) +{ + require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); + require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); + + $langs->load("companies"); + + llxHeader("",$langs->trans("Agenda"),''); + + if ($conf->notification->enabled) $langs->load("mails"); + $head = member_prepare_head($object); + + dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user'); + + print ''; + + // Reference + print ''; + print ''; + print ''; + + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + print ''; + } + + // Morphy + print ''; + /*print '';*/ + print ''; + + // Type + print '\n"; + + // Company + print ''; + + // Civility + print ''; + print ''; + + // Lastname + print ''; + print ''; + + // Firstname + print ''; + + // Status + print ''; + + print '
'.$langs->trans('Ref').''; + print $form->showrefnav($object,'id'); + print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Nature").''.$object->getmorphylib().''; + print $form->showphoto('memberphoto',$member); + print '
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("UserTitle").''.$object->getCivilityLabel().' 
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; + + print ''; + + + dol_htmloutput_mesg($mesg); + + + /* + * Barre d'action + */ + + print '
'; + + if ($conf->agenda->enabled) + { + print ''.$langs->trans("AddAction").''; + } + + print '
'; + + print '
'; + + print load_fiche_titre($langs->trans("ActionsOnMember"),'',''); + + // List of todo actions + show_actions_todo($conf,$langs,$db,$object); + + // List of done actions + show_actions_done($conf,$langs,$db,$object); +} + + + +llxFooter(); + +$db->close(); +?> diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3a4fd7a6fca..ebf941962d1 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1428,6 +1428,7 @@ class Adherent extends CommonObject defined('ADHERENT_SPIP_DB') && ADHERENT_SPIP_DB != '' ) { + require_once(DOL_DOCUMENT_ROOT."/core/lib/security2.lib.php"); $mdpass=dol_hash($this->pass); $htpass=crypt($this->pass,makesalt()); $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->firstname." ".$this->lastname."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index ec10a5622af..4f371c27b38 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -584,7 +584,8 @@ if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_del_spip' { if (! count($object->errors)) { - if(!$object->del_to_spip()){ + if(!$object->del_to_spip()) + { $errmsg.="Echec de la suppression de l'utilisateur dans spip: ".$object->error."
\n"; } } @@ -1516,8 +1517,9 @@ if ($rowid && $action != 'edit') { print "id&action=add_spip\">".$langs->trans("AddIntoSpip")."\n"; } - if ($isinspip == -1) { - print '
Failed to connect to SPIP: '.$object->error.''; + if ($isinspip == -1) + { + print '

Failed to connect to SPIP: '.$object->error.''; } } @@ -1529,7 +1531,7 @@ if ($rowid && $action != 'edit') } -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 87fc6990c40..e2f2bacc853 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -25,6 +25,15 @@ */ require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/security2.lib.php"); + +// Security check +if (! $user->rights->adherent->export) accessforbidden(); + + +/* + * View + */ llxHeader(); @@ -42,13 +51,12 @@ if (! isset($cotis)) } - $sql = "SELECT d.login, d.pass, d.datefin"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d "; $sql .= " WHERE d.statut = $statut "; if ($cotis==1) { - $sql .= " AND datefin > ".$db->idate(mktime()); + $sql .= " AND datefin > '".$db->idate(mktime())."'"; } $sql.= $db->order($sortfield,$sortorder); //$sql.=$db->plimit($conf->liste_limit, $offset); @@ -77,7 +85,7 @@ else } -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 7c36b2414aa..7a2b9c3aca3 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -27,37 +27,36 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'); require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"); -$action=isset($_GET["action"])?$_GET["action"]:(isset($_POST["action"])?$_POST["action"]:""); -$id=isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:""); +$action=GETPOST('action'); +$id=GETPOST("id"); $langs->load("companies"); $langs->load("members"); $langs->load("bills"); -if (!$user->rights->adherent->lire) - accessforbidden(); +if (!$user->rights->adherent->lire) accessforbidden(); -$adh = new Adherent($db); -$result=$adh->fetch($id); +$object = new Adherent($db); +$result=$object->fetch($id); if ($result > 0) { $adht = new AdherentType($db); - $result=$adht->fetch($adh->typeid); + $result=$adht->fetch($object->typeid); } -/******************************************************************************/ -/* Actions */ -/******************************************************************************/ +/* + * Actions + */ if ($_POST["action"] == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"]) { $db->begin(); - $res=$adh->update_note($_POST["note"],$user); + $res=$object->update_note($_POST["note"],$user); if ($res < 0) { - $mesg='
'.$adh->error.'
'; + $mesg='
'.$object->error.'
'; $db->rollback(); } else @@ -78,11 +77,11 @@ $form = new Form($db); if ($id) { - $head = member_prepare_head($adh); + $head = member_prepare_head($object); dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user'); - if ($msg) print '
'.$msg.'
'; + dol_htmloutput_errors($msg); print "
"; print ''; @@ -92,18 +91,18 @@ if ($id) // Reference print ''.$langs->trans('Ref').''; print ''; - print $form->showrefnav($adh,'id'); + print $form->showrefnav($object,'id'); print ''; print ''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' / '.$langs->trans("Id").''.$adh->login.' '; + print ''.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' '; } // Morphy - print ''.$langs->trans("Nature").''.$adh->getmorphylib().''; + print ''.$langs->trans("Nature").''.$object->getmorphylib().''; /*print ''; print $form->showphoto('memberphoto',$member); print '';*/ @@ -113,21 +112,21 @@ if ($id) print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // Company - print ''.$langs->trans("Company").''.$adh->societe.''; + print ''.$langs->trans("Company").''.$object->societe.''; // Civility - print ''.$langs->trans("UserTitle").''.$adh->getCivilityLabel().' '; + print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; print ''; // Lastname - print ''.$langs->trans("Lastname").''.$adh->lastname.' '; + print ''.$langs->trans("Lastname").''.$object->lastname.' '; print ''; // Firstname - print ''.$langs->trans("Firstname").''.$adh->firstname.' '; + print ''.$langs->trans("Firstname").''.$object->firstname.' '; // Status - print ''.$langs->trans("Status").''.$adh->getLibStatut(4).''; + print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; // Note print ''.$langs->trans("Note").''; @@ -135,14 +134,14 @@ if ($id) if ($action == 'edit' && $user->rights->adherent->creer) { print ""; - print "id."\">"; + print "id."\">"; require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); - $doleditor=new DolEditor('note',$adh->note,'',280,'dolibarr_notes','',true,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); + $doleditor=new DolEditor('note',$object->note,'',280,'dolibarr_notes','',true,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); $doleditor->Create(); } else { - print nl2br($adh->note); + print nl2br($object->note); } print ""; @@ -167,7 +166,7 @@ if ($id) if ($user->rights->adherent->creer && $action != 'edit') { - print "id&action=edit\">".$langs->trans('Modify').""; + print "id."&action=edit\">".$langs->trans('Modify').""; } print ""; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index f97cc01b06c..3c641be8566 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -51,7 +51,7 @@ $id = GETPOST('id'); if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id'); -if (isset($_GET["error"])) $error=$_GET["error"]; +$error=GETPOST("error"); $cactioncomm = new CActionComm($db); $actioncomm = new ActionComm($db); diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 60a0524fd11..56e78a0f523 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -856,7 +856,9 @@ if ($id > 0) if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { - // List of todo actions + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + + // List of todo actions show_actions_todo($conf,$langs,$db,$object); // List of done actions @@ -868,8 +870,8 @@ else dol_print_error($db,'Bad value for socid parameter'); } + llxFooter(); $db->close(); - ?> diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 82a79a17387..db6a493c54e 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -328,6 +328,8 @@ if ($socid > 0) if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + // List of todo actions show_actions_todo($conf,$langs,$db,$societe); @@ -336,7 +338,8 @@ if ($socid > 0) } } -$db->close(); llxFooter(); + +$db->close(); ?> diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 3b34162c8f8..e10f83c9174 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -884,13 +884,16 @@ else print "
"; } + print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); + print show_actions_todo($conf,$langs,$db,$objsoc,$object); print show_actions_done($conf,$langs,$db,$objsoc,$object); } } -$db->close(); llxFooter(); + +$db->close(); ?> diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bd05cf29889..d15a1eb133d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1630,10 +1630,10 @@ abstract class CommonObject dol_print_error($this->db); } } - + /** * Update object linked of a current object - * + * * @param int $sourceid Object source id * @param string $sourcetype Object source type * @param int $targetid Object target id @@ -1644,10 +1644,10 @@ abstract class CommonObject { $updatesource=false; $updatetarget=false; - + if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid) && empty($targettype)) $updatesource=true; else if (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $updatetarget=true; - + $sql = "UPDATE ".MAIN_DB_PREFIX."element_element SET "; if ($updatesource) { @@ -1663,7 +1663,7 @@ abstract class CommonObject $sql.= " WHERE fk_source = ".$this->id; $sql.= " AND sourcetype = '".$this->element."'"; } - + dol_syslog(get_class($this)."::updateObjectLinked sql=".$sql, LOG_DEBUG); if ($this->db->query($sql)) { @@ -1676,7 +1676,7 @@ abstract class CommonObject return -1; } } - + /** * Delete all links between an object $this * @@ -1687,7 +1687,7 @@ abstract class CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_element"; $sql.= " WHERE fk_target = ".$this->id; $sql.= " AND targettype = '".$this->element."'"; - + dol_syslog(get_class($this)."::deleteObjectLinked sql=".$sql, LOG_DEBUG); if ($this->db->query($sql)) { @@ -1700,7 +1700,7 @@ abstract class CommonObject return -1; } } - + /** * Set statut of an object * @@ -1859,7 +1859,7 @@ abstract class CommonObject global $langs; $error=0; - + if (count($this->array_options) > 0) { // Check parameters @@ -2015,7 +2015,7 @@ abstract class CommonObject /** - * List urls of elemùent + * List urls of element * * @param int $objectid Id of record * @param string $objecttype Type of object diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2029537ab5e..2f3c70ee723 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -600,15 +600,18 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db - * @param Object $object Object third party + * @param Object $object Object third party or member * @param Contact $objcon Object contact - * @param int $noprint Return string but does not output it + * @param int $noprint Return string but does not output it * @return void */ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) { global $bc,$user; + // Check parameters + if (! is_object($object)) dol_print_error('','BadParameter'); + $now=dol_now(); $out=''; @@ -620,17 +623,20 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $contactstatic = new Contact($db); $out.="\n"; - if (is_object($objcon) && $objcon->id) $out.=load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); - else $out.=load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - $out.=''; $out.=''; - $out.=''; + $out.=''; $out.='
'.$langs->trans("ActionsToDoShort").''; + if (get_class($object) == 'Societe') $out.=''; + $out.=$langs->trans("ActionsToDoShort"); + if (get_class($object) == 'Societe') $out.=''; + $out.=''; $permok=$user->rights->agenda->myactions->create; if (($object->id || $objcon->id) && $permok) { - $out.=''; + $out.=''; $out.=$langs->trans("AddAnAction").' '; $out.=img_picto($langs->trans("AddAnAction"),'filenew'); $out.=""; @@ -645,13 +651,17 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $sql.= " a.fk_user_author, a.fk_contact,"; $sql.= " a.fk_element, a.elementtype,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.login, u.rowid,"; - $sql.= " sp.name, sp.firstname"; + $sql.= " u.login, u.rowid"; + if (get_class($object) == 'Adherent') $sql.= ", m.nom as name, m.prenom as firstname"; + if (get_class($object) == 'Societe') $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"; + if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; + if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE u.rowid = a.fk_user_author"; - $sql.= " AND u.entity = ".$conf->entity; - if ($object->id) $sql.= " AND a.fk_soc = ".$object->id; + $sql.= " AND a.entity IN (".getEntity('actioncomm').")"; + if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; + if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id; + if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id; if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id; $sql.= " AND c.id=a.fk_action"; $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; @@ -749,15 +759,19 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db - * @param Object $object Object third party + * @param Object $object Object third party or member * @param Contact $objcon Object contact - * @param int $noprint Return string but does not output it + * @param int $noprint Return string but does not output it * @return void + * TODO change function to be able to list event linked to an object. */ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) { global $bc,$user; + // Check parameters + if (! is_object($object)) dol_print_error('','BadParameter'); + $out=''; $histo=array(); $numaction = 0 ; @@ -773,13 +787,17 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $sql.= " a.fk_element, a.elementtype,"; $sql.= " a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.login, u.rowid as user_id,"; - $sql.= " sp.name, sp.firstname"; + $sql.= " u.login, u.rowid as user_id"; + if (get_class($object) == 'Adherent') $sql.= ", m.nom as name, m.prenom as firstname"; + if (get_class($object) == 'Societe') $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"; + if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; + if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE u.rowid = a.fk_user_author"; - $sql.= " AND u.entity = ".$conf->entity; - if ($object->id) $sql.= " AND a.fk_soc = ".$object->id; + $sql.= " AND a.entity IN (".getEntity('actioncomm').")"; + if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; + if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id; + if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id; if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id; $sql.= " AND c.id=a.fk_action"; $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; @@ -810,7 +828,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) } } - if ($conf->mailing->enabled && $objcon->email) + if ($conf->mailing->enabled && ! empty($objcon->email)) { $langs->load("mails"); @@ -851,7 +869,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) } - if ($conf->agenda->enabled || ($conf->mailing->enabled && $objcon->email)) + if ($conf->agenda->enabled || ($conf->mailing->enabled && ! empty($objcon->email))) { require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"); @@ -869,12 +887,18 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $out.="\n"; $out.=''; $out.=''; - $out.=''; + $out.=''; $out.='
'.$langs->trans("ActionsDoneShort").''; + if (get_class($object) == 'Societe') $out.=''; + $out.=$langs->trans("ActionsDoneShort"); + if (get_class($object) == 'Societe') $out.=''; + $out.=''; $permok=$user->rights->agenda->myactions->create; if (($object->id || $objcon->id) && $permok) { - $out.=''; + $out.=''; $out.=$langs->trans("AddAnAction").' '; $out.=img_picto($langs->trans("AddAnAction"),'filenew'); $out.=""; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index a278417689d..8928fac972e 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -57,6 +57,15 @@ function member_prepare_head($object) $h++; } + // Show agenda tab + if (! empty($conf->agenda->enabled)) + { + $head[$h][0] = DOL_URL_ROOT."/adherents/agenda.php?id=".$object->id; + $head[$h][1] = $langs->trans('Agenda'); + $head[$h][2] = 'agenda'; + $h++; + } + // Show category tab if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 0afce405673..7741ddfc42f 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -411,6 +411,8 @@ if ($object->fetch($id)) if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); + // List of todo actions show_actions_todo($conf,$langs,$db,$object); diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index 15db47e106a..df58ad3b95b 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -191,6 +191,9 @@ ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_expedition_methode F -- VMYSQL4.1 UPDATE llx_chargesociales set tms = date_creation WHERE tms = '0000-00-00 00:00:00'; ALTER TABLE llx_actioncomm DROP COLUMN propalrowid; +ALTER TABLE llx_actioncomm DROP COLUMN fk_facture; +ALTER TABLE llx_actioncomm DROP COLUMN fk_supplier_order; +ALTER TABLE llx_actioncomm DROP COLUMN fk_supplier_invoice; ALTER TABLE llx_actioncomm DROP COLUMN fk_commande; ALTER TABLE llx_product_stock DROP COLUMN location; -- DROP TABLE llx_c_methode_commande_fournisseur; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c78a083e148..ffd39beea2e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -329,6 +329,7 @@ ActionDoneShort=Finished CompanyFoundation=Company/Foundation ContactsForCompany=Contacts/adresses for this third party ActionsOnCompany=Events about this third party +ActionsOnMember=Events about this member NActions=%s events NActionsLate=%s late Filter=Filter diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 35214bb2bfe..5e2187a3d09 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -330,6 +330,7 @@ ActionDoneShort=Terminé CompanyFoundation=Société ou institution ContactsForCompany=Contacts/adresses de ce tiers ActionsOnCompany=Événements vis à vis de ce tiers +ActionsOnMember=Événements vis à vis de cet adhérent NActions=%s événements NActionsLate=%s en retard Filter=Filtre diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 907b9cff53a..330cff56858 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -35,7 +35,7 @@ $langs->load("companies"); $mesg=isset($_GET["mesg"])?'
'.$_GET["mesg"].'
':''; // Security check -$socid = isset($_GET["socid"])?$_GET["socid"]:''; +$socid = GETPOST("socid"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'societe', $socid); @@ -59,7 +59,7 @@ $form = new Form($db); /* * Fiche categorie de client et/ou fournisseur */ -if ($_GET["socid"]) +if ($socid) { require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); @@ -68,8 +68,8 @@ if ($_GET["socid"]) $soc = new Societe($db); - $result = $soc->fetch($_GET["socid"]); - llxHeader("",$langs->trans("Agenda"),$langs->trans("Category")); + $result = $soc->fetch($socid); + llxHeader("",$langs->trans("Agenda"),''); if ($conf->notification->enabled) $langs->load("mails"); $head = societe_prepare_head($soc); @@ -144,7 +144,9 @@ if ($_GET["socid"]) print ''; - if ($mesg) print($mesg); + + dol_htmloutput_mesg($mesg); + /* * Barre d'action @@ -161,31 +163,17 @@ if ($_GET["socid"]) print '
'; -/* - if ($conf->global->MAIN_REPEATCONTACTONEACHTAB) - { - // List of contacts - show_contacts($conf,$langs,$db,$societe); - } + print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); - if ($conf->global->MAIN_REPEATTASKONEACHTAB) - { -*/ - // List of todo actions - show_actions_todo($conf,$langs,$db,$soc); - - // List of done actions - show_actions_done($conf,$langs,$db,$soc); -// } + // List of todo actions + show_actions_todo($conf,$langs,$db,$soc); + // List of done actions + show_actions_done($conf,$langs,$db,$soc); } - - - +llxFooter(); $db->close(); - -llxFooter(); ?>