5require_once 
"Services/Table/classes/class.ilTable2GUI.php";
 
    6require_once 
"Services/Contact/classes/class.ilMailingLists.php";
 
    7require_once 
"Services/Mail/classes/class.ilFormatMail.php";
 
    8require_once 
"Services/Contact/classes/class.ilAddressbook.php";
 
   42                $this->mlists->setCurrentMailingList(
$_GET[
'ml_id']);
 
   44                $this->ctrl->saveParameter($this, 
'mobj_id');
 
   45                $this->ctrl->saveParameter($this, 
'ref');
 
   50                $forward_class = $this->ctrl->getNextClass($this);
 
   51                switch ($forward_class)
 
   54                                if (!(
$cmd = $this->ctrl->getCmd()))
 
   56                                        $cmd = 
'showMailingLists';
 
   75                include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
 
   78                $c_gui->setFormAction($this->ctrl->getFormAction($this, 
'performDelete'));
 
   79                $c_gui->setHeaderText($this->lng->txt(
'mail_sure_delete_entry'));
 
   80                $c_gui->setCancel($this->lng->txt(
'cancel'), 
'showMailingLists');
 
   81                $c_gui->setConfirm($this->lng->txt(
'confirm'), 
'performDelete');
 
   83                $entries = $this->mlists->getSelected($ml_ids);         
 
   84                foreach($entries as $entry)
 
   86                        $c_gui->addItem(
'ml_id[]', $entry->getId(), $entry->getTitle());
 
   89                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
   90                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_list.html', 
'Services/Contact');
 
   91                $this->tpl->setVariable(
'DELETE_CONFIRMATION', $c_gui->getHTML());
 
  102                if (is_array(
$_POST[
'ml_id']))
 
  105                        foreach (
$_POST[
'ml_id'] as $id)
 
  131                include_once 
"Services/Mail/classes/class.ilMail.php";
 
  133                $mailing_allowed = $rbacsystem->checkAccess(
'internal_mail',$mail->getMailObjectReferenceId());
 
  135                if (!$mailing_allowed)
 
  149                $mail_data = $this->umail->getSavedData();              
 
  150                if(!is_array($mail_data))
 
  152                        $this->umail->savePostData(
$ilUser->getId(), array(), 
'', 
'', 
'', 
'', 
'', 
'', 
'', 
'');
 
  156                foreach($ml_ids as $id)
 
  159                           !$this->umail->doesRecipientStillExists(
'#il_ml_'.$id, $mail_data[
'rcp_to']))
 
  161                                $lists[] = 
'#il_ml_'.$id;                       
 
  167                        $mail_data = $this->umail->appendSearchResult($lists, 
'to');
 
  168                        $this->umail->savePostData(
 
  169                                $mail_data[
'user_id'],
 
  170                                $mail_data[
'attachments'],
 
  171                                $mail_data[
'rcp_to'],
 
  172                                $mail_data[
'rcp_cc'],
 
  173                                $mail_data[
'rcp_bcc'],
 
  174                                $mail_data[
'm_type'],
 
  175                                $mail_data[
'm_email'],
 
  176                                $mail_data[
'm_subject'],
 
  177                                $mail_data[
'm_message'],
 
  178                                $mail_data[
'use_placeholders']
 
  191                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));              
 
  192                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_list.html', 
'Services/Contact');
 
  195                include_once 
"Services/Mail/classes/class.ilMail.php";
 
  197                $mailing_allowed = $rbacsystem->checkAccess(
'internal_mail',$mail->getMailObjectReferenceId());
 
  199                require_once 
