Пример #1
0
 function editList($listEdit, $forms, $show)
 {
     $lists = listsHTML::prepList($listEdit);
     $html = $listEdit->html;
     if ($listEdit->footer == '0') {
         $show['unsusbcribe'] = false;
     }
     echo $forms['main'];
     $config_tabs = new mosTabs(0);
     $config_tabs->startPane('acaListEdit');
     $config_tabs->startTab(_ACA_LIST_T_GENERAL, 'acaListEdit.general');
     listsHTML::description($listEdit, $lists, $show, $html);
     $config_tabs->endTab();
     $config_tabs->startTab(_ACA_LIST_T_TEMPLATE, 'acaListEdit.template');
     listsHTML::layout($listEdit, $lists, $show, $html);
     $config_tabs->endTab();
     if (($show['auto_option'] or $listEdit->new_letter == 1) and $GLOBALS[ACA . 'listype2'] == 1 and class_exists('autoresponder')) {
         $config_tabs->startTab(_ACA_AUTORESP, 'acaListEdit.autorespond');
         autoresponder::edit($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     if (($listEdit->list_type == '7' or $listEdit->new_letter == 1) and $GLOBALS[ACA . 'listype7'] == 1 and class_exists('autonews')) {
         $config_tabs->startTab(_ACA_AUTONEWS, 'acaListEdit.smartnews');
         autonews::edit($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     if ($show['unsusbcribe'] or $show['auto_subscribe'] or $GLOBALS[ACA . 'require_confirmation'] or $show['email_unsubcribe'] and class_exists('auto')) {
         $config_tabs->startTab(_ACA_LIST_T_SUBSCRIPTION, 'acaListEdit.subscriber');
         listsHTML::subscription($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     if (class_exists('pro')) {
         $config_tabs->startTab(_ACA_LIST_ADD_TAB, 'acaListEdit.pro');
         pro::editTab($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     $config_tabs->endPane();
 }
Пример #2
0
 function updateQueues($subId, $qids, $listId, $acc_level, $new)
 {
     if (ACA_CMSTYPE) {
         $database =& JFactory::getDBO();
     } else {
         global $database;
     }
     //endif
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $list = lists::getOneList($listId);
     if ($list->list_type == 1) {
         if ($new) {
             if (!empty($subId)) {
                 $erro->ck = queue::insertQueuesForNews($subId, $listId, $acc_level);
                 $erro->Eck(__LINE__, '8504');
             } else {
                 if (!empty($qids)) {
                     $qid = implode(',', $qids);
                     $query = 'SELECT `subscriber_id` FROM `#__acajoom_queue` WHERE `qid` IN ( ' . $qid . ' ) ';
                     $database->setQuery($query);
                     $subIds = $database->loadObjectList();
                     $erro->err = $database->getErrorMsg();
                 }
                 foreach ($subIds as $v) {
                     $subId[] = $v->subscriber_id;
                 }
                 $erro->ck = queue::insertQueuesForNews($subId, $listId, $acc_level);
                 $erro->E(__LINE__, '8505');
             }
         } else {
             if (!empty($subId)) {
                 $erro->ck = queue::updateQueueData('', $subId, 0, $listId, 0, 0, 0, 0, $acc_level, 0);
                 $erro->Eck(__LINE__, '8506');
             } elseif (!empty($qids)) {
                 $erro->ck = queue::updateQueueData($qids, '', 0, $listId, 0, 0, 0, 0, $acc_level, 0);
                 $erro->Eck(__LINE__, '8507');
             }
         }
     } elseif ($list->list_type == 7) {
         $newQueue->list_id = $list->id;
         $newQueue->mailing_id = 0;
         $newQueue->issue_nb = 0;
         $newQueue->send_date = 0;
         $newQueue->delay = 0;
         $newQueue->acc_level = $acc_level;
         $newQueue->published = $list->published;
         $erro->ck = autonews::insertQueuesForAutoNews($subId, $newQueue);
         $erro->Eck(__LINE__, '8508');
     } else {
         if ($new) {
             if (!empty($subId)) {
                 $mailingId = 0;
                 $mailing = queue::getValidMailing($list, $mailingId);
                 if (!empty($mailing)) {
                     if (class_exists('auto')) {
                         if ($mailing->list_type == 2) {
                             $newQueue->list_id = $mailing->list_id;
                             $newQueue->mailing_id = $mailing->id;
                             $newQueue->issue_nb = $mailing->issue_nb;
                             $newQueue->send_date = acajoom::getNow($mailing->delay);
                             $newQueue->delay = $mailing->delay;
                             $newQueue->acc_level = $acc_level;
                             $newQueue->published = $list->published;
                             $erro->ck = auto::insertQueuesForAuto($subId, $newQueue);
                             $erro->Eck(__LINE__, '8508');
                         } else {
                             $erro->ck = queue::insertQueuesForNews($subId, $mailing->list_id, $acc_level);
                             $erro->Eck(__LINE__, '8509');
                         }
                     }
                 } else {
                     if (class_exists('auto')) {
                         $newQueue->list_id = $list->id;
                         $newQueue->mailing_id = 0;
                         $newQueue->issue_nb = 0;
                         $newQueue->send_date = 0;
                         $newQueue->delay = 0;
                         $newQueue->acc_level = $acc_level;
                         $newQueue->published = $list->published;
                         $erro->ck = auto::insertQueuesForAuto($subId, $newQueue);
                         $erro->Eck(__LINE__, '8510');
                     }
                 }
             } elseif (!empty($qids)) {
                 //On r�cup�re le premier mail du follow up
                 $mailingId = xmailing::getFirstMailingId($listId);
                 if (!empty($mailingId)) {
                     $mailing = queue::getValidMailing($list, $mailingId);
                     if (!empty($mailing)) {
                         if ($mailing->list_type == 2) {
                             //$subscribers = subscribers::getSubscribers( -1 , -1 , '' , $total , $listId, '', 1, 1,'' );
                             //$subId = acajoom::convertObjectToIdList($subscribers , 'id');
                             if (!empty($subId)) {
                                 $erro->ck = queue::updateQueueData('', $subId, $mailing->list_type, $listId, $mailing->id, $mailing->issue_nb, 0, $mailing->delay, 0, 1);
                                 $erro->Eck(__LINE__, '8511');
                             } else {
                                 $erro->ck = queue::updateQueueData($qids, '', $mailing->list_type, $listId, $mailing->id, $mailing->issue_nb, 0, $mailing->delay, 0, 1);
                                 $erro->Eck(__LINE__, '8511');
                             }
                         } else {
                             $subscribers = subscribers::getSubscribers(-1, -1, '', $total, $listId, '', 1, 1, '');
                             $subId = acajoom::convertObjectToIdList($subscribers, 'id');
                             $erro->ck = queue::insertQueuesForNews($subId, $mailing->list_id, $acc_level);
                             $erro->Eck(__LINE__, '8512');
                         }
                     }
                 }
             }
         } else {
             if (!empty($subId)) {
                 $mailing = queue::getValidMailing($list, 0);
                 if (!empty($mailing)) {
                     $erro->ck = queue::updateQueueData('', $subId, $list->list_type, $listId, '', '', 0, '', 0, $list->published);
                 } else {
                     $erro->ck = queue::updateQueueData('', $subId, $mailing->list_type, $mailing->list_id, $mailing->id, $mailing->issue_nb, acajoom::getNow(), $mailing->delay, $acc_level, $mailing->published);
                 }
                 $erro->E(__LINE__, '8513');
             } elseif (!empty($qids)) {
                 $mailing = queue::getValidMailing($list, 0);
                 if (!empty($mailing)) {
                     if ($mailing->list_type == 2) {
                         $erro->ck = queue::updateQueueData($qids, '', $list->list_type, $listId, $mailing->id, $mailing->issue_nb, acajoom::getNow(), $mailing->delay, 0, 1);
                         $erro->E(__LINE__, '8514');
                     } else {
                         $subId = acajoom::convertObjectToIdList($qids, 'subscriber_id');
                         $erro->ck = queue::deleteQueues($qids);
                         $erro->Eck(__LINE__, '8515');
                         $erro->ck = queue::insertQueuesForNews($subId, $mailing->list_id, $acc_level);
                         $erro->Eck(__LINE__, '8516');
                     }
                 }
             }
         }
     }
     return $erro->R();
 }