/**
  *
  * @method get
  * @route /businessview/configuration
  */
 public function listAction()
 {
     $router = Di::getDefault()->get('router');
     $this->tpl->addJs('hogan-3.0.0.min.js')->addJs('centreon.tag.js', 'bottom', 'centreon-administration');
     $urls = array('tag' => array('add' => $router->getPathFor('/centreon-administration/tag/add'), 'del' => $router->getPathFor('/centreon-administration/tag/delete')));
     $this->tpl->append('jsUrl', $urls, true);
     parent::listAction();
 }
 /**
  *
  * @method get
  * @route /businessactivitytype/configuration
  */
 public function listAction()
 {
     $router = Di::getDefault()->get('router');
     $this->tpl->addJs('hogan-3.0.0.min.js');
     $urls = array();
     $this->tpl->append('jsUrl', $urls, true);
     parent::listAction();
 }
Beispiel #3
0
 /**
  * 
  * @method get
  * @route /{object}/[i:id]
  */
 public function editAction($additionnalParamsForSmarty = array(), $defaultValues = array())
 {
     $requestParam = $this->getParams('named');
     $auth_id = $requestParam['id'];
     $infos = AuthResourcesInfoRepository::getList($fields = '*', $count = -1, $offset = 0, $order = null, $sort = 'asc', $filters = array('ar_id' => $auth_id));
     foreach ($infos as $info) {
         $defaultValues['auth_info[' . $info["ari_name"] . ']'] = $info["ari_value"];
     }
     parent::editAction($additionnalParamsForSmarty, $defaultValues);
 }
 /**
  * Update a period
  *
  * @method post
  * @route /scheduled-downtime/update
  */
 public function updateAction()
 {
     $givenParameters = $this->getParams('post');
     $periods = json_decode($givenParameters['periods'], true);
     /* Update the periods */
     if (is_array($periods)) {
         ScheduledDowntimeRepository::updatePeriods($givenParameters['object_id'], $periods);
     }
     parent::updateAction();
 }
 /**
  * Update centreon options
  *
  *
  * @method post
  * @route /options/centreon/update
  */
 public function updateAction()
 {
     parent::updateAction();
 }
Beispiel #6
0
 /**
  * Update a poller
  *
  * @method get
  * @route /poller/[i:id]
  */
 public function editAction()
 {
     $params = $this->getParams();
     $poller = PollerModel::get($params['id']);
     $node = NodeModel::get($poller['node_id']);
     $this->tpl->addJs('poller-template.js', 'bottom', 'centreon-configuration');
     parent::editAction(array(), array('ip_address' => $node['ip_address']));
 }
 /**
  * Get list of icons for a specific business activity
  *
  *
  * @method get
  * @route /businessactivity/[i:id]/icon
  */
 public function iconForBaAction()
 {
     parent::getSimpleRelation('icon_id', '\\CentreonBam\\Models\\Icon');
 }
 /**
  * Get the timeperiod for a rule
  *
  * @method get
  * @route /notification-rule/[i:id]/timeperiod
  */
 public function getTimezoneAction()
 {
     parent::getSimpleRelation('timeperiod_id', '\\CentreonConfiguration\\Models\\Timeperiod');
 }
 /**
  * Get list of timezones for a specific user
  * 
  * @method get
  * @route /user/[i:id]/timezonesForUser
  */
 public function timezonesForUserAction()
 {
     parent::getRelations(static::$relationMap['user_timezone']);
 }
 /**
  * Create a new resource
  *
  * @method post
  * @route /resource/add
  */
 public function createAction()
 {
     parent::createAction();
 }