'Services/Contact/classes/class.ilMailingListsTableGUI.php';
 
  203                $entries = $this->mlists->getAll();
 
  206                        $tbl->enable(
'select_all');
 
  208                        require_once 
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
 
  210                        foreach($entries as $entry)
 
  218                                $result[$counter][
'title'] = $entry->getTitle() . 
" [#il_ml_" . $entry->getId() . 
"]";
 
  219                                $result[$counter][
'description'] = $entry->getDescription();
 
  220                                $result[$counter][
'members'] = count($entry->getAssignedEntries());
 
  222                                $this->ctrl->setParameter($this, 
'ml_id',  $entry->getId());
 
  225                                $current_selection_list->setListTitle($this->lng->txt(
"actions"));
 
  226                                $current_selection_list->setId(
"act_".$counter);
 
  228                                $current_selection_list->addItem($this->lng->txt(
"edit"), 
'', $this->ctrl->getLinkTarget($this, 
"showForm"));
 
  229                                $current_selection_list->addItem($this->lng->txt(
"members"), 
'', $this->ctrl->getLinkTarget($this, 
"showMembersList"));
 
  232                                        $current_selection_list->addItem($this->lng->txt(
"send_mail_to"), 
'', $this->ctrl->getLinkTarget($this, 
"mailToList"));
 
  234                                $current_selection_list->addItem($this->lng->txt(
"delete"), 
'', $this->ctrl->getLinkTarget($this, 
"confirmDelete"));
 
  236                                $result[$counter][
'COMMAND_SELECTION_LIST'] = $current_selection_list->getHTML();
 
  242                                $tbl->addMultiCommand(
'mailToList', $this->lng->txt(
'send_mail_to'));
 
  244                        $tbl->addMultiCommand(
'confirmDelete', $this->lng->txt(
'delete'));
 
  248                        $tbl->disable(
'header');
 
  249                        $tbl->disable(
'footer');
 
  254                if(isset(
$_GET[
'ref']) && 
$_GET[
'ref'] == 
'mail')
 
  256                        $tbl->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  259                $this->tpl->setVariable(
'MAILING_LISTS', $tbl->getHTML());
 
  269                if(isset(
$_GET[
'ref']) && 
$_GET[
'ref'] == 
'mail')
 
  271                        $this->ctrl->returnToParent($this);
 
  281                if($this->mlists->getCurrentMailingList()->getId())
 
  287                                $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  290                        $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  298                if($this->form_gui->checkInput())
 
  300                        $this->mlists->getCurrentMailingList()->setTitle(
$_POST[
'title']);
 
  301                        $this->mlists->getCurrentMailingList()->setDescription(
$_POST[
'description']);
 
  302                        if($this->mlists->getCurrentMailingList()->getId())
 
  304                                $this->mlists->getCurrentMailingList()->setChangedate(date(
'Y-m-d H:i:s', time()));
 
  305                                $this->mlists->getCurrentMailingList()->update();                               
 
  310                                $this->mlists->getCurrentMailingList()->setCreatedate(date(
'Y-m-d H:i:s', time()));
 
  311                                $this->mlists->getCurrentMailingList()->insert();
 
  312                                $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  313                                $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'saveForm'));
 
  315                                $this->ctrl->setParameter($this, 
'ml_id',  $this->mlists->getCurrentMailingList()->getId());
 
  316                                $this->ctrl->redirect($this,
'showMembersList');
 
  322                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));              
 
  323                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_form.html', 
'Services/Contact');
 
  325                $this->form_gui->setValuesByPost();
 
  327                $this->tpl->setVariable(
'FORM', $this->form_gui->getHTML());
 
  328                return $this->tpl->show();
 
  333                include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');            
 
  336                $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'saveForm'));
 
  337                $this->form_gui->setTitle($this->lng->txt(
'mail_mailing_list'));
 
  339                $titleGui = 
new ilTextInputGUI($this->lng->txt(
'title'), 
'title');
 
  340                $titleGui->setRequired(
true);
 
  341                $this->form_gui->addItem($titleGui);
 
  343                $descriptionGui = 
