Example #1
0
require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . "/core/class/CMailFile.class.php";
require_once DOL_DOCUMENT_ROOT . "/core/lib/functions2.lib.php";
require_once DOL_DOCUMENT_ROOT . "/adherent/class/adherent_card.class.php";
require_once DOL_DOCUMENT_ROOT . "/core/class/html.formother.class.php";
$langs->load("members");
$langs->load("mails");
if (!$user->rights->adherent->configurer) {
    accessforbidden();
}
$id = "licenseCard";
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$message = '';
$object = new AdherentCard($db);
// Action update emailing
if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"])) {
    require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
    try {
        $object->load($id);
        $object->title = trim($_POST["title"]);
        $object->resume = trim($_POST["resume"]);
        $object->body = trim($_POST["body"]);
        $object->tms = dol_now();
        if (!$object->title) {
            $message .= ($message ? '<br>' : '') . $langs->trans("ErrorFieldRequired", $langs->trans("MailTopic"));
        }
        if (!$object->body) {
            $message .= ($message ? '<br>' : '') . $langs->trans("ErrorFieldRequired", $langs->trans("MailBody"));
        }
Example #2
0
         if ($object->Status > 0) {
             print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $rowid . '&action=addsubscription">' . $langs->trans("AddSubscription") . "</a>";
         } else {
             print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("ValidateBefore")) . '">' . $langs->trans("AddSubscription") . '</a>';
         }
         print "<br>\n";
         print '</div>';
     }
 }
 print end_box();
 $titre = $langs->trans("Messenger");
 print start_box($titre, "six", "16-Mail.png");
 print end_box();
 $titre = $langs->trans("CardMember");
 print start_box($titre, "six", "16-Mail.png");
 $licence = new AdherentCard($db);
 try {
     $licence->load($object->login);
     print $licence->body;
 } catch (Exception $e) {
     print "No licence Card";
 }
 print '<div class="tabsAction">';
 // Send card by email
 if ($user->rights->adherent->creer) {
     if ($object->Status >= 1) {
         if ($object->email) {
             print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sendinfo">' . $langs->trans("SendCard") . "</a>\n";
         } else {
             print "<a class=\"butActionRefused\" href=\"#\" title=\"" . dol_escape_htmltag($langs->trans("NoEMail")) . "\">" . $langs->trans("SendCard") . "</a>\n";
         }