Minor fix
This commit is contained in:
parent
eadbfc7b99
commit
16c9fd79d3
@ -29,7 +29,7 @@ require("./pre.inc.php");
|
||||
$langs->load("mails");
|
||||
|
||||
if (! $user->rights->mailing->lire || $user->societe_id > 0)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
|
||||
$dirmod=DOL_DOCUMENT_ROOT."/includes/modules/mailings";
|
||||
@ -58,67 +58,81 @@ $search_email=isset($_GET["search_email"])?$_GET["search_email"]:$_POST["search_
|
||||
*/
|
||||
if ($_GET["action"] == 'add')
|
||||
{
|
||||
$modulename=$_GET["module"];
|
||||
$modulename=$_GET["module"];
|
||||
$result=0;
|
||||
|
||||
// Chargement de la classe
|
||||
$file = $dirmod."/".$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once($file);
|
||||
$var=true;
|
||||
foreach ($conf->dol_document_root as $dirmod)
|
||||
{
|
||||
$dir=$dirmod."/includes/modules/mailings/";
|
||||
|
||||
$filtersarray=array();
|
||||
if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"];
|
||||
if (is_dir($dir))
|
||||
{
|
||||
// Chargement de la classe
|
||||
$file = $dir."/".$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
|
||||
$obj = new $classname($db);
|
||||
$result=$obj->add_to_target($_GET["rowid"],$filtersarray);
|
||||
if (file_exists($file))
|
||||
{
|
||||
require_once($file);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: cibles.php?id=".$_GET["rowid"]);
|
||||
exit;
|
||||
}
|
||||
if ($result == 0)
|
||||
{
|
||||
$mesg='<div class="warning">'.$langs->trans("WarningNoEMailsAdded").'</div>';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||
}
|
||||
$_REQUEST["id"]=$_GET["rowid"];
|
||||
$filtersarray=array();
|
||||
if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"];
|
||||
|
||||
$obj = new $classname($db);
|
||||
$result=$obj->add_to_target($_GET["rowid"],$filtersarray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: cibles.php?id=".$_GET["rowid"]);
|
||||
exit;
|
||||
}
|
||||
if ($result == 0)
|
||||
{
|
||||
$mesg='<div class="warning">'.$langs->trans("WarningNoEMailsAdded").'</div>';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||
}
|
||||
$_REQUEST["id"]=$_GET["rowid"];
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'clear')
|
||||
{
|
||||
// Chargement de la classe
|
||||
$file = $dirmod."/modules_mailings.php";
|
||||
$classname = "MailingTargets";
|
||||
require_once($file);
|
||||
// Chargement de la classe
|
||||
$file = $dirmod."/modules_mailings.php";
|
||||
$classname = "MailingTargets";
|
||||
require_once($file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj->clear_target($_GET["rowid"]);
|
||||
$obj = new $classname($db);
|
||||
$obj->clear_target($_GET["rowid"]);
|
||||
|
||||
Header("Location: cibles.php?id=".$_GET["rowid"]);
|
||||
exit;
|
||||
Header("Location: cibles.php?id=".$_GET["rowid"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
// Ici, rowid indique le destinataire et id le mailing
|
||||
$sql="DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles where rowid=".$_GET["rowid"];
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$file = $dirmod."/modules_mailings.php";
|
||||
$classname = "MailingTargets";
|
||||
require_once($file);
|
||||
// Ici, rowid indique le destinataire et id le mailing
|
||||
$sql="DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles where rowid=".$_GET["rowid"];
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$file = $dirmod."/modules_mailings.php";
|
||||
$classname = "MailingTargets";
|
||||
require_once($file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj->update_nb($_REQUEST["id"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$obj = new $classname($db);
|
||||
$obj->update_nb($_REQUEST["id"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["button_removefilter"])
|
||||
@ -142,298 +156,298 @@ $html = new Form($db);
|
||||
if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
{
|
||||
|
||||
$h=0;
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailCard");
|
||||
$h++;
|
||||
$h=0;
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailCard");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailRecipients");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailRecipients");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
/*
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailHistory");
|
||||
$h++;
|
||||
*/
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Mailing"));
|
||||
/*
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailHistory");
|
||||
$h++;
|
||||
*/
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Mailing"));
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $html->showrefnav($mil,'id');
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3">'.htmlentities($mil->email_from).'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->getLibStatut(4).'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("TotalNbOfDistinctRecipients").'</td><td colspan="3">'.($mil->nbemail?$mil->nbemail:'0').'</td></tr>';
|
||||
print '</table>';
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3">'.htmlentities($mil->email_from).'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->getLibStatut(4).'</td></tr>';
|
||||
print '<tr><td width="25%">'.$langs->trans("TotalNbOfDistinctRecipients").'</td><td colspan="3">'.($mil->nbemail?$mil->nbemail:'0').'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print "</div>";
|
||||
print "</div>";
|
||||
|
||||
if ($mesg) print "$mesg<br>\n";
|
||||
if ($mesg) print "$mesg<br>\n";
|
||||
|
||||
$var=!$var;
|
||||
$var=!$var;
|
||||
|
||||
// Affiche les listes de selection
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print_titre($langs->trans("ToAddRecipientsChooseHere"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("RecipientSelectionModules");
|
||||
// Affiche les listes de selection
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print_titre($langs->trans("ToAddRecipientsChooseHere"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("RecipientSelectionModules");
|
||||
if ($user->admin) print ' '.info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"),1);
|
||||
print '</td>';
|
||||
print '<td align="center">'.$langs->trans("NbOfUniqueEMails").'</td>';
|
||||
print '<td align="left">'.$langs->trans("Filter").'</td>';
|
||||
print '<td align="center" width="120"> </td>';
|
||||
print "</tr>\n";
|
||||
print '<td align="center">'.$langs->trans("NbOfUniqueEMails").'</td>';
|
||||
print '<td align="left">'.$langs->trans("Filter").'</td>';
|
||||
print '<td align="center" width="120"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
clearstatcache();
|
||||
|
||||
$var=true;
|
||||
foreach ($conf->dol_document_root as $dirroot)
|
||||
{
|
||||
$dir=$dirroot."/includes/modules/mailings/";
|
||||
$var=true;
|
||||
foreach ($conf->dol_document_root as $dirroot)
|
||||
{
|
||||
$dir=$dirroot."/includes/modules/mailings/";
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle=opendir($dir);
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle=opendir($dir);
|
||||
if ($handle)
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
if (eregi("(.*)\.modules\.php$",$file,$reg))
|
||||
{
|
||||
$modulename=$reg[1];
|
||||
if ($modulename == 'example') continue;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
if (eregi("(.*)\.modules\.php$",$file,$reg))
|
||||
{
|
||||
$modulename=$reg[1];
|
||||
if ($modulename == 'example') continue;
|
||||
|
||||
// Chargement de la classe
|
||||
$file = $dir.$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once($file);
|
||||
// Chargement de la classe
|
||||
$file = $dir.$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once($file);
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj = new $classname($db);
|
||||
|
||||
$qualified=1;
|
||||
foreach ($obj->require_module as $key)
|
||||
{
|
||||
if (! $conf->$key->enabled || (! $user->admin && $obj->require_admin))
|
||||
{
|
||||
$qualified=0;
|
||||
//print "Les pr<70>requis d'activation du module mailing ne sont pas respect<63>s. Il ne sera pas actif";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$qualified=1;
|
||||
foreach ($obj->require_module as $key)
|
||||
{
|
||||
if (! $conf->$key->enabled || (! $user->admin && $obj->require_admin))
|
||||
{
|
||||
$qualified=0;
|
||||
//print "Les pr<70>requis d'activation du module mailing ne sont pas respect<63>s. Il ne sera pas actif";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Si le module mailing est qualifie
|
||||
if ($qualified)
|
||||
{
|
||||
$var = !$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
// Si le module mailing est qualifie
|
||||
if ($qualified)
|
||||
{
|
||||
$var = !$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
if ($mil->statut == 0) print '<form name="'.$modulename.'" action="cibles.php?action=add&rowid='.$mil->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
if ($mil->statut == 0) print '<form name="'.$modulename.'" action="cibles.php?action=add&rowid='.$mil->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
|
||||
print '<td>';
|
||||
if (! $obj->picto) $obj->picto='generic';
|
||||
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (! $obj->picto) $obj->picto='generic';
|
||||
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
|
||||
print '</td>';
|
||||
|
||||
/*
|
||||
print '<td width=\"100\">';
|
||||
print $modulename;
|
||||
print "</td>";
|
||||
*/
|
||||
$nbofrecipient=$obj->getNbOfRecipients();
|
||||
print '<td align="center">';
|
||||
if ($nbofrecipient >= 0)
|
||||
{
|
||||
print $nbofrecipient;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error").' '.img_error($obj->error);
|
||||
}
|
||||
print '</td>';
|
||||
/*
|
||||
print '<td width=\"100\">';
|
||||
print $modulename;
|
||||
print "</td>";
|
||||
*/
|
||||
$nbofrecipient=$obj->getNbOfRecipients();
|
||||
print '<td align="center">';
|
||||
if ($nbofrecipient >= 0)
|
||||
{
|
||||
print $nbofrecipient;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error").' '.img_error($obj->error);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="left">';
|
||||
$filter=$obj->formFilter();
|
||||
if ($filter) print $filter;
|
||||
else print $langs->trans("None");
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
$filter=$obj->formFilter();
|
||||
if ($filter) print $filter;
|
||||
else print $langs->trans("None");
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
//print $langs->trans("MailNoChangePossible");
|
||||
print " ";
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
//print $langs->trans("MailNoChangePossible");
|
||||
print " ";
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
if ($mil->statut == 0) print '</form>';
|
||||
if ($mil->statut == 0) print '</form>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
} // End foreach dir
|
||||
}
|
||||
} // End foreach dir
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<form action="cibles.php?action=clear&rowid='.$mil->id.'" method="POST">';
|
||||
print '<form action="cibles.php?action=clear&rowid='.$mil->id.'" method="POST">';
|
||||
print_titre($langs->trans("ToClearAllRecipientsClickHere"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("TargetsReset").'"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// List of selected targets
|
||||
// List of selected targets
|
||||
print "\n<!-- Liste destinataires selectionnes -->\n";
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="id" value="'.$mil->id.'">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="id" value="'.$mil->id.'">';
|
||||
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.statut, mc.date_envoi, mc.url";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.fk_mailing=".$mil->id;
|
||||
if ($search_nom) $sql.= " AND mc.nom like '%".addslashes($search_nom)."%'";
|
||||
if ($search_prenom) $sql.= " AND mc.prenom like '%".addslashes($search_prenom)."%'";
|
||||
if ($search_email) $sql.= " AND mc.email like '%".addslashes($search_email)."%'";
|
||||
if ($sortfield) { $sql .= " ORDER BY $sortfield $sortorder"; }
|
||||
$sql .= $db->plimit($conf->liste_limit+1, $offset);
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.statut, mc.date_envoi, mc.url";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.fk_mailing=".$mil->id;
|
||||
if ($search_nom) $sql.= " AND mc.nom like '%".addslashes($search_nom)."%'";
|
||||
if ($search_prenom) $sql.= " AND mc.prenom like '%".addslashes($search_prenom)."%'";
|
||||
if ($search_email) $sql.= " AND mc.email like '%".addslashes($search_email)."%'";
|
||||
if ($sortfield) { $sql .= " ORDER BY $sortfield $sortorder"; }
|
||||
$sql .= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$addu = "&id=".$mil->id;
|
||||
if ($search_nom) $addu.= "&search_nom=".urlencode($search_nom);
|
||||
if ($search_prenom) $addu.= "&search_prenom=".urlencode($search_prenom);
|
||||
if ($search_email) $addu.= "&search_email=".urlencode($search_email);
|
||||
$addu = "&id=".$mil->id;
|
||||
if ($search_nom) $addu.= "&search_nom=".urlencode($search_nom);
|
||||
if ($search_prenom) $addu.= "&search_prenom=".urlencode($search_prenom);
|
||||
if ($search_email) $addu.= "&search_email=".urlencode($search_email);
|
||||
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$addu,$sortfield,$sortorder,"",$num,$mil->nbemail,'');
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$addu,$sortfield,$sortorder,"",$num,$mil->nbemail,'');
|
||||
|
||||
if ($page) $addu.= "&page=".$page;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.nom",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.prenom",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$addu,"",'align="center"',$sortfield,$sortorder);
|
||||
if ($page) $addu.= "&page=".$page;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.nom",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.prenom",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$addu,"",'align="center"',$sortfield,$sortorder);
|
||||
|
||||
// Date
|
||||
if ($mil->statut < 2)
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"mc.date_envoi",$addu,'','align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
if ($mil->statut < 2)
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"mc.date_envoi",$addu,'','align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
|
||||
// Statut
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$addu,'','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$addu,'','align="right"',$sortfield,$sortorder);
|
||||
|
||||
print '</tr>';
|
||||
|
||||
// Ligne des champs de filtres
|
||||
print '<tr class="liste_titre">';
|
||||
// EMail
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_email" size="14" value="'.$search_email.'">';
|
||||
print '</td>';
|
||||
// Name
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_nom" size="12" value="'.$search_nom.'">';
|
||||
print '</td>';
|
||||
// Firstname
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_prenom" size="10" value="'.$search_prenom.'">';
|
||||
print '</td>';
|
||||
// Other
|
||||
print '<td class="liste_titre">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
// Url
|
||||
print '<td class="liste_titre" align="right" colspan="3">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">';
|
||||
print ' <input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" alt="'.$langs->trans("RemoveFilter").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = true;
|
||||
$i = 0;
|
||||
// Ligne des champs de filtres
|
||||
print '<tr class="liste_titre">';
|
||||
// EMail
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_email" size="14" value="'.$search_email.'">';
|
||||
print '</td>';
|
||||
// Name
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_nom" size="12" value="'.$search_nom.'">';
|
||||
print '</td>';
|
||||
// Firstname
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_prenom" size="10" value="'.$search_prenom.'">';
|
||||
print '</td>';
|
||||
// Other
|
||||
print '<td class="liste_titre">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
// Url
|
||||
print '<td class="liste_titre" align="right" colspan="3">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">';
|
||||
print ' <input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" alt="'.$langs->trans("RemoveFilter").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->nom.'</td>';
|
||||
print '<td>'.$obj->prenom.'</td>';
|
||||
print '<td>'.$obj->other.'</td>';
|
||||
print '<td align="center">'.$obj->url.'</td>';
|
||||
if ($num)
|
||||
{
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
// Statut pour l'email destinataire (Attentioon != statut du mailing)
|
||||
if ($obj->statut == 0)
|
||||
{
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="right">'.$langs->trans("MailingStatusNotSent").' <a href="cibles.php?action=delete&id='.$mil->id.'&rowid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveRecipient")).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">'.$obj->date_envoi.'</td>';
|
||||
print '<td align="right">';
|
||||
if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->nom.'</td>';
|
||||
print '<td>'.$obj->prenom.'</td>';
|
||||
print '<td>'.$obj->other.'</td>';
|
||||
print '<td align="center">'.$obj->url.'</td>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="7">'.$langs->trans("NoTargetYet").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
// Statut pour l'email destinataire (Attentioon != statut du mailing)
|
||||
if ($obj->statut == 0)
|
||||
{
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="right">'.$langs->trans("MailingStatusNotSent").' <a href="cibles.php?action=delete&id='.$mil->id.'&rowid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveRecipient")).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">'.$obj->date_envoi.'</td>';
|
||||
print '<td align="right">';
|
||||
if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="7">'.$langs->trans("NoTargetYet").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
print '</form>';
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
print "\n<!-- Fin liste destinataires selectionnes -->\n";
|
||||
|
||||
}
|
||||
|
||||
@ -769,6 +769,8 @@ class Contrat extends CommonObject
|
||||
if (! $qty) $qty=1;
|
||||
if (! $ventil) $ventil=0;
|
||||
if (! $info_bits) $info_bits=0;
|
||||
if (! $pu_ht) $pu_ht=0;
|
||||
if (! $pu_ttc) $pu_ttc=0;
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$txtva=price2num($txtva);
|
||||
|
||||
@ -26,10 +26,10 @@
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoi une version en chaine depuis une version en tableau
|
||||
\param versionarray Tableau de version (vermajeur,vermineur,autre)
|
||||
\return string Chaine version
|
||||
*/
|
||||
* \brief Renvoi une version en chaine depuis une version en tableau
|
||||
* \param versionarray Tableau de version (vermajeur,vermineur,autre)
|
||||
* \return string Chaine version
|
||||
*/
|
||||
function versiontostring($versionarray)
|
||||
{
|
||||
$string='?';
|
||||
|
||||
@ -1,135 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/lib/admin.lib.php
|
||||
* \brief Library of admin functions
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \brief Create a redirect form to paybox form
|
||||
* \return int 1 if OK, -1 if ERROR
|
||||
*/
|
||||
function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko="",$ID=0)
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
|
||||
dol_syslog("Paypal.lib::print_paybox_redirect", LOG_DEBUG);
|
||||
|
||||
|
||||
$IBS_DEVISE="978"; # Euro
|
||||
|
||||
$ModulePaybox="module_linux.cgi";
|
||||
if ($_SERVER["WINDIR"] && eregi("windows",$_SERVER["WINDIR"])) { $ModulePaybox="module_NT_2000.cgi"; }
|
||||
$URLPAYBOX=URL_ROOT.'/cgi-bin/'.$ModulePaybox;
|
||||
if ($conf->global->PAYBOX_CGI_URL) $URLPAYBOX=$conf->global->PAYBOX_CGI_URL;
|
||||
$IBS_SITE=$conf->global->PAYBOX_IBS_SITE;
|
||||
$IBS_RANG=$conf->global->PAYBOX_IBS_RANG;
|
||||
|
||||
if (empty($URLPAYBOX))
|
||||
{
|
||||
dol_print_error('',"Paybox setup param PAYBOX_CGI_URL not defined");
|
||||
return -1;
|
||||
}
|
||||
if (empty($IBS_SITE))
|
||||
{
|
||||
dol_print_error('',"Paybox setup param PAYBOX_IBS_SITE not defined");
|
||||
return -1;
|
||||
}
|
||||
if (empty($IBS_RANG))
|
||||
{
|
||||
dol_print_error('',"Paybox setup param PAYBOX_IBS_RANG not defined");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Value to use for test
|
||||
$IBS_SITE="1999888"; # Site test
|
||||
$IBS_RANG="99"; # Rang test
|
||||
|
||||
|
||||
dol_syslog("Paypal.lib::print_paybox_redirect PRICE: ".$PRICE, LOG_DEBUG);
|
||||
|
||||
// Definition des parametres vente produit pour paybox
|
||||
$IBS_CMD="DOL:SITE=dolibarr-ID=".$ID;
|
||||
$IBS_TOTAL=$PRICE*100; # En centimes
|
||||
|
||||
$IBS_MODE=1; # Mode formulaire
|
||||
|
||||
$IBS_PORTEUR=$EMAIL;
|
||||
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des paramètres du get de validation en reponse (url a definir sous paybox)
|
||||
$IBS_TXT="<center><b>Vous allez être envoyé vers la page de paiement sécurisé Paybox</b><br><i>Merci de patienter quelques secondes...</i><br></center>";
|
||||
$IBS_EFFECTUE=$urlok;
|
||||
$IBS_ANNULE=$urlko;
|
||||
$IBS_REFUSE=$urlko;
|
||||
$IBS_BOUTPI="Continuer";
|
||||
$IBS_BKGD="#FFFFFF";
|
||||
$IBS_WAIT="4000";
|
||||
$IBS_LANG="FRA";
|
||||
|
||||
dol_syslog("Soumission Paybox");
|
||||
dol_syslog("IBS_MODE: $IBS_MODE");
|
||||
dol_syslog("IBS_SITE: $IBS_SITE");
|
||||
dol_syslog("IBS_RANG: $IBS_RANG");
|
||||
dol_syslog("IBS_TOTAL: $IBS_TOTAL");
|
||||
dol_syslog("IBS_DEVISE: $IBS_DEVISE");
|
||||
dol_syslog("IBS_CMD: $IBS_CMD");
|
||||
dol_syslog("IBS_PORTEUR: $IBS_PORTEUR");
|
||||
dol_syslog("IBS_RETOUR: $IBS_RETOUR");
|
||||
dol_syslog("IBS_EFFECTUE: $IBS_EFFECTUE");
|
||||
dol_syslog("IBS_ANNULE: $IBS_ANNULE");
|
||||
dol_syslog("IBS_REFUSE: $IBS_REFUSE");
|
||||
dol_syslog("IBS_BKGD: $IBS_BKGD");
|
||||
dol_syslog("IBS_WAIT: $IBS_WAIT");
|
||||
dol_syslog("IBS_LANG: $IBS_LANG");
|
||||
|
||||
print '<html><body>';
|
||||
print "\n";
|
||||
print '<form action="'.$URLPAYBOX.'" NAME="Submit" method="POST">';
|
||||
print '<input type="hidden" name="IBS_MODE" value="'.$IBS_MODE.'">';
|
||||
print '<input type="hidden" name="IBS_SITE" value="'.$IBS_SITE.'">';
|
||||
print '<input type="hidden" name="IBS_RANG" value="'.$IBS_RANG.'">';
|
||||
print '<input type="hidden" name="IBS_TOTAL" value="'.$IBS_TOTAL.'">';
|
||||
print '<input type="hidden" name="IBS_DEVISE" value="'.$IBS_DEVISE.'">';
|
||||
print '<input type="hidden" name="IBS_CMD" value="'.$IBS_CMD.'">';
|
||||
print '<input type="hidden" name="IBS_PORTEUR" value="'.$IBS_PORTEUR.'">';
|
||||
print '<input type="hidden" name="IBS_RETOUR" value="'.$IBS_RETOUR.'">';
|
||||
print '<input type="hidden" name="IBS_EFFECTUE" value="'.$IBS_EFFECTUE.'">';
|
||||
print '<input type="hidden" name="IBS_ANNULE" value="'.$IBS_ANNULE.'">';
|
||||
print '<input type="hidden" name="IBS_REFUSE" value="'.$IBS_REFUSE.'">';
|
||||
print '<input type="hidden" name="IBS_TXT" value="'.$IBS_TXT.'">';
|
||||
print '<input type="hidden" name="IBS_BKGD" value="'.$IBS_BKGD.'">';
|
||||
print '<input type="hidden" name="IBS_WAIT" value="'.$IBS_WAIT.'">';
|
||||
print '<input type="hidden" name="IBS_LANG" value="'.$IBS_LANG.'">';
|
||||
print '</form>';
|
||||
print "\n";
|
||||
print '<script type="text/javascript" language="javascript">';
|
||||
print ' document.Submit.submit();';
|
||||
print '</script>';
|
||||
print "\n";
|
||||
print '</body></html>';
|
||||
print "\n";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -114,6 +114,7 @@ if ($mode == 'search')
|
||||
llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (isset($_POST["button_removefilter_x"]))
|
||||
@ -215,10 +216,10 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$params = "&socname=".$socname."&search_nom=".$search_nom."&search_ville=".$search_ville;
|
||||
@ -226,7 +227,7 @@ if ($result)
|
||||
$params.= '&search_idprof2='.$search_idprof2;
|
||||
$params.= '&search_idprof3='.$search_idprof3;
|
||||
$params.= '&search_idprof4='.$search_idprof4;
|
||||
|
||||
|
||||
print_barre_liste($title, $page, "societe.php",$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
$langs->load("other");
|
||||
@ -243,7 +244,7 @@ if ($result)
|
||||
}
|
||||
|
||||
print '<form method="post" action="societe.php" name="formfilter">';
|
||||
|
||||
|
||||
// Lignes des titres
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -292,12 +293,13 @@ if ($result)
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object();
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print "<a href=\"".DOL_URL_ROOT."/soc.php?socid=".$obj->rowid."\">";
|
||||
print img_object($langs->trans("ShowCompany"),"company");
|
||||
print "</a> <a href=\"".DOL_URL_ROOT."/soc.php?socid=".$obj->rowid."\">".$obj->nom."</a></td>\n";
|
||||
$companystatic->id=$obj->rowid;
|
||||
$companystatic->nom=$obj->nom;
|
||||
print $companystatic->getNomUrl(1,'',24);
|
||||
print "</td>\n";
|
||||
print "<td>".$obj->ville."</td>\n";
|
||||
print "<td>".$obj->idprof1."</td>\n";
|
||||
print "<td>".$obj->idprof2."</td>\n";
|
||||
@ -306,36 +308,36 @@ if ($result)
|
||||
print '<td align="center">';
|
||||
if ($obj->client==1)
|
||||
{
|
||||
print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=".$obj->rowid."\">".$langs->trans("Customer")."</a>\n";
|
||||
print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=".$obj->rowid."\">".$langs->trans("Customer")."</a>\n";
|
||||
}
|
||||
elseif ($obj->client==2)
|
||||
{
|
||||
print "<a href=\"".DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$obj->rowid."\">".$langs->trans("Prospect")."</a>\n";
|
||||
print "<a href=\"".DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$obj->rowid."\">".$langs->trans("Prospect")."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
print " ";
|
||||
}
|
||||
print "</td><td align=\"center\">";
|
||||
if ($obj->fournisseur)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '</td></tr>'."\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user