Esempio n. 1
0
 /**
  *
  */
 public function update(Zend_Controller_Request_Abstract $request)
 {
     $node = parent::update($request);
     $defaults = array('NodeParamBlacklistId' => null, 'HasPayphoneFilter' => null, 'PayphoneRejectionPromptId' => null, 'BlacklistId' => null, 'BlacklistRejectionPromptId' => null);
     $nodeParameter = SwIRS_Web_Request::getParam($request, $defaults);
     if (count($nodeParameter) > 1) {
         $result = Streamwide_Web_Model::call('Blacklist.UpdateNodeParameter', array($nodeParameter));
     }
     return $node;
 }
Esempio n. 2
0
File: Link.php Progetto: 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;
 }
Esempio 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;
 }
Esempio n. 4
0
File: Prompt.php Progetto: cwcw/cms
 /**
  *
  */
 public function update(Zend_Controller_Request_Abstract $request)
 {
     $node = parent::update($request);
     $nodeOutput = $request->getParam('NodeOutput');
     $this->updateOutput($nodeOutput);
     $defaults = array('NodeParamPromptId' => null, 'PromptId' => null, 'IsStandard' => null);
     $nodeParameter = SwIRS_Web_Request::getParam($request, $defaults);
     if (count($nodeParameter) > 1) {
         $result = Streamwide_Web_Model::call('Prompt.UpdateNodeParameter', array($nodeParameter));
     }
     return $node;
 }
Esempio n. 5
0
File: Menu.php Progetto: cwcw/cms
 /**
  * NodeOutputs = array(
  *      array(
  *          NodeOutputId
  *          NodeId
  *          NextNodeId
  *          Label
  *          IsDefault
  *          IsActive
  *          IsAllowed
  *      )
  * )
  *
  */
 public function update(Zend_Controller_Request_Abstract $request)
 {
     $node = parent::update($request);
     $outputs = $request->getParam('NodeOutputs');
     $this->updateOutputs($outputs);
     $defaults = array('NodeParamMenuId' => null, 'MaxTries' => null, 'NoinputTimeout' => null, 'DetectDtmfOnPrompt' => null, 'GreetingPromptId' => null, 'NoinputPromptId' => null, 'WrongKeyPromptId' => null);
     $nodeParameter = SwIRS_Web_Request::getParam($request, $defaults);
     if (count($nodeParameter) > 1) {
         $result = Streamwide_Web_Model::call('Menu.UpdateNodeParameter', array($nodeParameter));
     }
     return $node;
 }
Esempio n. 6
0
 /**
  *
  */
 public function update(Zend_Controller_Request_Abstract $request)
 {
     $node = parent::update($request);
     $outputs = $request->getParam('NodeOutputs');
     $this->updateOutputs($outputs);
     $defaults = array('NodeParamOutgoingId' => null, 'DestinationTypeId' => null, 'ContactId' => null, 'IsAgentGroupAllowed' => false, 'AgentGroupId' => null, 'IsFailoverAllowed' => false, 'RingingDuration' => null, 'IsWaitingQueueAllowed' => false, 'IsSimutaneousCallAllowed' => false);
     $nodeParameter = SwIRS_Web_Request::getParam($request, $defaults);
     if ($nodeParameter['IsWaitingQueueAllowed']) {
         $waitingQueueDefaults = array('HasWaitingQueue' => null, 'QueueGreetingPromptId' => null, 'QueuePeriodicPromptId' => null, 'QueueMaxLength' => null, 'QueueMaxWaitingTime' => null, 'QueueHasPositionPrompt' => null, 'QueueMaxPositionPrompt' => null);
         $waitingQueue = SwIRS_Web_Request::getParam($request, $waitingQueueDefaults);
         $nodeParameter['WaitingQueue'] = $waitingQueue;
     }
     if ($nodeParameter['IsSimutaneousCallAllowed']) {
         $simutaneousCallDefaults = array('HasSimutaneousCalls' => null, 'MaxSimutaneousCalls' => null);
         $simutaneousCall = SwIRS_Web_Request::getParam($request, $simutaneousCallDefaults);
         $nodeParameter['SimutaneousCall'] = $simutaneousCall;
     }
     $result = Streamwide_Web_Model::call('Outgoing.UpdateNodeParameter', array($nodeParameter));
     return $node;
 }
Esempio n. 7
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());
 }
Esempio n. 8
0
 /**
  * update an user account
  *
  * --------------------//Actual update
  * <request>
  * 'Act'               //string
  * 'CustomerUserId'    //numberic
  * 'Name'              //string
  * 'EmailAddress'      //string
  * 'Password'          //string
  * <view-assign>
  *
  * --------------------//Default
  * <request>
  * <view-assign>
  * 'CurrentRequestUri' //string   for navigation menu
  * 'User'              //struct
  *
  * @return void
  */
 public function accountAction()
 {
     $request = $this->getRequest();
     $act = $request->getParam('Act');
     $userId = $request->getParam('CustomerUserId');
     if ($request->isPost() && $request->isXmlHttpRequest()) {
         Streamwide_Web_Log::debug('update a user account actual');
         $defaults = array('UserId' => $userId, 'Name' => null, 'EmailAddress' => null, 'Password' => null);
         $user = SwIRS_Web_Request::getParam($request, $defaults);
         $result = Streamwide_Web_Model::call('User.Update', array($user));
         if ('OK' == $result) {
             $_SESSION['SwIRS_Web']['userInfo'] = Streamwide_Web_Model::call('User.GetById', array($userId));
             if (array_key_exists('Password', $user)) {
                 $_SESSION['SwIRS_Web']['password'] = $user['Password'];
             }
             $_SESSION['SwIRS_Web']['customerState'] = SwIRS_Web_Request::STATE_ACTIVE;
         }
         $this->view->assign(array('Result' => $result, 'User' => $_SESSION['SwIRS_Web']['userInfo']));
         $this->getHelper('viewRenderer')->direct('account-ack');
     }
     $this->view->assign(array('CurrentRequestUri' => 'admin/account', 'User' => $_SESSION['SwIRS_Web']['userInfo']));
 }
Esempio 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);
 }
Esempio 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));
     }
 }
Esempio n. 11
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);
 }
Esempio n. 12
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);
 }
Esempio n. 13
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));
     }
 }
Esempio n. 14
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);
 }
Esempio n. 15
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);
 }
Esempio n. 16
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);
 }
Esempio n. 17
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
 }