Ejemplo n.º 1
0
Archivo: Link.php Proyecto: cwcw/cms
 /**
  *
  */
 public function update(Zend_Controller_Request_Abstract $request)
 {
     $node = parent::update($request);
     $defaults = array('NodeParamLinkId' => null, 'LinkedNodeId' => null, 'IsInternal' => null);
     $nodeParameter = SwIRS_Web_Request::getParam($request, $defaults);
     if (count($nodeParameter) > 1) {
         $result = Streamwide_Web_Model::call('Link.UpdateNodeParameter', array($nodeParameter));
     }
     return $node;
 }
Ejemplo n.º 2
0
Archivo: Prompt.php Proyecto: cwcw/cms
 /**
  *
  */
 public function getModalWindowData(Zend_Controller_Request_Abstract $request)
 {
     $customerPrompts = array();
     if (!SwIRS_Web_Request::isSuperAdmin($request)) {
         $customerAccountId = $request->getParam('CustomerAccountId');
         $customerPrompts = Streamwide_Web_Model::call('Prompt.GetByCustomer', array($customerAccountId));
     }
     $standardPrompts = Streamwide_Web_Model::call('Prompt.GetByCustomer', array(null));
     return array('CustomerPrompts' => $customerPrompts, 'StandardPrompts' => $standardPrompts);
 }
Ejemplo n.º 3
0
 /**
  *
  */
 public function update(Zend_Controller_Request_Abstract $request)
 {
     Streamwide_Web_Log::debug("update a " . $this->_type . " node");
     $defaults = array('NodeId' => null, 'Label' => null, 'IsActive' => null);
     $node = SwIRS_Web_Request::getParam($request, $defaults);
     if (count($node) > 1) {
         $result = Streamwide_Web_Model::call('Node.Update', array($node));
         Streamwide_Web_Log::debug("node " . $node['NodeId'] . " is updated");
     }
     return $node;
 }
Ejemplo n.º 4
0
 /**
  *
  */
 public function init()
 {
     // disable layout for ajax
     if ($this->_request->isXmlHttpRequest()) {
         $this->view->layout()->disableLayout();
     }
     $request = $this->getRequest();
     if (SwIRS_Web_Request::isSuperAdmin($request)) {
         $request->setParam('CustomerAccountId', 1);
         // global resource has customer account id null
     }
 }
Ejemplo n.º 5
0
 /**
  * Initialization
  *
  * @return void
  */
 public function init()
 {
     // disable layout for ajax
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->view->layout()->disableLayout();
     }
     $request = $this->getRequest();
     $customerAccountId = $request->getParam('CustomerAccountId');
     if (SwIRS_Web_Request::isSuperAdmin($request)) {
         $this->_isSuperAdmin = true;
         $this->_apiMaps = array('Query' => 'Tree.GetTemplatesByLabelPart', 'Count' => 'Tree.CountTemplates', 'GetAll' => 'Tree.GetTemplates');
     }
 }
Ejemplo n.º 6
0
 /**
  * Acl, error while the access deny
  * For Role[visitor] (@see SwIRS_Web_Request::isVisitor()), redirect to homepage
  * Otherwise, displayed the 403 Error page
  *
  * @return void
  */
 public function aclAction()
 {
     $this->getHelper('Layout')->disableLayout();
     Streamwide_Web_Log::debug('acl rejected');
     $request = $this->getRequest();
     if (SwIRS_Web_Request::isVisitor($request)) {
         Streamwide_Web_Log::debug('redirect the role[visitor] to homepage');
         $this->getHelper('ViewRenderer')->setNoRender();
         $this->getHelper('Redirector')->gotoSimpleAndExit('index', 'index');
     } else {
         // 403 error -- HTTP Error 403, access forbidden
         $this->getResponse()->setHttpResponseCode(403);
     }
 }