Beispiel #11
0
 /**
  * Trap for a specific service
  *
  * @method get
  * @route /service/[i:id]/trap
  */
 public function trapForServiceAction()
 {
     parent::getRelations(static::$relationMap['service_traps']);
 }
 /**
  * Users for a specific usergroup
  *
  * @method get
  * @route /usergroup/[i:id]/user
  */
 public function userForAclgroupAction()
 {
     parent::getRelations(static::$relationMap['usergroup_users']);
 }
 /**
  * Get the service template for a graph template
  *
  * @method get
  * @route /configuration/graphtemplate/[i:id]/servicetemplate
  */
 public function getServiceTemplateAction()
 {
     parent::getSimpleRelation('svc_tmpl_id', '\\CentreonConfiguration\\Models\\Servicetemplate');
 }
 /**
  * Service templates for specific trap
  *
  * @method get
  * @route /trap/[i:id]/servicetemplate
  */
 public function servicetemplateForTrapAction()
 {
     parent::getRelations(static::$relationMap['trap_servicetemplates']);
 }
 /**
  * Get command of a Host
  *
  *
  * @method get
  * @route /servicetemplate/[i:id]/command
  */
 public function getHostCommandAction()
 {
     parent::getSimpleRelation('command_command_id', '\\CentreonConfiguration\\Models\\Command');
 }
Beispiel #16
0
 /**
  * Get linked business activity for a specific kpi
  *
  *
  * @method get
  * @route /indicator/[i:id]/linkedbusinessactivity
  */
 public function linkedBusinessActivityForIndicatorAction()
 {
     parent::getSimpleRelation('id_ba', '\\CentreonBam\\Models\\BusinessActivity');
 }
 /**
  * Get contact group for a specific contact template
  *
  * @method get
  * @route /contacttemplate/[i:id]/contactgroup
  */
 public function contactGroupForContactAction()
 {
     parent::getRelations(static::$relationMap['contact_contactgroups']);
 }
Beispiel #18
0
 /**
  * Get list of pollers for a specific host
  *
  *
  * @method get
  * @route /host/[i:id]/poller
  */
 public function pollerForHostAction()
 {
     parent::getSimpleRelation('poller_id', '\\CentreonConfiguration\\Models\\Poller');
 }
Beispiel #19
0
 /**
  * Connector for a specific command
  *
  * @method get
  * @route /command/[i:id]/connector
  */
 public function connectorForCommandAction()
 {
     parent::getSimpleRelation('connector_id', '\\CentreonConfiguration\\Models\\Connector');
 }
 /**
  * Get command of a Host
  *
  *
  * @method get
  * @route /hosttemplate/[i:id]/command
  */
 public function getHostCommandAction()
 {
     $di = Di::getDefault();
     $router = $di->get('router');
     $requestParam = $this->getParams('named');
     parent::getSimpleRelation('command_command_id', '\\CentreonConfiguration\\Models\\Command');
 }
Beispiel #21
0
 /**
  *
  * @method get
  * @route /engine/[i:id]/ocspcommand
  */
 public function ocspCommandForEngineAction()
 {
     parent::getSimpleRelation('ocsp_command', '\\CentreonConfiguration\\Models\\Command');
 }
 /**
  * Domains for a specific acl resource
  *
  * @method get
  * @route /aclresource/[i:id]/domain
  */
 public function domainForAclresourceAction()
 {
     parent::getRelations(static::$relationMap['aclresource_domains']);
 }
Beispiel #23
0
 /**
  * Create a new host
  *
  * @method post
  * @route /contact/add
  */
 public function createAction()
 {
     $aTags = array();
     $givenParameters = $this->getParams('post');
     $id = parent::createAction(false);
     $listWays = array();
     if (isset($givenParameters['way_name']) && isset($givenParameters['way_value'])) {
         $wayName = $givenParameters['way_name'];
         $wayValue = $givenParameters['way_value'];
         foreach ($wayName as $key => $name) {
             if (!empty($name) && !empty($wayValue[$key])) {
                 $listWays[$name] = array('value' => $wayValue[$key]);
             }
         }
     }
     try {
         NotificationWayRepository::saveNotificationWays($id, 'create', $listWays);
     } catch (\Exception $ex) {
         $errorMessage = $ex->getMessage();
         $this->router->response()->json(array('success' => false, 'error' => $errorMessage));
     }
     if (isset($givenParameters['contact_tags'])) {
         $aTagList = explode(",", $givenParameters['contact_tags']);
         foreach ($aTagList as $var) {
             $var = trim($var);
             if (!empty($var)) {
                 array_push($aTags, $var);
             }
         }
         if (count($aTags) > 0) {
             TagsRepository::saveTagsForResource(self::$objectName, $id, $aTags, '', false, 1);
         }
     }
     $this->router->response()->json(array('success' => true));
 }