Пример #1
0
 /**
  * Load all Documenttemplates
  *
  * @param sfWebRequest $request
  * @return <type>
  */
 public function executeLoadDocumenttemplate(sfWebRequest $request) {
     $docObj = new Documenttemplate();
     $data = DocumenttemplateTemplateTable::instance()->getAllDocumentTemplates(-1,-1)->toArray();
     $json_result = $docObj->buildAllDocumenttemplates($data);
     $this->renderText('({"result":'.json_encode($json_result).'})');
     return sfView::NONE;
 }
Пример #2
0
 /**
  * Load all versions of an template, for the popwindow
  * @param sfWebRequest $request
  * @return <type>
  */
 public function executeLoadAllVersion(sfWebRequest $request) {
     $docObj = new Documenttemplate();
     $data = DocumenttemplateVersionTable::instance()->getAllVersionByTemplateId($request->getParameter('id'));
     $json_result = $docObj->buildAllVersion($data, $this->getUser()->getCulture(), $this->getContext());
     $this->renderText('({"result":'.json_encode($json_result).'})');
     return sfView::NONE;
 }
Пример #3
0
 /**
  * Adapt mailinglist to current version
  * @param sfWebRequest $request
  * @return <type>
  */
 public function executeAdaptMailinglist(sfWebRequest $request) {
     $mailinglist = new Mailinglist();
     $docuObj = new Documenttemplate();
     $mailinglistdata = MailinglistTemplateTable::instance()->getMailinglistByVersionTemplateId($request->getParameter('id'))->toArray();
     $currentdocumenttemplateversion = DocumenttemplateVersionTable::instance()->getActiveVersionById($mailinglistdata[0]['documenttemplatetemplate_id'])->toArray();
     $slots = $docuObj->buildSlots($currentdocumenttemplateversion[0]['id'], 'SLOTSONLY');
     $mailinglistversiondata = MailinglistVersionTable::instance()->getActiveVersionById($request->getParameter('id'))->toArray();
     MailinglistVersionTable::instance()->setMailinglistInactiveById($mailinglistversiondata[0]['mailinglisttemplate_id']);
     $mailinglistversion_id = $mailinglist->storeVersion($mailinglistversiondata[0]['mailinglisttemplate_id'],$mailinglistversiondata[0]['version']+1, $currentdocumenttemplateversion[0]['id']);
     $userdata = MailinglistAllowedSenderTable::instance()->getAllowedSenderById($mailinglistversiondata[0]['id']);
     $users = $mailinglist->buildAllowedUser($userdata);
     $mailinglist->saveUser($mailinglistversion_id, isset($users) ? $users: array());
     $authdata = MailinglistAuthorizationSettingTable::instance()->getAuthorizationById($mailinglistversiondata[0]['id'])->toArray();
     $mailinglist->adaptAuthorizationEntry($authdata, $mailinglistversion_id);
     $mailinglist->storeMailinglist($slots, $mailinglistversion_id);
     return sfView::NONE;
 }