Ejemplo n.º 7
0
 /**
  * Login, register environments on this web application
  *
  * --------------------//Actual Login
  * <request>
  * 'Username'          //string
  * 'Password'          //string
  * <view-assign>
  * 'User'              //struct        $loggedUserInfo
  *
  * --------------------//Default
  * <request>
  * <view-assign>
  *
  * @return void
  */
 public function loginAction()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         if ($this->getRequest()->isXmlHttpRequest()) {
             $this->getHelper('Layout')->disableLayout();
         }
         $username = $request->getParam("Username");
         $password = $request->getParam("Password");
         $webservice = $this->getInvokeArg('bootstrap')->getResource('webservice');
         $webservice->setAuth(array('user' => $username, 'password' => $password));
         $user = Streamwide_Web_Model::call('User.Login', array($username, $password));
         //$user = $user[0];
         Streamwide_Web_Log::debug("user {$username} login");
         $namespace = new Zend_Session_Namespace('SwIRS_Web');
         $namespace->userInfo = $user;
         $namespace->username = $username;
         $namespace->password = $password;
         $namespace->customerState = $user['TemporaryPassword'];
         $namespace->customerUserId = $user['UserId'];
         $namespace->customerAccountId = $user['CustomerAccountId'];
         $namespace->secondaryCustomerAccountId = $user['CustomerAccountId'];
         $profile = Streamwide_Web_Model::call('User.GetProfileById', array($user['ProfileId']));
         $namespace->profile = $profile;
         $role = SwIRS_Web_Request::getRole($profile);
         $_SESSION['APPLICATION_ROLE'] = $role;
         if ($role == SwIRS_Web_Request::SUPER_ADMIN) {
             $namespace->customerAccountId = SwIRS_Web_Request::SUPER_ADMIN_CUSTOMER_ACCOUNT_ID;
             $namespace->secondaryCustomerAccountId = SwIRS_Web_Request::SUPER_ADMIN_CUSTOMER_ACCOUNT_ID;
         }
         if ($namespace->customerState == SwIRS_Web_Request::STATE_PROVISIONAL) {
             $role = SwIRS_Web_Request::PROVISIONAL;
         }
         $menu = SwIRS_Web_Request::getMenu($role);
         $namespace->menu = $menu;
         $this->view->assign('User', $user);
         $this->getHelper('viewRenderer')->direct('login-ack');
     }
 }
Ejemplo n.º 8
0
 /**
  * <request>
  * AssignedCustomerAccountId
  */
 public function sudoAction()
 {
     $request = $this->getRequest();
     $customerAccountId = $request->getParam('AssignedCustomerAccountId');
     $_SESSION['SwIRS_Web']['customerAccountId'] = $customerAccountId;
     if ($customerAccountId != SwIRS_Web_Request::SUPER_ADMIN_CUSTOMER_ACCOUNT_ID) {
         Streamwide_Web_Log::debug("super admin sudo as {$customerAccountId}");
         $_SESSION['SwIRS_Web']['menu'] = SwIRS_Web_Request::getMenu(SwIRS_Web_Request::ACCOUNT_ADMIN);
     } else {
         Streamwide_Web_Log::debug("super admin quits sudo");
         $_SESSION['SwIRS_Web']['menu'] = SwIRS_Web_Request::getMenu(SwIRS_Web_Request::SUPER_ADMIN);
     }
 }
