Pridani adresare
549862
public function handleAddDir(): void
	{
		if ($this->presenter->isAjax() && $this->editable) {
			$files = $this->getFiles();
			$dirName = $this->generateName('newDir');
			mkdir($this->getFullPath($dirName));
			array_unshift($files, $this->rename($dirName));
			$this->template->files = $files;
			$this->redrawControl();
		} else {
			exit;
		}
	}
1306807
function f_nesne_idleri(_olay, _tahta_id) {
        return f_olaya_uygun_idler(_olay)
            .then(function (_cekilen_idler) {
                if (_cekilen_idler && _cekilen_idler.length > 0) {
                    switch (_olay) {
                        case schema.SABIT.OLAY.IHALE_EKLENDI:
                        case schema.SABIT.OLAY.IHALE_GUNCELLENDI:
                        case schema.SABIT.OLAY.IHALE_SILINDI:
                        case schema.SABIT.OLAY.IHALE_TARIHI_ERTELENDI:
                        {
                            var db_ihale = require('./db_ihale');
                            return db_ihale.f_db_tahta_ihale_idler_aktif(_tahta_id)
                                .then(function (_ihale_idler) {
                                    return _.intersection(_ihale_idler, _cekilen_idler);
                                });
                        }
                            break;
                        case schema.SABIT.OLAY.KALEM_DURUMU_GUNCELLENDI:
                        case schema.SABIT.OLAY.KALEM_EKLENDI:
                        case schema.SABIT.OLAY.KALEM_GUNCELLENDI:
                        case schema.SABIT.OLAY.KALEM_SILINDI:
                        {
                            var db_kalem = require('./db_kalem');
                            return db_kalem.f_db_tahta_kalem_idler_aktif(_tahta_id)
                                .then(function (_kalem_idler) {
                                    return _.intersection(_kalem_idler, _cekilen_idler);
                                });
                        }
                            break;
                        case schema.SABIT.OLAY.TEKLIF_DURUMU_GUNCELLENDI:
                        case schema.SABIT.OLAY.TEKLIF_EKLENDI:
                        case schema.SABIT.OLAY.TEKLIF_GUNCELLENDI:
                        case schema.SABIT.OLAY.TEKLIF_SILINDI:
                        {
                            var db_tahta = require('./db_tahta');
                            return db_tahta.f_db_tahta_teklif_idleri(_tahta_id)
                                .then(function (_teklif_idler) {
                                    return _.intersection(_teklif_idler, _cekilen_idler);
                                });
                        }
                            break;

                        case schema.SABIT.OLAY.URUN_EKLENDI:
                        case schema.SABIT.OLAY.URUN_GUNCELLENDI:
                        case schema.SABIT.OLAY.URUN_SILINDI:
                        case schema.SABIT.OLAY.URUN_ANAHTAR_EKLENDI:
                        case schema.SABIT.OLAY.URUN_ANAHTAR_SILINDI:
                        {
                            var db_urun = require('./db_urun')
                            return db_urun.f_db_urun_aktif_urun_idleri(_tahta_id)
                                .then(function (_urun_idler) {
                                    return _.intersection(_urun_idler, _cekilen_idler);
                                });
                        }
                            break;

                        case schema.SABIT.OLAY.KURUM_EKLENDI:
                        case schema.SABIT.OLAY.KURUM_GUNCELLENDI:
                        case schema.SABIT.OLAY.KURUM_SILINDI:
                        {
                            var db_kurum = require('./db_kurum');
                            return db_kurum.f_db_aktif_kurum_idleri(_tahta_id)
                                .then(function (_kurum_idler) {
                                    return _.intersection(_kurum_idler, _cekilen_idler);
                                });
                        }
                            break;

                        default:
                            break;
                    }
                } else {
                    return null;
                }
            });
    }
1041126
public function beforeSave()
    {
        $tag = $this->getElement('tag')->getValue();
        //wyszukanie tagu
        if (null === $tagRecord = (new \Cms\Orm\CmsTagQuery)
            ->whereTag()->equals($tag)
            ->findFirst()) {
            //utworzenie tagu
            $tagRecord = new \Cms\Orm\CmsTagRecord;
            $tagRecord->tag = $tag;
            $tagRecord->save();
        }
        //przypisanie id tagu
        $this->getRecord()->cmsTagId = $tagRecord->id;
        return true;
    }
493059
function f_indexli_tarihine_gore_grupla(_tahta_id, _tarih1, _tarih2) {
        var db_tahta = require("./db_tahta");
        return db_tahta.f_db_tahta_ihale_indeksli_idler_tarihe_gore_sirali(_tahta_id)
            .then(function () {
                return (_tarih1 && _tarih2
                    ? result.dbQ.zrangebyscore(result.kp.temp.zsetTahtaAnahtaraGoreSiraliIhaleTarihineGore(_tahta_id), _tarih1, _tarih2)
                    : result.dbQ.zrangebyscore(result.kp.temp.zsetTahtaAnahtaraGoreSiraliIhaleTarihineGore(_tahta_id), "-inf", "+inf"))
                    .then(function (_ihale_idler) {
                        if (Array.isArray(_ihale_idler) && _ihale_idler.length > 0) {
                            /** @type {OptionsIhale} */
                            var opts = {};
                            opts.bArrKalemleri = false;
                            opts.bYapanKurum = true;
                            opts.bTakip = true;
                            /** @type {OptionsKalem} */
                            //opts.optKalem = {};
                            /*    opts.optKalem.bArrTeklifleri = false;
                             opts.optKalem.bOnayDurumu = false;
                             opts.optKalem.bTakiptemi = false;*/

                            return f_id(_ihale_idler, _tahta_id, opts)
                                .then(function (_ihaleler) {
                                    return _.sortBy(_ihaleler.groupX("IhaleTarihi", "Id"), "Key");
                                });
                        } else {
                            return [];
                        }
                    });
            });
    }
1165756
public function afterSave()
    {
        //sprawdzenie istnienia rekordu
        if ($this->hasRecord()) {
            $this->_appendFiles($this->_record->getPk(), $this->getFiles());
        }
        //po uploadzie
        $this->afterUpload();
        return true;
    }
786602
public function getExposureTime()
    {
        //brak exposure
        if (!isset($this->_exif['ExposureTime'])) {
            return;
        }
        //obliczenia czasu ekspozycji do eleganckiej postaci
        $arr = explode('/', $this->_exif['ExposureTime']);
        if (count($arr) == 2 && $arr[0] > 1 && $arr[1] > $arr[0]) {
            return '1/' . round($arr[1] / $arr[0]);
        }
        if (count($arr) == 2 && $arr[0] > 1 && $arr[1] > 0) {
            return round($arr[0] / $arr[1]);
        }
        return $this->_exif['ExposureTime'];
    }
207054
private function agregarContinuo57(array $dte, $timbre, $width = 57, $height = 0)
    {
        // determinar alto de la página y agregarla
        $this->AddPage('P', [$height ? $height : $this->papel_continuo_alto, $width]);
        $x = 1;
        $y = 5;
        $this->SetXY($x,$y);
        // agregar datos del documento
        $this->setFont('', '', 8);
        $this->MultiTexto(!empty($dte['Encabezado']['Emisor']['RznSoc']) ? $dte['Encabezado']['Emisor']['RznSoc'] : $dte['Encabezado']['Emisor']['RznSocEmisor'], $x, null, '', $width-2);
        $this->MultiTexto($dte['Encabezado']['Emisor']['RUTEmisor'], $x, null, '', $width-2);
        $this->MultiTexto('Giro: '.(!empty($dte['Encabezado']['Emisor']['GiroEmis']) ? $dte['Encabezado']['Emisor']['GiroEmis'] : $dte['Encabezado']['Emisor']['GiroEmisor']), $x, null, '', $width-2);
        $this->MultiTexto($dte['Encabezado']['Emisor']['DirOrigen'].', '.$dte['Encabezado']['Emisor']['CmnaOrigen'], $x, null, '', $width-2);
        if (!empty($dte['Encabezado']['Emisor']['Sucursal'])) {
            $this->MultiTexto('Sucursal: '.$dte['Encabezado']['Emisor']['Sucursal'], $x, null, '', $width-2);
        }
        if (!empty($this->casa_matriz)) {
            $this->MultiTexto('Casa matriz: '.$this->casa_matriz, $x, null, '', $width-2);
        }
        $this->MultiTexto($this->getTipo($dte['Encabezado']['IdDoc']['TipoDTE']).' N° '.$dte['Encabezado']['IdDoc']['Folio'], $x, null, '', $width-2);
        $this->MultiTexto('Fecha: '.date('d/m/Y', strtotime($dte['Encabezado']['IdDoc']['FchEmis'])), $x, null, '', $width-2);
        // si no es boleta no nominativa se agregan datos receptor
        if ($dte['Encabezado']['Receptor']['RUTRecep']!='66666666-6') {
            $this->Ln();
            $this->MultiTexto('Receptor: '.$dte['Encabezado']['Receptor']['RUTRecep'], $x, null, '', $width-2);
            $this->MultiTexto($dte['Encabezado']['Receptor']['RznSocRecep'], $x, null, '', $width-2);
            if (!empty($dte['Encabezado']['Receptor']['GiroRecep'])) {
                $this->MultiTexto('Giro: '.$dte['Encabezado']['Receptor']['GiroRecep'], $x, null, '', $width-2);
            }
            if (!empty($dte['Encabezado']['Receptor']['DirRecep'])) {
                $this->MultiTexto($dte['Encabezado']['Receptor']['DirRecep'].', '.$dte['Encabezado']['Receptor']['CmnaRecep'], $x, null, '', $width-2);
            }
        }
        $this->Ln();
        // hay un sólo detalle
        if (!isset($dte['Detalle'][0])) {
            $this->MultiTexto($dte['Detalle']['NmbItem'].': $'.$this->num($dte['Detalle']['MontoItem']), $x, null, '', $width-2);
        }
        // hay más de un detalle
        else {
            foreach ($dte['Detalle'] as $d) {
                $this->MultiTexto($d['NmbItem'].': $'.$this->num($d['MontoItem']), $x, null, '', $width-2);
            }
            if (in_array($dte['Encabezado']['IdDoc']['TipoDTE'], [39, 41])) {
                $this->MultiTexto('TOTAL: $'.$this->num($dte['Encabezado']['Totales']['MntTotal']), $x, null, '', $width-2);
            }
        }
        // si no es boleta se coloca EXENTO, NETO, IVA y TOTAL si corresponde
        if (!in_array($dte['Encabezado']['IdDoc']['TipoDTE'], [39, 41])) {
            if (!empty($dte['Encabezado']['Totales']['MntExe'])) {
                $this->MultiTexto('EXENTO: $'.$this->num($dte['Encabezado']['Totales']['MntExe']), $x, null, '', $width-2);
            }
            if (!empty($dte['Encabezado']['Totales']['MntNeto'])) {
                $this->MultiTexto('NETO: $'.$this->num($dte['Encabezado']['Totales']['MntNeto']), $x, null, '', $width-2);
            }
            if (!empty($dte['Encabezado']['Totales']['IVA'])) {
                $this->MultiTexto('IVA: $'.$this->num($dte['Encabezado']['Totales']['IVA']), $x, null, '', $width-2);
            }
            $this->MultiTexto('TOTAL: $'.$this->num($dte['Encabezado']['Totales']['MntTotal']), $x, null, '', $width-2);
        }
        // agregar acuse de recibo y leyenda cedible
        if ($this->cedible and !in_array($dte['Encabezado']['IdDoc']['TipoDTE'], $this->sinAcuseRecibo)) {
            $this->agregarAcuseReciboContinuo(-1, $this->y+6, $width+2, 34);
            $this->agregarLeyendaDestinoContinuo($dte['Encabezado']['IdDoc']['TipoDTE']);
        }
        // agregar timbre
        if (!empty($dte['Encabezado']['IdDoc']['TermPagoGlosa'])) {
            $this->Ln();
            $this->MultiTexto('Observación: '.$dte['Encabezado']['IdDoc']['TermPagoGlosa']."\n\n", $x);
        }
        $this->agregarTimbre($timbre, -11, $x, $this->GetY()+6, 55, 6);
        // si el alto no se pasó, entonces es con autocálculo, se elimina esta página y se pasa el alto
        // que se logró determinar para crear la página con el alto correcto
        if (!$height) {
            $this->deletePage($this->PageNo());
            $this->agregarContinuo57($dte, $timbre, $width, $this->getY()+30);
        }
    }