new ilTextAreaInputGUI($this->lng->txt(
'description'), 
'description');                
 
  344                $descriptionGui->setCols(40);
 
  345                $descriptionGui->setRows(8);
 
  346                $this->form_gui->addItem($descriptionGui);
 
  348                $this->form_gui->addCommandButton(
'saveForm',$this->lng->txt(
'save'));
 
  349                $this->form_gui->addCommandButton(
'showMailingLists',$this->lng->txt(
'cancel'));                
 
  354                $this->form_gui->setValuesByArray(array(
 
  355                        'title' => $this->mlists->getCurrentMailingList()->getTitle(),
 
  356                        'description' => $this->mlists->getCurrentMailingList()->getDescription()
 
  362                $this->form_gui->setValuesByArray(array(
 
  372                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  373                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_form.html', 
'Services/Contact');
 
  375                if($this->mlists->getCurrentMailingList()->getId())
 
  379                                $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  382                        $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  392                $this->tpl->setVariable(
'FORM', $this->form_gui->getHTML());
 
  393                return $this->tpl->show();
 
  398                if(!$this->mlists->getCurrentMailingList()->getId())
 
  404                $this->ctrl->setParameter($this, 
'cmd', 
'post');
 
  405                $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  407                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  408                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_members.html', 
'Services/Contact');
 
  410                require_once 
'Services/Contact/classes/class.ilMailingListsMembersTableGUI.php';
 
  414                $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  415                if(count($assigned_entries))
 
  417                        $tbl->enable(
'select_all');
 
  418                        $tbl->setSelectAllCheckbox(
'a_id');
 
  421                        foreach($assigned_entries as $entry)
 
  424                                $result[$counter][
'title'] = ($entry[
'login'] != 
'' ? $entry[
'login'] : $entry[
'email']);
 
  429                        $tbl->addMultiCommand(
'confirmDeleteMembers', $this->lng->txt(
'delete'));
 
  433                        $tbl->disable(
'header');
 
  434                        $tbl->disable(
'footer');
 
  436                        $tbl->setNoEntriesText($this->lng->txt(
'mail_search_no'));
 
  441                $this->tpl->setVariable(
'MEMBERS_LIST', $tbl->getHTML());
 
  448                if (!isset(
$_POST[
'a_id']))
 
  455                include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
 
  457                $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  458                $c_gui->setFormAction($this->ctrl->getFormAction($this, 
'performDeleteMembers'));
 
  459                $c_gui->setHeaderText($this->lng->txt(
'mail_sure_delete_entry'));
 
  460                $c_gui->setCancel($this->lng->txt(
'cancel'), 
'showMembersList');
 
  461                $c_gui->setConfirm($this->lng->txt(
'confirm'), 
'performDeleteMembers');
 
  463                $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  464                if (is_array($assigned_entries))
 
  466                        foreach ($assigned_entries as $entry)
 
  468                                if (in_array($entry[
'a_id'], 
$_POST[
'a_id']))
 
  470                                        $c_gui->addItem(
'a_id[]', $entry[
'a_id'], ($entry[
'login'] != 
'' ? $entry[
'login'] : $entry[
'email']));         
 
  475                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  476                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_members.html', 
'Services/Contact');
 
  477                $this->tpl->setVariable(
'DELETE_CONFIRMATION', $c_gui->getHTML());
 
  490                        $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  493                if (is_array(
$_POST[
'a_id']))
 
  495                        foreach (
$_POST[
'a_id'] as $id)
 
  518                        $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  521                if (
$_POST[
'addr_id'] == 
'') $this->
setError($this->lng->txt(
'mail_entry_of_addressbook'));
 
  527                        $all_entries = $this->abook->getEntries();
 
  528                        if ((
int)count($all_entries))
 
  530                                foreach ($all_entries as $entry)
 
  532                                        if($entry[
'addr_id'] == 
$_POST[
'addr_id'])
 
  556                                if ($this->
isError()) $mandatory .= 
', ';
 
  559                        ilUtil::sendInfo($this->lng->txt(
'fill_out_all_required_fields') . 
': ' . $mandatory);
 
  571                if (!$this->mlists->getCurrentMailingList()->getId())
 
  580                        $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  583                $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));              
 
  584                $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_members_form.html', 
'Services/Contact');
 
  586                include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
  589                $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  590                $form->setFormAction($this->ctrl->getFormAction($this, 
'saveForm'));
 
  591                $form->setTitle($this->lng->txt(
'mail_assign_entry_to_mailing_list') . 
' ' . $this->mlists->getCurrentMailingList()->getTitle());
 
  594                $options[
''] = $this->lng->txt(
'please_select');
 
  596                $all_entries = $this->abook->getEntries();
 
  597                if ((
int)count($all_entries))
 
  599                        foreach ($all_entries as $entry)
 
  601                                $options[$entry[
'addr_id']] = ($entry[
'login'] != 
'' ? $entry[
'login'] : $entry[
'email']);
 
  605                $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  606                if ((
int)count($assigned_entries))
 
  608                        foreach ($assigned_entries as $assigned_entry)
 
  610                                if (is_array(
$options) && array_key_exists($assigned_entry[
'addr_id'], 
$options))
 
  612                                        unset(
$options[$assigned_entry[
'addr_id']]);
 
  619                        $formItem = 
new ilSelectInputGUI($this->lng->txt(
'mail_entry_of_addressbook'), 
'addr_id');              
 
  621                        $formItem->setValue($this->mlists->getCurrentMailingList()->getTitle());
 
  622                        $form->addItem($formItem);
 
  624                        $form->addCommandButton(
'saveAssignmentForm',$this->lng->txt(
'assign'));                        
 
  626                else if(count(
$options) == 1 && (
int)count($all_entries))
 
  628                        ilUtil::sendInfo($this->lng->txt(
'mail_mailing_lists_all_addressbook_entries_assigned'));
 
  630                else if(!(
int)count($all_entries))
 
  632                        ilUtil::sendInfo($this->lng->txt(
'mail_mailing_lists_no_addressbook_entries'));
 
  636                $form->addCommandButton(
'showMembersList',$this->lng->txt(
'cancel'));   
 
  638                $this->tpl->setVariable(
'FORM', $form->getHTML());
 
  646                return $this->
error[] = $a_error;
 
  650                return array_pop($this->
error);
 
  654                if (is_array($this->
error) && !empty($this->
error)) 
return true;
 
error($a_errmsg)
set error message @access public
Mail Box class Base class for creating and handling mail boxes.
User interface class for advanced drop-down selection lists.
Confirmation screen class.
Class Mail this class handles base functions for mail handling.
static _isOwner($a_ml_id, $a_usr_id)
initForm($a_type='create')
This class represents a text area property in a property form.
This class represents a text property in a property form.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options