コード例 #1
0
 private function akzioak($request, $que = false)
 {
     $this->yafirmado = $request->getParameter('yafirmado', 0);
     $this->sinatuta = $request->getParameter('sinatuta', 0);
     $id_fichero = $request->getParameter('id_fichero');
     $id_notificacion = $request->getParameter('id_notificacion', null);
     if (!is_null($id_notificacion)) {
         $notificacion_anterior = NotificacionesPeer::retrieveByPK($id_notificacion);
         $this->id_notificacion = $id_notificacion;
     } else {
         $notificacion_anterior = null;
     }
     if (!$que && $notificacion_anterior->getSoporte() == 'Internet firmado con certificado digital') {
         $pos = strrpos(UsuarioPeer::getRuta(), "https://");
         if ($pos === false) {
             header("location: " . str_replace("http://", "https://", UsuarioPeer::getRuta()) . '/notificaciones/enviar/id_notificacion/' . $notificacion_anterior->getNotId() . '/id_fichero/' . $notificacion_anterior->getIdFichero());
             exit;
         }
     }
     if ($que) {
         $con = Propel::getConnection();
         $query = "SELECT `notificaciones`.* FROM `notificaciones` WHERE `notificaciones`.`notid` != '" . $id_notificacion . "' AND `notificaciones`.`id_fichero` = '" . $id_fichero . "';";
         $statement = $con->prepare($query);
         $statement->execute();
         $anteriores_tipo = array();
         $anteriores_procesado = array();
         while ($notificaciones_anteriores = $statement->fetch(PDO::FETCH_OBJ)) {
             $anteriores_tipo[] = $notificaciones_anteriores->tipo;
             $anteriores_procesado[] = $notificaciones_anteriores->procesado;
         }
     }
     if ($que && in_array($que, $anteriores_tipo) && array_search($que, $anteriores_tipo) !== false && $anteriores_procesado[array_search($que, $anteriores_tipo)] == '0') {
         return sfView::ERROR;
     } else {
         $c = new Criteria();
         $c->addJoin(ItemPeer::ID_ITEM_BASE, ItemBasePeer::ID_ITEM_BASE, Criteria::JOIN);
         $c->addAnd(ItemPeer::ID_FORMULARIO, $id_fichero, Criteria::EQUAL);
         $c->addAnd(ItemBasePeer::ES_RESPONSABLE_FICHERO, true, Criteria::EQUAL);
         $item_encargado = ItemPeer::doSelectOne($c);
         if (is_null($item_encargado)) {
             return sfView::ERROR;
         } else {
             $this->id_fichero = $id_fichero;
             $this->empresa_actual = EmpresaPeer::retrieveByPK(sfContext::getInstance()->getUser()->getAttribute('idempresa', 0));
             $this->encargado = UsuarioPeer::retrieveByPk($item_encargado->getIdObjeto());
             $this->user_id = Usuario::getUsuarioActual()->getIdUsuario();
             $this->user = UsuarioPeer::retrieveByPk($this->user_id);
             return sfView::SUCCESS;
         }
     }
 }
コード例 #2
0
 /**
  * Envía un email a través de la configuración de campanias de la empresa que se pasa como parámetro. Utiliza el plugin sfSwiftPlugin
  * @param id_empresa, identificador de la empresa a través de la que se envia el mensaje.
  * @param asunto, asunto del mensaje
  * @param cuerpo, cuerpo del mensaje
  * @param lista_emails, lista de emails, a los que se envia el mensjae.
  * @return integer, número de mensajes enviados
  * @version 25-02-09
  * @author Ana Martin
  */
 public static function enviarEmailDefault($id_empresa, $asunto, $cuerpo, $lista_emails)
 {
     $empresa = EmpresaPeer::retrievebypk($id_empresa);
     if ($empresa instanceof Empresa) {
         $smtp_server = $empresa->getSmtpServer();
         $smtp_user = $empresa->getSmtpUser();
         $smtp_password = $empresa->getSmtpPassword();
         $smtp_port = $empresa->getSmtpPort();
         $sender_email = $empresa->getSenderAddress();
         $sender_name = $empresa->getSenderName();
         //$c = new Criteria();
         //$c->add(PlantillaPeer::ID_EMPRESA, $empresa->getIdEmpresa());
         //$plantilla = PlantillaPeer::doSelectOne($c);
         $plantilla = "";
         $cuerpo = MensajePeer::prepararMailingCuerpoDefault($cuerpo, $plantilla, $asunto);
         $smtp = new Swift_Connection_SMTP($smtp_server, $smtp_port);
         $smtp->setUsername($smtp_user);
         $smtp->setpassword($smtp_password);
         $mailer = new Swift($smtp);
         $message = new Swift_Message(utf8_decode($asunto));
         $message->attach(new Swift_Message_Part($cuerpo, "text/html"));
         $recipients = new Swift_RecipientList();
         foreach ($lista_emails as $email) {
             $recipients->addTo($email);
         }
         //Load the plugin with these replacements
         /*  $replacaments = array(
                        '{FECHA}' => date('d-m-Y') , 
                        '{ASUNTO}' => utf8_decode($asunto),
                        '{MENSAJE}' => utf8_decode($cuerpo),             
                     );
          	  $mailer->attachPlugin(new Swift_Plugin_Decorator($replacaments), "decorator");*/
         $enviado_por = new Swift_Address($sender_email, $sender_name);
         $cuantos = $mailer->send($message, $recipients, $enviado_por);
         $mailer->disconnect();
         return $cuantos;
     } else {
         return 0;
     }
 }
コード例 #3
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Usuario is new, it will return
  * an empty collection; or if this Usuario has previously
  * been saved, it will retrieve related Empresas from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Usuario.
  */
 public function getEmpresasJoinTaula1($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(UsuarioPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collEmpresas === null) {
         if ($this->isNew()) {
             $this->collEmpresas = array();
         } else {
             $criteria->add(EmpresaPeer::ID_USUARIO, $this->id_usuario);
             $this->collEmpresas = EmpresaPeer::doSelectJoinTaula1($criteria, $con, $join_behavior);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(EmpresaPeer::ID_USUARIO, $this->id_usuario);
         if (!isset($this->lastEmpresaCriteria) || !$this->lastEmpresaCriteria->equals($criteria)) {
             $this->collEmpresas = EmpresaPeer::doSelectJoinTaula1($criteria, $con, $join_behavior);
         }
     }
     $this->lastEmpresaCriteria = $criteria;
     return $this->collEmpresas;
 }
コード例 #4
0
 /**
  * Selects a collection of Documento objects pre-filled with all related objects except Item.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Documento objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptItem(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     DocumentoPeer::addSelectColumns($c);
     $startcol2 = DocumentoPeer::NUM_COLUMNS - DocumentoPeer::NUM_LAZY_LOAD_COLUMNS;
     EmpresaPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (EmpresaPeer::NUM_COLUMNS - EmpresaPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(DocumentoPeer::ID_EMPRESA), array(EmpresaPeer::ID_EMPRESA), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = DocumentoPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = DocumentoPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = DocumentoPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             DocumentoPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Empresa rows
         $key2 = EmpresaPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = EmpresaPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = EmpresaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 EmpresaPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Documento) to the collection in $obj2 (Empresa)
             $obj2->addDocumento($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
コード例 #5
0
 /**
  * Get the associated Empresa object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Empresa The associated Empresa object.
  * @throws     PropelException
  */
 public function getEmpresa(PropelPDO $con = null)
 {
     if ($this->aEmpresa === null && $this->id_empresa !== null) {
         $c = new Criteria(EmpresaPeer::DATABASE_NAME);
         $c->add(EmpresaPeer::ID_EMPRESA, $this->id_empresa);
         $this->aEmpresa = EmpresaPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aEmpresa->addTareas($this);
         		 */
     }
     return $this->aEmpresa;
 }
コード例 #6
0
 protected function getCriterio()
 {
     $c = EmpresaPeer::getCriterioAlcance();
     return $c;
 }
コード例 #7
0
 protected function getCriterioEmpresa()
 {
     return EmpresaPeer::getCriterioAlcance();
 }
コード例 #8
0
ファイル: Empresa.php プロジェクト: Esleelkartea/legedia-ESLE
 public static function getListaEmpresas()
 {
     $array_empresas = array();
     //$c=new Criteria();
     $c = EmpresaPeer::getCriterioAlcance();
     $lista_empresas = EmpresaPeer::doSelect($c);
     foreach ($lista_empresas as $empresa) {
         $array_empresas[$empresa->getIdEmpresa()] = $empresa->getNombre();
     }
     return $array_empresas;
 }
コード例 #9
0
    <fieldset style="clear:both">
        <legend class="form1">
            <span class="number">0</span> <?php 
echo __('Persona física que actúa en representación del responsable del fichero ante la AEPD');
?>
        </legend>
        <fieldset style="margin-top:-3px;">
            <legend><?php 
echo __('Datos del responsable del fichero (del Apartado 1)');
?>
</legend>
            <div class="flerro">
                <div id="txt01_div" class="fcell" style="float:left"><?php 
$c = new Criteria();
$c->addAnd(EmpresaPeer::ID_USUARIO, $user_id, Criteria::EQUAL);
$empresa = EmpresaPeer::doSelectOne($c);
echo __('Razón social o Nombre y apellidos');
?>
<br />
                    <input id="txt01" type="text" name="razsocial_0" class="text required" size="60" value="<?php 
echo $empresa->getNombre();
?>
" />
                </div>
                <div id="txt02_div" class="fcell"><?php 
echo __('CIF/NIF/NIE');
?>
<br />
                    <input id="txt02" type="text" name="cif_0" class="cif required" maxlength="9" size="30" value="<?php 
echo $empresa->getCif();
?>
コード例 #10
0
ファイル: Tabla.php プロジェクト: Esleelkartea/legedia-ESLE
 /**
  * Devuelve el nombre de la fuente de datos y el de la empresa a la que pertenece.
  * @return string, nombre de la fuente de datos y el de la empresa.
  * @version 20-04-09
  * @author Ana Martín
  */
 public function getNombreyEmpresa()
 {
     $empresa = EmpresaPeer::retrieveByPK($this->getIdEmpresa());
     return $empresa->__toString() . " - " . $this->__toString();
 }
コード例 #11
0
ファイル: layout.php プロジェクト: Esleelkartea/legedia-ESLE
?>
    <?php 
use_helper("JSCookMenu");
?>
    <?php 
if ($usuario) {
    echo jscookmenu_from_yml(dirname(__FILE__) . "/../config/menu.yml", "menu_name", "hbr", "cmThemeGray");
}
?>
    </div>

    <div id="wrapper">
        <div id="centro">
            <div id="logo_empresa">
                <?php 
$empresa = EmpresaPeer::retrieveByPk($id_empresa);
if ($empresa != null && sfContext::getInstance()->getModuleName() != "login") {
    $url_image = $empresa->getUrlLogoMax();
}
/*else $url_image='/images/logos/default_logo_max.jpg';*/
if ($empresa instanceof Empresa && sfContext::getInstance()->getModuleName() != "login") {
    echo link_to(image_tag($url_image, array("alt" => $empresa->getNombre(), 'title' => $empresa->getNombre(), "border" => 0)), 'empresas/show?id_empresa=' . $empresa->getIdEmpresa());
}
/*else {
      echo image_tag($url_image, array());
  }*/
?>
            </div>
            
            <?php 
echo $sf_content;
コード例 #12
0
        });
    });