216839
function f_ihaleDunyasindanCek(_ihale_id, _topX) {
        var defer = redis.dbQ.Q.defer();
        console.log("ihale dünyasından cekmeden onceki argumanlar: " + JSON.stringify(arguments));
        // MySql bağlantısı kurulsun
        result.connection = f_ihaleDunyasinaBaglan();

        var queryWhere = _ihale_id
            ? "WHERE ihale_id>" + _ihale_id
            : "";

        var queryLimit = _topX
            ? "LIMIT " + _topX
            : "LIMIT 2";

        //var query = "SELECT * FROM webservis " + queryWhere + " " + queryLimit;
        var query = "SELECT * FROM ihale " + queryWhere + " " + queryLimit;

        console.log(query);

        result.connection.query(query, function (err, rows) {
            if (err) {
                console.log("Errr: ");
                console.log(err);
                defer.reject(err);
            } else {
                console.log("Çekilen kayıt sayısı: " + rows.length);
                defer.resolve(rows);
            }
        });

        return defer.promise;
    }
781705
def Guardar(self, tipo_doc, nro_doc, denominacion, cat_iva, direccion, 
               email, imp_ganancias='NI', imp_iva='NI', monotributo='NI', 
               integrante_soc='N', empleador='N'):
        ""
        if self.Buscar(nro_doc, tipo_doc):
            sql = ("UPDATE padron SET denominacion=?, cat_iva=?, email=?, "
					"imp_ganancias=?, imp_iva=?, monotributo=?, "
					"integrante_soc=?, empleador=? "
                    "WHERE tipo_doc=? AND nro_doc=?")
            params = [denominacion, cat_iva, email, imp_ganancias, 
                      imp_iva, monotributo, integrante_soc, empleador,
                     tipo_doc, nro_doc]
        else:
            sql = ("INSERT INTO padron (tipo_doc, nro_doc, denominacion, "
                    "cat_iva, email, imp_ganancias, imp_iva, monotributo, "
                    "integrante_soc, empleador) "
                    "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
            params = [tipo_doc, nro_doc, denominacion, cat_iva, email,
                      imp_ganancias, imp_iva, monotributo, 
                      integrante_soc, empleador]
        self.cursor.execute(sql, params)
        # agregar el domicilio solo si no existe:
        if direccion:
            self.cursor.execute("SELECT * FROM domicilio WHERE direccion=? "
                                "AND tipo_doc=? AND nro_doc=?", 
                                [direccion, tipo_doc, nro_doc])
            if self.cursor.rowcount < 0:
                sql = ("INSERT INTO domicilio (nro_doc, tipo_doc, direccion)"
                        "VALUES (?, ?, ?)")
                self.cursor.execute(sql, [nro_doc, tipo_doc, direccion])
        self.db.commit()
        return True
638622
function f_aktif_kullanici_idleri() {
        var defered = result.dbQ.Q.defer();

        result.rc.multi()
            .sdiffstore("temp_kul", result.kp.kullanici.ssetGenel, result.kp.kullanici.ssetSilinen)
            .expire("temp_kul", 10)
            .smembers("temp_kul")
            .exec(function (_err, _replies) {
                if (_err) {
                    console.log("hata");
                    console.log(_err);
                    defered.reject(_err);
                } else {
                    defered.resolve(_replies[2]);
                }
            });

        return defered.promise;
    }
417186
protected final function _prepareFields()
    {
        //jeśli pusty schemat połączeń
        if (empty($this->_query->getQueryCompile()->joinSchema)) {
            return '*';
        }
        $fields = '';
        //pobranie struktury tabeli
        $mainStructure = DbConnector::getTableStructure($this->_query->getTableName());
        //przygotowanie tabeli
        $table = DbConnector::getAdapter()->prepareTable($this->_query->getTableName());
        //iteracja po polach tabeli głównej
        foreach ($mainStructure as $fieldName => $info) {
            //dodawanie pola
            $fields .= $table . '.' . DbConnector::getAdapter()->prepareField($fieldName) . ', ';
        }
        //pola z tabel dołączonych
        foreach ($this->_query->getQueryCompile()->joinSchema as $schema) {
            //pobranie struktury tabeli dołączonej
            $structure = DbConnector::getTableStructure($schema[0]);
            //alias połączenia
            $joinAlias = isset($schema[5]) ? $schema[5] : $schema[0];
            //pola tabeli dołączonej
            foreach ($structure as $fieldName => $info) {
                $fields .= DbConnector::getAdapter()->prepareTable($joinAlias) . '.' . DbConnector::getAdapter()->prepareField($fieldName) . ' AS ' . DbConnector::getAdapter()->prepareField($joinAlias . '__' . $schema[0] . '__' . $fieldName) . ', ';
            }
        }
        return rtrim($fields, ', ');
    }
778719
func AdminAPI(d *tq.Dispatcher) api.AdminServer {
	impl := &adminImpl{tq: d}
	impl.init()
	return &api.DecoratedAdmin{
		Service: impl,
		Prelude: checkAdminPrelude,
	}
}
300778
function f_ElasticTemizle() {
        // İndeksi silip cache'i boşaltalım. Sıfır başlangıç için.
        elastic.client.indices.clearCache();
        elastic.client.indices.flush();
        elastic.client.indices.delete({index: elastic.SABIT.INDEKS.APP}, function (err, resp, respcode) {
            elastic.client.indices.create({
                index: elastic.SABIT.INDEKS.APP,
                body: {
                    "mappings": {
                        "urun": {
                            "properties": {
                                "Adi": {"type": "string", "index": "analyzed"}
                            }
                        },
                        "kurum": {
                            "properties": {
                                "Adi": {"type": "string", "index": "analyzed"}
                            }
                        },
                        "ihale": {
                            "properties": {
                                "Konusu": {"type": "string", "index": "analyzed"}
                            }
                        },
                        "kalem": {
                            "properties": {
                                "Aciklama": {"type": "string", "index": "analyzed"},
                                "BransKodu": {"type": "string", "index": "analyzed"}
                            }
                        }
                    }
                }
            }, function (err, resp, respcode) {
                console.log(err, resp, respcode);
            });
        });
    }
1008071
public final void makeDocReversed(final Map<String, Object> pReqVars,
    final ADoc pReversing, final ADoc pReversed,
      final String pLangDef) throws Exception {
    pReversing.setIdDatabaseBirth(pReversed.getIdDatabaseBirth());
    pReversing.setReversedId(pReversed.getItsId());
    pReversing.setReversedIdDatabaseBirth(pReversed.getIdDatabaseBirth());
    pReversing.setItsDate(new Date(pReversed.getItsDate().getTime() + 1));
    pReversing.setItsTotal(pReversed.getItsTotal().negate());
    pReversing.setHasMadeAccEntries(false);
    getSrvOrm().insertEntity(pReqVars, pReversing);
    pReversing.setIsNew(false);
    String oldDesr = "";
    if (pReversed.getDescription() != null) {
      oldDesr = pReversed.getDescription();
    }
    pReversed.setDescription(oldDesr + " " + getSrvI18n()
      .getMsg("reversing_n", pLangDef) + pReversing.getIdDatabaseBirth() + "-"
        + pReversing.getItsId());
    pReversed.setReversedId(pReversing.getItsId());
    pReversed.setReversedIdDatabaseBirth(pReversing.getIdDatabaseBirth());
    getSrvOrm().updateEntity(pReqVars, pReversed);
    this.srvAccEntry.reverseEntries(pReqVars, pReversing, pReversed);
  }
1320827
function f_role_bagli_uyeler(_tahta_id, _rol_ids, _uyari) {
        //o role sahip üyeleri çekeceğiz
        l.info("---------f_role_bagli_uyeler-----------")

        var db_tahta = require('./db_tahta');

        var defer = result.dbQ.Q.defer(),
            arrPromise = _rol_ids.map(function (_elm) {
                return db_tahta.f_db_tahta_uyeleri_x_rolune_sahip(_tahta_id, _elm)
                    .then(function (_uyeler) {

                        _uyeler.map(function (_uye) {
                            if (_uye.EPosta) {
                                _uyari.RENDER.Uyeler.mail_listesi.push(_uye.EPosta);
                            }

                            if (_uye.GSM) {
                                _uyari.RENDER.Uyeler.gsm_listesi.push(_uye.GSM);
                            }

                            _uyari.RENDER.Uyeler.id_listesi.push(_uye.Id);
                            _uyari.RENDER.Uyeler.uye_listesi.push(_uye);
                            return _uyari;
                        });
                    });
            });

        result.dbQ.Q.all(arrPromise)
            .then(function () {
                defer.resolve(_uyari.RENDER.Uyeler);
            });

        return defer.promise;
    }
860916
public function pricons()
    {
        add_filter('mce_external_plugins', function ($plugins) {
            global $pagenow;

            if (!current_user_can('edit_posts') || !current_user_can('edit_pages') || $pagenow != 'post.php') {
                return $plugins;
            }

            $plugins['pricons'] = get_template_directory_uri() . '/assets/dist/' . \Municipio\Helper\CacheBust::name('js/mce-pricons.js');
            return $plugins;
        });

        add_filter('mce_buttons_2', function ($buttons) {
            global $pagenow;

            if (!current_user_can('edit_posts') || !current_user_can('edit_pages') || $pagenow != 'post.php') {
                return $buttons;
            }

            $buttons[] = 'pricons';
            return $buttons;
        });
    }
673569
function getDetalleAsistenciaSala (asistenciaGeneral, senador, periodo) {
  assert.equal(typeof asistenciaGeneral, 'object', '[senadores-asistencia]: La asistencia general ingresada debe ser un objeto.')
  assert.equal(typeof senador, 'object', '[senadores-asistencia]: El senador general ingresada debe ser un objeto.')
  assert.equal(typeof periodo, 'object', '[senadores-asistencia]: El periodo general ingresada debe ser un objeto.')

  let url = URL_ASISTENCIA_SALA_DETALLE.replace(/:periodo:/, periodo.legislatura)
  url = url.replace(/:senador-id:/, senador.id)

  return scraperjs.StaticScraper.create()
    .get(url)
    .scrape($ => {
      const detalle = $('table:last-child tr:not(:first-child)').map(function () {
        const str = $(this).find('td:last-child a').text()
        // console.log(str, periodo)
        const data = str.match(/(-{0,1}\d*) ([\s\S]*), [\s\S]* (\d*) de (\w*) de (\d*)/)
        const sesion = data[1]
        const tipo = data[2]
                      // año, mes, día
        const fecha = new Date(parseInt(data[5]), clMonthToMonth(data[4]), parseInt(data[3]))
        const asiste = $(this).find('td:first-child').has('img').length > 0
        return {
          sesion,
          tipo,
          fecha,
          asiste
        }
      }).get()
      return Object.assign(asistenciaGeneral, { detalle })
    })
}