Exemplo n.º 1
0
 protected function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     if ($this->getTextMode() === TTextBoxMode::SingleLine) {
         if ($this->mask !== "") {
             $page = $this->getPage();
             $isEnabled = $this->getEnabled(true);
             if ($isEnabled && $page->getClientSupportsJavaScript() && $this->getEnableClientScript()) {
                 $JSFile = $this->publishAsset('assets/MaskedTextBox.js');
                 $writer->addAttribute('id', $this->getClientID());
                 $csm = $page->getClientScript();
                 if (!$csm->isScriptFileRegistered('MaskedTextBox')) {
                     $csm->registerScriptFile('MaskedTextBox', $JSFile);
                 }
                 $this->getPage()->getClientScript()->registerPostBackControl('MaskedTextBox', $this->getPostBackOptions());
             }
             if (strlen($this->getMask()) > 0) {
                 $writer->addAttribute('maxlength', strlen($this->getMask()));
             }
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Registers CSS and JS.
  * This method is invoked right before the control rendering, if the control is visible.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $this->registerClientScript();
 }
 private function draw_cells_dimension($PFCALCULATOR, $name = "Summe", $ORDER = 0, $DetailRow = "0")
 {
     if ($DetailRow == 0) {
         //$TESTDETAIL = StammdatenGroupRecord::finder()->findByidta_stammdaten_group((StammdatenRecord::finder()->findByidtm_stammdaten($PFCALCULATOR->dimension)->idta_stammdaten_group))->stammdaten_group_original;
         //$DetailChecker = $TESTDETAIL==1?1:0;
         $DetailChecker = 0;
     } else {
         $DetailChecker = 1;
     }
     $PFCALCULATOR->executeDimensionSQL($name, $DetailChecker, $this->InputBericht);
     $ROWS = $PFCALCULATOR->getValues();
     $ROWSPLAIN = $PFCALCULATOR->getPlainValues();
     $ALTERNATING = $this->sheetrow;
     $ROWCOUNTER = 0;
     //here comes the part for the iniputfield
     if ($this->InputBericht == 1) {
         $inp_idta_feldfunktion = $PFCALCULATOR->FeldFunktion;
         $inp_idta_variante = $this->Variante;
     }
     $temparray = array();
     //hier speicher ich die werte fuer das zwischenergebnis
     $WorkRowID = "";
     //empty an init var
     foreach ($ROWS as $row) {
         $jj = 1;
         $ROWCOUNTER++;
         $DDRowCounter = 1;
         //hier bauen wir die einzelnen Zeilen
         $ControlListCell = array();
         //clean the children
         $WorkRow = new TActiveTableRow();
         if ($this->InputBericht == 1) {
             $walkerCheck = count($ROWS) > 2 ? count($ROWS) - 1 : count($ROWS);
         } else {
             $walkerCheck = count($ROWS);
         }
         if ($ROWCOUNTER < $walkerCheck or $DetailChecker == 0 and $this->InputBericht == 0 or $this->InputBericht == 1) {
             $WorkRowID = "R" . $this->sheetrow;
             //new for grouping
             $this->resulttable->Rows[] = $WorkRow;
             $ColumnCounter = 0;
             foreach ($row as $value) {
                 $ControlListCellChildren = array();
                 //clean the children
                 $cell = new TActiveTableCell();
                 $cell->setID("R" . $this->sheetrow . "C" . $jj);
                 $jj++;
                 $cell->EnableViewState = true;
                 if ($this->InputBericht == 0 or $DDRowCounter == 1) {
                     if ($this->InputBericht == 1) {
                         $tmpText = preg_split("/xxx/", $value);
                         $cell->Text = $tmpText[1];
                         $inp_idtm_struktur = $tmpText[2];
                         $inp_idta_struktur_type = StrukturRecord::finder()->findByidtm_struktur($inp_idtm_struktur)->idta_struktur_type;
                     } else {
                         $cell->Text = $value;
                     }
                 } else {
                     $inp_per_month = $this->Perioden[$ColumnCounter - 1];
                     $inp_per_year = $PFCALCULATOR->getYearByMonth($inp_per_month);
                     $inputfield = new TActiveTextBox();
                     $UniqueID = 'xxx' . $inp_per_year . 'xxx' . $inp_per_month . 'xxx' . $inp_idta_struktur_type . 'xxx' . $inp_idta_feldfunktion . 'xxx' . $inp_idtm_struktur . 'xxx' . $inp_idta_variante . 'xxx';
                     if (!$this->page->isPostBack && !$this->page->isCallback && $this->InputBericht == 1) {
                         $inputfield->setText($value);
                         $MyUserFelderRecord = new UserFelderRecord();
                         $MyUserFelderRecord->user_id = $this->User->getUserId($this->User->Name);
                         $MyUserFelderRecord->tuf_feldname = $UniqueID;
                         $MyUserFelderRecord->save();
                     }
                     //$local_jahr."xxx".$local_jahr."xxx".$local_type."xxx".$local_ff."xxx".$local_id;
                     $inputfield->setId($UniqueID);
                     $inputfield->setCssClass("inputgrid");
                     //$this->page->registerObject($UniqueID,$inputfield);
                     $cell->Controls->add($inputfield);
                     $ControlListCellChildren[] = array("class" => "TActiveTextBox", "id" => $UniqueID, "OnCallback" => "", "CommandParameter" => "");
                 }
                 $WorkRow->Cells[] = $cell;
                 $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $jj, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
                 $DDRowCounter++;
                 $ColumnCounter++;
             }
             fmod($ALTERNATING, 2) == 0 ? $WorkRow->setCssClass('listalternating') : $WorkRow->setCssClass('listnonealternating');
             $ALTERNATING++;
         } else {
             $WorkRowID = "R" . $this->sheetrow . "G";
             //new for grouping
             $this->resulttable->Rows[] = $WorkRow;
             $jj = 1;
             if ($this->InputBericht == 0) {
                 $ControlListCellChildren = array();
                 foreach ($row as $value) {
                     $cell = new TActiveTableCell();
                     $cell->setID("R" . $this->sheetrow . "C" . $jj);
                     $jj++;
                     $cell->EnableViewState = true;
                     $cell->Text = $value;
                     $cell->setCssClass('calculatedsumme');
                     $WorkRow->Cells[] = $cell;
                     $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $jj, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
                 }
             }
         }
         $WorkRow->setID($WorkRowID);
         $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => $WorkRowID, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
         $this->sheetrow++;
         //increment rowcounter
     }
     $ALTERNATING = 0;
     $labelcounter = 0;
     foreach ($ROWSPLAIN as $rowplain) {
         $ALTERNATING++;
         if ($ALTERNATING == count($ROWSPLAIN)) {
             foreach ($rowplain as $valueplain) {
                 $labelcounter == 0 ? $labelcounter++ : array_push($temparray, $valueplain * 1);
             }
         }
     }
     $this->zwischenergebnisse[$name] = $temparray;
 }
Exemplo n.º 4
0
 /**
  * @return array list of callback options.
  */
 protected function getPostBackOptions()
 {
     //disallow page state update ?
     //$this->getActiveControl()->getClientSide()->setEnablePageStateUpdate(false);
     $options = array();
     if (strlen($string = $this->getSeparator())) {
         $string = strtr($string, array('\\t' => "\t", '\\n' => "\n", '\\r' => "\r"));
         $token = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);
         $options['tokens'] = $token;
     }
     if ($this->getAutoPostBack()) {
         $options = array_merge($options, parent::getPostBackOptions());
         $options['AutoPostBack'] = true;
     }
     if (strlen($select = $this->getTextCssClass())) {
         $options['select'] = $select;
     }
     $options['ResultPanel'] = $this->getResultPanel()->getClientID();
     $options['ID'] = $this->getClientID();
     $options['EventTarget'] = $this->getUniqueID();
     if (($minchars = $this->getMinChars()) !== '') {
         $options['minChars'] = $minchars;
     }
     if (($frequency = $this->getFrequency()) !== '') {
         $options['frequency'] = $frequency;
     }
     $options['CausesValidation'] = $this->getCausesValidation();
     $options['ValidationGroup'] = $this->getValidationGroup();
     return $options;
 }
Exemplo n.º 5
0
 /**
  * @return array list of callback options.
  */
 protected function getPostBackOptions()
 {
     $options = $this->getOptions()->toArray();
     if (strlen($separator = $this->getSeparator())) {
         $options['Separators'] = $separator;
     }
     if ($this->getAutoPostBack()) {
         $options = array_merge($options, parent::getPostBackOptions());
         $options['AutoPostBack'] = true;
     }
     if (strlen($textCssClass = $this->getTextCssClass())) {
         $options['textCssClass'] = $textCssClass;
     }
     $options['minLength'] = $this->getMinChars();
     $options['delay'] = $this->getFrequency() * 1000.0;
     $options['appendTo'] = '#' . $this->getResultPanel()->getClientID();
     $options['ID'] = $this->getClientID();
     $options['EventTarget'] = $this->getUniqueID();
     $options['CausesValidation'] = $this->getCausesValidation();
     $options['ValidationGroup'] = $this->getValidationGroup();
     return $options;
 }
Exemplo n.º 6
0
 /**
  * Ensure that the ID attribute is rendered and registers the javascript code
  * for initializing the active control. Also registers language specific global
  * settings for the first used date picker.
  */
 protected function addAttributesToRender($writer)
 {
     $cs = $this->getPage()->getClientScript();
     if (self::$_first) {
         $code = "jQuery(document).ready(function(){jQuery.datepicker.setDefaults(jQuery.datepicker.regional['{$this->getCurrentCulture()}']);});";
         $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
         self::$_first = false;
     }
     parent::addAttributesToRender($writer);
     $options = TJavascript::encode($this->getOptions()->toArray());
     $code = "jQuery('#" . $this->getWidgetID() . "')." . $this->getWidget() . "(" . $options . ");";
     $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
 }
