protected function _setDefaultValueMain()
 {
     parent::_setDefaultValueMain();
     $this->default_data['url'] = 'http://{$address}/glpi/front/ticket.form.php?id={$ticket_id}';
     $this->default_data['clones']['groupList'] = array(array('Id' => 'gpli_entity', 'Label' => _('Entity'), 'Type' => self::GPLI_ENTITIES_TYPE, 'Filter' => '', 'Mandatory' => ''), array('Id' => 'glpi_group', 'Label' => _('Glpi group'), 'Type' => self::GPLI_GROUPS_TYPE, 'Filter' => '', 'Mandatory' => ''), array('Id' => 'glpi_itil_category', 'Label' => _('Itil category'), 'Type' => self::GLPI_ITIL_CATEGORIES_TYPE, 'Filter' => '', 'Mandatory' => ''), array('Id' => 'urgency', 'Label' => _('Urgency'), 'Type' => self::CUSTOM_TYPE, 'Filter' => '', 'Mandatory' => ''), array('Id' => 'impact', 'Label' => _('Impact'), 'Type' => self::CUSTOM_TYPE, 'Filter' => '', 'Mandatory' => ''));
     $this->default_data['clones']['customList'] = array(array('Id' => 'urgency', 'Value' => '1', 'Default' => ''), array('Id' => 'urgency', 'Value' => '2', 'Default' => ''), array('Id' => 'urgency', 'Value' => '3', 'Default' => ''), array('Id' => 'urgency', 'Value' => '4', 'Default' => ''), array('Id' => 'urgency', 'Value' => '5', 'Default' => ''), array('Id' => 'impact', 'Value' => '1', 'Default' => ''), array('Id' => 'impact', 'Value' => '2', 'Default' => ''), array('Id' => 'impact', 'Value' => '3', 'Default' => ''), array('Id' => 'impact', 'Value' => '4', 'Default' => ''), array('Id' => 'impact', 'Value' => '5', 'Default' => ''));
 }
Ejemplo n.º 2
0
 public function initialize(\Boris\Boris $boris, $dir)
 {
     parent::initialize($boris, $dir);
     chdir($dir);
     define('DRUPAL_ROOT', $dir);
     require_once "{$dir}/includes/bootstrap.inc";
     drupal_override_server_variables();
     drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 }
Ejemplo n.º 3
0
 public function initialize(\Boris\Boris $boris, $dir)
 {
     $config = json_decode(file_get_contents("{$dir}/composer.json"), true);
     if (isset($config['name'])) {
         $this->name = $config['name'];
     }
     parent::initialize($boris, $dir);
     echo "Using {$dir}/composer.json\n";
     $loader = (require "{$dir}/vendor/autoload.php");
     $boris->onStart(function ($worker, $vars) use($loader) {
         $worker->setLocal('loader', $loader);
     });
 }
Ejemplo n.º 4
0
 public function initialize(\Boris\Boris $boris, $dir)
 {
     parent::initialize($boris, $dir);
     require "{$dir}/ezpublish/bootstrap.php.cache";
     require_once "{$dir}/ezpublish/EzPublishKernel.php";
     $kernel = new \EzPublishKernel('dev', true);
     $kernel->loadClassCache();
     $kernel->boot();
     $boris->onStart(function ($worker, $vars) use($kernel) {
         $worker->setLocal('kernel', $kernel);
         $worker->setLocal('container', $kernel->getContainer());
     });
 }
 public function __construct($options, $entityManager, $userService)
 {
     parent::__construct($options, $entityManager, $userService);
     // init ZF2 logger
     $logFileDir = getcwd() . '/data/VisoftBaseModule/log/';
     $logFilePath = $logFileDir . 'oauth2-provider-' . static::PROVIDER_NAME . '.log';
     \VisoftBaseModule\Controller\Plugin\AccessoryPlugin::checkDir($logFileDir);
     $this->logger = new \Zend\Log\Logger();
     $writer = new \Zend\Log\Writer\Stream($logFilePath);
     $this->logger->addWriter($writer);
     // init Facebook SDK
     $this->facebookSDK = new \Facebook\Facebook(['app_id' => $options->getClientId(), 'app_secret' => $options->getClientSecret(), 'default_graph_version' => 'v2.6']);
 }
Ejemplo n.º 6
0
 public function initialize(\Boris\Boris $boris, $dir)
 {
     parent::initialize($boris, $dir);
     $classloader = (require_once $dir . '/core/vendor/autoload.php');
     $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
     $kernel = \Drupal\Core\DrupalKernel::createFromRequest($request, $classloader, 'dev');
     $kernel->boot();
     $kernel->prepareLegacyRequest($request);
     \Drupal::getContainer()->set('request', $request);
     $boris->onStart(function ($worker, $vars) use($kernel) {
         $worker->setLocal('kernel', $kernel);
         $worker->setLocal('container', $kernel->getContainer());
     });
 }