Ejemplo n.º 9
0
 /**
  * update a contact
  * Actual update
  * ----------------
  * <request>
  * Act
  * ContactName
  * ContactNumber
  * ContactId
  *
  * <view-assign>
  * Result
  * Contact = array(
  *     ContactId
  *     ContactPhone
  *     ContactName
  *     CustomerUserId
  *     CustomerUserName
  *     CustomerAccountId
  *     CreationDateTime
  *     ModificationDateTime
  *     Automatic
  *     ReferenceCounter
  * )
  *
  * Modal window
  * ----------------
  * <request>
  * ContactId
  *
  * <view-assign>
  * Contact = array(
  *     ContactId
  *     ContactPhone
  *     ContactName
  *     CustomerUserId
  *     CustomerUserName
  *     CustomerAccountId
  *     CreationDateTime
  *     ModificationDateTime
  *     Automatic
  *     ReferenceCounter
  * )
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $contactId = $request->getParam('ContactId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug('contact update actual');
         $defaults = array('ContactId' => $contactId, 'ContactPhone' => null, 'ContactName' => null, 'Automatic' => false);
         $contact = SwIRS_Web_Request::getParam($request, $defaults);
         $result = Streamwide_Web_Model::call('Contact.Update', array($contact));
         Streamwide_Web_Log::debug("contact {$contactId} is updated");
         $this->view->assign('Result', $result);
         $this->getHelper('viewRenderer')->direct('update-ack');
     }
     Streamwide_Web_Log::debug("get a contact {$contactId}");
     $contact = Streamwide_Web_Model::call('Contact.GetById', array($contactId));
     $this->view->assign('Contact', $contact);
 }
Ejemplo n.º 10
0
 /**
  * create new numbergroup
  */
 public function createAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     if ('create' == $act) {
         Streamwide_Web_Log::debug("create a number group actual");
         $defaults = array('PremiumNumberGroupName' => '', 'SolutionId' => 1, 'CustomerAccountId' => 1, 'CustomerUserId' => 1, 'EmergencyTreeId' => null, 'EmergencyActivated' => null);
         $premiumNumberGroup = SwIRS_Web_Request::getParam($request, $defaults);
         $premiumNumberGroupId = Streamwide_Web_Model::call('PremiumNumberGroup.Create', array($premiumNumberGroup));
         Streamwide_Web_Log::debug("number group {$premiumNumberGroupId} is created");
         $premiumNumberIds = $request->getParam('PremiumNumberIds', array());
         if (!empty($premiumNumberIds)) {
             Streamwide_Web_Log::debug("add numbers to a number group {$premiumNumberGroupId}");
             $result = Streamwide_Web_Model::call('PremiumNumberGroup.AddPremiumNumber', array($premiumNumberGroupId, $premiumNumberIds));
         }
         $treeIds = $request->getParam('TreeIds', array());
         $startDatetimes = $request->getParam('StartDatetimes', array());
         $endDatetimes = $request->getParam('EndDatetimes', array());
         foreach ($treeIds as $key => $treeId) {
             $routingPlanId[] = Streamwide_Web_Model::call('PremiumNumberGroup.AddAllocatedTree', array($premiumNumberGroupId, $treeId, $startDatetimes[$key], $endDatetimes[$key]));
             Streamwide_Web_Log::debug("allocate tree {$treeId} to a number group {$premiumNumberGroupId}");
         }
         $this->view->assign(array('PremiumNumberGroupName' => $premiumNumberGroup['PremiumNumberGroupName'], 'CustomerUserId' => $premiumNumberGroup['CustomerUserId'], 'CustomerAccountId' => $premiumNumberGroup['CustomerAccountId'], 'Pagination' => $premiumNumberGroup));
         $this->getHelper('viewRenderer')->direct('create-ack');
     }
     if ('change-solution' == $act) {
         $solutionId = $request->getParam('SolutionId');
         $customerAccountId = $request->getParam('CustomerAccountId');
         Streamwide_Web_Log::debug("change solution as {$solutionId}");
         $availableNumbers = Streamwide_Web_Model::call('PremiumNumber.GetNotGrouped', array($solutionId, $customerAccountId));
         $trees = Streamwide_Web_Model::call('Tree.GetByCustomer', array($customerAccountId, $solutionId));
         $this->view->assign(array('AvailableNumbers' => $availableNumbers, 'Trees' => $trees));
         $this->getHelper('viewRenderer')->direct('change-solution');
     } else {
         $solutions = Streamwide_Web_Model::call('Solution.GetAll', array());
         $this->view->assign(array('Solutions' => $solutions));
     }
 }