</script>
<div class="sf_admin_filters">
<?php 
if (isset($filters) and (isset($filters['nombre']) and $filters['nombre'] != '' or isset($filters['apellido1']) and $filters['apellido1'] != '' or isset($filters['apellido2']) and $filters['apellido2'] != '' or isset($filters['poblacion']) and $filters['poblacion'] != '' or isset($filters['codigo_postal']) and $filters['codigo_postal'] != '' or isset($filters['id_provincia']) and $filters['id_provincia'] != '' or isset($filters['tiene_datos']) and $filters['tiene_datos'] != '' or isset($filters['id_empresa']) and $filters['id_empresa'] != '' or isset($filters['id_tabla']) and $filters['id_tabla'] != '' or isset($filters['ultimo_contacto']) and $filters['id_ultimo_contacto'] != '' or isset($filters['id_grupo']) and $filters['id_grupo'] != '')) {
    $titulo = __("Filtros activados");
    $clase = "accesos_amarillo";
} else {
    $titulo = __("Filtros");
    $clase = "";
}
$usuario_actual = Usuario::getUsuarioActual();
$id_empresa = null;
if (isset($filters['id_empresa']) && $filters['id_empresa'] != '') {
    $empresa = EmpresaPeer::retrievebypk($filters['id_empresa']);
} else {
    $empresa = $usuario_actual->getEmpresaSesion();
}
$id_empresa = $empresa->getIdEmpresa();
$id_tabla = isset($filters['id_tabla']) ? $filters['id_tabla'] : null;
?>

