Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e1235d08
Commit
e1235d08
authored
Feb 13, 2002
by
bbaetz%student.usyd.edu.au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 100094 - use generic template handling code
r=mattyt, afranke
parent
5938698d
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
93 additions
and
313 deletions
+93
-313
Attachment.pm
Attachment.pm
+11
-24
Attachment.pm
Bugzilla/Attachment.pm
+11
-24
attachment.cgi
attachment.cgi
+5
-29
colchange.cgi
colchange.cgi
+6
-36
createaccount.cgi
createaccount.cgi
+5
-21
editattachstatuses.cgi
editattachstatuses.cgi
+5
-29
enter_bug.cgi
enter_bug.cgi
+0
-4
globals.pl
globals.pl
+14
-3
index.cgi
index.cgi
+5
-30
query.cgi
query.cgi
+20
-62
quips.cgi
quips.cgi
+6
-20
sidebar.cgi
sidebar.cgi
+5
-31
No files found.
Attachment.pm
View file @
e1235d08
...
...
@@ -27,25 +27,15 @@
use
diagnostics
;
use
strict
;
use
vars
qw(
$template
$vars
)
;
package
Attachment
;
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "templates/" subdirectory.
use
Template
;
# This is the global template object that gets used one or more times by
# the script when it needs to process a template and return the results.
# Configuration parameters can be specified here that apply to all templates
# processed in this file.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
'template/custom:template/default'
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
}
);
my
$template
=
$::template
;
my
$vars
=
$::vars
;
# This module requires that its caller have said "require CGI.pl" to import
# relevant functions from that script and its companion globals.pl.
...
...
@@ -99,16 +89,13 @@ sub list
push
@attachments
,
\%
a
;
}
my
$vars
=
{
'bugid'
=>
$bugid
,
'attachments'
=>
\
@attachments
,
'Param'
=>
\&::
Param
,
# for retrieving global parameters
'PerformSubsts'
=>
\&::
PerformSubsts
# for processing global parameters
};
$vars
->
{
'bugid'
}
=
$bugid
;
$vars
->
{
'attachments'
}
=
\
@attachments
;
$template
->
process
(
"attachment/list.atml"
,
$vars
)
||
&::
DisplayError
(
"Template process failed: "
.
$template
->
error
())
&&
exit
;
}
1
;
Bugzilla/Attachment.pm
View file @
e1235d08
...
...
@@ -27,25 +27,15 @@
use
diagnostics
;
use
strict
;
use
vars
qw(
$template
$vars
)
;
package
Attachment
;
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "templates/" subdirectory.
use
Template
;
# This is the global template object that gets used one or more times by
# the script when it needs to process a template and return the results.
# Configuration parameters can be specified here that apply to all templates
# processed in this file.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
'template/custom:template/default'
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
}
);
my
$template
=
$::template
;
my
$vars
=
$::vars
;
# This module requires that its caller have said "require CGI.pl" to import
# relevant functions from that script and its companion globals.pl.
...
...
@@ -99,16 +89,13 @@ sub list
push
@attachments
,
\%
a
;
}
my
$vars
=
{
'bugid'
=>
$bugid
,
'attachments'
=>
\
@attachments
,
'Param'
=>
\&::
Param
,
# for retrieving global parameters
'PerformSubsts'
=>
\&::
PerformSubsts
# for processing global parameters
};
$vars
->
{
'bugid'
}
=
$bugid
;
$vars
->
{
'attachments'
}
=
\
@attachments
;
$template
->
process
(
"attachment/list.atml"
,
$vars
)
||
&::
DisplayError
(
"Template process failed: "
.
$template
->
error
())
&&
exit
;
}
1
;
attachment.cgi
View file @
e1235d08
...
...
@@ -31,41 +31,17 @@ use strict;
use
lib
qw(.)
;
use
vars
qw(
$template
$vars
)
;
# Include the Bugzilla CGI and general utility library.
require
"CGI.pl"
;
# Establish a connection to the database backend.
ConnectToDatabase
();
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "template/" subdirectory.
use
Template
;
# Create the global template object that processes templates and specify
# configuration parameters that apply to all templates processed in this script.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
}
);
# Define the global variables and functions that will be passed to the UI
# template. Individual functions add their own values to this hash before
# sending them to the templates they process.
my
$vars
=
{
# Function for retrieving global parameters.
'Param'
=>
\&
Param
,
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts'
=>
\&
PerformSubsts
};
# Check whether or not the user is logged in and, if so, set the $::userid
# and $::usergroupset variables.
quietly_check_login
();
...
...
colchange.cgi
View file @
e1235d08
...
...
@@ -25,45 +25,15 @@ use strict;
use
lib
qw(.)
;
sub
sillyness
{
# shut up "used only once" warnings
my
$zz
=
@::legal_keywords
;
$zz
=
$::buffer
;
}
use
vars
qw(
@legal_keywords
$buffer
$template
$vars
)
;
require
"CGI.pl"
;
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "template/" subdirectory.
use
Template
;
# Create the global template object that processes templates and specify
# configuration parameters that apply to all templates processed in this script.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
,
PRE_CHOMP
=>
1
,
});
# Define the global variables and functions that will be passed to the UI
# template. Individual functions add their own values to this hash before
# sending them to the templates they process.
my
$vars
=
{
# Function for retrieving global parameters.
'Param'
=>
\&
Param
,
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts'
=>
\&
PerformSubsts
,
# Function to search an array for a value
'lsearch'
=>
\&
lsearch
,
};
print
"Content-type: text/html\n"
;
# The master list not only says what fields are possible, but what order
...
...
createaccount.cgi
View file @
e1235d08
...
...
@@ -32,27 +32,11 @@ use lib qw(.);
require
"CGI.pl"
;
# Shut up misguided -w warnings about "used only once":
use
vars
%::
FORM
;
# Use the template toolkit (http://www.template-toolkit.org/)
use
Template
;
# Create the global template object that processes templates
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
RELATIVE
=>
1
,
PRE_CHOMP
=>
1
,
});
# Define the global variables and functions that will be passed to the UI
# template.
my
$vars
=
{
'Param'
=>
\&
Param
,
'PerformSubsts'
=>
\&
PerformSubsts
,
};
use
vars
qw(
%FORM
$template
$vars
)
;
ConnectToDatabase
();
...
...
editattachstatuses.cgi
View file @
e1235d08
...
...
@@ -29,41 +29,17 @@
use
diagnostics
;
use
strict
;
use
vars
qw(
$template
$vars
)
;
# Include the Bugzilla CGI and general utility library.
require
"CGI.pl"
;
# Establish a connection to the database backend.
ConnectToDatabase
();
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "template/" subdirectory.
use
Template
;
# Create the global template object that processes templates and specify
# configuration parameters that apply to all templates processed in this script.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
}
);
# Define the global variables and functions that will be passed to the UI
# template. Individual functions add their own values to this hash before
# sending them to the templates they process.
my
$vars
=
{
# Function for retrieving global parameters.
'Param'
=>
\&
Param
,
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts'
=>
\&
PerformSubsts
};
# Make sure the user is logged in and is allowed to edit products
# (i.e. the user has "editcomponents" privileges), since attachment
# statuses are product-specific.
...
...
enter_bug.cgi
View file @
e1235d08
...
...
@@ -51,10 +51,6 @@ use vars qw(
%MFORM
)
;
# Use template variables
my
$template
=
$::template
;
my
$vars
=
$::vars
;
# If we're using bug groups to restrict bug entry, we need to know who the
# user is right from the start.
confirm_login
()
if
(
Param
(
"usebuggroupsentry"
));
...
...
globals.pl
View file @
e1235d08
...
...
@@ -1578,9 +1578,6 @@ $::template = Template->new(
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
,
# Remove white-space before template directives (PRE_CHOMP) and at the
# beginning and end of templates and template blocks (TRIM) for better
# looking, more compact content. Use the plus sign at the beginning
...
...
@@ -1593,6 +1590,17 @@ $::template = Template->new(
{
# Render text in strike-through style.
strike
=>
sub
{
return
"<strike>"
.
$_
[
0
]
.
"</strike>"
}
,
# Returns the text with backslashes, single/double quotes,
# and newlines/carriage returns escaped for use in JS strings.
js
=>
sub
{
my
(
$var
)
=
@_
;
$var
=~
s/([\\\'\"])/\\$1/g
;
$var
=~
s/\n/\\n/g
;
$var
=~
s/\r/\\r/g
;
return
$var
;
}
}
,
}
);
...
...
@@ -1652,6 +1660,9 @@ $::vars =
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts'
=>
\&
PerformSubsts
,
# Generic linear search function
'lsearch'
=>
\&
lsearch
,
};
1
;
index.cgi
View file @
e1235d08
...
...
@@ -37,38 +37,13 @@ use strict;
use
lib
"."
;
require
"CGI.pl"
;
# Establish a connection to the database backend.
ConnectToDatabase
();
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "template/" subdirectory.
use
Template
;
# Create the global template object that processes templates and specify
# configuration parameters that apply to all templates processed in this script.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
,
POST_CHOMP
=>
1
,
}
use
vars
qw(
$template
$vars
)
;
# Define the global variables and functions that will be passed to the UI
# template. Individual functions add their own values to this hash before
# sending them to the templates they process.
my
$vars
=
{
# Function for retrieving global parameters.
'Param'
=>
\&
Param
,
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts'
=>
\&
PerformSubsts
};
# Establish a connection to the database backend.
ConnectToDatabase
();
# Check whether or not the user is logged in and, if so, set the $::userid
# and $::usergroupset variables.
...
...
query.cgi
View file @
e1235d08
...
...
@@ -34,68 +34,26 @@ require "CGI.pl";
# that no longer exist), since we don't want to die in the query page.
$::CheckOptionValues
=
0
;
use
vars
@::CheckOptionValues
,
@::legal_resolution
,
@::legal_bug_status
,
@::legal_components
,
@::legal_keywords
,
@::legal_opsys
,
@::legal_platform
,
@::legal_priority
,
@::legal_product
,
@::legal_severity
,
@::legal_target_milestone
,
@::legal_versions
,
@::log_columns
,
%::
versions
,
%::
components
,
%::
FORM
;
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "template/" subdirectory.
use
Template
;
# Create the global template object that processes templates and specify
# configuration parameters that apply to all templates processed in this script.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
,
PRE_CHOMP
=>
1
,
FILTERS
=>
{
# Returns the text with backslashes, single/double quotes,
# and newlines/carriage returns escaped for use in JS strings.
'js'
=>
sub
{
my
(
$var
)
=
@_
;
$var
=~
s/([\\\'\"])/\\$1/g
;
$var
=~
s/\n/\\n/g
;
$var
=~
s/\r/\\r/g
;
return
$var
;
}
},
});
# Define the global variables and functions that will be passed to the UI
# template. Individual functions add their own values to this hash before
# sending them to the templates they process.
my
$vars
=
{
# Function for retrieving global parameters.
'Param'
=>
\&
Param
,
# Function for processing global parameters that contain references
# to other global parameters.
'PerformSubsts'
=>
\&
PerformSubsts
,
# Function to search an array for a value
'lsearch'
=>
\&
lsearch
,
};
use
vars
qw(
@CheckOptionValues
@legal_resolution
@legal_bug_status
@legal_components
@legal_keywords
@legal_opsys
@legal_platform
@legal_priority
@legal_product
@legal_severity
@legal_target_milestone
@legal_versions
@log_columns
%versions
%components
%FORM
$template
$vars
)
;
if
(
defined
$::FORM
{
"GoAheadAndLogIn"
})
{
# We got here from a login page, probably from relogin.cgi. We better
...
...
quips.cgi
View file @
e1235d08
...
...
@@ -23,31 +23,17 @@
use
diagnostics
;
use
strict
;
use
vars
(
%::
FORM
);
use
vars
qw(
%FORM
$template
$vars
)
;
use
lib
qw(.)
;
require
"CGI.pl"
;
# Use the template toolkit (http://www.template-toolkit.org/)
use
Template
;
# Create the global template object that processes templates
my
$template
=
Template
->
new
(
{
INCLUDE_PATH
=>
"template/custom:template/default"
,
RELATIVE
=>
1
,
PRE_CHOMP
=>
1
,
});
# Define the global variables and functions that will be passed to the UI
# template.
my
$vars
=
{
'Param'
=>
\&
Param
,
'PerformSubsts'
=>
\&
PerformSubsts
,
};
my
$action
=
$::FORM
{
'action'
}
||
""
;
if
(
$action
eq
"show"
)
{
...
...
sidebar.cgi
View file @
e1235d08
...
...
@@ -22,39 +22,13 @@ use lib ".";
require
"CGI.pl"
;
# Shut up "Used Only Once" errors
use
vars
qw {
$anyvotesallowed
};
ConnectToDatabase
();
# Use the template toolkit (http://www.template-toolkit.org/) to generate
# the user interface (HTML pages and mail messages) using templates in the
# "template/" subdirectory.
use
Template
;
# Create the global template object that processes templates and specify
# configuration parameters that apply to all templates processed in this script.
my
$template
=
Template
->
new
(
{
# Colon-separated list of directories containing templates.
INCLUDE_PATH
=>
"template/custom:template/default"
,
# Allow templates to be specified with relative paths.
RELATIVE
=>
1
,
POST_CHOMP
=>
1
,
}
use
vars
qw(
$anyvotesallowed
$template
$vars
)
;
# Define the global variables and functions that will be passed to the UI
# template. Individual functions add their own values to this hash before
# sending them to the templates they process.
my
$vars
=
{
# Function for retrieving global parameters.
'Param'
=>
\&
Param
,
# Function that tells us if the logged in user is in a specific group.
'UserInGroup'
=>
\&
UserInGroup
,
};
ConnectToDatabase
();
# Needed for $::anyvotesallowed
GetVersionTable
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment