Ejemplo n.º 1
0
 /**
  * Static method to get the singleton instance
  * 
  * @access	public
  * @return	object $instance Singular ilBMFSettings instance
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new ilBMFSettings();
     }
     return self::$instance;
 }
 public function bmfSettingsObject()
 {
     /** 
      * @var $rbacsystem ilRbacSystem
      * */
     global $rbacsystem;
     // MINIMUM ACCESS LEVEL = 'read'
     if (!$rbacsystem->checkAccess('read', $this->object->getRefId())) {
         $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
     }
     include_once './Services/Payment/classes/class.ilBMFSettings.php';
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     /**
      * @var $bmfSetObj ilBMFSettings	
      */
     $bmfSetObj = ilBMFSettings::getInstance();
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveBmfSettings'));
     $form->setTitle($this->lng->txt('pays_bmf_settings'));
     $form->addCommandButton('saveBmfSettings', $this->lng->txt('save'));
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_client_id'), 'mandantNr');
     $formItem->setValue($bmfSetObj->getClientId());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_bewirtschafter_nr'), 'bewirtschafterNr');
     $formItem->setValue($bmfSetObj->getBewirtschafterNr());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_haushaltsstelle'), 'haushaltsstelle');
     $formItem->setValue($bmfSetObj->getHaushaltsstelle());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_object_id'), 'objektNr');
     $formItem->setValue($bmfSetObj->getObjectId());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_kennzeichen_mahnverfahren'), 'kennzeichenMahnverfahren');
     $formItem->setValue($bmfSetObj->getKennzeichenMahnverfahren());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_waehrungskennzeichen'), 'waehrungskennzeichen');
     $formItem->setValue($bmfSetObj->getWaehrungsKennzeichen());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_epayment_server'), 'ePaymentServer');
     $formItem->setValue($bmfSetObj->getEpaymentServer());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_client_certificate'), 'clientCertificate');
     $formItem->setValue($bmfSetObj->getClientCertificate());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_ca_certificate'), 'caCertificate');
     $formItem->setValue($bmfSetObj->getCaCertificate());
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt('pays_bmf_timeout'), 'timeOut');
     $formItem->setValue($bmfSetObj->getTimeOut());
     $form->addItem($formItem);
     $this->tpl->setVariable('FORM', $form->getHTML());
     return true;
 }
 function BuchungsListe($userId, $values = "")
 {
     global $ilias;
     $bmfSetObj = ilBMFSettings::getInstance();
     $bmfConfig = $bmfSetObj->getAll();
     if ($bmfConfig["bewirtschafterNr"] != NULL) {
         $this->bewirtschafterNr = $bmfConfig["bewirtschafterNr"];
     }
     if ($bmfConfig["waehrungskennzeichen"] != NULL) {
         $this->waehrungskennzeichen = $bmfConfig["waehrungskennzeichen"];
     }
     $this->faelligkeitsdatum = date("Y-m-d") . "T" . date("H:i:s") . "Z";
     if ($bmfConfig["kennzeichenMahnverfahren"] != NULL) {
         $this->kennzeichenMahnverfahren = $bmfConfig["kennzeichenMahnverfahren"];
     }
     $inst_id_time = $ilias->getSetting('inst_id') . '_' . $userId . '_' . substr((string) time(), -3);
     $this->EShopTransaktionsNr = $inst_id_time . substr(md5(uniqid(rand(), true)), 0, 4);
     if (is_array($values)) {
         if ($values["betrag"] != NULL) {
             $this->betrag = (double) $values["betrag"];
         }
         if ($values["buchungen"] != NULL) {
             $this->buchungen = $values["buchungen"];
         }
     }
 }