コード例 #1
0
ファイル: mailings.php プロジェクト: nrueckmann/yeager
     $oldMailingInfo = $sourceMailing->get();
     $oldMailingId = $oldMailingInfo['ID'];
     $newMailingId = $mailingMgr->add($mailingMgr->tree->getRoot());
     $newMailing = $mailingMgr->getMailing($newMailingId);
     $newMailing->copyFrom($sourceMailing);
     $jsQueue->add($newMailingId, HISTORYTYPE_MAILING, 'MAILING_ADD', sGuiUS(), NULL);
     // Inherit permissions of the parent of the newly created copy
     $allPerms = $sourceMailing->permissions->getPermissions();
     //$newMailing->permissions->clear();
     $newMailing->permissions->setPermissions($allPerms);
     break;
 case 'saveMailingInfo':
     $defaulttemplate = (int) $this->params['mailing_defaulttemplate'];
     $templateroot = (int) $this->params['mailings_templateroot'];
     if ($defaulttemplate == -1) {
         $mailingMgr->setDefaultTemplate(0);
     } elseif ($defaulttemplate > 0) {
         $mailingMgr->setDefaultTemplate($defaulttemplate);
     }
     if ($templateroot == -1) {
         $mailingMgr->setTemplateRoot(0);
     } elseif ($templateroot > 0) {
         $mailingMgr->setTemplateRoot($templateroot);
     }
     break;
 case 'setMailingConfigTemplateRoot':
     $template = $this->params['templateId'];
     $parentwindow = $this->params['wid'];
     // Check if we really got sane values
     if ($template != 'template') {
         $templatePreview = '';