projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
82eea86
)
DataObjects/Companies.php
author
Alan Knowles
<alan@roojs.com>
Tue, 14 Aug 2012 05:24:16 +0000
(13:24 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 14 Aug 2012 05:24:16 +0000
(13:24 +0800)
DataObjects/Companies.php
patch
|
blob
|
history
diff --git
a/DataObjects/Companies.php
b/DataObjects/Companies.php
index
0c3e3f0
..
0764d35
100644
(file)
--- a/
DataObjects/Companies.php
+++ b/
DataObjects/Companies.php
@@
-70,16
+70,16
@@
class Pman_Core_DataObjects_Companies extends DB_DataObject
$this->whereAdd("Companies.id IN (
SELECT distinct(company_id) FROM ProjectDirectory where project_id IN ($pids)
) $add" );
$this->whereAdd("Companies.id IN (
SELECT distinct(company_id) FROM ProjectDirectory where project_id IN ($pids)
) $add" );
-
-
-
+
}
if (!empty($q['query']['comptype'])) {
$this->whereAddIn('comptype', explode(',', $q['query']['comptype']), 'string');
}
}
if (!empty($q['query']['comptype'])) {
$this->whereAddIn('comptype', explode(',', $q['query']['comptype']), 'string');
}
-
+
+ // depricated - should be moved to module specific (texon afair)
+
if (!empty($q['query']['province'])) {
$prov = $this->escape($q['query']['province']);
$this->whereAdd("province LIKE '$prov%'");
if (!empty($q['query']['province'])) {
$prov = $this->escape($q['query']['province']);
$this->whereAdd("province LIKE '$prov%'");
@@
-268,6
+268,25
@@
class Pman_Core_DataObjects_Companies extends DB_DataObject
return $i->toHTML($size);
}
return $i->toHTML($size);
}
+ function firstImage($filter='image/%')
+ {
+ $i = DB_DataObject::factory('Images');
+ //DB_DataObject::debugLevel(1);
+ $im = $i->gather($this, $filter);
+ if (empty($im)) {
+ return false;
+ }
+ return $im[0];
+ }
+
+ function firstImageTag($size =-1, $base="/Images/Thumb", $filter='image/%')
+ {
+ $fm = $this->firstImage($filter);
+ if (empty($fm)) {
+ return '';
+ }
+ return $fm->toHTML($size, $base);
+ }