Ejemplo n.º 11
0
 /**
  * update a trunk group
  * Act
  * TrunkGroupId
  * Label
  *
  * <view-assign>
  * Result
  * TrunkGroup = array(
  *     TrunkGroupId
  *     Label
  *     TrunkNumberCount
  *     CreationDateTime
  * )
  *
  * Modal window
  * -------------
  * <request>
  * TrunkGroupId
  * <view-assign>
  * TrunkGroup = array(
  *     TrunkGroupId
  *     Label
  *     TrunkNumberCount
  *     CreationDateTime
  * )
  *
  * Trunks = array(
  *      array(
  *          TrunkId
  *          Label
  *          ExternalId
  *          IpAddress
  *          Port
  *          TrunkStatusId
  *          TrunkStatus
  *          CreationDateTime
  *      )
  * )
  * AssignedTrunks = array(
  *      array(
  *          TrunkId
  *          Label
  *          ExternalId
  *          IpAddress
  *          Port
  *          TrunkStatusId
  *          TrunkStatus
  *          CreationDateTime
  *      )
  * )
  *
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $trunkGroupId = $request->getParam('TrunkGroupId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug("update trunk group {$trunkGroupId} actual");
         $defaults = array('TrunkGroupId' => $trunkGroupId, 'Label' => null);
         $trunkGroup = SwIRS_Web_Request::getParam($request, $defaults);
         if (!is_null($trunkGroup['Label'])) {
             $result = Streamwide_Web_Model::call('TrunkGroup.Update', array($trunkGroup));
             $this->view->assign('Result', $result);
         }
         $this->getHelper('viewRenderer')->direct('update-ack');
     } else {
         $trunks = Streamwide_Web_Model::call('Trunk.GetAll', array());
         $assignedTrunks = Streamwide_Web_Model::call('TrunkGroup.GetTrunks', array($trunkGroupId));
         $this->view->assign('Trunks', $trunks);
         $this->view->assign('AssignedTrunks', $assignedTrunks);
     }
     $trunkGroup = Streamwide_Web_Model::call('TrunkGroup.GetById', array($trunkGroupId));
     $this->view->assign('TrunkGroup', $trunkGroup);
 }
Ejemplo n.º 12
0
 /**
  * update a trunk
  * Actual update
  * -------------
  * <request>
  * Act
  * TrunkId
  * Label
  * ExternalId
  * IpAddress
  * Port
  *
  * <view-assign>
  * Result
  * Trunk = array(
  *     TrunkId
  *     Label
  *     ExternalId
  *     IpAddress
  *     Port
  *     TrunkStatusId
  *     TrunkStatus
  *     CreationDateTime
  * )
  *
  * Modal window
  * -------------
  * <request>
  * TrunkId
  * <view-assign>
  * Trunk = array(
  *     TrunkId
  *     Label
  *     ExternalId
  *     IpAddress
  *     Port
  *     TrunkStatusId
  *     TrunkStatus
  *     CreationDateTime
  * )
  *
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $trunkId = $request->getParam('TrunkId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug("update trunk {$trunkId} actual");
         $defaults = array('Label' => null, 'ExternalId' => null, 'IpAddress' => null, 'Port' => null);
         $trunk = SwIRS_Web_Request::getParam($request, $defaults);
         $result = Streamwide_Web_Model::call('Trunk.Update', array($trunk));
         $this->view->assign('Result', $result);
         $this->getHelper('viewRenderer')->direct('update-ack');
     }
     $trunk = Streamwide_Web_Model::call('Trunk.GetById', array($trunkId));
     $this->view->assign('Trunk', $trunk);
 }
Ejemplo n.º 13
0
 /**
  * update a customer
  * Actual update
  * -------------
  * <request>
  * Act
  * CustomerAccountId
  * CustomerAccountName
  * CustomerAccountBillingId
  * ContactName
  * ContactEmail
  * ContactPhone
  * MaxResPrompt
  * MaxResOrigin
  * MaxResBlacklist
  * MaxResCalendar
  * MaxResAgentgroup
  * MaxResContact
  * MaxResUser
  *
  * <view-assign>
  * Result
  * CustomerAccount = array(
  *     CustomerAccountName
  *     CustomerAccountBillingId
  *     ContactName
  *     ContactEmail
  *     ContactPhone
  *     CreationDateTime
  *     Quotas = array(
  *         QuotaId
  *         MaxResPrompt
  *         MaxResOrigin
  *         MaxResBlacklist
  *         MaxResCalendar
  *         MaxResAgentgroup
  *         MaxResContact
  *         MaxResUser
  *     )
  * )
  *
  * Modal window
  * -------------
  * <request>
  * CustomerAccountId
  *
  * <view-assign>
  * CustomerAccount = array(
  *     CustomerAccountName
  *     CustomerAccountBillingId
  *     ContactName
  *     ContactEmail
  *     ContactPhone
  *     CreationDateTime
  *     Quotas = array(
  *         QuotaId
  *         MaxResPrompt
  *         MaxResOrigin
  *         MaxResBlacklist
  *         MaxResCalendar
  *         MaxResAgentgroup
  *         MaxResContact
  *         MaxResUser
  *     )
  * )
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $customerAccountId = $request->getParam('CustomerAccountId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug('update a customer actual');
         $defaults = array('CustomerAccountId' => $customerAccountId, 'CustomerAccountName' => null, 'CustomerAccountBillingId' => null, 'ContactName' => null, 'ContactEmail' => null, 'ContactPhone' => null);
         $quotasDefaults = array('MaxResPrompt' => null, 'MaxResOrigin' => null, 'MaxResBlacklist' => null, 'MaxResCalendar' => null, 'MaxResAgentgroup' => null, 'MaxResContact' => null, 'MaxResUser' => null);
         $customerAccount = SwIRS_Web_Request::getParam($request, $defaults);
         $quotas = SwIRS_Web_Request::getParam($request, $quotasDefaults);
         if (!empty($quotas)) {
             $customerAccount['Quotas'] = $quotas;
         }
         $result = Streamwide_Web_Model::call('Customer.Update', array($customerAccount));
         Streamwide_Web_Log::debug("customer {$customerAccountId} is updated");
         $this->view->assign('Result', $result);
         $this->getHelper('viewRenderer')->direct('update-ack');
     }
     $customerAccount = Streamwide_Web_Model::call('Customer.GetById', array($customerAccountId));
     $this->view->assign('CustomerAccount', $customerAccount);
 }
Ejemplo n.º 14
0
 /**
  * create a calendar
  */
 public function createAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     if ('create' == $act) {
         Streamwide_Web_Log::debug("create a calendar actual");
         $pagination['CurrentPage'] = $request->getParam('CurrentPage', SwIRS_Web_Request::CURRENT_PAGE);
         $pagination['ItemsPerPage'] = $request->getParam('ItemsPerPage', SwIRS_Web_Request::ITEMS_PER_PAGE);
         $defaults = array('Label' => '', 'CalendarTypeId' => 1, 'Automatic' => false, 'CustomerUserId' => 1, 'CustomerAccountId' => 1);
         $calendar = SwIRS_Web_Request::getParam($request, $defaults);
         $calendarId = Streamwide_Web_Model::call('Calendar.Create', array($calendar));
         Streamwide_Web_Log::debug("calendar {$calendarId} is created");
         $period = array();
         if (3 == $calendar['CalendarTypeId']) {
             $periodLabels = $request->getParam('PeriodLabel', array());
             foreach ($periodLabels as $key => $periodLabel) {
                 $periodLabel = $periodLabel;
                 $period = array('CalendarId' => $calendarId, 'Label' => $periodLabel);
                 $periodIds[$key] = Streamwide_Web_Model::call('Calendar.AddPeriod', array($period));
                 Streamwide_Web_Log::debug("period {$periodIds[$key]} is created");
             }
         } else {
             $period = array('CalendarId' => $calendarId, 'Label' => '');
             $periodId = Streamwide_Web_Model::call('Calendar.AddPeriod', array($period));
             $periodIds[] = $periodId;
             Streamwide_Web_Log::debug("period {$periodId} is created");
         }
         foreach ($periodIds as $periodId) {
             $dates = $request->getParam('Date', array());
             $startDates = $endDates = '';
             if (count($dates) > 0) {
                 $startDates = $endDates = $dates;
             } else {
                 $startDates = $request->getParam('StartDate', array());
                 $endDates = $request->getParam('EndDate', array());
             }
             $count = 0;
             foreach ($startDates as $startDate) {
                 $endDate = $endDates[$count];
                 $count++;
                 $periodDay = array('PeriodId' => $periodId, 'StartDate' => $startDate, 'EndDate' => $endDate);
                 $periodDaysId = Streamwide_Web_Model::call('Calendar.AddPeriodDay', array($periodDay));
                 Streamwide_Web_Log::debug("period day {$periodDaysId} is created");
             }
         }
         $startSeconds = $request->getParam('StartSecond', array());
         $endSeconds = $request->getParam('EndSecond', array());
         foreach ($periodIds as $key => $periodId) {
             $startSecond = $startSeconds;
             $endSecond = $endSeconds;
             if (3 == $calendar['CalendarTypeId']) {
                 $startSecond = $startSeconds[$key];
                 $endSecond = $endSeconds[$key];
             }
             foreach ($startSecond as $index => $start) {
                 $end = $endSecond[$index];
                 $frequency = array('PeriodId' => $periodId, 'StartSecond' => $start, 'EndSecond' => $end);
                 $periodFrequencyId = Streamwide_Web_Model::call('Calendar.AddPeriodFrequency', array($frequency));
                 Streamwide_Web_Log::debug("period frequency {$periodFrequencyId} is created");
             }
         }
         $this->view->assign(array('CalendarLabel' => $calendar['Label'], 'CustomerUserId' => $calendar['CustomerUserId'], 'CustomerAccountId' => $calendar['CustomerAccountId'], 'Pagination' => $pagination));
         $this->getHelper('viewRenderer')->direct('create-ack');
     } else {
         Streamwide_Web_Log::debug("create a calendar modal window");
         $calendarTypes = Streamwide_Web_Model::call('Calendar.GetTypes', array());
         $this->view->assign(array('CalendarTypes' => $calendarTypes));
     }
 }
Ejemplo n.º 15
0
 /**
  * update number in blacklist
  * <request>
  * Act
  * BlacklistNumberId
  * PhoneNumber
  * EndDate
  * Dynamic
  *
  * <view-assign>
  * Result
  * BlacklistNumber = array(
  *     BlacklistNumberId
  *     PhoneNumber
  *     EndDate
  *     Dynamic
  *     BlacklistId
  * )
  */
 public function updatenumberAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $blacklistNumberId = $request->getParam('BlacklistNumberId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug("update a blacklist number {$blacklistNumberId} actual");
         $defaults = array('BlacklistNumberId' => $blacklistNumberId, 'PhoneNumber' => null, 'EndDate' => null, 'Dynamic' => null);
         $blacklistNumber = SwIRS_Web_Request::getParam($request, $defaults);
         $result = Streamwide_Web_Model::call('Blacklist.UpdateNumber', array($blacklistNumber));
         $this->view->assign('Result', $result);
         $this->getHelper('viewRenderer')->direct('updatenumber-ack');
     }
     Streamwide_Web_Log::debug("get a blacklist number {$blacklistNumberId}");
     $blacklistNumber = Streamwide_Web_Model::call('Blacklist.GetNumberById', array($blacklistNumberId));
     $this->view->assign('BlacklistNumber', $blacklistNumber);
 }