Exemplo n.º 7
0
 protected function setFilter()
 {
     $cmd = $this->db->createCommand(SQL::SQL_GET_EXPORT);
     $cmd->bindValue(":id", $this->Request['id']);
     $data = $cmd->query();
     $data = $data->read();
     $sql = $data['sql'];
     $expreg = "(:\\w*_\\w*)";
     $jsParams = "var param = '&id=" . $this->Request['id'] . "'";
     if (preg_match_all($expreg, $sql, $catches)) {
         foreach ($catches[0] as $catch) {
             $type = explode("_", $catch);
             $this->catches[] = substr($catch, 1, strlen($catch) - 1);
             if (count($type) == 2) {
                 $fName = $type[1];
             } else {
                 $fName = 'TBD';
             }
             $label = new TLabel();
             $label->setText($fName . ' ');
             $this->filtre->Controls[] = $label;
             switch ($type[0]) {
                 case ':date':
                     $date = new TActiveDatePicker();
                     $date->setText('');
                     $date->setMode('ImageButton');
                     $date->setID(substr($catch, 1, strlen($catch) - 1));
                     $date->OnCallBack = array($this, "filterChange");
                     $this->filtre->Controls[] = $date;
                     $this->jsPrint .= "var {$fName} = document.getElementById('" . $date->getClientID() . "');\n";
                     $jsParams .= "+ '&" . substr($catch, 1, strlen($catch) - 1) . "=' + {$fName}.value";
                     break;
                 case ':int':
                     $int = new TActiveTextBox();
                     $int->setID(substr($catch, 1, strlen($catch) - 1));
                     $int->setText(0);
                     $int->OnCallBack = array($this, "filterChange");
                     $this->filtre->Controls[] = $int;
                     $this->jsPrint .= "var {$fName} = document.getElementById('" . $int->getClientID() . "');\n";
                     $jsParams .= "+ '&" . substr($catch, 1, strlen($catch) - 1) . "=' + {$fName}.value";
                     break;
                 case ':string':
                     $string = new TActiveTextBox();
                     $string->setID(substr($catch, 1, strlen($catch) - 1));
                     $string->setText('');
                     $string->setAutoPostBack(true);
                     $string->OnCallBack = array($this, "filterChange");
                     $this->filtre->Controls[] = $string;
                     $this->jsPrint .= "var {$fName} = document.getElementById('" . $string->getClientID() . "');\n";
                     $jsParams .= "+ '&" . substr($catch, 1, strlen($catch) - 1) . "=' + {$fName}.value";
                     break;
             }
             $label = new TLabel();
             $label->setText('&nbsp;&nbsp;&nbsp;');
             $this->filtre->Controls[] = $label;
         }
     }
     $jsParams .= "+ '&pdf=' + document.getElementById('" . $this->pdfExport->getClientID() . "').checked";
     $jsParams .= "+ '&excel=' + document.getElementById('" . $this->excelExport->getClientID() . "').checked";
     $jsParams .= "+ '&csv=' + document.getElementById('" . $this->csvExport->getClientID() . "').checked";
     $this->jsPrint .= $jsParams . ";\n";
     $this->jsPrint .= 'window.open( "' . $this->Service->constructUrl($this->getApplication()->getService()->getRequestedPagePath()) . '&action=print" + param, target="_blank" ) ;';
 }
 /**
  * @return array callback options.
  */
 protected function getPostBackOptions()
 {
     $options = parent::getPostBackOptions();
     $options['ID'] = $this->getLabelClientID();
     $options['TextBoxID'] = $this->getClientID();
     $options['ExternalControl'] = $this->getExternalControlID();
     $options['AutoHide'] = $this->getAutoHideTextBox() == false ? '' : true;
     $options['AutoPostBack'] = $this->getAutoPostBack() == false ? '' : true;
     $options['Columns'] = $this->getColumns();
     if ($this->getTextMode() === 'MultiLine') {
         $options['Rows'] = $this->getRows();
         $options['Wrap'] = $this->getWrap() == false ? '' : true;
     } else {
         $length = $this->getMaxLength();
         $options['MaxLength'] = $length > 0 ? $length : '';
     }
     if ($this->hasEventHandler('OnLoadingText')) {
         $options['LoadTextOnEdit'] = true;
     }
     $options['ReadOnly'] = $this->getReadOnly();
     return $options;
 }
Exemplo n.º 9
0
 public function load_splasher_table($sender, $param)
 {
     //init des von bezuges
     if ($sender->ID == "From_StammdatenGroupListe") {
         $this->From_idtm_stammdaten->Text = $param->Item->lst_idtm_stammdaten->Data;
         $this->load_splasher_values();
     }
     //alternierende werte
     $Alternating = 1;
     //holen der perioden
     $Taschenrechner = new PFCalculator();
     $Taschenrechner->setStartPeriod($this->DWH_idta_perioden->Text);
     //holen der detialwerte der zielperiode
     $MyRecords = StammdatenRecord::finder()->findAll('idta_stammdaten_group = ? AND stammdaten_aktiv = 0', $this->to_idta_stammdaten_group->Text);
     //kopfzeile
     $WorkRow = new TActiveTableRow();
     $this->resulttable->Rows[] = $WorkRow;
     $WorkRow->setCssClass('thead');
     //Beschriftung
     $ii = 1;
     $cell = new TActiveTableCell();
     $cell->setID("R" . $this->sheetrow . "C" . $ii . "GA");
     $cell->Text = "<b>Name</b>";
     $WorkRow->Cells[] = $cell;
     $ii++;
     //Datum als Titel
     foreach ($Taschenrechner->Perioden as $Periode) {
         $cell = new TActiveTableCell();
         $cell->setID("R" . $this->sheetrow . "C" . $ii . "A");
         $activeLabel = new TActiveLabel();
         $activeLabel->setID("R" . $this->sheetrow . "C" . $ii . "AL");
         $activeLabel->setText($Periode[0]);
         $cell->Controls->add($activeLabel);
         $WorkRow->Cells[] = $cell;
         $ii++;
     }
     foreach ($MyRecords as $StammdatenRC) {
         $ControlListCell = array();
         //clean the children
         $WorkRow = new TActiveTableRow();
         $this->resulttable->Rows[] = $WorkRow;
         //Beschriftung
         $cell = new TActiveTableCell();
         $cell->Text = "<b>" . $StammdatenRC->stammdaten_name . "</b>";
         $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C1", "OnCallback" => "", "CommandParameter" => "", "children" => "");
         $WorkRow->Cells[] = $cell;
         //Datenfelder
         $jj = 2;
         foreach ($Taschenrechner->Perioden as $Periode) {
             $ControlListCellChildren = array();
             //clean the children
             $cell = new TActiveTableCell();
             //eingabefeld
             $inputfield = new TActiveTextBox();
             $inputfield->setCssClass("inputgrid");
             $UniqueID = 'xxx' . $Taschenrechner->getYearByMonth($Periode[0]) . 'xxx' . $Periode[0] . 'xxx' . $this->From_idtm_stammdaten->Text . 'xxx' . $StammdatenRC->idtm_stammdaten;
             $inputfield->setId($UniqueID);
             $inputfield->Text = $this->RAMRecord[$UniqueID];
             $inputfield->AutoPostback = true;
             $inputfield->OnCallback = "page.onTextChanged";
             $cell->Controls->add($inputfield);
             $ControlListCellChildren[] = array("class" => "TActiveTextBox", "id" => $UniqueID, "OnCallback" => "page.onTextChanged", "CommandParameter" => "");
             $WorkRow->Cells[] = $cell;
             $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $jj, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
             $jj++;
         }
         //alternieren der zeilen
         fmod($ALTERNATING, 2) == 0 ? $WorkRow->setCssClass('listalternating') : $WorkRow->setCssClass('listnonealternating');
         $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => "R" . $this->sheetrow, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
         $ALTERNATING++;
         $this->sheetrow++;
     }
     $this->bindList_From_StammdatenGroupList();
     $param->Item->CssClass = "PSPFAZ";
     unset($Taschenrechner);
     $this->session['dynamicControlList'] = $this->dynamicControlList;
 }