Added new event from member module to possible agenda tracked events.

This commit is contained in:
Laurent Destailleur 2008-11-11 19:32:48 +00:00
parent 7a98515bf4
commit 40f94a5668
14 changed files with 959 additions and 910 deletions

View File

@ -24,6 +24,8 @@ For users:
- Add juridical status and number of employees in third party - Add juridical status and number of employees in third party
export definition. export definition.
- A lot of enhancements and translation in withdraw module. - A lot of enhancements and translation in withdraw module.
- Full support of Mysql option mode=strict.
- Added new event from member module to possible agenda tracked events.
For translators: For translators:
- The errors language file contains only error or warning messages with - The errors language file contains only error or warning messages with
@ -33,6 +35,7 @@ For translators:
For developers: For developers:
- Update skeletons. - Update skeletons.
- Add an experimental Cash Desk module. - Add an experimental Cash Desk module.
- Added new triggers events in agenda module.
- All submodules are moved in the includes directory. - All submodules are moved in the includes directory.
- Removed some deprecated files. - Removed some deprecated files.

View File

@ -18,19 +18,17 @@
*/ */
/** /**
\file htdocs/actioncomm.class.php * \file htdocs/actioncomm.class.php
\ingroup commercial * \ingroup commercial
\brief Fichier de la classe des actions commerciales * \brief Fichier de la classe des actions commerciales
\version $Id$ * \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT.'/cactioncomm.class.php'); require_once(DOL_DOCUMENT_ROOT.'/cactioncomm.class.php');
/** \class ActionComm /** \class ActionComm
\brief Classe permettant la gestion des actions commerciales * \brief Classe permettant la gestion des actions commerciales
*/ */
class ActionComm class ActionComm
{ {
var $db; var $db;
@ -133,7 +131,7 @@ class ActionComm
} }
$this->db->begin(); $this->db->begin("ActionComm::add");
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm";
$sql.= "(datec,"; $sql.= "(datec,";
@ -143,7 +141,9 @@ class ActionComm
$sql.= "datea2,"; $sql.= "datea2,";
$sql.= "durationp,"; $sql.= "durationp,";
$sql.= "durationa,"; $sql.= "durationa,";
$sql.= "fk_action,fk_soc,note,"; $sql.= "fk_action,";
$sql.= "fk_soc,";
$sql.= "note,";
$sql.= "fk_contact,"; $sql.= "fk_contact,";
$sql.= "fk_user_author,"; $sql.= "fk_user_author,";
$sql.= "fk_user_action,"; $sql.= "fk_user_action,";
@ -158,7 +158,9 @@ class ActionComm
$sql.= (strval($this->dateend)!=''?"'".$this->db->idate($this->dateend)."'":"null").","; $sql.= (strval($this->dateend)!=''?"'".$this->db->idate($this->dateend)."'":"null").",";
$sql.= ($this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; $sql.= ($this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
$sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").","; $sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").",";
$sql.= "'".$this->type_id."', '".$this->societe->id."' ,'".addslashes($this->note)."',"; $sql.= " '".$this->type_id."',";
$sql.= ($this->societe->id>0?" '".$this->societe->id."'":"null").",";
$sql.= " '".addslashes($this->note)."',";
$sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").","; $sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").",";
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").","; $sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").","; $sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
@ -185,13 +187,13 @@ class ActionComm
// Fin appel triggers // Fin appel triggers
} }
$this->db->commit(); $this->db->commit("ActionComm::add");
return $this->id; return $this->id;
} }
else else
{ {
$this->error=$this->db->lasterror().' sql='.$sql; $this->error=$this->db->lasterror().' sql='.$sql;
$this->db->rollback(); $this->db->rollback("ActionComm::add");
return -1; return -1;
} }

View File

@ -37,8 +37,8 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php");
/** /**
\class Adherent * \class Adherent
\brief Classe permettant la gestion d'un adherent * \brief Classe permettant la gestion d'un adherent
*/ */
class Adherent extends CommonObject class Adherent extends CommonObject
@ -222,9 +222,8 @@ class Adherent extends CommonObject
/** /**
\brief imprime une liste d'erreur. * \brief imprime une liste d'erreur.
*/ */
function print_error_list() function print_error_list()
{ {
$num = sizeof($this->error); $num = sizeof($this->error);
@ -236,10 +235,9 @@ class Adherent extends CommonObject
/** /**
\brief Renvoie le libelle traduit de la nature d'un adherent (physique ou morale) * \brief Renvoie le libelle traduit de la nature d'un adherent (physique ou morale)
\param morphy Nature physique ou morale de l'adherent * \param morphy Nature physique ou morale de l'adherent
*/ */
function getmorphylib($morphy='') function getmorphylib($morphy='')
{ {
global $langs; global $langs;
@ -250,110 +248,10 @@ class Adherent extends CommonObject
} }
/** /**
\brief Verifie les donnees entrees * \brief Fonction qui cree l'adherent
\param minimum * \param user Objet user qui demande la creation
*/ * \param notrigger 1 ne declenche pas les triggers, 0 sinon
* \return int <0 si ko, >0 si ok
function check($minimum=0)
{
$err = 0;
if (strlen(trim($this->societe)) == 0)
{
if ((strlen(trim($this->nom)) + strlen(trim($this->prenom))) == 0)
{
$error_string[$err] = "Vous devez saisir vos nom et prenom ou le nom de votre societe.";
$err++;
}
}
if (strlen(trim($this->adresse)) == 0)
{
$error_string[$err] = "L'adresse saisie est invalide";
$err++;
}
if (strlen(trim($this->cp)) == 0)
{
$error_string[$err] = "Le code postal saisi est invalide";
$err++;
}
if (strlen(trim($this->ville)) == 0)
{
$error_string[$err] = "La ville saisie est invalide";
$err++;
}
if (strlen(trim($this->email)) == 0)
{
$error_string[$err] = "L'email saisi est invalide";
$err++;
}
if (strlen(trim($this->login)) == 0)
{
$error_string[$err] = "Le login saisi est invalide";
$err++;
}
if (strlen(trim($this->pass)) == 0)
{
$error_string[$err] = "Le pass saisi est invalide";
$err++;
}
$this->amount = trim($this->amount);
$map = range(0,9);
for ($i = 0; $i < strlen($this->amount) ; $i++)
{
if (!isset($map[substr($this->amount, $i, 1)] ))
{
$error_string[$err] = "Le montant du don contient un/des caractere(s) invalide(s)";
$err++;
$amount_invalid = 1;
break;
}
}
if (! $amount_invalid)
{
if ($this->amount == 0)
{
$error_string[$err] = "Le montant du don est null";
$err++;
}
else
{
if ($this->amount < $minimum && $minimum > 0)
{
$error_string[$err] = "Le montant minimum du don est de $minimum";
$err++;
}
}
}
/*
* Return errors
*/
if ($err)
{
$this->error = $error_string;
return 0;
}
else
{
return 1;
}
}
/**
\brief Fonction qui cree l'adherent
\param user Objet user qui demande la creation
\param notrigger 1 ne declenche pas les triggers, 0 sinon
\return int <0 si ko, >0 si ok
*/ */
function create($user,$notrigger=0) function create($user,$notrigger=0)
{ {
@ -371,11 +269,11 @@ class Adherent extends CommonObject
// Insertion membre // Insertion membre
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
$sql.= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid)"; $sql.= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy)";
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= " '".$this->db->idate($this->datec)."',"; $sql.= " '".$this->db->idate($this->datec)."',";
$sql.= " '".addslashes($this->login)."',"; $sql.= " '".addslashes($this->login)."',";
$sql.= " '".$user->id."',null,null"; $sql.= " '".$user->id."',null,null,'".$this->morphy."'";
$sql.= ")"; $sql.= ")";
dolibarr_syslog("Adherent::create sql=".$sql); dolibarr_syslog("Adherent::create sql=".$sql);
@ -498,15 +396,23 @@ class Adherent extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid";
foreach($this->array_options as $key => $value) foreach($this->array_options as $key => $value)
{ {
// recupere le nom de l'attribut // Add field o fattribut
$attr=substr($key,8); $attr=substr($key,8);
$sql.=",$attr"; $sql.=",$attr";
} }
$sql .= ") VALUES (".$this->id; $sql .= ") VALUES (".$this->id;
foreach($this->array_options as $key => $value) foreach($this->array_options as $key => $value)
{
// Add field o fattribut
if ($this->array_options[$key] != '')
{ {
$sql.=",'".$this->array_options[$key]."'"; $sql.=",'".$this->array_options[$key]."'";
} }
else
{
$sql.=",null";
}
}
$sql.=")"; $sql.=")";
dolibarr_syslog("Adherent::update sql=".$sql); dolibarr_syslog("Adherent::update sql=".$sql);
@ -876,9 +782,9 @@ class Adherent extends CommonObject
/** /**
\brief Fonction qui recupere l'adherent en donnant son rowid * \brief Fonction qui recupere l'adherent en donnant son rowid
\param rowid * \param rowid
\return int <0 si KO, >0 si OK * \return int <0 si KO, >0 si OK
*/ */
function fetch($rowid) function fetch($rowid)
{ {
@ -970,12 +876,12 @@ class Adherent extends CommonObject
/** /**
\brief Fonction qui recupere pour un adherent les parametres * \brief Fonction qui recupere pour un adherent les parametres
firstsubscription_date * firstsubscription_date
fistrsubscription_amount * fistrsubscription_amount
lastsubscription_date * lastsubscription_date
lastsubscription_amount * lastsubscription_amount
\return int <0 si KO, >0 si OK * \return int <0 si KO, >0 si OK
*/ */
function fetch_subscriptions() function fetch_subscriptions()
{ {
@ -1004,7 +910,7 @@ class Adherent extends CommonObject
$this->lastsubscription_date=$obj->dateadh; $this->lastsubscription_date=$obj->dateadh;
$this->lastsubscription_amount=$obj->cotisation; $this->lastsubscription_amount=$obj->cotisation;
// TODO Completer avec records // TODO Add also array of subscription records
$i++; $i++;
} }
@ -1019,13 +925,13 @@ class Adherent extends CommonObject
/** /**
\brief Fonction qui recupere les donnees optionelles de l'adherent * \brief Fonction qui recupere les donnees optionelles de l'adherent
\param rowid * \param rowid
*/ */
function fetch_optionals($rowid) function fetch_optionals($rowid)
{ {
$tab=array(); $tab=array();
$sql = "SELECT *"; $sql = "SELECT *"; // \TODO Should not use this syntax
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_options"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_options";
$sql.= " WHERE adhid=".$rowid; $sql.= " WHERE adhid=".$rowid;
@ -1054,8 +960,8 @@ class Adherent extends CommonObject
} }
/* /**
* fetch optional attribute name * \brief Fetch optional attribute name
*/ */
function fetch_name_optionals() function fetch_name_optionals()
{ {
@ -1223,12 +1129,20 @@ class Adherent extends CommonObject
/** /**
* \brief Function that validate a member * \brief Function that validate a member
* \param user user adherent qui valide * \param user user adherent qui valide
* \return int <0 si ko, >0 si ok * \return int <0 if KO, 0 if nothing done, >0 if OK
*/ */
function validate($user) function validate($user)
{ {
global $langs,$conf; global $langs,$conf;
if ($this->statut == 1)
{
dolibarr_syslog("Adherent::validate statut of member does not allow this", LOG_WARNING);
return 0;
}
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql.= " statut=1, datevalid = ".$this->db->idate(mktime()).","; $sql.= " statut=1, datevalid = ".$this->db->idate(mktime()).",";
$sql.= " fk_user_valid=".$user->id; $sql.= " fk_user_valid=".$user->id;
@ -1270,11 +1184,17 @@ class Adherent extends CommonObject
{ {
global $langs,$conf; global $langs,$conf;
if ($this->statut == 0)
{
dolibarr_syslog("Adherent::resiliate statut of member does not allow this", LOG_WARNING);
return 0;
}
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql .= "statut=0"; $sql.= " statut=0,";
$sql .= ",fk_user_valid=".$user->id; $sql.= " fk_user_valid=".$user->id;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -130,7 +130,7 @@ if (sizeof($array_options)>0)
print "<td>".$adho->attribute_label[$key]."&nbsp;</td>\n"; print "<td>".$adho->attribute_label[$key]."&nbsp;</td>\n";
print "<td>$key</td>\n"; print "<td>$key</td>\n";
print "<td>$value</td>\n"; print "<td>$value</td>\n";
print "<td align=\"center\"><a href=\"options.php?action=edit&attrname=$key\">".img_edit()."</a>"; print "<td align=\"right\"><a href=\"options.php?action=edit&attrname=$key\">".img_edit()."</a>";
print "&nbsp; <a href=\"options.php?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; print "&nbsp; <a href=\"options.php?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
print "</tr>"; print "</tr>";
// $i++; // $i++;

View File

@ -53,8 +53,10 @@ $eventstolog=array(
array('id'=>'BILL_SUPPLIER_VALIDATE', 'test'=>$conf->fournisseur->enabled), array('id'=>'BILL_SUPPLIER_VALIDATE', 'test'=>$conf->fournisseur->enabled),
// array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled), // array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled),
// array('id'=>'PAYMENT_SUPPLIER_CREATE','test'=>$conf->fournisseur->enabled), // array('id'=>'PAYMENT_SUPPLIER_CREATE','test'=>$conf->fournisseur->enabled),
// array('id'=>'MEMBER_VALIDATE', 'test'=>$conf->adherent->enabled), array('id'=>'MEMBER_VALIDATE', 'test'=>$conf->adherent->enabled),
// array('id'=>'MEMBER_SUBSCRIPTION', 'test'=>$conf->adherent->enabled), array('id'=>'MEMBER_SUBSCRIPTION', 'test'=>$conf->adherent->enabled),
array('id'=>'MEMBER_RESILIATE', 'test'=>$conf->adherent->enabled),
array('id'=>'MEMBER_DELETE', 'test'=>$conf->adherent->enabled),
); );

View File

@ -68,6 +68,8 @@ $day=isset($_REQUEST["day"])?$_REQUEST["day"]:0;
$langs->load("other"); $langs->load("other");
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
/* /*
* Actions * Actions
@ -413,7 +415,7 @@ if ($_GET["action"] != 'show_day')
{ {
$style='cal_other_month'; $style='cal_other_month';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
show_day_events ($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $style, $actionarray,3); show_day_events ($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
echo " </td>\n"; echo " </td>\n";
} }
/* Show days of the current month */ /* Show days of the current month */
@ -429,7 +431,7 @@ if ($_GET["action"] != 'show_day')
$style='cal_current_month'; $style='cal_current_month';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
show_day_events($db, $tmpday, $month, $year, $style, $actionarray, 3); show_day_events($db, $tmpday, $month, $year, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
echo " </td>\n"; echo " </td>\n";
} }
/* Show days after the current month (next month) */ /* Show days after the current month (next month) */
@ -437,7 +439,7 @@ if ($_GET["action"] != 'show_day')
{ {
$style='cal_other_month'; $style='cal_other_month';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $style, $actionarray, 3); show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $style, $actionarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
echo "</td>\n"; echo "</td>\n";
} }
$tmpday++; $tmpday++;
@ -448,6 +450,7 @@ if ($_GET["action"] != 'show_day')
} }
else else
{ {
// Code to show just one day
$style='cal_current_month'; $style='cal_current_month';
$timestamp=dolibarr_mktime(12,0,0,$month,$_GET["day"],$year); $timestamp=dolibarr_mktime(12,0,0,$month,$_GET["day"],$year);
$arraytimestamp=adodb_getdate(dolibarr_mktime(12,0,0,$month,$_GET["day"],$year)); $arraytimestamp=adodb_getdate(dolibarr_mktime(12,0,0,$month,$_GET["day"],$year));
@ -458,7 +461,7 @@ else
echo " </tr>\n"; echo " </tr>\n";
echo " <tr>\n"; echo " <tr>\n";
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
show_day_events ($db, $_GET["day"], $month, $year, $style, $actionarray); show_day_events ($db, $_GET["day"], $month, $year, $style, $actionarray, 0, 0);
echo "</td>\n"; echo "</td>\n";
echo " </tr>\n"; echo " </tr>\n";
echo '</table>'; echo '</table>';
@ -480,16 +483,17 @@ llxFooter('$Date$ - $Revision$');
* @param unknown_type $year Year * @param unknown_type $year Year
* @param unknown_type $style Style to use for this day * @param unknown_type $style Style to use for this day
* @param unknown_type $actionarray Array of actions * @param unknown_type $actionarray Array of actions
* @param unknown_type $maxPrint Nb of actions to show each day on month view * @param unknown_type $maxPrint Nb of actions to show each day on month view (0 means non limit)
* @param unknown_type nbofchartoshow Nb of characters to show for event line
*/ */
function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPrint=-1) function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPrint=0, $nbofchartoshow=14)
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
global $filtera, $filtert, $filted; global $filtera, $filtert, $filted;
global $theme_datacolor; global $theme_datacolor;
if ($_GET["action"] == 'maxPrint') if ($_GET["action"] == 'maxPrint')
{ {
$maxPrint=-1; $maxPrint=0;
} }
$curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year); $curtime = dolibarr_mktime (0, 0, 0, $month, $day, $year);
@ -517,7 +521,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
foreach ($actionarray[$daykey] as $index => $action) foreach ($actionarray[$daykey] as $index => $action)
{ {
if ($i < $maxPrint || $maxPrint == -1) if ($i < $maxPrint || $maxPrint == 0)
{ {
$ponct=($action->date_start_in_calendar == $action->date_end_in_calendar); $ponct=($action->date_start_in_calendar == $action->date_end_in_calendar);
// Show rect of event // Show rect of event
@ -562,11 +566,11 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
print dolibarr_print_date($action->date_end_in_calendar,'%H:%M'); print dolibarr_print_date($action->date_end_in_calendar,'%H:%M');
} }
print '<br>'; print '<br>';
print $action->getNomUrl(0,14,'cal_event'); print $action->getNomUrl(0,$nbofchartoshow,'cal_event');
} }
else // It's a birthday else // It's a birthday
{ {
print $action->getNomUrl(0,14,'cal_event','birthday'); print $action->getNomUrl(0,$nbofchartoshow,'cal_event','birthday');
} }
print '</td>'; print '</td>';
print '<td align="right" nowrap="nowrap">'; print '<td align="right" nowrap="nowrap">';

View File

@ -402,10 +402,17 @@ class InterfaceLogevents
// Members // Members
elseif ($action == 'MEMBER_CREATE') elseif ($action == 'MEMBER_CREATE')
{ {
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("NewMemberCreated",$object->id); $this->texte=$langs->transnoentities("NewMemberCreated",$object->ref);
$this->desc=$langs->transnoentities("NewMemberCreated",$object->id); $this->desc=$langs->transnoentities("NewMemberCreated",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
} }
elseif ($action == 'MEMBER_VALIDATE') elseif ($action == 'MEMBER_VALIDATE')
{ {
@ -415,8 +422,8 @@ class InterfaceLogevents
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -429,8 +436,8 @@ class InterfaceLogevents
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberSubscriptionInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberSubscriptionInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
@ -445,8 +452,8 @@ class InterfaceLogevents
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -459,8 +466,8 @@ class InterfaceLogevents
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -473,8 +480,8 @@ class InterfaceLogevents
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;

View File

@ -104,8 +104,8 @@ class InterfaceActionsAuto
// Following properties must be filled: // Following properties must be filled:
// $object->actiontypecode; // $object->actiontypecode;
// $object->actionmsg (label) // $object->actionmsg (note, long text)
// $object->actionmsg2 (note) // $object->actionmsg2 (label, short text)
// $object->sendtoid // $object->sendtoid
// $object->socid // $object->socid
// Optionnal: // Optionnal:
@ -328,6 +328,86 @@ class InterfaceActionsAuto
$ok=1; $ok=1;
} }
// Members
elseif ($action == 'MEMBER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$object->facid=0; // Supplier invoice not yet supported
$object->orderrowid=$object->propalrowid=0;
$ok=1;
}
elseif ($action == 'MEMBER_SUBSCRIPTION')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
$object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dolibarr_print_date($object->last_subscription_date_start,'day').' - '.dolibarr_print_date($object->last_subscription_date_end,'day');
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$object->facid=$object->orderrowid=$object->propalrowid=0;
$ok=1;
}
elseif ($action == 'MEMBER_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'MEMBER_RESILIATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$object->facid=$object->orderrowid=$object->propalrowid=0;
$ok=1;
}
elseif ($action == 'MEMBER_DELETE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$object->facid=$object->orderrowid=$object->propalrowid=0;
$ok=1;
}
// If not found // If not found
/* /*

View File

@ -101,6 +101,12 @@ class InterfaceLdapsynchro
if (! $conf->ldap->enabled) return 0; // Module non actif if (! $conf->ldap->enabled) return 0; // Module non actif
if (! function_exists('ldap_connect'))
{
dolibarr_syslog("Warning, module LDAP is enabled but LDAP functions not available in this PHP", LOG_WARNING);
return 0;
}
// Users // Users
if ($action == 'USER_CREATE') if ($action == 'USER_CREATE')
{ {

View File

@ -288,6 +288,17 @@ class InterfacePhenixsynchro
// Members // Members
elseif ($action == 'MEMBER_CREATE') elseif ($action == 'MEMBER_CREATE')
{ {
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$this->date=time();
$this->duree=0;
$this->texte=$langs->transnoentities("NewMemberCreated",$object->ref);
$this->desc=$langs->transnoentities("NewMemberCreated",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
} }
elseif ($action == 'MEMBER_VALIDATE') elseif ($action == 'MEMBER_VALIDATE')
{ {
@ -297,8 +308,8 @@ class InterfacePhenixsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -311,8 +322,8 @@ class InterfacePhenixsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberSubscriptionInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberSubscriptionInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
@ -327,8 +338,8 @@ class InterfacePhenixsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -341,8 +352,8 @@ class InterfacePhenixsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -355,8 +366,8 @@ class InterfacePhenixsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;

View File

@ -265,6 +265,17 @@ class InterfaceWebcalsynchro
// Members // Members
elseif ($action == 'MEMBER_CREATE') elseif ($action == 'MEMBER_CREATE')
{ {
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("members");
$this->date=time();
$this->duree=0;
$this->texte=$langs->transnoentities("NewMemberCreated",$object->ref);
$this->desc=$langs->transnoentities("NewMemberCreated",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
} }
elseif ($action == 'MEMBER_VALIDATE') elseif ($action == 'MEMBER_VALIDATE')
{ {
@ -274,8 +285,8 @@ class InterfaceWebcalsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -288,8 +299,8 @@ class InterfaceWebcalsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberSubscriptionInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberSubscriptionInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
@ -304,8 +315,8 @@ class InterfaceWebcalsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -318,8 +329,8 @@ class InterfaceWebcalsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -332,8 +343,8 @@ class InterfaceWebcalsynchro
$this->date=time(); $this->date=time();
$this->duree=0; $this->duree=0;
$this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->id); $this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->id); $this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname;
$this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type;
$this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login;

View File

@ -95,6 +95,7 @@ class Interfaces
dolibarr_syslog("Interfaces::run_triggers Triggers for file '".$file."' need module to be enabled",LOG_INFO); dolibarr_syslog("Interfaces::run_triggers Triggers for file '".$file."' need module to be enabled",LOG_INFO);
continue; continue;
} }
dolibarr_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO); dolibarr_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO);
include_once($this->dir."/".$file); include_once($this->dir."/".$file);
$objMod = new $modName($this->db); $objMod = new $modName($this->db);

View File

@ -118,6 +118,7 @@ SupplierPaymentDoneInDolibarr=Supplier payment %s done in Dolibarr
MemberValidatedInDolibarr=Member %s validated in Dolibarr MemberValidatedInDolibarr=Member %s validated in Dolibarr
MemberResiliatedInDolibarr=Member %s resiliated in Dolibarr MemberResiliatedInDolibarr=Member %s resiliated in Dolibarr
MemberDeletedInDolibarr=Member %s deleted from Dolibarr MemberDeletedInDolibarr=Member %s deleted from Dolibarr
MemberSubscriptionAddedInDolibarr=Subscription for member %s added in Dolibarr
##### Export ##### ##### Export #####
ExportsArea=Exports area ExportsArea=Exports area
AvailableFormats=Available formats AvailableFormats=Available formats

View File

@ -120,6 +120,7 @@ SupplierPaymentDoneInDolibarr=Paiement fournisseur %s dans Dolibarr
MemberValidatedInDolibarr=Adhérent %s validé dans Dolibarr MemberValidatedInDolibarr=Adhérent %s validé dans Dolibarr
MemberResiliatedInDolibarr=Adhérent %s résilié dans Dolibarr MemberResiliatedInDolibarr=Adhérent %s résilié dans Dolibarr
MemberDeletedInDolibarr=Adhérent %s supprimé de Dolibarr MemberDeletedInDolibarr=Adhérent %s supprimé de Dolibarr
MemberSubscriptionAddedInDolibarr=Souscription adhérent %s ajoutée dans Dolibarr
##### Export ##### ##### Export #####
ExportsArea=Espace exports ExportsArea=Espace exports
AvailableFormats=Formats disponibles AvailableFormats=Formats disponibles