public static function getParents() { $parents = array(); foreach (ColLocationPeer::doSelect(new Criteria()) as $d) { if (count($d->getColLocationRelatedByParent()) > 0) { $parents[] = $d->getId(); } } return $parents; }
public function getParentalIndex() { $parentalIndex = "#" . str_pad($this->getId(), 3, '0', STR_PAD_LEFT); $this->level = 1; if ($this->getParent() !== null && $this->getParent() != 0) { $p = ColLocationPeer::retrieveByPK($this->getParent()); $parentalIndex = str_pad($p->getParentalIndex(), 3, '0', STR_PAD_LEFT) . "_" . $parentalIndex; $this->level += $p->level; } $this->parentalIndex = $parentalIndex; return $parentalIndex; }
public static function doSelectJoinAllExceptColStatus(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VOpacPeer::addSelectColumns($c); $startcol2 = VOpacPeer::NUM_COLUMNS - VOpacPeer::NUM_LAZY_LOAD_COLUMNS + 1; CatalogPeer::addSelectColumns($c); $startcol3 = $startcol2 + CatalogPeer::NUM_COLUMNS; DepartmentPeer::addSelectColumns($c); $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS; CatCategoryPeer::addSelectColumns($c); $startcol5 = $startcol4 + CatCategoryPeer::NUM_COLUMNS; ColLocationPeer::addSelectColumns($c); $startcol6 = $startcol5 + ColLocationPeer::NUM_COLUMNS; $c->addJoin(VOpacPeer::CATALOG_ID, CatalogPeer::ID); $c->addJoin(VOpacPeer::DEPARTMENT_ID, DepartmentPeer::ID); $c->addJoin(VOpacPeer::CAT_CATEGORY_ID, CatCategoryPeer::ID); $c->addJoin(VOpacPeer::COL_LOCATION_ID, ColLocationPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VOpacPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = CatalogPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getCatalog(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVOpac($obj1); break; } } if ($newObject) { $obj2->initVOpacs(); $obj2->addVOpac($obj1); } $omClass = DepartmentPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getDepartment(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVOpac($obj1); break; } } if ($newObject) { $obj3->initVOpacs(); $obj3->addVOpac($obj1); } $omClass = CatCategoryPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getCatCategory(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVOpac($obj1); break; } } if ($newObject) { $obj4->initVOpacs(); $obj4->addVOpac($obj1); } $omClass = ColLocationPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getColLocation(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addVOpac($obj1); break; } } if ($newObject) { $obj5->initVOpacs(); $obj5->addVOpac($obj1); } $results[] = $obj1; } return $results; }
} ?> > <td class='filter'><?php echo submit_image_tag('/images/magnifier.png', array('class' => 'sort', 'onclick' => "blur();")); ?> </td> <td class='filter_first'><?php echo input_tag('filters[CODE]', isset($filters['CODE']) ? $filters['CODE'] : null, array('size' => 15)); ?> </td> <td class='filter'> <?php echo input_hidden_tag('filters[id]', isset($filters['id']) ? $filters['id'] : null); if (isset($filters['id']) && $filters['id']) { echo input_auto_complete_tag('col_name', isset($filters['id']) && $filters['id'] ? ColLocationPeer::retrieveByPk($filters['id'])->getName() : '', '/col_location/getListName', array('size' => 50), array('after_update_element' => 'function(f, s) {$("id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1)); } else { echo input_auto_complete_tag('col_name', null, '/col_location/getListName', array('size' => 50), array('after_update_element' => 'function(f, s) {$("filters_id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1)); } ?> </td> <td class='filter'><?php echo object_select_tag(isset($filters['DEPARTMENT_ID']) ? $filters['DEPARTMENT_ID'] : null, null, array('include_blank' => true, 'related_class' => 'Department', 'text_method' => '__toString', 'peer_method' => 'doSelectOrdered', 'control_name' => 'filters[DEPARTMENT_ID]')); ?> </td> </tr> </thead> <tbody> <?php if ($pager->getNbResults() < 1) { ?>
public function getColLocation($con = null) { include_once 'lib/model/om/BaseColLocationPeer.php'; if ($this->aColLocation === null && $this->col_location_id !== null) { $this->aColLocation = ColLocationPeer::retrieveByPK($this->col_location_id, $con); } return $this->aColLocation; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(ColLocationPeer::ID, $pks, Criteria::IN); $objs = ColLocationPeer::doSelect($criteria, $con); } return $objs; }
public function filter($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'SIGN_CODE') { $c->addJoin(CatalogPeer::ID, ColItemPeer::CATALOG_ID); $column = CatalogPeer::getTableMap()->getColumn('CODE'); } elseif ($key == 'CODE') { $c->addJoin(ColLocationPeer::ID, ColItemPeer::COL_LOCATION_ID); $column = ColLocationPeer::getTableMap()->getColumn('CODE'); } elseif ($key == 'TITLE') { $c->addJoin(CatalogPeer::ID, ColItemPeer::CATALOG_ID); $column = CatalogPeer::getTableMap()->getColumn('TITLE'); } elseif ($key == 'PUBLISHER_NAME') { $c->addJoin(CatalogPeer::ID, ColItemPeer::CATALOG_ID); $c->addJoin(PublisherPeer::ID, CatalogPeer::PUBLISHER_ID); $column = PublisherPeer::getTableMap()->getColumn('NAME'); } elseif ($key == 'WRITER_NAME') { $c->addJoin(CatalogPeer::ID, ColItemPeer::CATALOG_ID); $c->addJoin(CatalogWriterPeer::CATALOG_ID, CatalogPeer::ID); $c->addJoin(WriterPeer::ID, CatalogWriterPeer::WRITER_ID); $column = WriterPeer::getTableMap()->getColumn('NAME'); } elseif ($key == 'CAT_CATEGORY_ID') { $c->addJoin(CatalogPeer::ID, ColItemPeer::CATALOG_ID); $c->addJoin(CatCategoryPeer::ID, CatalogPeer::CAT_CATEGORY_ID); $column = CatCategoryPeer::getTableMap()->getColumn('ID'); } else { $column = ColItemPeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER || $creoleType == CreoleTypes::BIGINT) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
public static function doSelectJoinAllExceptColSource(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } ColItemPeer::addSelectColumns($c); $startcol2 = ColItemPeer::NUM_COLUMNS - ColItemPeer::NUM_LAZY_LOAD_COLUMNS + 1; CatalogPeer::addSelectColumns($c); $startcol3 = $startcol2 + CatalogPeer::NUM_COLUMNS; ColStatusPeer::addSelectColumns($c); $startcol4 = $startcol3 + ColStatusPeer::NUM_COLUMNS; ColConditionPeer::addSelectColumns($c); $startcol5 = $startcol4 + ColConditionPeer::NUM_COLUMNS; MemberPeer::addSelectColumns($c); $startcol6 = $startcol5 + MemberPeer::NUM_COLUMNS; ColLocationPeer::addSelectColumns($c); $startcol7 = $startcol6 + ColLocationPeer::NUM_COLUMNS; $c->addJoin(ColItemPeer::CATALOG_ID, CatalogPeer::ID); $c->addJoin(ColItemPeer::COL_STATUS_ID, ColStatusPeer::ID); $c->addJoin(ColItemPeer::COL_CONDITION_ID, ColConditionPeer::ID); $c->addJoin(ColItemPeer::MEMBER_ID, MemberPeer::ID); $c->addJoin(ColItemPeer::COL_LOCATION_ID, ColLocationPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = ColItemPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = CatalogPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getCatalog(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addColItem($obj1); break; } } if ($newObject) { $obj2->initColItems(); $obj2->addColItem($obj1); } $omClass = ColStatusPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getColStatus(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addColItem($obj1); break; } } if ($newObject) { $obj3->initColItems(); $obj3->addColItem($obj1); } $omClass = ColConditionPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getColCondition(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addColItem($obj1); break; } } if ($newObject) { $obj4->initColItems(); $obj4->addColItem($obj1); } $omClass = MemberPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getMember(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addColItem($obj1); break; } } if ($newObject) { $obj5->initColItems(); $obj5->addColItem($obj1); } $omClass = ColLocationPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getColLocation(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addColItem($obj1); break; } } if ($newObject) { $obj6->initColItems(); $obj6->addColItem($obj1); } $results[] = $obj1; } return $results; }
public function executeGetListName() { if ($this->hasRequestParameter('col_name') && $this->getRequestParameter('col_name') != '') { $c = new Criteria(); $cton1 = $c->getNewCriterion(ColLocationPeer::NAME, '%' . $this->getRequestParameter('col_name') . '%', Criteria::LIKE); $cton2 = $c->getNewCriterion(ColLocationPeer::CODE, '%' . $this->getRequestParameter('col_name') . '%', Criteria::LIKE); $cton3 = $c->getNewCriterion(ColLocationPeer::DEPARTMENT_ID, '%' . $this->getRequestParameter('col_name') . '%', Criteria::LIKE); $cton2->addOr($cton3); $cton1->addOr($cton2); $c->add($cton1); $this->rows = ColLocationPeer::doSelect($c); } }
public static function doSelectJoinAllExceptCatCategory(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VTotalCatalogPeer::addSelectColumns($c); $startcol2 = VTotalCatalogPeer::NUM_COLUMNS - VTotalCatalogPeer::NUM_LAZY_LOAD_COLUMNS + 1; ColLocationPeer::addSelectColumns($c); $startcol3 = $startcol2 + ColLocationPeer::NUM_COLUMNS; $c->addJoin(VTotalCatalogPeer::COL_LOCATION_ID, ColLocationPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VTotalCatalogPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = ColLocationPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getColLocation(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVTotalCatalog($obj1); break; } } if ($newObject) { $obj2->initVTotalCatalogs(); $obj2->addVTotalCatalog($obj1); } $results[] = $obj1; } return $results; }
public function filter($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'col_location_id') { $c->addJoin(VisitorPeer::COL_LOCATION_ID, ColLocationPeer::ID); $column = ColLocationPeer::getTableMap()->getColumn('ID'); } elseif ($key == 'DEPARTMENT_MEMBER_ID') { $c->addJoin(DepartmentPeer::ID, MemberPeer::DEPARTMENT_ID); $c->addJoin(VisitorPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::getTableMap()->getColumn('DEPARTMENT_ID'); } elseif ($key == 'NO_REG') { $c->addJoin(VisitorPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::gettableMap()->getColumn('NO_REG'); } elseif ($key == 'CODE') { $c->addJoin(VisitorPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::gettableMap()->getColumn('CODE'); } elseif ($key == 'NAME') { $c->addJoin(VisitorPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::gettableMap()->getColumn('NAME'); } else { $column = VisitorPeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::DATE) { #$from = $value['from']; #$to = $value['to']; #if ($from != '' && $from != null) $c->add($name, $from, Criteria::GREATER_EQUAL ); #if ($to != '' && $to != null) $c->add($name, $to, Criteria::LESS_EQUAL ); $c->add($name, $value, Criteria::LIKE); } else { if ($creoleType == CreoleTypes::INTEGER) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
public function getColLocationsRelatedByParentJoinDepartment($criteria = null, $con = null) { include_once 'lib/model/om/BaseColLocationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collColLocationsRelatedByParent === null) { if ($this->isNew()) { $this->collColLocationsRelatedByParent = array(); } else { $criteria->add(ColLocationPeer::PARENT, $this->getId()); $this->collColLocationsRelatedByParent = ColLocationPeer::doSelectJoinDepartment($criteria, $con); } } else { $criteria->add(ColLocationPeer::PARENT, $this->getId()); if (!isset($this->lastColLocationRelatedByParentCriteria) || !$this->lastColLocationRelatedByParentCriteria->equals($criteria)) { $this->collColLocationsRelatedByParent = ColLocationPeer::doSelectJoinDepartment($criteria, $con); } } $this->lastColLocationRelatedByParentCriteria = $criteria; return $this->collColLocationsRelatedByParent; }
public function filterLate($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'CODE3') { $c->addJoin(CirHistoryPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::gettableMap()->getColumn('CODE3'); } elseif ($key == 'CODE') { $c->addJoin(CirHistoryPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::gettableMap()->getColumn('CODE'); } elseif ($key == 'NAME') { $c->addJoin(CirHistoryPeer::MEMBER_ID, MemberPeer::ID); $column = MemberPeer::gettableMap()->getColumn('NAME'); } elseif ($key == 'TITLE') { $c->addJoin(ColItemPeer::CATALOG_ID, CatalogPeer::ID); $c->addJoin(CirHistoryPeer::COL_ITEM_ID, ColItemPeer::ID); $column = CatalogPeer::gettableMap()->getColumn('TITLE'); } elseif ($key == 'department_id') { $c->addJoin(ColItemPeer::COL_LOCATION_ID, ColLocationPeer::ID); $c->addJoin(CirHistoryPeer::COL_ITEM_ID, ColItemPeer::ID); $column = ColLocationPeer::gettableMap()->getColumn('DEPARTMENT_ID'); } else { $column = CirHistoryPeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIME) { $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->addAnd($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
public function filterItem($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'code') { $c->addJoin(ColLocationPeer::ID, ColItemPeer::COL_LOCATION_ID); $column = ColLocationPeer::getTableMap()->getColumn('CODE'); } else { $column = ColItemPeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER || $creoleType == CreoleTypes::BIGINT) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
public function getLocation() { $crit = new Criteria(); $crit->add(ColLocationPeer::DEPARTMENT_ID, $catalog_per_dept->getDepartmentId()); $location = ColLocationPeer::doSelectOne($crit); return $location; }