Ejemplo n.º 16
0
 /**
  * update a report
  * Actual update
  * -------------
  * <request>
  * Act
  *
  * <view-assign>
  * Result
  *
  * Modal window
  * -------------
  * <request>
  * <view-assign>
  * ReportTimeframes = array(
  *      array(
  *          ReportTimeframeId
  *          Resolution
  *          ResolutionUnit
  *          TimeframeUnit
  *          TimeframeMax
  *      )
  * )
  *
  * Users = array(
  *      array(
  *          UserId
  *          Name
  *          ....
  *      )
  * )
  *
  * Recipients = array(
  *      array(
  *          UserId
  *          Name
  *          ....
  *      )
  * )
  *
  * OriginGroups = array(
  *      array(
  *          OriginGroupId
  *          OriginGroupName
  *      )
  * )
  *
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $reportId = $request->getParam('ReportId');
     $customerUserId = $request->getParam('CustomerUserId');
     $customerAccountId = $request->getParam('CustomerAccountId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug("update report {$reportId} actual");
         $defaults = array('ReportId' => $reportId, 'ReportName' => null, 'ReportFormat' => null, 'ReportType' => null, 'OriginGroupId' => null, 'EmailFrequency' => null);
         $report = SwIRS_Web_Request::getParam($request, $defaults);
         $phoneNumberDefaults = array('PhoneNumberType' => null, 'PhoneNumberFrom' => null, 'PhoneNumberTo' => null);
         $reportPhoneNumber = SwIRS_Web_Request::getParam($request, $phoneNumberDefaults);
         if (!empty($reportPhoneNumber)) {
             $report['PhoneNumber'] = $reportPhoneNumber;
         }
         $timeframeDefaults = array('ReportStartDate' => null, 'ReportEndDate' => null, 'SumOnly' => null, 'ReportTimeframeValue' => null, 'ReportTimeframeId' => null);
         $reportTimeframe = SwIRS_Web_Request::getParam($request, $timeframeDefaults);
         if (!empty($reportTimeframe)) {
             $report['Timeframe'] = $reportTimeframe;
         }
         $result = Streamwide_Web_Model::call('Report.Update', array($report));
         $this->view->assign('Result', $result);
         $this->getHelper('viewRenderer')->direct('update-ack');
     } else {
         Streamwide_Web_Log::debug("update a report modal window");
         $users = Streamwide_Web_Model::call('User.GetByCustomer', array($customerAccountId));
         $recipients = Streamwide_Web_Model::call('Report.GetRecipients', array($reportId));
         $reportTimeframes = Streamwide_Web_Model::call('Report.GetTimeframes', array());
         $originGroups = Streamwide_Web_Model::call('Origin.GetGroups', array());
         $this->view->assign(array('ReportTimeframes' => $reportTimeframes, 'Users' => $users, 'Recipients' => $recipients, 'OriginGroups' => $originGroups));
     }
     $report = Streamwide_Web_Model::call('Report.GetById', array($reportId));
     $this->view->assign('Report', $report);
     $this->view->assign($this->_getDates());
 }
Ejemplo n.º 17
0
 /**
  *
  */
 public function getModalWindowData(Zend_Controller_Request_Abstract $request)
 {
     $customerPrompts = array();
     $agentGroups = array();
     $contacts = array();
     if (!SwIRS_Web_Request::isSuperAdmin($request)) {
         $customerAccountId = $request->getParam('CustomerAccountId');
         $customerPrompts = Streamwide_Web_Model::call('Prompt.GetByCustomer', array($customerAccountId));
         $agentGroups = Streamwide_Web_Model::call('Agentgroup.GetByCustomer', array($customerAccountId));
         $contacts = Streamwide_Web_Model::call('Contact.GetByCustomer', array($customerAccountId));
     }
     $standardPrompts = Streamwide_Web_Model::call('Prompt.GetByCustomer', array(null));
     $destinationTypes = Streamwide_Web_Model::call('Outgoing.GetDestinationTypes', array());
     return array('CustomerPrompts' => $customerPrompts, 'StandardPrompts' => $standardPrompts, 'DestinationTypes' => $destinationTypes, 'AgentGroups' => $agentGroups, 'Contacts' => $contacts);
 }