<ul class="sf_admin_actions" style="padding-top: 0px;">
  <?php 
/*$ruta=sfContext::getInstance()->getUser()->getAttribute('ruta_legedia',null);*/
$ruta = UsuarioPeer::getRuta();
?>
  <li><input class="sf_admin_action_reset_filter" value="<?php 
echo __('reset');
?>
コード例 #13
0
<!--
<fieldset id="sf_fieldset_empresa" class="">
<h2><?php 
echo __('Empresa a la que pertenece');
?>
</h2>
<div class="form-row">
  <?php 
echo label_for('campo[id_empresa]', __($labels['campo{id_empresa}']), '');
?>
  <div class="content">
  <?php 
$empresa = EmpresaPeer::retrievebypk($campo->getIdEmpresa());
echo $empresa ? link_to($empresa->__toString() ? $empresa->__toString() : '-', 'empresas/show?id_empresa=' . $empresa->getPrimaryKey()) : '-';
?>
  </div>
</div>
-->
コード例 #14
0
 /**
  * Selects a collection of Tarea objects pre-filled with all related objects except Parametro.
  *
  * @param      Criteria  $c
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Tarea objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAllExceptParametro(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $c = clone $c;
     // Set the correct dbName if it has not been overridden
     // $c->getDbName() will return the same object if not set to another value
     // so == check is okay and faster
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TareaPeer::addSelectColumns($c);
     $startcol2 = TareaPeer::NUM_COLUMNS - TareaPeer::NUM_LAZY_LOAD_COLUMNS;
     FormularioPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + (FormularioPeer::NUM_COLUMNS - FormularioPeer::NUM_LAZY_LOAD_COLUMNS);
     CampoPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + (CampoPeer::NUM_COLUMNS - CampoPeer::NUM_LAZY_LOAD_COLUMNS);
     UsuarioPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + (UsuarioPeer::NUM_COLUMNS - UsuarioPeer::NUM_LAZY_LOAD_COLUMNS);
     EmpresaPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + (EmpresaPeer::NUM_COLUMNS - EmpresaPeer::NUM_LAZY_LOAD_COLUMNS);
     $c->addJoin(array(TareaPeer::ID_FORMULARIO), array(FormularioPeer::ID_FORMULARIO), $join_behavior);
     $c->addJoin(array(TareaPeer::ID_CAMPO), array(CampoPeer::ID_CAMPO), $join_behavior);
     $c->addJoin(array(TareaPeer::ID_USUARIO), array(UsuarioPeer::ID_USUARIO), $join_behavior);
     $c->addJoin(array(TareaPeer::ID_EMPRESA), array(EmpresaPeer::ID_EMPRESA), $join_behavior);
     $stmt = BasePeer::doSelect($c, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = TareaPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = TareaPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://propel.phpdb.org/trac/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $omClass = TareaPeer::getOMClass();
             $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
             $obj1 = new $cls();
             $obj1->hydrate($row);
             TareaPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined Formulario rows
         $key2 = FormularioPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = FormularioPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $omClass = FormularioPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 FormularioPeer::addInstanceToPool($obj2, $key2);
             }
             // if $obj2 already loaded
             // Add the $obj1 (Tarea) to the collection in $obj2 (Formulario)
             $obj2->addTarea($obj1);
         }
         // if joined row is not null
         // Add objects for joined Campo rows
         $key3 = CampoPeer::getPrimaryKeyHashFromRow($row, $startcol3);
         if ($key3 !== null) {
             $obj3 = CampoPeer::getInstanceFromPool($key3);
             if (!$obj3) {
                 $omClass = CampoPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj3 = new $cls();
                 $obj3->hydrate($row, $startcol3);
                 CampoPeer::addInstanceToPool($obj3, $key3);
             }
             // if $obj3 already loaded
             // Add the $obj1 (Tarea) to the collection in $obj3 (Campo)
             $obj3->addTarea($obj1);
         }
         // if joined row is not null
         // Add objects for joined Usuario rows
         $key4 = UsuarioPeer::getPrimaryKeyHashFromRow($row, $startcol4);
         if ($key4 !== null) {
             $obj4 = UsuarioPeer::getInstanceFromPool($key4);
             if (!$obj4) {
                 $omClass = UsuarioPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj4 = new $cls();
                 $obj4->hydrate($row, $startcol4);
                 UsuarioPeer::addInstanceToPool($obj4, $key4);
             }
             // if $obj4 already loaded
             // Add the $obj1 (Tarea) to the collection in $obj4 (Usuario)
             $obj4->addTarea($obj1);
         }
         // if joined row is not null
         // Add objects for joined Empresa rows
         $key5 = EmpresaPeer::getPrimaryKeyHashFromRow($row, $startcol5);
         if ($key5 !== null) {
             $obj5 = EmpresaPeer::getInstanceFromPool($key5);
             if (!$obj5) {
                 $omClass = EmpresaPeer::getOMClass();
                 $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1);
                 $obj5 = new $cls();
                 $obj5->hydrate($row, $startcol5);
                 EmpresaPeer::addInstanceToPool($obj5, $key5);
             }
             // if $obj5 already loaded
             // Add the $obj1 (Tarea) to the collection in $obj5 (Empresa)
             $obj5->addTarea($obj1);
         }
         // if joined row is not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
コード例 #15
0
ファイル: Usuario.php プロジェクト: Esleelkartea/legedia-ESLE
 public function setEmpresaSesion($empresa = null)
 {
     if (!$empresa || !sfContext::getInstance()->getUser()->isAuthenticated()) {
         $this->setEmpresaSesionNull();
         return false;
     }
     $c = clone EmpresaPeer::getCriterioAlcance();
     $empresas = EmpresaPeer::doSelect($c);
     $comprobacion = true;
     $resultado = false;
     if ($comprobacion) {
         sfContext::getInstance()->getUser()->setAttribute('empresa_sesion', $empresa, 'sesion');
         sfContext::getInstance()->getUser()->setAttribute('empresas_sesion', $empresas, 'sesion');
         $resultado = true;
     } else {
         $this->setEmpresaSesionNull();
     }
     return $resultado;
 }
コード例 #16
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(EmpresaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(EmpresaPeer::DATABASE_NAME);
         $criteria->add(EmpresaPeer::ID_EMPRESA, $pks, Criteria::IN);
         $objs = EmpresaPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
コード例 #17
0
?>

  <fieldset>
    <h2><?php 
echo __('filters');
?>
</h2>
     <div class="form-row">
    <?php 
echo label_for('filters[id_empresa]', __('empresa'), '');
?>
    <div class="content">
    <?php 
$id_empresa = isset($filters['id_empresa']) ? $filters['id_empresa'] : null;
$c = EmpresaPeer::getCriterioAlcance();
$empresas = EmpresaPeer::doSelect($c);
$value = select_empresas('filters[id_empresa]', objects_for_select($empresas, 'getIdEmpresa', '__toString', $id_empresa, array('include_blank' => true)), array('control_name' => 'filters[id_empresa]', 'include_blank' => true));
echo $value ? $value : "&nbsp;";
?>
    </div>
    </div>
   
    
    
  </fieldset>

  <ul class="sf_admin_actions">
    <li><?php 
echo button_to(__('reset'), 'tablas/list?filter=filter', 'class=sf_admin_action_reset_filter');
?>
</li>
コード例 #18
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = EmpresaPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setIdEmpresa($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setIdProvincia($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setIdUsuario($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setNombre($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setIdActividad($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setTelefono($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setFax($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setEmail($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setDomicilio($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setPoblacion($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setCodigoPostal($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setCif($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setLogoMin($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setLogoMed($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setLogoMax($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setIdVtiger($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setSmtpServer($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setSmtpUser($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setSmtpPassword($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setSmtpPort($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setSenderAddress($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setSenderName($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setColor1($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setColor2($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setColor3($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setColor4($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setColorLetra1($arr[$keys[26]]);
     }
     if (array_key_exists($keys[27], $arr)) {
         $this->setColorLetra2($arr[$keys[27]]);
     }
     if (array_key_exists($keys[28], $arr)) {
         $this->setColorLetra3($arr[$keys[28]]);
     }
     if (array_key_exists($keys[29], $arr)) {
         $this->setColorLetra4($arr[$keys[29]]);
     }
     if (array_key_exists($keys[30], $arr)) {
         $this->setCreatedAt($arr[$keys[30]]);
     }
     if (array_key_exists($keys[31], $arr)) {
         $this->setUpdatedAt($arr[$keys[31]]);
     }
     if (array_key_exists($keys[32], $arr)) {
         $this->setBorrado($arr[$keys[32]]);
     }
 }