Example #1
0
 public function __construct(AriiSession $session)
 {
     $this->session = $session;
     // date par defaut
     $this->CurrentDate = date('Y-m-d');
     $Site = $session->getSite();
     $this->TZLocal = $Site['timezone'];
     // si le timezone est vide, on prend le timezone php
     if ($this->TZLocal == '') {
         $this->TZLocal = date_default_timezone_get();
     }
     $target_offset = $this->getOffset($this->TZLocal);
     foreach ($session->getSpoolers() as $k => $v) {
         $s = $v['name'];
         $t = $v['timezone'];
         $this->TZSpooler[$s] = $t;
         $this->TZOffset[$s] = $target_offset - $this->getOffset($t);
     }
     // pour les spoolers par defaut en 1.5
     $this->DefaultOffset = $this->getOffset($this->TZLocal);
 }
Example #2
0
 public function __construct(AriiSession $session, TranslatorInterface $translator)
 {
     $this->session = $session;
     // date par defaut
     $this->CurrentDate = date('Y-m-d');
     $this->translator = $translator;
     $Site = $session->getSite();
     $this->TZLocal = $Site['timezone'];
     // si le timezone est vide, on prend le timezone php
     if ($this->TZLocal == '') {
         $this->TZLocal = date_default_timezone_get();
     }
     $target_offset = $this->getOffset($this->TZLocal);
     /* Devient inutile, les ordonnanceurs stockent les dates en GMT
        foreach ($session->getSpoolers() as $k=>$v) {     
            $s = $v['name'];
            $t = $v['timezone'];
            $this->TZSpooler[$s] = $t;
            $this->TZOffset[$s] = $target_offset - $this->getOffset($t);
        }
         */
     // pour les spoolers par defaut en 1.5
     $this->DefaultOffset = $this->getOffset($this->TZLocal);
 }
Example #3
0
 public function __construct(AriiSession $session)
 {
     $this->session = $session;
     $this->enterprise = $session->getEnterprise();
     // Securité !
     $this->Access = $session->getTeamRights();
     // on retraite les champs d'accès
     $n = 0;
     while (isset($this->Access[$n]['path'])) {
         $this->Access[$n]['job_name'] = $this->AppendPath($this->Access[$n]['path'], $this->Access[$n]['job']);
         $this->Access[$n]['job_chain'] = $this->AppendPath($this->Access[$n]['path'], $this->Access[$n]['job_chain']);
         $n++;
     }
     $db = $session->getDatabase();
     $this->driver = $db['driver'];
     if (isset($db['owner'])) {
         $this->owner = $db['owner'];
     } else {
         $this->owner = '';
     }
     $Spooler = $session->getSpooler();
     $this->spooler = $Spooler['name'];
     if ($this->spooler == 'spooler.all') {
         $this->spooler = '%';
     }
     $this->ref_date = $session->getRefDate();
     $this->ref_past = $session->getRefPast();
     $this->ref_future = $session->getRefFuture();
     $this->ref_timestamp = $session->getRefTimestamp();
     // Correction des dates
     switch ($this->driver) {
         case 'oci8':
         case 'oracle':
         case 'pdo_oci':
             $this->past = "to_date('" . $session->getPast() . "','yyyy-mm-dd hh24:mi:ss')";
             $this->future = "to_date('" . $session->getFuture() . "','yyyy-mm-dd hh24:mi:ss')";
             break;
         default:
             $this->past = '"' . $session->getPast() . '"';
             $this->future = '"' . $session->getFuture() . '"';
             break;
     }
     // filtre en cours
     $Filter = $session->getUserFilter();
     $this->spooler = str_replace('*', '%', $Filter['spooler']);
     $this->job_name = str_replace('*', '%', $Filter['job']);
     $this->job_chain = str_replace('*', '%', $Filter['job_chain']);
     if ($this->job_chain == '') {
         $this->job_chain = '%';
     }
     $this->order_id = str_replace('*', '%', $Filter['order_id']);
     if ($this->order_id == '') {
         $this->order_id = '%';
     }
     $this->status = str_replace('*', '%', $Filter['status']);
     # valeur par defaut, au cas ou...
     if ($this->ref_past == "") {
         $this->ref_past = -4;
     }
     if ($this->ref_future == "") {
         $this->ref_future = 2;
     }
     if ($this->spooler == "") {
         $this->spooler = "%";
     }
 }
Example #4
0
 public function __construct(\Arii\CoreBundle\Service\AriiSession $session)
 {
     $this->ColorStatus = $session->getColors();
 }