more guid stuff
This commit is contained in:
parent
c975503292
commit
01c69d5291
6 changed files with 33 additions and 33 deletions
|
|
@ -255,5 +255,5 @@ alter table users change referringAffiliate referringAffiliate char(22) not null
|
||||||
alter table page change lft nestedSetLeft int(11);
|
alter table page change lft nestedSetLeft int(11);
|
||||||
alter table page change rgt nestedSetRight int(11);
|
alter table page change rgt nestedSetRight int(11);
|
||||||
alter table page change id id char(22);
|
alter table page change id id char(22);
|
||||||
delete from incrementer where incrementerId in ("collateralId","pageId","databaseLinkId", "DataForm_entryId", "DataForm_fieldId", "DataForm_tabId", "EventsCalendar_eventId", "EventsCalendar_recurringId", "FileManager_fileId", "forumId", "forumPostId", "forumThreadId", "groupId", "languageId", "Product_benefitId", "Product_featureId", "Product_specificationId", "replacementId", "Survey_answerId", "Survey_id", "Survey_questionId", "Survey_responseId", "USS_id", "USS_submissionId", "wobjectId");
|
delete from incrementer where incrementerId in ("navigationId","passiveProfileLogId","metaData_field","userId","collateralId","pageId","databaseLinkId", "DataForm_entryId", "DataForm_fieldId", "DataForm_tabId", "EventsCalendar_eventId", "EventsCalendar_recurringId", "FileManager_fileId", "forumId", "forumPostId", "forumThreadId", "groupId", "languageId", "Product_benefitId", "Product_featureId", "Product_specificationId", "replacementId", "Survey_answerId", "Survey_id", "Survey_questionId", "Survey_responseId", "USS_id", "USS_submissionId", "wobjectId");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,17 @@ package WebGUI::Operation::MetaData;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
use strict;
|
use strict;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
|
use WebGUI::Icon;
|
||||||
|
use WebGUI::Id;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Macro;
|
use WebGUI::Macro;
|
||||||
|
use WebGUI::MetaData;
|
||||||
|
use WebGUI::Operation::Shared;
|
||||||
|
use WebGUI::Privilege;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
|
use WebGUI::SQL;
|
||||||
use WebGUI::URL;
|
use WebGUI::URL;
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
use WebGUI::Operation::Shared;
|
|
||||||
use WebGUI::Icon;
|
|
||||||
use WebGUI::Privilege;
|
|
||||||
use WebGUI::SQL;
|
|
||||||
use WebGUI::MetaData;
|
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(&www_editMetaDataField &www_manageMetaData &www_editMetaDataFieldSave &www_deleteMetaDataField
|
our @EXPORT = qw(&www_editMetaDataField &www_manageMetaData &www_editMetaDataFieldSave &www_deleteMetaDataField
|
||||||
|
|
@ -109,7 +110,7 @@ sub www_editMetaDataFieldSave {
|
||||||
. www_editMetaDataField();
|
. www_editMetaDataField();
|
||||||
}
|
}
|
||||||
if($session{form}{fid} eq 'new') {
|
if($session{form}{fid} eq 'new') {
|
||||||
$session{form}{fid} = getNextId("metaData_fieldId");
|
$session{form}{fid} = WebGUI::Id::generate();
|
||||||
WebGUI::SQL->write("insert into metaData_properties (fieldId, fieldName, defaultValue, description, fieldType, possibleValues) values (".
|
WebGUI::SQL->write("insert into metaData_properties (fieldId, fieldName, defaultValue, description, fieldType, possibleValues) values (".
|
||||||
quote($session{form}{fid}).",".
|
quote($session{form}{fid}).",".
|
||||||
quote($session{form}{fieldName}).",".
|
quote($session{form}{fieldName}).",".
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ use WebGUI::ErrorHandler;
|
||||||
use WebGUI::Grouping;
|
use WebGUI::Grouping;
|
||||||
use WebGUI::HTMLForm;
|
use WebGUI::HTMLForm;
|
||||||
use WebGUI::Icon;
|
use WebGUI::Icon;
|
||||||
|
use WebGUI::Id;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Macro;
|
use WebGUI::Macro;
|
||||||
use WebGUI::Navigation;
|
use WebGUI::Navigation;
|
||||||
|
|
@ -60,9 +61,9 @@ sub www_copyNavigation {
|
||||||
WebGUI::SQL->write("insert into Navigation (navigationId, identifier, depth, method, startAt, stopAtLevel,
|
WebGUI::SQL->write("insert into Navigation (navigationId, identifier, depth, method, startAt, stopAtLevel,
|
||||||
templateId, showSystemPages, showHiddenPages, showUnprivilegedPages,
|
templateId, showSystemPages, showHiddenPages, showUnprivilegedPages,
|
||||||
reverse)
|
reverse)
|
||||||
values (".getNextId("navigationId").",
|
values (".WebGUI::Id::generate().",
|
||||||
".quote('Copy of '.$navigation{identifier}).", $navigation{depth}, ".quote($navigation{method}).
|
".quote($navigation{identifier}.' (copy)').", $navigation{depth}, ".quote($navigation{method}).
|
||||||
", ".quote($navigation{startAt}).", $navigation{stopAtLevel}, $navigation{templateId},
|
", ".quote($navigation{startAt}).", $navigation{stopAtLevel}, ".quote($navigation{templateId}).",
|
||||||
$navigation{showSystemPages}, $navigation{showHiddenPages},$navigation{showUnprivilegedPages},
|
$navigation{showSystemPages}, $navigation{showHiddenPages},$navigation{showUnprivilegedPages},
|
||||||
$navigation{reverse})");
|
$navigation{reverse})");
|
||||||
return www_listNavigation();
|
return www_listNavigation();
|
||||||
|
|
@ -90,7 +91,7 @@ sub www_deleteNavigationConfirm {
|
||||||
if ($session{form}{navigationId} < 1000 && $session{form}{navigationId} > 0) {
|
if ($session{form}{navigationId} < 1000 && $session{form}{navigationId} > 0) {
|
||||||
return WebGUI::Privilege::vitalComponent();
|
return WebGUI::Privilege::vitalComponent();
|
||||||
}
|
}
|
||||||
WebGUI::SQL->write("delete from Navigation where navigationId = $session{form}{navigationId}");
|
WebGUI::SQL->write("delete from Navigation where navigationId = ".quote($session{form}{navigationId}));
|
||||||
|
|
||||||
# Also delete cache
|
# Also delete cache
|
||||||
WebGUI::Page->recacheNavigation;
|
WebGUI::Page->recacheNavigation;
|
||||||
|
|
@ -258,22 +259,22 @@ sub www_editNavigationSave {
|
||||||
return WebGUI::International::get(33,'Navigation').www_editNavigation();
|
return WebGUI::International::get(33,'Navigation').www_editNavigation();
|
||||||
}
|
}
|
||||||
if ($session{form}{navigationId} eq "new") {
|
if ($session{form}{navigationId} eq "new") {
|
||||||
$session{form}{navigationId} = getNextId("navigationId");
|
$session{form}{navigationId} = WebGUI::Id::generate();
|
||||||
WebGUI::SQL->write("insert into Navigation (navigationId, identifier)
|
WebGUI::SQL->write("insert into Navigation (navigationId, identifier)
|
||||||
values ($session{form}{navigationId}, ".quote($session{form}{identifier}).")");
|
values (".quote($session{form}{navigationId}).", ".quote($session{form}{identifier}).")");
|
||||||
}
|
}
|
||||||
$session{form}{startAt} = $session{form}{startAt_new} || $session{form}{startAt}; # Combo field
|
$session{form}{startAt} = $session{form}{startAt_new} || $session{form}{startAt}; # Combo field
|
||||||
WebGUI::SQL->write("update Navigation set depth = $session{form}{depth},
|
WebGUI::SQL->write("update Navigation set depth = $session{form}{depth},
|
||||||
method = ".quote($session{form}{method}).",
|
method = ".quote($session{form}{method}).",
|
||||||
startAt = ".quote($session{form}{startAt}).",
|
startAt = ".quote($session{form}{startAt}).",
|
||||||
stopAtLevel = ".quote($session{form}{stopAtLevel}).",
|
stopAtLevel = ".quote($session{form}{stopAtLevel}).",
|
||||||
templateId = $session{form}{templateId},
|
templateId = ".quote($session{form}{templateId}).",
|
||||||
showSystemPages = $session{form}{showSystemPages},
|
showSystemPages = $session{form}{showSystemPages},
|
||||||
showHiddenPages = $session{form}{showHiddenPages},
|
showHiddenPages = $session{form}{showHiddenPages},
|
||||||
showUnprivilegedPages = $session{form}{showUnprivilegedPages},
|
showUnprivilegedPages = $session{form}{showUnprivilegedPages},
|
||||||
identifier = ".quote($session{form}{identifier}).",
|
identifier = ".quote($session{form}{identifier}).",
|
||||||
reverse = ".quote($session{form}{'reverse'})."
|
reverse = ".quote($session{form}{'reverse'})."
|
||||||
where navigationId = $session{form}{navigationId}");
|
where navigationId = ".quote($session{form}{navigationId}));
|
||||||
# Delete from cache
|
# Delete from cache
|
||||||
|
|
||||||
WebGUI::Page->recacheNavigation;
|
WebGUI::Page->recacheNavigation;
|
||||||
|
|
|
||||||
|
|
@ -92,14 +92,14 @@ sub www_deleteTemplateConfirm {
|
||||||
return WebGUI::Privilege::vitalComponent();
|
return WebGUI::Privilege::vitalComponent();
|
||||||
} elsif (WebGUI::Grouping::isInGroup(8)) {
|
} elsif (WebGUI::Grouping::isInGroup(8)) {
|
||||||
if ($session{form}{namespace} eq "Page") {
|
if ($session{form}{namespace} eq "Page") {
|
||||||
$a = WebGUI::SQL->read("select * from page where templateId=".$session{form}{tid});
|
$a = WebGUI::SQL->read("select * from page where templateId=".quote($session{form}{tid}));
|
||||||
while (($pageId) = $a->array) {
|
while (($pageId) = $a->array) {
|
||||||
WebGUI::SQL->write("update wobject set templatePosition=1 where pageId=$pageId");
|
WebGUI::SQL->write("update wobject set templatePosition=1 where pageId=".quote($pageId));
|
||||||
}
|
}
|
||||||
$a->finish;
|
$a->finish;
|
||||||
WebGUI::SQL->write("update page set templateId=2 where templateId=".$session{form}{tid});
|
WebGUI::SQL->write("update page set templateId=2 where templateId=".quote($session{form}{tid}));
|
||||||
}
|
}
|
||||||
WebGUI::SQL->write("delete from template where templateId=".$session{form}{tid}
|
WebGUI::SQL->write("delete from template where templateId=".quote($session{form}{tid})
|
||||||
." and namespace=".quote($session{form}{namespace}));
|
." and namespace=".quote($session{form}{namespace}));
|
||||||
return www_listTemplates();
|
return www_listTemplates();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -120,7 +120,7 @@ sub www_editTemplate {
|
||||||
$template{template} = "<h1><tmpl_var title></h1>\n\n";
|
$template{template} = "<h1><tmpl_var title></h1>\n\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
%template = WebGUI::SQL->quickHash("select * from template where templateId=$session{form}{tid} and
|
%template = WebGUI::SQL->quickHash("select * from template where templateId=".quote($session{form}{tid})." and
|
||||||
namespace=".quote($session{form}{namespace}));
|
namespace=".quote($session{form}{namespace}));
|
||||||
}
|
}
|
||||||
$output .= helpIcon("template add/edit");
|
$output .= helpIcon("template add/edit");
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,11 @@ package WebGUI::PassiveProfiling;
|
||||||
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use Tie::IxHash;
|
||||||
|
use WebGUI::DateTime;
|
||||||
|
use WebGUI::Id;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
use WebGUI::DateTime;
|
|
||||||
use Tie::IxHash;
|
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
@ -60,7 +61,7 @@ sub add {
|
||||||
return unless ($session{setting}{passiveProfilingEnabled});
|
return unless ($session{setting}{passiveProfilingEnabled});
|
||||||
my $wobjectId = shift;
|
my $wobjectId = shift;
|
||||||
my $sql = "insert into passiveProfileLog (passiveProfileLogId, userId, sessionId, wobjectId, dateOfEntry)
|
my $sql = "insert into passiveProfileLog (passiveProfileLogId, userId, sessionId, wobjectId, dateOfEntry)
|
||||||
values (".quote(getNextId("passiveProfileLogId")).",".
|
values (".quote(WebGUI::Id::generate()).",".
|
||||||
quote($session{user}{userId}).",".
|
quote($session{user}{userId}).",".
|
||||||
quote($session{var}{sessionId}).",".
|
quote($session{var}{sessionId}).",".
|
||||||
quote($wobjectId).",".
|
quote($wobjectId).",".
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,15 @@ package WebGUI::Template;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
use File::Path;
|
||||||
use HTML::Template;
|
use HTML::Template;
|
||||||
use strict;
|
use strict;
|
||||||
use WebGUI::Attachment;
|
use WebGUI::Attachment;
|
||||||
use WebGUI::ErrorHandler;
|
use WebGUI::ErrorHandler;
|
||||||
|
use WebGUI::Id;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
use File::Path;
|
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
@ -109,7 +110,7 @@ Defaults to "page". Specify the namespace of the template to retrieve.
|
||||||
sub get {
|
sub get {
|
||||||
my $templateId = shift || 1;
|
my $templateId = shift || 1;
|
||||||
my $namespace = shift || "page";
|
my $namespace = shift || "page";
|
||||||
return WebGUI::SQL->quickHashRef("select * from template where templateId=".$templateId." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
|
return WebGUI::SQL->quickHashRef("select * from template where templateId=".quote($templateId)." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -229,7 +230,7 @@ sub process {
|
||||||
|
|
||||||
my $template;
|
my $template;
|
||||||
unless (-f $file->getPath) {
|
unless (-f $file->getPath) {
|
||||||
($template) = WebGUI::SQL->quickArray("select template from template where templateId=".$templateId." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
|
($template) = WebGUI::SQL->quickArray("select template from template where templateId=".quote($templateId)." and namespace=".quote($namespace),WebGUI::SQL->getSlave);
|
||||||
$file->saveFromScalar($template);
|
$file->saveFromScalar($template);
|
||||||
unless (-f $file->getPath) {
|
unless (-f $file->getPath) {
|
||||||
WebGUI::ErrorHandler::warn("Could not create file ".$file->getPath."\nTemplate file caching is disabled");
|
WebGUI::ErrorHandler::warn("Could not create file ".$file->getPath."\nTemplate file caching is disabled");
|
||||||
|
|
@ -304,18 +305,14 @@ A hash reference containing the data to be stored. At minimum the hash reference
|
||||||
sub set {
|
sub set {
|
||||||
my $data = shift;
|
my $data = shift;
|
||||||
if ($data->{templateId} eq "new") {
|
if ($data->{templateId} eq "new") {
|
||||||
($data->{templateId}) = WebGUI::SQL->quickArray("select max(templateId) from template where namespace=".quote($data->{namespace}));
|
$data->{templateId} = WebGUI::Id::generate();
|
||||||
$data->{templateId}++;
|
WebGUI::SQL->write("insert into template (templateId,namespace) values (".quote($data->{templateId}).",".quote($data->{namespace}).")");
|
||||||
if ($data->{templateId} < 1000) {
|
|
||||||
$data->{templateId} = 1000;
|
|
||||||
}
|
|
||||||
WebGUI::SQL->write("insert into template (templateId,namespace) values (".$data->{templateId}.",".quote($data->{namespace}).")");
|
|
||||||
}
|
}
|
||||||
my @pairs;
|
my @pairs;
|
||||||
foreach my $key (keys %{$data}) {
|
foreach my $key (keys %{$data}) {
|
||||||
push(@pairs, $key."=".quote($data->{$key})) unless ($key eq "namespace" || $key eq "templateId");
|
push(@pairs, $key."=".quote($data->{$key})) unless ($key eq "namespace" || $key eq "templateId");
|
||||||
}
|
}
|
||||||
WebGUI::SQL->write("update template set ".join(",",@pairs)." where templateId=".$data->{templateId}." and namespace=".quote($data->{namespace}));
|
WebGUI::SQL->write("update template set ".join(",",@pairs)." where templateId=".quote($data->{templateId})." and namespace=".quote($data->{namespace}));
|
||||||
my $file = _getTemplateFile($data->{templateId},$data->{namespace});
|
my $file = _getTemplateFile($data->{templateId},$data->{namespace});
|
||||||
$file->delete;
|
$file->delete;
|
||||||
return $data->{templateId};
|
return $data->{templateId};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue