5require_once 
"Services/Table/classes/class.ilTable2GUI.php";
 
    6require_once 
"Services/Contact/classes/class.ilMailingLists.php";
 
    7require_once 
"Services/Mail/classes/class.ilFormatMail.php";
 
   65        $this->tpl = 
$DIC[
'tpl'];
 
   66        $this->ctrl = 
$DIC[
'ilCtrl'];
 
   67        $this->lng = 
$DIC[
'lng'];
 
   68        $this->rbacsystem = 
$DIC[
'rbacsystem'];
 
   69        $this->
user = $DIC[
'ilUser'];
 
   70        $this->
error = $DIC[
'ilErr'];
 
   71        $this->toolbar = 
$DIC[
'ilToolbar'];
 
   72        $this->tabs = 
$DIC[
'ilTabs'];
 
   76        $this->mlists->setCurrentMailingList(
$_GET[
'ml_id']);
 
   78        $this->ctrl->saveParameter($this, 
'mobj_id');
 
   79        $this->ctrl->saveParameter($this, 
'ref');
 
   88            $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
   91        $forward_class = $this->ctrl->getNextClass($this);
 
   92        switch ($forward_class) {
 
   94                if (!($cmd = $this->ctrl->getCmd())) {
 
   95                    $cmd = 
'showMailingLists';
 
  113        include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
 
  116        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
'performDelete'));
 
  117        $c_gui->setHeaderText($this->lng->txt(
'mail_sure_delete_entry'));
 
  118        $c_gui->setCancel($this->lng->txt(
'cancel'), 
'showMailingLists');
 
  119        $c_gui->setConfirm($this->lng->txt(
'confirm'), 
'performDelete');
 
  121        $entries = $this->mlists->getSelected($ml_ids);
 
  122        foreach ($entries as $entry) {
 
  123            $c_gui->addItem(
'ml_id[]', $entry->getId(), $entry->getTitle());
 
  126        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  127        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_list.html', 
'Services/Contact');
 
  128        $this->tpl->setVariable(
'DELETE_CONFIRMATION', $c_gui->getHTML());
 
  137        if (is_array(
$_POST[
'ml_id'])) {
 
  140                if (ilMailingList::_isOwner(
$id, $this->
user->getId())) {
 
  161        include_once 
"Services/Mail/classes/class.ilMail.php";
 
  163        $mailing_allowed = $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId());
 
  165        if (!$mailing_allowed) {
 
  177        $mail_data = $this->umail->getSavedData();
 
  178        if (!is_array($mail_data)) {
 
  179            $this->umail->savePostData($this->
user->getId(), array(), 
'', 
'', 
'', 
'', 
'', 
'', 
'', 
'');
 
  183        foreach ($ml_ids as 
$id) {
 
  184            if (ilMailingList::_isOwner(
$id, $this->
user->getId()) &&
 
  185               !$this->umail->existsRecipient(
'#il_ml_' . 
$id, (
string) $mail_data[
'rcp_to'])) {
 
  186                $lists[] = 
'#il_ml_' . 
$id;
 
  191            $mail_data = $this->umail->appendSearchResult($lists, 
'to');
 
  192            $this->umail->savePostData(
 
  193                $mail_data[
'user_id'],
 
  194                $mail_data[
'attachments'],
 
  195                $mail_data[
'rcp_to'],
 
  196                $mail_data[
'rcp_cc'],
 
  197                $mail_data[
'rcp_bcc'],
 
  198                $mail_data[
'm_type'],
 
  199                $mail_data[
'm_email'],
 
  200                $mail_data[
'm_subject'],
 
  201                $mail_data[
'm_message'],
 
  202                $mail_data[
'use_placeholders'],
 
  203                $mail_data[
'tpl_ctx_id'],
 
  204                $mail_data[
'tpl_ctx_params']
 
  215        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  216        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_list.html', 
'Services/Contact');
 
  219        include_once 
"Services/Mail/classes/class.ilMail.php";
 
  221        $mailing_allowed = $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId());
 
  223        require_once 
'Services/Contact/classes/class.ilMailingListsTableGUI.php';
 
  226        require_once 
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
 
  228        $create_btn->setCaption(
'create');
 
  229        $create_btn->setUrl($this->ctrl->getLinkTarget($this, 
'showForm'));
 
  230        $this->toolbar->addButtonInstance($create_btn);
 
  233        $entries = $this->mlists->getAll();
 
  234        if (count($entries)) {
 
  235            $tbl->enable(
'select_all');
 
  237            require_once 
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
 
  239            foreach ($entries as $entry) {
 
  245                $result[$counter][
'title'] = $entry->getTitle() . 
" [#il_ml_" . $entry->getId() . 
"]";
 
  246                $result[$counter][
'description'] = $entry->getDescription();
 
  247                $result[$counter][
'members'] = count($entry->getAssignedEntries());
 
  249                $this->ctrl->setParameter($this, 
'ml_id', $entry->getId());
 
  252                $current_selection_list->setListTitle($this->lng->txt(
"actions"));
 
  253                $current_selection_list->setId(
"act_" . $counter);
 
  255                $current_selection_list->addItem($this->lng->txt(
"edit"), 
'', $this->ctrl->getLinkTarget($this, 
"showForm"));
 
  256                $current_selection_list->addItem($this->lng->txt(
"members"), 
'', $this->ctrl->getLinkTarget($this, 
"showMembersList"));
 
  257                if ($mailing_allowed) {
 
  258                    $current_selection_list->addItem($this->lng->txt(
"send_mail_to"), 
'', $this->ctrl->getLinkTarget($this, 
"mailToList"));
 
  260                $current_selection_list->addItem($this->lng->txt(
"delete"), 
'', $this->ctrl->getLinkTarget($this, 
"confirmDelete"));
 
  262                $result[$counter][
'COMMAND_SELECTION_LIST'] = $current_selection_list->getHTML();
 
  266            if ($mailing_allowed) {
 
  267                $tbl->addMultiCommand(
'mailToList', $this->lng->txt(
'send_mail_to'));
 
  269            $tbl->addMultiCommand(
'confirmDelete', $this->lng->txt(
'delete'));
 
  271            $tbl->disable(
'header');
 
  272            $tbl->disable(
'footer');
 
  277        if (isset(
$_GET[
'ref']) && 
$_GET[
'ref'] == 
'mail') {
 
  278            $tbl->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  281        $this->tpl->setVariable(
'MAILING_LISTS', 
$tbl->getHTML());
 
  291        if (isset(
$_GET[
'ref']) && 
$_GET[
'ref'] == 
'mail') {
 
  292            $this->ctrl->returnToParent($this);
 
  300        if ($this->mlists->getCurrentMailingList()->getId()) {
 
  301            if (!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $this->user->getId())) {
 
  302                $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  305            $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  311        if ($this->form_gui->checkInput()) {
 
  312            $this->mlists->getCurrentMailingList()->setTitle(
$_POST[
'title']);
 
  313            $this->mlists->getCurrentMailingList()->setDescription(
$_POST[
'description']);
 
  314            if ($this->mlists->getCurrentMailingList()->getId()) {
 
  315                $this->mlists->getCurrentMailingList()->setChangedate(date(
'Y-m-d H:i:s', time()));
 
  316                $this->mlists->getCurrentMailingList()->update();
 
  317                ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'));
 
  319                $this->mlists->getCurrentMailingList()->setCreatedate(date(
'Y-m-d H:i:s', time()));
 
  320                $this->mlists->getCurrentMailingList()->insert();
 
  321                $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  322                $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'saveForm'));
 
  324                $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  325                $this->ctrl->redirect($this, 
'showMembersList');
 
  331        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  332        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_form.html', 
'Services/Contact');
 
  334        $this->form_gui->setValuesByPost();
 
  336        $this->tpl->setVariable(
'FORM', $this->form_gui->getHTML());
 
  337        return $this->tpl->show();
 
  342        include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
  345        $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'saveForm'));
 
  346        $this->form_gui->setTitle($this->lng->txt(
'mail_mailing_list'));
 
  348        $titleGui = 
new ilTextInputGUI($this->lng->txt(
'title'), 
'title');
 
  349        $titleGui->setRequired(
true);
 
  350        $this->form_gui->addItem($titleGui);
 
  352        $descriptionGui = 
new ilTextAreaInputGUI($this->lng->txt(
'description'), 
'description');
 
  353        $descriptionGui->setCols(40);
 
  354        $descriptionGui->setRows(8);
 
  355        $this->form_gui->addItem($descriptionGui);
 
  357        $this->form_gui->addCommandButton(
'saveForm', $this->lng->txt(
'save'));
 
  358        $this->form_gui->addCommandButton(
'showMailingLists', $this->lng->txt(
'cancel'));
 
  363        $this->form_gui->setValuesByArray(array(
 
  364            'title' => $this->mlists->getCurrentMailingList()->getTitle(),
 
  365            'description' => $this->mlists->getCurrentMailingList()->getDescription()
 
  371        $this->form_gui->setValuesByArray(array(
 
  379        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  380        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_form.html', 
'Services/Contact');
 
  382        if ($this->mlists->getCurrentMailingList()->getId()) {
 
  383            if (!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $this->user->getId())) {
 
  384                $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  387            $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  395        $this->tpl->setVariable(
'FORM', $this->form_gui->getHTML());
 
  396        return $this->tpl->show();
 
  401        if (!$this->mlists->getCurrentMailingList()->getId()) {
 
  406        $this->ctrl->setParameter($this, 
'cmd', 
'post');
 
  407        $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  409        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  410        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_members.html', 
'Services/Contact');
 
  412        require_once 
'Services/Contact/classes/class.ilMailingListsMembersTableGUI.php';
 
  416        require_once 
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
 
  418        $create_btn->setCaption(
'add');
 
  419        $create_btn->setUrl($this->ctrl->getLinkTarget($this, 
'showAssignmentForm'));
 
  420        $this->toolbar->addButtonInstance($create_btn);
 
  422        $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  423        if (count($assigned_entries)) {
 
  424            $tbl->enable(
'select_all');
 
  425            $tbl->setSelectAllCheckbox(
'a_id');
 
  428            foreach ($assigned_entries as $entry) {
 
  429                $usr_ids[] = $entry[
'usr_id'];
 
  432            require_once 
'Services/User/classes/class.ilUserUtil.php';
 
  436            foreach ($assigned_entries as $entry) {
 
  438                $result[$counter][
'user'] = $names[$entry[
'usr_id']];
 
  442            $tbl->addMultiCommand(
'confirmDeleteMembers', $this->lng->txt(
'delete'));
 
  444            $tbl->disable(
'header');
 
  445            $tbl->disable(
'footer');
 
  447            $tbl->setNoEntriesText($this->lng->txt(
'mail_search_no'));
 
  452        $this->tpl->setVariable(
'MEMBERS_LIST', 
$tbl->getHTML());
 
  459        if (!isset(
$_POST[
'a_id'])) {
 
  465        include_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
 
  467        $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  468        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
'performDeleteMembers'));
 
  469        $c_gui->setHeaderText($this->lng->txt(
'mail_sure_delete_entry'));
 
  470        $c_gui->setCancel($this->lng->txt(
'cancel'), 
'showMembersList');
 
  471        $c_gui->setConfirm($this->lng->txt(
'confirm'), 
'performDeleteMembers');
 
  473        $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  476        foreach ($assigned_entries as $entry) {
 
  477            $usr_ids[] = $entry[
'usr_id'];
 
  480        require_once 
'Services/User/classes/class.ilUserUtil.php';
 
  483        foreach ($assigned_entries as $entry) {
 
  484            if (in_array($entry[
'a_id'], 
$_POST[
'a_id'])) {
 
  485                $c_gui->addItem(
'a_id[]', $entry[
'a_id'], $names[$entry[
'usr_id']]);
 
  489        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  490        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_members.html', 
'Services/Contact');
 
  491        $this->tpl->setVariable(
'DELETE_CONFIRMATION', $c_gui->getHTML());
 
  499        if (!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $this->user->getId())) {
 
  500            $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  503        if (is_array(
$_POST[
'a_id'])) {
 
  504            $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  506                if (isset($assigned_entries[
$id])) {
 
  507                    $this->mlists->getCurrentMailingList()->deleteEntry((
int) 
$id);
 
  523    protected function getAssignmentForm()
 
  525        require_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  527        $this->ctrl->setParameter($this, 
'ml_id', $this->mlists->getCurrentMailingList()->getId());
 
  528        $form->setFormAction($this->ctrl->getFormAction($this, 
'saveAssignmentForm'));
 
  529        $form->setTitle($this->lng->txt(
'mail_assign_entry_to_mailing_list') . 
' ' . $this->mlists->getCurrentMailingList()->getTitle());
 
  532        $options[
''] = $this->lng->txt(
'please_select');
 
  534        require_once 
'Services/Contact/BuddySystem/classes/class.ilBuddyList.php';
 
  535        require_once 
'Services/User/classes/class.ilUserUtil.php';
 
  538        foreach ($relations as $relation) {
 
  542            $options[$relation->getBuddyUserId()] = $names[$relation->getBuddyUserId()];
 
  545        $assigned_entries = $this->mlists->getCurrentMailingList()->getAssignedEntries();
 
  546        if (count($assigned_entries)) {
 
  547            foreach ($assigned_entries as $assigned_entry) {
 
  548                if (is_array(
$options) && array_key_exists($assigned_entry[
'usr_id'], 
$options)) {
 
  549                    unset(
$options[$assigned_entry[
'usr_id']]);
 
  555            $formItem = 
new ilSelectInputGUI($this->lng->txt(
'mail_entry_of_contacts'), 
'usr_id');
 
  556            $formItem->setRequired(
true);
 
  558            $form->addItem($formItem);
 
  560            $form->addCommandButton(
'saveAssignmentForm', $this->lng->txt(
'assign'));
 
  561        } elseif (count(
$options) == 1 && count($relations)) {
 
  562            ilUtil::sendInfo($this->lng->txt(
'mail_mailing_lists_all_contact_entries_assigned'));
 
  563        } elseif (count($relations) == 0) {
 
  566        $form->addCommandButton(
'showMembersList', $this->lng->txt(
'cancel'));
 
  576        if (!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $this->user->getId())) {
 
  577            $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  580        $form = $this->getAssignmentForm();
 
  581        if (!
$form->checkInput()) {
 
  582            $form->setValuesByPost();
 
  587        require_once 
'Services/Contact/BuddySystem/classes/class.ilBuddyList.php';
 
  589            $this->mlists->getCurrentMailingList()->assignUser((
int) 
$_POST[
'usr_id']);
 
  605        if (!$this->mlists->getCurrentMailingList()->getId()) {
 
  610        if (!ilMailingList::_isOwner($this->mlists->getCurrentMailingList()->getId(), $this->user->getId())) {
 
  611            $this->
error->raiseError($this->lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  614        $this->tpl->setTitle($this->lng->txt(
'mail_addressbook'));
 
  615        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail_mailing_lists_members_form.html', 
'Services/Contact');
 
  618            $form = $this->getAssignmentForm();
 
  621        $this->tpl->setVariable(
'FORM', 
$form->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
User interface class for advanced drop-down selection lists.
static getInstanceByGlobalUser()
Confirmation screen class.
showAssignmentForm(ilPropertyFormGUI $form=null)
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 getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
static redirect($a_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(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form