no more getSlave, convert code to use dbSlave instead

more form accessor fixes
Form/Template.pm, all asset calls need a session var
This commit is contained in:
Colin Kuskie 2006-01-16 00:08:58 +00:00
parent 77f9ae07b2
commit 197dacadec
9 changed files with 13 additions and 15 deletions

View file

@ -195,7 +195,7 @@ sub getNextThread {
)
group by assetData.assetId
order by ".$sortBy." asc
",$self->session->db->getSlave);
",$self->session->dbSlave);
$self->{_next} = WebGUI::Asset->new($id,$class,$version);
# delete $self->{_next} unless ($self->{_next}->{_properties}{className} =~ /Thread/);
};
@ -232,7 +232,7 @@ sub getPreviousThread {
or (assetData.ownerUserId=".$self->session->db->quote($self->session->user->userId)." and assetData.ownerUserId<>'1')
)
group by assetData.assetId
order by ".$sortBy." desc, assetData.revisionDate desc ",$self->session->db->getSlave);
order by ".$sortBy." desc, assetData.revisionDate desc ",$self->session->dbSlave);
$self->{_previous} = WebGUI::Asset::Post::Thread->new($id,$class,$version);
# delete $self->{_previous} unless ($self->{_previous}->{_properties}{className} =~ /Thread/);
};

View file

@ -204,7 +204,7 @@ sub getList {
my $session = shift;
my $namespace = shift;
my $sql = "select asset.assetId, assetData.revisionDate from template left join asset on asset.assetId=template.assetId left join assetData on assetData.revisionDate=template.revisionDate and assetData.assetId=template.assetId where template.namespace=".$session->db->quote($namespace)." and template.showInForms=1 and asset.state='published' and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' or assetData.tagId=".$session->db->quote($session->scratch->get("versionTag")).")) order by assetData.title";
my $sth = $session->db->read($sql,$session->db->getSlave);
my $sth = $session->db->read($sql,$session->dbSlave);
my %templates;
tie %templates, 'Tie::IxHash';
while (my ($id, $version) = $sth->array) {

View file

@ -233,7 +233,7 @@ sub getCollateral {
if ($keyValue eq "new" || $keyValue eq "") {
return {$keyName=>"new"};
} else {
return $self->session->db->quickHashRef("select * from $table where $keyName=".$self->session->db->quote($keyValue),$self->session->db->getSlave);
return $self->session->db->quickHashRef("select * from $table where $keyName=".$self->session->db->quote($keyValue),$self->session->dbSlave);
}
}