Ejemplo n.º 7
0
 public function initialize(\Boris\Boris $boris, $dir)
 {
     parent::initialize($boris, $dir);
     if (is_file("{$dir}/app/bootstrap.php.cache")) {
         require "{$dir}/app/bootstrap.php.cache";
     } else {
         require "{$dir}/app/autoload.php";
     }
     require_once "{$dir}/app/AppKernel.php";
     $kernel = new \AppKernel('dev', true);
     $kernel->loadClassCache();
     $kernel->boot();
     $boris->onStart(function ($worker, $vars) use($kernel) {
         $worker->setLocal('kernel', $kernel);
         $worker->setLocal('container', $kernel->getContainer());
     });
 }
    protected function _setDefaultValueMain()
    {
        parent::_setDefaultValueMain();
        $this->default_data['message_confirm'] = '
<table class="table">
<tr>
    <td class="FormHeader" colspan="2"><h3 style="color: #00bfb3;">{$title}</h3></td>
</tr>
{if $ticket_is_ok == 1}
    <tr><td class="FormRowField" style="padding-left:15px;">New ticket opened: {$ticket_id}.</td></tr>
{else}
    <tr><td class="FormRowField" style="padding-left:15px;">Error to open the ticket: <xmp>{$ticket_error_message}</xmp></td></tr>
{/if}
</table>
';
        $this->default_data['message_confirm'] = $this->change_html_tags($this->default_data['message_confirm']);
        $this->default_data['url'] = 'http://{$address}/index.pl?Action=AgentTicketZoom;TicketNumber={$ticket_id}';
    }
 /**
  * @return array
  */
 public function getDefaultOptions()
 {
     $defaultOptions = parent::getDefaultOptions();
     $defaultOptions['header'] = 'diamante.automation.notification.ticket.removed';
     return $defaultOptions;
 }
Ejemplo n.º 10
0
 protected function getTokenFields($code)
 {
     return array_merge(parent::getTokenFields($code), ['grant_type' => 'authorization_code']);
 }
Ejemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 protected function getCodeFields($state = null)
 {
     $fields = parent::getCodeFields($state);
     if ($this->popup) {
         $fields['display'] = 'popup';
     }
     return $fields;
 }
Ejemplo n.º 12
0
 /**
  * 获取 access token 所需的参数。
  *
  * @param string $code
  * @return array
  */
 protected function getTokenFields($code)
 {
     $fields = parent::getTokenFields($code);
     $fields['grant_type'] = 'authorization_code';
     return $fields;
 }
 public function closeTicket(&$tickets)
 {
     if ($this->doCloseTicket()) {
         foreach ($tickets as $k => $v) {
             if ($this->closeTicketOtrs($k) == 0) {
                 $tickets[$k]['status'] = 2;
             } else {
                 $tickets[$k]['status'] = -1;
                 $tickets[$k]['msg_error'] = $this->ws_error;
             }
         }
     } else {
         parent::closeTicket($tickets);
     }
 }
Ejemplo n.º 14
0
 /**
  * 从响应内容解析出 access token。
  *
  * @param string $body
  * @return string
  */
 protected function parseAccessToken($body)
 {
     $this->openId = json_decode($body, true)['openid'];
     return parent::parseAccessToken($body);
 }
Ejemplo n.º 15
0
 public function __construct($acct)
 {
     parent::__construct($acct);
 }
Ejemplo n.º 16
0
 protected function getPostingFormFields()
 {
     $fields = parent::getPostingFormFields();
     $fields->setFields(['button' => 'post']);
     return $fields;
 }
 /**
  * @return array
  */
 public function getDefaultOptions()
 {
     $defaultOptions = parent::getDefaultOptions();
     $defaultOptions['header'] = 'diamante.automation.notification.comment.created';
     return $defaultOptions;
 }
 public function __construct($options, $entityManager, $userService)
 {
     parent::__construct($options, $entityManager, $userService);
 }
Ejemplo n.º 19
0
 /**
  * Get the POST fields for the token request.
  *
  * @param  string  $code
  * @return array
  */
 protected function getTokenFields($code)
 {
     return parent::getTokenFields($code) + ['grant_type' => 'authorization_code'];
 }
 protected function _setDefaultValueMain()
 {
     parent::_setDefaultValueMain();
     $this->default_data['format_popup'] = '';
 }
Ejemplo n.º 21
0
 /**
  * {@inheritdoc}
  */
 protected function getCodeFields($state = null)
 {
     $fields = parent::getCodeFields($state);
     if ($this->popup) {
         $fields['display'] = 'popup';
     }
     if ($this->reRequest) {
         $fields['auth_type'] = 'rerequest';
     }
     return $fields;
 }
 protected function _setDefaultValueMain()
 {
     parent::_setDefaultValueMain(1);
 }