~fabiocbalbuquerque/sahana-agasti/web-services

« back to all changes in this revision

Viewing changes to apps/frontend/lib/packages/agEventPackage/modules/event/actions/actions.class.php

  • Committer: Chad Heuschober
  • Date: 2011-07-27 20:28:27 UTC
  • mto: (1.26.1 push-trunk)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: chad.heuschober@mail.cuny.edu-20110727202827-8i86niktz4ua1k2s
Merged event actions. Added specStrLength comparison for ints into ImportHelper

Show diffs side-by-side

added added

removed removed

Lines of Context:
503
503
        return sfView::NONE;
504
504
    }
505
505
 
506
 
    public function executeExportcontacts(sfWebRequest $request)
507
 
    {
508
 
        $this->setEventBasics($request);
509
 
        $this->info = array();
510
 
 
511
 
        $exporter = agSendWordNowPreDeploy::getInstance($this->event_id, 'staff_contacts_predeploy');
512
 
        $this->fileInfo = $exporter->getExport();
513
 
 
514
 
        $this->getResponse()->setHttpHeader('Content-Type', 'application/zip');
515
 
        $this->getResponse()->setHttpHeader('Content-Disposition', 'attachment;filename="' .
516
 
            $this->fileInfo['filename'] . '"');
517
 
 
518
 
        $exportFile = file_get_contents($this->fileInfo['path'] . DIRECTORY_SEPARATOR .
519
 
            $this->fileInfo['filename']);
520
 
 
521
 
        $this->getResponse()->setContent($exportFile);
522
 
        $this->getResponse()->send();
523
 
 
524
 
        $this->redirect('event/messaging?event=' . urlencode($this->event_name));
 
506
  public function executeExportcontacts(sfWebRequest $request)
 
507
  {
 
508
    $this->setEventBasics($request);
 
509
    $this->info = array();
 
510
 
 
511
    if ($request->hasParameter('type')) {
 
512
      $type = $request->getParameter('type');
 
513
 
 
514
      switch ($type) {
 
515
        case 'pre':
 
516
          $exporter = agSendWordNowPreDeploy::getInstance($this->event_id, 'staff_contacts_predeploy');
 
517
          break;
 
518
        case 'post':
 
519
          $exporter = agSendWordNowPostDeploy::getInstance($this->event_id, 'staff_contacts_postdeploy');
 
520
          break;
 
521
      }
 
522
 
 
523
      $this->fileInfo = $exporter->getExport();
 
524
 
 
525
      $this->getResponse()->setHttpHeader('Content-Type', 'application/zip');
 
526
      $this->getResponse()->setHttpHeader('Content-Disposition', 'attachment;filename="' .
 
527
        $this->fileInfo['filename'] . '"');
 
528
 
 
529
      $exportFile = file_get_contents($this->fileInfo['path'] . DIRECTORY_SEPARATOR .
 
530
        $this->fileInfo['filename']);
 
531
 
 
532
      $this->getResponse()->setContent($exportFile);
 
533
      $this->getResponse()->send();
525
534
    }
526
535
 
 
536
    $this->redirect('event/messaging?event=' . urlencode($this->event_name));
 
537
  }
527
538
    /**
528
539
     * provide event shift CRUD
529
540
     * @param sfWebRequest $request