2018-10-31 20:10:20 +01:00
< ? php
2018-11-06 19:49:52 +01:00
/* Copyright ( C ) 2018 Laurent Destailleur < eldy @ users . sourceforge . net >
2018-10-31 20:10:20 +01:00
*
* 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 3 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
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2018-10-31 20:10:20 +01:00
*/
/**
2018-11-06 19:49:52 +01:00
* \file htdocs / admin / emailcollector_card . php
2018-10-31 20:10:20 +01:00
* \ingroup emailcollector
* \brief Page to create / edit / view emailcollector
*/
require '../main.inc.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/agenda.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/events.class.php' ;
2018-11-06 19:49:52 +01:00
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php' ;
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php' ;
include_once DOL_DOCUMENT_ROOT . '/emailcollector/class/emailcollector.class.php' ;
include_once DOL_DOCUMENT_ROOT . '/emailcollector/class/emailcollectorfilter.class.php' ;
2018-11-07 18:02:08 +01:00
include_once DOL_DOCUMENT_ROOT . '/emailcollector/class/emailcollectoraction.class.php' ;
2018-11-06 19:49:52 +01:00
include_once DOL_DOCUMENT_ROOT . '/emailcollector/lib/emailcollector.lib.php' ;
2018-10-31 20:10:20 +01:00
2019-05-09 12:31:51 +02:00
if ( ! $user -> admin ) accessforbidden ();
if ( empty ( $conf -> emailcollector -> enabled )) accessforbidden ();
2018-10-31 20:10:20 +01:00
2019-09-20 07:02:14 +02:00
// Load traductions files required by page
2018-11-07 16:33:06 +01:00
$langs -> loadLangs ( array ( " admin " , " mails " , " other " ));
2018-10-31 20:10:20 +01:00
// Get parameters
2019-11-07 12:59:59 +01:00
$id = GETPOST ( 'id' , 'int' );
2018-10-31 20:10:20 +01:00
$ref = GETPOST ( 'ref' , 'alpha' );
2019-11-07 12:59:59 +01:00
$action = GETPOST ( 'action' , 'aZ09' );
2018-10-31 20:10:20 +01:00
$confirm = GETPOST ( 'confirm' , 'alpha' );
$cancel = GETPOST ( 'cancel' , 'aZ09' );
2019-11-07 12:59:59 +01:00
$contextpage = GETPOST ( 'contextpage' , 'aZ' ) ? GETPOST ( 'contextpage' , 'aZ' ) : 'myobjectcard' ; // To manage different context of search
2018-10-31 20:10:20 +01:00
$backtopage = GETPOST ( 'backtopage' , 'alpha' );
2019-04-29 15:44:16 +02:00
$operationid = GETPOST ( 'operationid' , 'int' );
2018-10-31 20:10:20 +01:00
// Initialize technical objects
$object = new EmailCollector ( $db );
$extrafields = new ExtraFields ( $db );
2019-11-07 12:59:59 +01:00
$diroutputmassaction = $conf -> emailcollector -> dir_output . '/temp/massgeneration/' . $user -> id ;
2018-10-31 20:10:20 +01:00
$hookmanager -> initHooks ( array ( 'emailcollectorcard' )); // Note that conf->hooks_modules contains array
2019-09-28 10:55:09 +02:00
2018-10-31 20:10:20 +01:00
// Fetch optionals attributes and labels
2019-10-06 14:41:52 +02:00
$extrafields -> fetch_name_optionals_label ( $object -> table_element );
2019-09-28 10:55:09 +02:00
2018-11-07 12:49:17 +01:00
$search_array_options = $extrafields -> getOptionalsFromPost ( $object -> table_element , '' , 'search_' );
2018-10-31 20:10:20 +01:00
// Initialize array of search criterias
2020-08-28 21:27:50 +02:00
$search_all = GETPOST ( " search_all " , 'alpha' );
2018-10-31 20:10:20 +01:00
$search = array ();
foreach ( $object -> fields as $key => $val ) {
2019-11-07 12:59:59 +01:00
if ( GETPOST ( 'search_' . $key , 'alpha' )) $search [ $key ] = GETPOST ( 'search_' . $key , 'alpha' );
2018-10-31 20:10:20 +01:00
}
2019-04-29 15:44:16 +02:00
if ( GETPOST ( 'saveoperation2' )) $action = 'updateoperation' ;
2019-11-07 12:59:59 +01:00
if ( empty ( $action ) && empty ( $id ) && empty ( $ref )) $action = 'view' ;
2018-10-31 20:10:20 +01:00
// Load object
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php' ; // Must be include, not include_once.
2018-10-31 20:10:20 +01:00
// Security check - Protection if external user
2019-11-22 15:35:19 +01:00
//if ($user->socid > 0) accessforbidden();
2019-10-31 20:46:31 +01:00
//if ($user->socid > 0) $socid = $user->socid;
2018-10-31 20:10:20 +01:00
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
2019-11-07 12:59:59 +01:00
$permissionnote = $user -> rights -> emailcollector -> write ; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user -> rights -> emailcollector -> write ; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user -> rights -> emailcollector -> write ; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
2019-04-12 12:12:08 +02:00
2019-11-07 12:59:59 +01:00
$debuginfo = '' ;
2019-04-07 18:32:01 +02:00
2018-10-31 20:10:20 +01:00
/*
* Actions
*/
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
if ( empty ( $reshook ))
{
$error = 0 ;
2019-11-07 12:59:59 +01:00
$permissiontoadd = 1 ;
$permissiontodelete = 1 ;
2018-11-05 16:59:40 +01:00
if ( empty ( $backtopage )) $backtopage = DOL_URL_ROOT . '/admin/emailcollector_card.php?id=' . ( $id > 0 ? $id : '__ID__' );
$backurlforlist = DOL_URL_ROOT . '/admin/emailcollector_list.php' ;
2018-10-31 20:10:20 +01:00
// Actions cancel, add, update, delete or clone
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php' ;
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
// Actions when linking object each other
2019-04-12 12:12:08 +02:00
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php' ;
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
// Actions when printing a doc from card
include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php' ;
}
2019-01-27 11:55:16 +01:00
if ( GETPOST ( 'addfilter' , 'alpha' ))
2018-11-07 16:33:06 +01:00
{
$emailcollectorfilter = new EmailCollectorFilter ( $db );
2019-09-24 14:20:29 +02:00
$emailcollectorfilter -> type = GETPOST ( 'filtertype' , 'aZ09' );
2018-11-07 16:33:06 +01:00
$emailcollectorfilter -> rulevalue = GETPOST ( 'rulevalue' , 'alpha' );
$emailcollectorfilter -> fk_emailcollector = $object -> id ;
2018-11-07 18:02:08 +01:00
$emailcollectorfilter -> status = 1 ;
2018-11-07 16:33:06 +01:00
$result = $emailcollectorfilter -> create ( $user );
if ( $result > 0 )
{
$object -> fetchFilters ();
2020-05-21 09:35:30 +02:00
} else {
2018-11-07 16:33:06 +01:00
setEventMessages ( $emailcollectorfilter -> errors , $emailcollectorfilter -> error , 'errors' );
}
}
2018-11-05 20:29:07 +01:00
2018-11-07 18:02:08 +01:00
if ( $action == 'deletefilter' )
{
$emailcollectorfilter = new EmailCollectorFilter ( $db );
2019-01-27 11:55:16 +01:00
$emailcollectorfilter -> fetch ( GETPOST ( 'filterid' , 'int' ));
2018-11-07 18:02:08 +01:00
$result = $emailcollectorfilter -> delete ( $user );
if ( $result > 0 )
{
$object -> fetchFilters ();
2020-05-21 09:35:30 +02:00
} else {
2018-11-07 18:02:08 +01:00
setEventMessages ( $emailcollectorfilter -> errors , $emailcollectorfilter -> error , 'errors' );
}
}
2019-01-27 11:55:16 +01:00
if ( GETPOST ( 'addoperation' , 'alpha' ))
2018-11-07 18:02:08 +01:00
{
$emailcollectoroperation = new EmailCollectorAction ( $db );
2019-09-24 14:20:29 +02:00
$emailcollectoroperation -> type = GETPOST ( 'operationtype' , 'aZ09' );
2018-11-16 16:55:53 +01:00
$emailcollectoroperation -> actionparam = GETPOST ( 'operationparam' , 'none' );
2018-11-07 18:02:08 +01:00
$emailcollectoroperation -> fk_emailcollector = $object -> id ;
$emailcollectoroperation -> status = 1 ;
2018-11-19 14:25:34 +01:00
$emailcollectoroperation -> position = 50 ;
2018-11-07 18:02:08 +01:00
$result = $emailcollectoroperation -> create ( $user );
if ( $result > 0 )
{
$object -> fetchActions ();
2020-05-21 09:35:30 +02:00
} else {
2018-11-07 18:02:08 +01:00
setEventMessages ( $emailcollectoroperation -> errors , $emailcollectoroperation -> error , 'errors' );
}
}
2019-04-29 15:44:16 +02:00
if ( $action == 'updateoperation' )
{
2020-09-07 10:18:17 +02:00
$emailcollectoroperation = new EmailCollectorAction ( $db );
$emailcollectoroperation -> fetch ( GETPOST ( 'rowidoperation2' , 'int' ));
2019-04-29 15:44:16 +02:00
2020-09-07 10:18:17 +02:00
$emailcollectoroperation -> actionparam = GETPOST ( 'operationparam2' , 'none' );
2019-04-29 15:44:16 +02:00
2020-09-07 10:18:17 +02:00
$result = $emailcollectoroperation -> update ( $user );
2019-04-29 15:44:16 +02:00
2020-09-07 10:18:17 +02:00
if ( $result > 0 )
{
$object -> fetchActions ();
} else {
setEventMessages ( $emailcollectoroperation -> errors , $emailcollectoroperation -> error , 'errors' );
}
2019-04-29 15:44:16 +02:00
}
2018-11-07 18:02:08 +01:00
if ( $action == 'deleteoperation' )
{
$emailcollectoroperation = new EmailCollectorAction ( $db );
2019-01-27 11:55:16 +01:00
$emailcollectoroperation -> fetch ( GETPOST ( 'operationid' , 'int' ));
2018-11-07 18:02:08 +01:00
$result = $emailcollectoroperation -> delete ( $user );
if ( $result > 0 )
{
$object -> fetchActions ();
2020-05-21 09:35:30 +02:00
} else {
2018-11-07 18:02:08 +01:00
setEventMessages ( $emailcollectoroperation -> errors , $emailcollectoroperation -> error , 'errors' );
}
}
2018-11-09 18:18:17 +01:00
if ( $action == 'confirm_collect' )
{
dol_include_once ( '/emailcollector/class/emailcollector.class.php' );
2018-11-09 19:30:44 +01:00
$res = $object -> doCollectOneCollector ();
if ( $res > 0 )
2018-11-09 18:18:17 +01:00
{
2020-09-07 10:18:17 +02:00
$debuginfo = $object -> debuginfo ;
setEventMessages ( $object -> lastresult , null , 'mesgs' );
2020-05-21 09:35:30 +02:00
} else {
2020-09-07 10:18:17 +02:00
$debuginfo = $object -> debuginfo ;
setEventMessages ( $object -> error , null , 'errors' );
2018-11-09 18:18:17 +01:00
}
$action = '' ;
}
2018-11-05 20:29:07 +01:00
2018-10-31 20:10:20 +01:00
/*
* View
*/
$form = new Form ( $db );
$formfile = new FormFile ( $db );
2020-04-10 10:59:32 +02:00
$help_url = " EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électronique|ES:Module_EMail_Collector " ;
2020-02-27 18:26:38 +01:00
llxHeader ( '' , 'EmailCollector' , $help_url );
2018-10-31 20:10:20 +01:00
// Example : Adding jquery code
print ' < script type = " text/javascript " language = " javascript " >
jQuery ( document ) . ready ( function () {
function init_myfunc ()
{
jQuery ( " #myid " ) . removeAttr ( \ ' disabled\ ' );
jQuery ( " #myid " ) . attr ( \ ' disabled\ ' , \ ' disabled\ ' );
}
init_myfunc ();
jQuery ( " #mybutton " ) . click ( function () {
init_myfunc ();
});
});
</ script > ' ;
// Part to create
if ( $action == 'create' ) {
print load_fiche_titre ( $langs -> trans ( " NewEmailCollector " , $langs -> transnoentitiesnoconv ( " EmailCollector " )));
2019-11-07 12:59:59 +01:00
print '<form method="POST" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
2019-12-18 23:12:31 +01:00
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
2018-10-31 20:10:20 +01:00
print '<input type="hidden" name="action" value="add">' ;
2019-11-07 12:59:59 +01:00
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">' ;
2018-10-31 20:10:20 +01:00
dol_fiche_head ( array (), '' );
2019-11-01 15:53:57 +01:00
print '<table class="border centpercent tableforfield">' . " \n " ;
2018-10-31 20:10:20 +01:00
2018-11-05 17:53:31 +01:00
//unset($fields[]);
2018-10-31 20:10:20 +01:00
// Common attributes
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php' ;
2018-10-31 20:10:20 +01:00
// Other attributes
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php' ;
2018-10-31 20:10:20 +01:00
print '</table>' . " \n " ;
dol_fiche_end ();
print '<div class="center">' ;
2019-11-07 12:59:59 +01:00
print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag ( $langs -> trans ( " Create " )) . '">' ;
2018-10-31 20:10:20 +01:00
print ' ' ;
2019-11-07 12:59:59 +01:00
print '<input type="' . ( $backtopage ? " submit " : " button " ) . '" class="button" name="cancel" value="' . dol_escape_htmltag ( $langs -> trans ( " Cancel " )) . '"' . ( $backtopage ? '' : ' onclick="javascript:history.go(-1)"' ) . '>' ; // Cancel for create does not post form if we don't know the backtopage
2018-10-31 20:10:20 +01:00
print '</div>' ;
print '</form>' ;
}
// Part to edit record
if (( $id || $ref ) && $action == 'edit' )
{
print load_fiche_titre ( $langs -> trans ( " EmailCollector " ));
2019-11-07 12:59:59 +01:00
print '<form method="POST" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
2019-12-18 23:12:31 +01:00
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
2018-10-31 20:10:20 +01:00
print '<input type="hidden" name="action" value="update">' ;
2019-11-07 12:59:59 +01:00
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2018-10-31 20:10:20 +01:00
dol_fiche_head ();
2019-11-07 12:59:59 +01:00
print '<table class="border centpercent tableforfield">' . " \n " ;
2018-10-31 20:10:20 +01:00
// Common attributes
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php' ;
2018-10-31 20:10:20 +01:00
// Other attributes
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php' ;
2018-10-31 20:10:20 +01:00
print '</table>' ;
dol_fiche_end ();
2019-11-07 12:59:59 +01:00
print '<div class="center"><input type="submit" class="button" name="save" value="' . $langs -> trans ( " Save " ) . '">' ;
print ' <input type="submit" class="button" name="cancel" value="' . $langs -> trans ( " Cancel " ) . '">' ;
2018-10-31 20:10:20 +01:00
print '</div>' ;
print '</form>' ;
}
// Part to show record
if ( $object -> id > 0 && ( empty ( $action ) || ( $action != 'edit' && $action != 'create' )))
{
$res = $object -> fetch_optionals ();
2018-11-06 19:49:52 +01:00
$object -> fetchFilters ();
$object -> fetchActions ();
2018-10-31 20:10:20 +01:00
$head = emailcollectorPrepareHead ( $object );
2020-08-21 01:28:40 +02:00
dol_fiche_head ( $head , 'card' , $langs -> trans ( " EmailCollector " ), - 1 , 'email' );
2018-10-31 20:10:20 +01:00
$formconfirm = '' ;
// Confirmation to delete
if ( $action == 'delete' )
{
2019-11-07 12:59:59 +01:00
$formconfirm = $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id , $langs -> trans ( 'DeleteEmailCollector' ), $langs -> trans ( 'ConfirmDeleteEmailCollector' ), 'confirm_delete' , '' , 0 , 1 );
2018-10-31 20:10:20 +01:00
}
// Clone confirmation
if ( $action == 'clone' ) {
// Create an array for form
$formquestion = array ();
2019-11-07 12:59:59 +01:00
$formconfirm = $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id , $langs -> trans ( 'ToClone' ), $langs -> trans ( 'ConfirmCloneEmailCollector' , $object -> ref ), 'confirm_clone' , $formquestion , 'yes' , 1 );
2018-10-31 20:10:20 +01:00
}
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
// Confirmation of action process
if ( $action == 'collect' ) {
$formquestion = array (
'text' => $langs -> trans ( " EmailCollectorConfirmCollect " ),
);
2019-11-07 12:59:59 +01:00
$formconfirm = $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id , $langs -> trans ( 'EmailCollectorConfirmCollectTitle' ), $text , 'confirm_collect' , $formquestion , 0 , 1 , 220 );
2018-10-31 20:10:20 +01:00
}
// Call Hook formConfirm
2020-01-28 12:00:27 +01:00
$parameters = array ( 'formConfirm' => $formconfirm , 'lineid' => $lineid );
2018-10-31 20:10:20 +01:00
$reshook = $hookmanager -> executeHooks ( 'formConfirm' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
2019-11-07 12:59:59 +01:00
if ( empty ( $reshook )) $formconfirm .= $hookmanager -> resPrint ;
elseif ( $reshook > 0 ) $formconfirm = $hookmanager -> resPrint ;
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
// Print form confirm
print $formconfirm ;
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
// Object card
// ------------------------------------------------------------
2019-11-07 12:59:59 +01:00
$linkback = '<a href="' . dol_buildpath ( '/admin/emailcollector_list.php' , 1 ) . '?restore_lastsearch_values=1' . ( ! empty ( $socid ) ? '&socid=' . $socid : '' ) . '">' . $langs -> trans ( " BackToList " ) . '</a>' ;
2018-10-31 20:10:20 +01:00
$morehtmlref = '<div class="refidno">' ;
/*
// Ref bis
$morehtmlref .= $form -> editfieldkey ( " RefBis " , 'ref_client' , $object -> ref_client , $object , $user -> rights -> emailcollector -> creer , 'string' , '' , 0 , 1 );
$morehtmlref .= $form -> editfieldval ( " RefBis " , 'ref_client' , $object -> ref_client , $object , $user -> rights -> emailcollector -> creer , 'string' , '' , null , null , '' , 1 );
// Thirdparty
$morehtmlref .= '<br>' . $langs -> trans ( 'ThirdParty' ) . ' : ' . $soc -> getNomUrl ( 1 );
// Project
if ( ! empty ( $conf -> projet -> enabled ))
{
$langs -> load ( " projects " );
$morehtmlref .= '<br>' . $langs -> trans ( 'Project' ) . ' ' ;
if ( $user -> rights -> emailcollector -> creer )
{
if ( $action != 'classify' )
{
2019-10-06 15:34:22 +02:00
$morehtmlref .= '<a class="editfielda" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=classify&id=' . $object -> id . '">' . img_edit ( $langs -> transnoentitiesnoconv ( 'SetProject' )) . '</a> : ' ;
2018-10-31 20:10:20 +01:00
if ( $action == 'classify' ) {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '<form method="post" action="' . $_SERVER [ 'PHP_SELF' ] . '?id=' . $object -> id . '">' ;
$morehtmlref .= '<input type="hidden" name="action" value="classin">' ;
2019-12-18 23:12:31 +01:00
$morehtmlref .= '<input type="hidden" name="token" value="' . newToken () . '">' ;
2018-10-31 20:10:20 +01:00
$morehtmlref .= $formproject -> select_projects ( $object -> socid , $object -> fk_project , 'projectid' , $maxlength , 0 , 1 , 0 , 1 , 0 , 0 , '' , 1 );
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs -> trans ( " Modify " ) . '">' ;
$morehtmlref .= '</form>' ;
} else {
$morehtmlref .= $form -> form_project ( $_SERVER [ 'PHP_SELF' ] . '?id=' . $object -> id , $object -> socid , $object -> fk_project , 'none' , 0 , 0 , 0 , 1 );
}
}
} else {
if ( ! empty ( $object -> fk_project )) {
$proj = new Project ( $db );
$proj -> fetch ( $object -> fk_project );
$morehtmlref .= '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $object -> fk_project . '" title="' . $langs -> trans ( 'ShowProject' ) . '">' ;
$morehtmlref .= $proj -> ref ;
$morehtmlref .= '</a>' ;
} else {
$morehtmlref .= '' ;
}
}
}
*/
$morehtmlref .= '</div>' ;
2018-11-09 18:18:17 +01:00
$morehtml = $langs -> trans ( " NbOfEmailsInInbox " ) . ' : ' ;
$sourcedir = $object -> source_directory ;
2019-11-07 12:59:59 +01:00
$targetdir = ( $object -> target_directory ? $object -> target_directory : '' ); // Can be '[Gmail]/Trash' or 'mytag'
2018-11-09 18:18:17 +01:00
2018-12-06 21:40:51 +01:00
$connection = null ;
$connectstringserver = '' ;
$connectstringsource = '' ;
$connectstringtarget = '' ;
2019-01-03 11:47:27 +01:00
2018-12-06 21:40:51 +01:00
if ( function_exists ( 'imap_open' ))
{
$connectstringserver = $object -> getConnectStringIMAP ();
2018-11-09 18:18:17 +01:00
2019-11-21 18:51:26 +01:00
try {
2019-11-21 19:12:25 +01:00
if ( $sourcedir ) {
//$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
$connectstringsource = $connectstringserver . $object -> getEncodedUtf7 ( $sourcedir );
}
if ( $targetdir ) {
//$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
$connectstringtarget = $connectstringserver . $object -> getEncodedUtf7 ( $targetdir );
}
2019-11-21 18:51:26 +01:00
$connection = imap_open ( $connectstringsource , $object -> login , $object -> password );
2020-05-21 09:35:30 +02:00
} catch ( Exception $e )
2019-11-21 18:51:26 +01:00
{
print $e -> getMessage ();
}
2019-11-21 20:07:22 +01:00
$morehtml .= $form -> textwithpicto ( '' , 'connect string ' . $connectstringserver );
2020-05-21 09:35:30 +02:00
} else {
2018-12-06 21:40:51 +01:00
$morehtml .= 'IMAP functions not available on your PHP' ;
}
2019-01-03 11:47:27 +01:00
2019-11-07 12:59:59 +01:00
if ( ! $connection )
2018-11-09 18:18:17 +01:00
{
$morehtml .= 'Failed to open IMAP connection ' . $connectstringsource ;
2020-05-21 09:35:30 +02:00
} else {
2018-11-09 18:18:17 +01:00
$morehtml .= imap_num_msg ( $connection );
}
2018-12-06 21:40:51 +01:00
if ( $connection )
{
imap_close ( $connection );
}
2019-01-03 11:47:27 +01:00
2018-11-09 18:18:17 +01:00
dol_banner_tab ( $object , 'ref' , $linkback , 1 , 'ref' , 'ref' , $morehtmlref . '<div class="refidno">' . $morehtml . '</div>' , '' , 0 , '' , '' , 0 , '' );
2018-10-31 20:10:20 +01:00
print '<div class="fichecenter">' ;
print '<div class="fichehalfleft">' ;
print '<div class="underbanner clearboth"></div>' ;
2019-11-01 15:53:57 +01:00
print '<table class="border centpercent tableforfield">' . " \n " ;
2018-10-31 20:10:20 +01:00
// Common attributes
//$keyforbreak='fieldkeytoswithonsecondcolumn';
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php' ;
2018-10-31 20:10:20 +01:00
// Other attributes
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php' ;
2018-10-31 20:10:20 +01:00
print '</table>' ;
2018-11-07 16:33:06 +01:00
2019-11-07 12:59:59 +01:00
print '<form method="POST" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
2019-12-18 23:12:31 +01:00
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
2018-11-07 16:33:06 +01:00
print '<input type="hidden" name="action" value="updatefiltersactions">' ;
2019-11-07 12:59:59 +01:00
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2018-11-07 16:33:06 +01:00
2018-11-06 19:49:52 +01:00
// Filters
2020-08-31 19:21:33 +02:00
print '<div class="div-table-responsive">' ;
2020-03-20 11:49:00 +01:00
print '<table class="border centpercent tableforfield">' ;
2018-11-06 19:49:52 +01:00
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " Filters " ) . '</td><td></td><td></td>' ;
print '</tr>' ;
// Add filter
print '<tr class="oddeven">' ;
print '<td>' ;
2019-11-07 12:59:59 +01:00
$arrayoftypes = array (
2020-09-07 10:18:17 +02:00
'from' => array ( 'label' => 'MailFrom' , 'data-placeholder' => $langs -> trans ( 'SearchString' )),
'to' => array ( 'label' => 'MailTo' , 'data-placeholder' => $langs -> trans ( 'SearchString' )),
'cc' => array ( 'label' => 'Cc' , 'data-placeholder' => $langs -> trans ( 'SearchString' )),
'bcc' => array ( 'label' => 'Bcc' , 'data-placeholder' => $langs -> trans ( 'SearchString' )),
'subject' => array ( 'label' => 'Subject' , 'data-placeholder' => $langs -> trans ( 'SearchString' )),
'body' => array ( 'label' => 'Body' , 'data-placeholder' => $langs -> trans ( 'SearchString' )),
// disabled because PHP imap_search is not compatible IMAPv4, only IMAPv2
//'header'=>array('label'=>'Header', 'data-placeholder'=>'HeaderKey SearchString'), // HEADER key value
//'X1'=>'---',
//'notinsubject'=>array('label'=>'SubjectNotIn', 'data-placeholder'=>'SearchString'),
//'notinbody'=>array('label'=>'BodyNotIn', 'data-placeholder'=>'SearchString'),
'X2' => '---' ,
'seen' => array ( 'label' => 'AlreadyRead' , 'data-noparam' => 1 ),
'unseen' => array ( 'label' => 'NotRead' , 'data-noparam' => 1 ),
'unanswered' => array ( 'label' => 'Unanswered' , 'data-noparam' => 1 ),
'answered' => array ( 'label' => 'Answered' , 'data-noparam' => 1 ),
'smaller' => array ( 'label' => 'SmallerThan' , 'data-placeholder' => $langs -> trans ( 'NumberOfBytes' )),
'larger' => array ( 'label' => 'LargerThan' , 'data-placeholder' => $langs -> trans ( 'NumberOfBytes' )),
'X3' => '---' ,
'withtrackingid' => array ( 'label' => 'WithDolTrackingID' , 'data-noparam' => 1 ),
'withouttrackingid' => array ( 'label' => 'WithoutDolTrackingID' , 'data-noparam' => 1 ),
2020-08-20 20:16:38 +02:00
'X4' => '---' ,
'isnotanswer' => array ( 'label' => 'IsNotAnAnswer' , 'data-noparam' => 1 ),
'isanswer' => array ( 'label' => 'IsAnAnswer' , 'data-noparam' => 1 )
2019-03-26 19:15:18 +01:00
);
2020-08-31 19:21:33 +02:00
print $form -> selectarray ( 'filtertype' , $arrayoftypes , '' , 1 , 0 , 0 , '' , 1 , 0 , 0 , '' , 'maxwidth500' , 0 , '' , 2 );
2019-04-07 18:32:01 +02:00
print " \n " ;
print '<script>' ;
print ' jQuery ( " #filtertype " ) . change ( function () {
console . log ( " We change a filter " );
if ( jQuery ( " #filtertype option:selected " ) . attr ( " data-noparam " )) {
jQuery ( " #rulevalue " ) . attr ( " placeholder " , " " );
jQuery ( " #rulevalue " ) . text ( " " ); jQuery ( " #rulevalue " ) . prop ( " disabled " , true );
}
else { jQuery ( " #rulevalue " ) . prop ( " disabled " , false ); }
jQuery ( " #rulevalue " ) . attr ( " placeholder " , ( jQuery ( " #filtertype option:selected " ) . attr ( " data-placeholder " )));
' ;
2019-11-21 18:39:41 +01:00
/* $noparam = array ();
2019-11-07 12:59:59 +01:00
foreach ( $arrayoftypes as $key => $value )
2019-04-07 18:32:01 +02:00
{
2019-11-07 12:59:59 +01:00
if ( $value [ 'noparam' ]) $noparam [] = $key ;
2019-11-21 18:39:41 +01:00
} */
2019-04-07 18:32:01 +02:00
print '})' ;
print '</script>' . " \n " ;
2018-11-06 19:49:52 +01:00
print '</td><td>' ;
2019-04-07 18:32:01 +02:00
print '<input type="text" name="rulevalue" id="rulevalue">' ;
2018-11-06 19:49:52 +01:00
print '</td>' ;
2019-01-22 11:46:12 +01:00
print '<td class="right"><input type="submit" name="addfilter" id="addfilter" class="flat button" value="' . $langs -> trans ( " Add " ) . '"></td>' ;
2018-11-06 19:49:52 +01:00
print '</tr>' ;
// List filters
2019-11-07 12:59:59 +01:00
foreach ( $object -> filters as $rulefilter )
2018-11-06 19:49:52 +01:00
{
2019-11-07 12:59:59 +01:00
$rulefilterobj = new EmailCollectorFilter ( $db );
2018-11-06 19:49:52 +01:00
$rulefilterobj -> fetch ( $rulefilter [ 'id' ]);
print '<tr class="oddeven">' ;
2018-11-07 18:02:08 +01:00
print '<td>' ;
2019-04-07 18:32:01 +02:00
print $langs -> trans ( $arrayoftypes [ $rulefilter [ 'type' ]][ 'label' ]);
2018-11-07 18:02:08 +01:00
print '</td>' ;
2018-11-06 19:49:52 +01:00
print '<td>' . $rulefilter [ 'rulevalue' ] . '</td>' ;
2019-01-22 11:46:12 +01:00
print '<td class="right">' ;
2018-11-07 18:02:08 +01:00
print ' <a href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=deletefilter&filterid=' . $rulefilter [ 'id' ] . '">' . img_delete () . '</a>' ;
print '</td>' ;
2018-11-06 19:49:52 +01:00
print '</tr>' ;
}
print '</tr>' ;
print '</table>' ;
2020-08-31 19:21:33 +02:00
print '</div>' ;
2018-11-06 19:49:52 +01:00
print '<div class="clearboth"></div><br>' ;
// Operations
2020-08-31 19:21:33 +02:00
print '<div class="div-table-responsive">' ;
2020-03-20 11:49:00 +01:00
print '<table id="tablelines" class="noborder noshadow tableforfield">' ;
2018-11-06 19:49:52 +01:00
print '<tr class="liste_titre">' ;
2018-11-15 19:58:06 +01:00
print '<td>' . $langs -> trans ( " EmailcollectorOperations " ) . '</td><td></td><td></td><td></td>' ;
2018-11-06 19:49:52 +01:00
print '</tr>' ;
// Add operation
print '<tr class="oddeven">' ;
print '<td>' ;
2019-11-07 12:59:59 +01:00
$arrayoftypes = array (
2020-09-07 10:18:17 +02:00
'loadthirdparty' => $langs -> trans ( 'LoadThirdPartyFromName' , $langs -> transnoentities ( " ThirdPartyName " )),
'loadandcreatethirdparty' => $langs -> trans ( 'LoadThirdPartyFromNameOrCreate' , $langs -> transnoentities ( " ThirdPartyName " )),
'recordevent' => 'RecordEvent' );
2019-11-07 12:59:59 +01:00
if ( $conf -> projet -> enabled ) $arrayoftypes [ 'project' ] = 'CreateLeadAndThirdParty' ;
if ( $conf -> ticket -> enabled ) $arrayoftypes [ 'ticket' ] = 'CreateTicketAndThirdParty' ;
2020-08-21 13:00:12 +02:00
if ( $conf -> recruitment -> enabled ) $arrayoftypes [ 'candidature' ] = 'CreateCandidature' ;
2020-02-26 08:20:08 +01:00
// support hook for add action
2020-04-10 10:59:32 +02:00
$parameters = array ( 'arrayoftypes' => $arrayoftypes );
2020-02-26 08:15:49 +01:00
$res = $hookmanager -> executeHooks ( 'addMoreActionsEmailCollector' , $parameters , $object , $action );
2020-02-26 08:20:08 +01:00
2020-04-10 10:59:32 +02:00
if ( $res )
2020-02-26 08:20:08 +01:00
$arrayoftypes = $hookmanager -> resArray ;
2020-05-21 01:41:27 +02:00
else foreach ( $hookmanager -> resArray as $k => $desc )
2020-04-10 10:59:32 +02:00
$arrayoftypes [ $k ] = $desc ;
2020-02-26 08:20:08 +01:00
2019-04-25 17:37:54 +02:00
print $form -> selectarray ( 'operationtype' , $arrayoftypes , '' , 1 , 0 , 0 , '' , 1 , 0 , 0 , '' , 'maxwidth300' );
2018-11-06 19:49:52 +01:00
print '</td><td>' ;
print '<input type="text" name="operationparam">' ;
2020-08-20 20:16:38 +02:00
print '</td>' ;
print '<td>' ;
2019-11-07 12:59:59 +01:00
$htmltext = $langs -> transnoentitiesnoconv ( " OperationParamDesc " );
2020-05-14 14:10:04 +02:00
print $form -> textwithpicto ( '' , $htmltext , 1 , 'help' , '' , 0 , 2 , 'operationparamtt' );
2018-11-06 19:49:52 +01:00
print '</td>' ;
2019-01-22 11:46:12 +01:00
print '<td class="right"><input type="submit" name="addoperation" id="addoperation" class="flat button" value="' . $langs -> trans ( " Add " ) . '"></td>' ;
2018-11-06 19:49:52 +01:00
print '</tr>' ;
// List operations
2018-11-15 19:58:06 +01:00
$nboflines = count ( $object -> actions );
$table_element_line = 'emailcollector_emailcollectoraction' ;
2019-11-07 12:59:59 +01:00
$fk_element = 'position' ;
$i = 0 ;
foreach ( $object -> actions as $ruleaction )
2018-11-06 19:49:52 +01:00
{
2019-11-07 12:59:59 +01:00
$ruleactionobj = new EmailcollectorAction ( $db );
2018-11-06 19:49:52 +01:00
$ruleactionobj -> fetch ( $ruleaction [ 'id' ]);
2018-11-15 19:58:06 +01:00
print '<tr class="drag drop oddeven" id="row-' . $ruleaction [ 'id' ] . '">' ;
2018-11-07 18:02:08 +01:00
print '<td>' ;
2020-01-13 12:10:20 +01:00
print '<!-- type of action: ' . $ruleaction [ 'type' ] . ' -->' ;
2018-11-07 18:02:08 +01:00
print $langs -> trans ( $arrayoftypes [ $ruleaction [ 'type' ]]);
2019-04-07 18:32:01 +02:00
if ( in_array ( $ruleaction [ 'type' ], array ( 'recordevent' )))
{
2020-09-07 10:18:17 +02:00
print $form -> textwithpicto ( '' , $langs -> transnoentitiesnoconv ( 'IfTrackingIDFoundEventWillBeLinked' ));
2020-05-21 09:35:30 +02:00
} elseif ( in_array ( $ruleaction [ 'type' ], array ( 'loadthirdparty' , 'loadandcreatethirdparty' ))) {
2020-01-13 12:10:20 +01:00
print $form -> textwithpicto ( '' , $langs -> transnoentitiesnoconv ( 'EmailCollectorLoadThirdPartyHelp' ));
}
2018-11-07 18:02:08 +01:00
print '</td>' ;
2020-01-13 12:10:20 +01:00
print '<td class="wordbreak">' ;
2019-04-29 15:44:16 +02:00
if ( $action == 'editoperation' && $ruleaction [ 'id' ] == $operationid )
{
2020-09-07 10:18:17 +02:00
print '<input type="text" class="quatrevingtquinzepercent" name="operationparam2" value="' . $ruleaction [ 'actionparam' ] . '"><br>' ;
print '<input type="hidden" name="rowidoperation2" value="' . $ruleaction [ 'id' ] . '"><br>' ;
print '<input type="submit" class="button" name="saveoperation2" value="' . $langs -> trans ( " Save " ) . '"> <input type="submit" class="button" name="cancel" value="' . $langs -> trans ( " Cancel " ) . '">' ;
2020-05-21 09:35:30 +02:00
} else {
2020-09-07 10:18:17 +02:00
print $ruleaction [ 'actionparam' ];
2019-04-29 15:44:16 +02:00
}
print '</td>' ;
2019-04-09 13:23:30 +02:00
// Move up/down
2018-11-15 19:58:06 +01:00
print '<td class="center linecolmove tdlineupdown">' ;
if ( $i > 0 )
{
print '<a class="lineupdown" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=up&rowid=' . $ruleaction [ 'id' ] . '">' . img_up ( 'default' , 0 , 'imgupforline' ) . '</a>' ;
}
2019-11-07 12:59:59 +01:00
if ( $i < count ( $object -> actions ) - 1 ) {
2018-11-15 19:58:06 +01:00
print '<a class="lineupdown" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=down&rowid=' . $ruleaction [ 'id' ] . '">' . img_down ( 'default' , 0 , 'imgdownforline' ) . '</a>' ;
}
print '</td>' ;
2019-04-09 13:23:30 +02:00
// Delete
2019-05-21 15:50:16 +02:00
print '<td class="right nowraponall">' ;
2020-05-14 14:10:04 +02:00
print '<a class="editfielda marginrightonly" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=editoperation&operationid=' . $ruleaction [ 'id' ] . '">' . img_edit () . '</a>' ;
2019-04-09 13:23:30 +02:00
print ' <a href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=deleteoperation&operationid=' . $ruleaction [ 'id' ] . '">' . img_delete () . '</a>' ;
print '</td>' ;
2018-11-06 19:49:52 +01:00
print '</tr>' ;
2018-11-15 19:58:06 +01:00
$i ++ ;
2018-11-06 19:49:52 +01:00
}
print '</tr>' ;
print '</table>' ;
2020-08-31 19:21:33 +02:00
print '</div>' ;
2018-11-06 19:49:52 +01:00
2019-11-07 12:59:59 +01:00
if ( ! empty ( $conf -> use_javascript_ajax )) {
2020-09-07 10:18:17 +02:00
$urltorefreshaftermove = DOL_URL_ROOT . '/admin/emailcollector_card.php?id=' . $id ;
2019-11-07 12:59:59 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php' ;
2018-11-15 19:58:06 +01:00
}
2018-11-07 16:33:06 +01:00
print '</form>' ;
2018-11-06 19:49:52 +01:00
2018-10-31 20:10:20 +01:00
print '</div>' ;
2019-11-07 12:59:59 +01:00
print '</div>' ; // End <div class="fichecenter">
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
print '<div class="clearboth"></div><br>' ;
dol_fiche_end ();
// Buttons for actions
if ( $action != 'presend' && $action != 'editline' ) {
2019-11-07 12:59:59 +01:00
print '<div class="tabsAction">' . " \n " ;
2018-10-31 20:10:20 +01:00
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'addMoreActionsButtons' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
if ( $reshook < 0 ) setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
2018-11-05 16:42:29 +01:00
2018-10-31 20:10:20 +01:00
if ( empty ( $reshook ))
{
2020-08-27 18:27:05 +02:00
// Edit
2019-11-07 12:59:59 +01:00
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=edit">' . $langs -> trans ( " Edit " ) . '</a></div>' ;
2018-11-05 16:59:40 +01:00
2019-04-25 12:11:32 +02:00
// Clone
2020-09-07 10:18:17 +02:00
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER [ 'PHP_SELF' ] . '?id=' . $object -> id . '&socid=' . $object -> socid . '&action=clone&object=order">' . $langs -> trans ( " ToClone " ) . '</a></div>' ;
2018-10-31 20:10:20 +01:00
2020-08-27 18:27:05 +02:00
// Collect now
if ( count ( $object -> actions ) > 0 ) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=collect">' . $langs -> trans ( " CollectNow " ) . '</a></div>' ;
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag ( $langs -> trans ( " NoOperations " )) . '">' . $langs -> trans ( " CollectNow " ) . '</a></div>' ;
}
2019-04-25 12:11:32 +02:00
2019-11-07 12:59:59 +01:00
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&action=delete">' . $langs -> trans ( 'Delete' ) . '</a></div>' ;
2018-10-31 20:10:20 +01:00
}
2019-11-07 12:59:59 +01:00
print '</div>' . " \n " ;
2018-10-31 20:10:20 +01:00
}
2019-11-07 12:59:59 +01:00
if ( ! empty ( $debuginfo ))
2019-04-07 18:32:01 +02:00
{
2020-09-07 10:18:17 +02:00
print info_admin ( $debuginfo );
2019-04-07 18:32:01 +02:00
}
2018-10-31 20:10:20 +01:00
// Select mail models is same action as presend
if ( GETPOST ( 'modelselected' )) {
$action = 'presend' ;
}
/*
if ( $action != 'presend' ) {
print '<div class="fichecenter"><div class="fichehalfleft">' ;
print '<a name="builddoc"></a>' ; // ancre
*/
// Documents
/* $objref = dol_sanitizeFileName ( $object -> ref );
$relativepath = $comref . '/' . $comref . '.pdf' ;
$filedir = $conf -> emailcollector -> dir_output . '/' . $objref ;
$urlsource = $_SERVER [ " PHP_SELF " ] . " ?id= " . $object -> id ;
$genallowed = $user -> rights -> emailcollector -> read ; // If you can read, you can build the PDF to read content
$delallowed = $user -> rights -> emailcollector -> create ; // If you can create/edit, you can remove a file on card
print $formfile -> showdocuments ( 'emailcollector' , $objref , $filedir , $urlsource , $genallowed , $delallowed , $object -> modelpdf , 1 , 0 , 0 , 28 , 0 , '' , '' , '' , $soc -> default_lang );
*/
/*
// Show links to link elements
$linktoelem = $form -> showLinkToObjectBlock ( $object , null , array ( 'emailcollector' ));
$somethingshown = $form -> showLinkedObjectBlock ( $object , $linktoelem );
print '</div><div class="fichehalfright"><div class="ficheaddleft">' ;
$MAXEVENT = 10 ;
$morehtmlright = '<a href="' . dol_buildpath ( '/emailcollector/emailcollector_info.php' , 1 ) . '?id=' . $object -> id . '">' ;
$morehtmlright .= $langs -> trans ( " SeeAll " );
$morehtmlright .= '</a>' ;
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php' ;
$formactions = new FormActions ( $db );
$somethingshown = $formactions -> showactions ( $object , 'emailcollector_emailcollector' , $socid , 1 , '' , $MAXEVENT , '' , $morehtmlright );
print '</div></div></div>' ;
}
*/
//Select mail models is same action as presend
/*
if ( GETPOST ( 'modelselected' )) $action = 'presend' ;
// Presend form
$modelmail = 'inventory' ;
$defaulttopic = 'InformationMessage' ;
$diroutput = $conf -> product -> dir_output . '/inventory' ;
$trackid = 'stockinv' . $object -> id ;
include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php' ;
*/
}
// End of page
llxFooter ();
$db -> close ();