function Save() { //$this->fecha_pub=time(); $f = newObject("fileh"); $f->CaptureFile = 'foto'; $par = new Ente($this->name); $par = typecast($this, "Ente"); return $par->save(); }
function save() { $f = newObject("fileh"); $f->CaptureFile = 'foto'; //dataDump($this); $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function save() { global $prefix; debug("Info: Calling Extended save"); if ($this->gtask_id < 2) { $this->ERROR = "No hay tarea seleccionada"; return false; } $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function save() { debug("Info: Calling Extended save"); unset($this->properties["fullname"]); if ($this->password == md5("")) { $this->ERROR = _("password vacio"); return FALSE; } if ($this->userExist($this->username) && $this->ID < 2) { $this->ERROR = _("Usuario existente"); return FALSE; } //dataDump($this); $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function save() { global $prefix; debug("Info: Calling Extended save"); if (!($con = ssh2_connect($this->fqdn, 22))) { $this->ERROR = "La conexión no se puede efecturar"; return false; } else { if (!ssh2_auth_password($con, $this->usuario, $this->pass)) { $this->ERROR = "Usuario/contraseña invalido ({$this->usuario} - contraseña de " . strlen($this->pass) . " car.)"; return false; } } $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function save() { global $prefix; debug("Info: Calling Extended save"); if ($this->ID > 1 && $this->md5 != $this->md5calc()) { $o = newObject("gtasklog"); $res = $o->selectA("schedule_id=" . $this->ID . " AND inicio>" . time()); foreach ($res as $row) { $IDS[] = $row["ID"]; } if ($IDS) { debug("Purgando programaciones", "green"); _query("DELETE FROM {$prefix}_gtasklog WHERE estado='No Iniciada' AND ID IN (" . implode(",", $IDS) . ")"); } } $this->md5 = $this->md5calc(); $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function save() { $obj = newObject($this->campos["entity"]); $this->usuario_id = BILO_uid(); $this->vista = $this->campos['entity']; foreach ($this->campos as $key => $value) { if (!in_array($key, array_keys($obj->properties))) { unset($this->campos[$key]); } } $this->campos_ser = serialize($this->campos); setLimitRows(15000); $this->searchResults = $this->select("usuario_id={$this->usuario_id} AND vista='{$this->vista}'"); resetLimitRows(); if ($this->nRes > 0) { $this->ID = $this->searchResults[0]->ID; } else { $this->ID = 1; } $par = new Ente($this->name); $par = typecast($this, "Ente"); return $par->save(); }
function delete() { debug("Info: Calling Extended delete"); if ($this->type == "archive") { $par = new Ente($this->name); $fi = newObject("fileh", $this->fileh); if (!$fi->delete()) { $this->WARNING = $fi->ERROR; } $par = typecast($this, "Ente"); return $par->delete(); } else { /* Ohohohoho we've a dir here */ $confirmation = newObject("data_object"); $n = $confirmation->select("inode=" . $this->ID); if ($confirmation->nRes < 1) { /* Lets detelete */ $par = new Ente($this->name); $par = typecast($this, "Ente"); return $par->delete(); } else { $this->ERROR = _("Folder not empty"); return False; } } }
function delete() { $o = newObject("gsteplog"); $o->deletes("gtasklog_id={$this->ID}"); $par = new Ente($this->name); $par = typecast($this, "Ente"); return $par->delete(); }
function uninstallPackage($package, $type) { global $mainframe, $classMap; $this->filename = $package; if (!typecast($this, $classMap[$type])) { mosRedirect('index2.php?option=com_docman', _DML_INSTALLER_ERROR . ': Typecasting'); } if (!$this->uninstall($package)) { $this->setError(4, $this->getError()); return false; } return true; }
function listList($psObject, $campos, $template, $navigation_vars = "", $parset = 1) { global $TOTALTIME, $SYS, $offset, $PET, $styles, $nn, $FFPATCH; $psObject->sc = $sc; $psObject->mod = $mod; $psObject->pag = $pag; $psObject->offset = $offset; $users = $this->InitTemplate($template); $count = 0; /**************** mod_rewrite patch */ if ($SYS["NAV_SEPARATOR"] == "/") { $chunk = strpos($PET, "navvars=on") !== false ? strpos($PET, "navvars=on") : strlen($PET); $navvars = $SYS["ROOT"] . "/" . substr($PET, 0, $chunk); debug("Navvars init {$navvars} POS=" . $chunk . "({$PET})", "green"); } /**************** mod_rewrite patch */ if ($navigation_vars > 0) { $navvars = base64_encode(serialize($navigation_vars)); $psObject->navvars = $navvars; } /* Paginacion */ $T = $psObject->totalPages; $W = $SYS["DEFAULTROWS"]; $N = ceil($T / $W); $P = ""; if ($FFPATCH === true) { $P = "" . $psObject->totalPages . " elementos<br /> "; } else { if ($T > $W) { $P = "Páginas "; } } /**************** mod_rewrite patch */ /**************** mod_rewrite patch */ if ($SYS["NAV_SEPARATOR"] == "/") { $chunk = strpos($PET, "navvars=on") !== false ? strpos($PET, "navvars=on") : strlen($PET); $navvars = $SYS["ROOT"] . "/" . substr($PET, 0, $chunk); debug("Navvars init {$navvars} POS=" . $chunk . "({$PET})", "green"); } /**************** mod_rewrite patch */ /**************** mod_rewrite patch */ $navvars .= "{$SYS["NAV_SEPARATOR_I"]}navvars=on"; foreach ($SYS["NAVVARS"] as $k => $v) { $navvars .= "{$SYS["NAV_SEPARATOR"]}{$v}=" . $GLOBALS[$v]; } debug("Navvars built {$navvars}", "green"); if ($N > 1) { if ($N < 7) { for ($i = 0; $i < $N; $i++) { if ($offset / $W == $i) { if ($i == 0) { $P .= "<a style=\"text-decoration:underline;text-weight:bold;\" href=\"{$navvars}{$SYS["NAV_SEPARATOR"]}offset=" . $i * $W . "\">" . ($i + 1) . "</a>"; } else { $P .= "·<a style=\"text-decoration:underline;text-weight:bold;\" href=\"{$navvars}{$SYS["NAV_SEPARATOR"]}offset=" . $i * $W . "\">" . ($i + 1) . "</a>"; } } else { if ($i == 0) { $P .= "<a style=\"text-decoration:none; text-weight:bold;\" href=\"{$navvars}{$SYS["NAV_SEPARATOR"]}offset=" . $i * $W . "\">" . ($i + 1) . "</a>"; } else { $P .= "·<a style=\"text-decoration:none; text-weight:bold;\" href=\"{$navvars}{$SYS["NAV_SEPARATOR"]}offset=" . $i * $W . "\">" . ($i + 1) . "</a>"; } } } } else { $i = $offset / $W; if ($i > 1 && $i < $N - 2) { $smart_pages = array(0, '-', $i - 1, $i, $i + 1, '-', $N - 1); } else { if ($i < 2) { $smart_pages = array(0, 1, 2, '-', $N - 2, $N - 1); } else { $smart_pages = array(0, '-', $N - 3, $N - 2, $N - 1); } } foreach ($smart_pages as $j) { if ($j === "-") { $P .= "·..."; } else { if ($offset / $W == $j) { $P .= "·<a style=\"text-decoration:underline;text-weight:bold;\" href=\"{$navvars}{$SYS["NAV_SEPARATOR"]}offset=" . $j * $W . "\">" . ($j + 1) . "</a>"; } else { $P .= "·<a style=\"text-decoration:none; text-weight:bold;\" href=\"{$navvars}{$SYS["NAV_SEPARATOR"]}offset=" . $j * $W . "\">" . ($j + 1) . "</a>"; } } } } } $psObject->Pager = $P; echo $this->plParseTemplateHeader(get_object_vars($psObject)); if ($psObject->searchResults > 0) { foreach ($psObject->searchResults as $key => $object) { /* VNH */ $count++; /* SLOW CODE */ /* Child inherits parent properties */ if (is_object($object)) { $child = get_object_vars($object); $parent = get_object_vars($psObject); $diff = array_diff(array_keys($parent), array_keys($child)); foreach ($diff as $k => $v) { $object->{$v} = $psObject->{$v}; } /* If child and parent of different class, typecast */ if ($object->name != $psObject->name) { $object = typecast($object, get_class($psObject)); } /* Normalization of object*/ $object->_normalize(); /* END OF SLOW CODE */ } if ($count % $parset == 0) { $object->parset = False; //echo $parset.":".$count.":True"; } else { //echo $parset.":".$count.":False"; $object->parset = True; } foreach ($campos as $fld => $type) { $multitype = explode("#", $type); switch ($multitype[0]) { case "texto": $object->{$fld} = substr(strip_tags($object->f($fld)), 0, $multitype[1]) . " ...."; break; case "parrafo": $object->{$fld} = nl2br(strip_tags($object->f($fld), "<br>")); break; case "fecha": if ($object->{$fld} == 0) { $object->{$fld} = ""; } else { $object->{$fld} = strftime("%d/%m/%Y", $object->f($fld)); } break; case "ref": $obj = explode("|", $multitype[1]); $class = $obj[0]; $field = $obj[1]; $nfield = $obj[2]; $void = newObject($class, $object->f($fld)); if (empty($nfield)) { $object->{$fld} = $void->f($field); } else { $object->{$nfield} = $void->f($field); } break; case "xref": $obj = explode("|", $multitype[1]); $class = $obj[0]; $field = $obj[2]; $xid = $obj[1]; if (is_object($object)) { $void = newObject($class, $object->f($xid)); $object->{$fld} = $void->f($field); } else { $void = newObject($class, $object["{$xid}"]); $object["{$fld}"] = $void->f($field); } break; case "fref": $obj = explode("|", $multitype[1]); $class = $obj[0]; $field = $obj[2]; $xid = $obj[1]; $void = newObject($class, $object->f($xid)); $object->{$fld} = $void->{$field}(); break; case "hora": $object->{$fld} = strftime("%H:%M", $object->f($fld)); break; case "guided": $object->{$fld} = $multitype[1]; break; case "code": //dataDump(get_class_methods($object)); //echo ' Antes: '.$object->$fld; debug(" Code " . $multitype[1] . $multitype[2], "red"); $aux = eval($multitype[1] . $multitype[2]); //echo " Despues: ".$aux; $object->{$fld} = $aux; break; case "select": $external[$fld] = eval("return array(" . $multitype[1] . ");"); //echo $multitype[1]; //dataDump($external); break; } } if (is_object($object)) { echo $this->plParseTemplate(get_object_vars($object), $external); } else { echo $this->plParseTemplate($object, $external); } } } else { $vars["error"] .= '<center><b>No hubo resultados</b></center>'; } unset($styles); unset($nn); echo $this->plParseTemplateFooter(get_object_vars($psObject)); return True; }
function delete() { $t = newObject("fileh", $this->id_foto); $t->delete(); $t = newObject("fileh", $this->id_thumb); $t->delete(); $par = typecast($this, "Ente"); return $par->delete(); }
function delete() { global $SYS, $FAMILYLABEL; if ($this->ID < 2) { return True; } debug("Info: Calling Extended delete"); $par = new Ente($this->name); $target = $this->localname(); if (unlink($target)) { debug("fileh: fichero borrado :" . $this->localname(), "red"); } $par = typecast($this, "Ente"); return $par->delete(); }