Ejemplo n.º 18
0
 /**
  * update a prompt
  * Actual update
  * -------------
  * <request>
  * Act
  * PromptId
  * PromptName
  * FileName
  * PromptContent
  * Description
  *
  * <view-assign>
  * Result
  * Prompt = array(
  *     PromptId
  * 	   PromptName
  * 	   FileSize
  *     FileName
  *     PromptContent
  *     Description
  *     CustomerUserId
  *     CustomerUserName
  *     CustomerAccountId
  *     CreationDateTime
  *     ModificationDateTime
  *     ReferenceCounter
  * )
  *
  * Modal window
  * ------------
  * <request>
  * PromptId
  * <view-assign>
  * Prompt = array(
  *     PromptId
  * 	   PromptName
  * 	   FileSize
  *     FileName
  *     PromptContent
  *     Description
  *     CustomerUserId
  *     CustomerUserName
  *     CustomerAccountId
  *     CreationDateTime
  *     ModificationDateTime
  *     ReferenceCounter
  * )
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $promptId = $request->getParam('PromptId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug('update a prompt actual');
         $defaults = array('PromptId' => $promptId, 'PromptName' => null, 'FileName' => null, 'PromptContent' => null, 'Description' => null);
         $prompt = SwIRS_Web_Request::getParam($request, $defaults);
         $result = Streamwide_Web_Model::call('Prompt.Update', array($prompt));
         $this->view->assign('Result', $result);
         $this->getHelper('viewRenderer')->direct('update-ack');
     }
     $prompt = Streamwide_Web_Model::call('Prompt.GetById', array($promptId));
     $this->view->assign('Prompt', $prompt);
 }
Ejemplo n.º 19
0
 /**
  * update a premium number
  *
  * Actual update
  * -------------
  * <request>
  * Act
  * PremiumNumberId
  * MaxCallDuration
  * StaticContactId
  * StaticContactPhone
  *
  * <view-assign>
  * Result
  * PremiumNumber = array(
  *     PremiumNumberId
  *     PremiumNumber
  *     PremiumNumberUi
  *     PremiumNumberGroupId
  *     PremiumNumberGroupName
  *     CustomerAccountId
  *     CustomerAccountName
  *     MaxCallDuration
  *     StaticContactId
  *     StaticContactName
  *     StaticContactPhoneNumber
  *     CreationDateTime
  *     SolutionId
  *     SolutionTypeId
  *     SolutionType
  *     TemplateTreeId
  *     TemplateTreeLabel
  * )
  *
  * Modal window
  * -------------
  * <request>
  * PremiumNumberId
  * <view-assign>
  * PremiumNumber = array(
  *     PremiumNumberId
  *     PremiumNumber
  *     PremiumNumberUi
  *     PremiumNumberGroupId
  *     PremiumNumberGroupName
  *     CustomerAccountId
  *     CustomerAccountName
  *     MaxCallDuration
  *     StaticContactId
  *     StaticContactName
  *     StaticContactPhoneNumber
  *     CreationDateTime
  *     SolutionId
  *     SolutionTypeId
  *     SolutionType
  *     TemplateTreeId
  *     TemplateTreeLabel
  * )
  */
 public function updateAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $premiumNumberId = $request->getParam('PremiumNumberId');
     if ('update' == $act) {
         Streamwide_Web_Log::debug("update premium number {$premiumNumberId} actual");
         $defaults = array('MaxCallDuration' => null, 'StaticContactId' => null, 'StaticContactPhone' => null);
         $premiumNumber = SwIRS_Web_Request::getParam($request, $defaults);
         if (!empty($premiumNumber)) {
             $premiumNumber['PremiumNumberId'] = $premiumNumberId;
             $result = Streamwide_Web_Model::call('PremiumNumber.Update', array($premiumNumber));
             $this->view->assign('Result', $result);
         }
         $this->getHelper('viewRenderer')->direct('update-ack');
     }
     $premiumNumber = Streamwide_Web_Model::call('PremiumNumber.GetById', array($premiumNumberId));
     $this->view->assign('PremiumNumber', $premiumNumber);
     $isSuperAdmin = true;
     if (!SwIRS_Web_Request::isSuperAdmin($request)) {
         $isSuperAdmin = false;
         $this->getHelper('viewRenderer')->direct('update-redirect');
         //update redirect number view for static solution
     }
     //update max call duraion view for super admin
 }