Permalink
Browse files

Finished POD documentation

Finished the POD documentation for TickIt

Signed-off-by: Adam Jimerson <vendion@gmail.com>
  • Loading branch information...
vendion committed Feb 7, 2011
1 parent 6bbe335 commit 41133750473375c6a441058b0d8811530e11c5ff
Showing with 165 additions and 26 deletions.
  1. +152 −24 TickItAdmin.pl
  2. +0 −2 repairs.pl
  3. +13 −0 updater.pl
View
@@ -10,9 +10,26 @@
use Carp;
use Config::General;
+=head1 NAME
+
+TickItAdmin - Admin backend for TickIt
+
+=head1 SYNOPSIS
+
+=head1 DISCRIPTION
+
+This is the administrator backend to TickIt admin doing things like adding/removing techs to the system and reports. As well as some high level database access.
+
+=cut
+
+=head2 Beginning
+
+Added for Windows compatability, some ports of Perl (Active Perl, Strawberry Perl, etc) on Windows
+act differently when it comes to using Enviremental data "$ENV{}"
+
+=cut
+
BEGIN {
- #Added for Windows compatability, some ports of Perl (Active Perl, Strawberry Perl, etc) on Windows
- #act differently when it comes to using Enviremental data "$ENV{}"
if ( $^O =~ /MSWin32/ ) {
if ( ! $ENV{HOME} ) {
if ( $ENV{USERPROFILE} ) {
@@ -66,9 +83,14 @@ BEGIN
quit() if $option == 13;
}
+=head2 main_menu
+
+Displays the main menu
+
+=cut
+
sub main_menu {
- # Displays the main menu
clear_screen();
my $menu = <<"END_MENU";
TickIt Admin System
@@ -106,9 +128,14 @@ sub main_menu {
return;
}
+=head2 db_connect
+
+Check the status of the database connection, if none exits then create a new connection
+
+=cut
+
sub db_connect {
-# Check the status of the database connection, if none exists then create a new connection
my $db_connected = q[0];
my $dsn = q[];
if ( $db_connected == 1 ) {
@@ -127,9 +154,14 @@ sub db_connect {
return;
}
+=head2 clear_screen
+
+Clears the screen for both Windows and *nix systems and returns to the caller
+
+=cut
+
sub clear_screen {
- # Clears the screen for both Windows and *nix systems and returns to the caller
if ( $^O =~ /MSWin32/ ) {
system 'cls';
} else {
@@ -138,9 +170,14 @@ sub clear_screen {
return;
}
+=head2 display_menu_error
+
+If any error messages are passed display them to the user and returns to the main menu
+
+=cut
+
sub display_menu_error {
-# if any error messages are passed display them to the user and returns to the main menu
my $msg = shift;
clear_screen();
my ( $time ) = get_time('time');
@@ -149,9 +186,14 @@ sub display_menu_error {
return;
}
+=head2 process_input
+
+Takes in information and loops through testing the input for valid alpanumeric charaters.
+
+=cut
+
sub process_input {
-# takes in information and loops through testing the input for valid alphanumeric characters.
my @data = @_;
for (@data) {
chomp;
@@ -161,9 +203,14 @@ sub process_input {
return @data;
}
+=head2 tech_login
+
+Start tech login section
+
+=cut
+
sub tech_login {
- #Start tech login section
print 'Please scan barcode to login: ';
my $techID = <>;
($techID) = process_input($techID);
@@ -196,9 +243,14 @@ sub tech_login {
return $techID;
}
+=head2 add_user
+
+Adds a new tech to the TickIt system
+
+=cut
+
sub add_user {
- #Adds a new tech to the TickIt system
my %tech = (
id => q[],
firstname => q[],
@@ -234,9 +286,14 @@ sub add_user {
return;
}
+=head2 user_details
+
+Lists details on a tech, mostly lists the current reviews on the tech in question
+
+=cut
+
sub user_details {
-#Lists details on a tech, mostly lists the current reviews on the tech in question
clear_screen();
print 'Enter Unique ID for Tech: ';
my $uniqid = <>;
@@ -275,9 +332,14 @@ sub user_details {
return;
}
+=head2 list_users
+
+Lists all techs in TickIt
+
+=cut
+
sub list_users {
- #Lists all users in TickIt
my $sth = $dbh->prepare('SELECT * FROM tech');
if ( !$sth ) {
my ( $time ) = get_time('time');
@@ -312,9 +374,14 @@ sub list_users {
return;
}
+=head2 add_review
+
+Adds a review on a tech, both rating from 1-10 and comments from management
+
+=cut
+
sub add_review {
- #Adds a review on a tech, both rating from 1-10 and comments from management
clear_screen();
print 'Enter Techs unique ID: ';
my $uniqid = <>;
@@ -376,9 +443,14 @@ sub add_review {
return;
}
+=head2 remove_user
+
+Removes a tech from the TickIt system
+
+=cut
+
sub remove_user {
- #Removes a tech from the TickIt system
clear_screen();
print 'Enter Techs unique ID #: ';
my $uniqid = <>;
@@ -389,15 +461,26 @@ sub remove_user {
return;
}
+=head2 quit
+
+Pretty much explains itself, quits the program.... what else is there to say?
+
+=cut
+
sub quit {
$dbh->disconnect;
close $LOG;
exit 0;
}
+=head2 db_add
+
+Adds information gathered from add_user() and inserts it into the database
+
+=cut
+
sub db_add {
- #Adds information gathered from add_user() and inserts it into the database
my %tech = @_;
$dbh->do(
'INSERT INTO tech (id, firstname, lastname, email, phone, managementrating, managementcomments, date, ismanagement) VALUES (?,?,?,?,?,?,?,?,?)',
@@ -422,9 +505,14 @@ sub db_add {
return;
}
+=head2 db_remove
+
+Remvoes the computer and custoemr from the system
+
+=cut
+
sub db_remove {
- # Removes the computer and customer from the system
my $barcode = shift;
if ( $barcode == q[] ) {
($barcode) = get_barcode();
@@ -437,19 +525,29 @@ sub db_remove {
return;
}
+=head2 get_barcode
+
+Gets the barcode information and returns to the calling function
+
+=cut
+
sub get_barcode {
- # Gets the barcode information and returns to the calling function
clear_screen();
print 'Please Scan System Barcode: '; # Get barcode information
my $barcode = <>;
($barcode) = process_input($barcode);
return $barcode;
}
+=head2 tech_review
+
+Prints out a tech review to a text file for printing
+
+=cut
+
sub tech_review {
- # Prints out a tech review to a text file for printing
print 'Enter Unique ID for Tech: ';
my $uniqid = <>;
($uniqid) = process_input($uniqid);
@@ -498,9 +596,14 @@ sub tech_review {
return;
}
+=head2 m_repairs
+
+Prints out a monthtly repair request report to a text file for printing
+
+=cut
+
sub m_repairs {
- # Prints out a monthly repair request report to a text file for printing
print 'Enter Begining Date (YYYY-MM-DD): ';
my $start = <>;
($start) = process_input($start);
@@ -550,9 +653,15 @@ sub m_repairs {
return;
}
+=head2 m_donation
+
+Prints out a monthly donation amount report to a text file for printing
+
+=cut
+
+
sub m_donation {
- # Prints out a monthly donation amount report to a text file for printing
print 'Enter Begining Date (YYYY-MM-DD): ';
my $start = <>;
($start) = process_input($start);
@@ -625,9 +734,14 @@ sub m_donation {
return;
}
+=head2 y_repairs
+
+Prints out a yearly repair request report to a text file for printing
+
+=cut
+
sub y_repairs {
- # Prints out a yearly repair request report to a text file for printing
my $current = q[0];
my $complete = q[0];
print "Generating Year To Date Number of Repair Requests\n";
@@ -677,9 +791,14 @@ sub y_repairs {
return;
}
+=head2 y_donation
+
+Prints out a yearly repair request report to a text file for printing
+
+=cut
+
sub y_donation {
- # Prints out a yearly repair request report to a text file for printing
my $current = q[0];
my $complete = q[0];
print "Generating Year to Date Donations Report\n";
@@ -746,10 +865,14 @@ sub y_donation {
return;
}
+=head2 eoy
+
+Preforms a End of Year reset on TickIt clearing all tables in the database of entries. Make sure all needed reports are done before running this step.
+
+=cut
+
sub eoy {
-# Preforms a End of Year reset on TickIt clearing all tables in the database of entries.
-# Make sure all needed reports are done before running this step.
print "Warning this completely emptys the Database of all information\n";
print
"Make sure that all reports and all important data has been backuped up/printed before running this!\n";
@@ -784,8 +907,13 @@ sub eoy {
return;
}
+=head2 get_time
+
+Gets the time or date from the OS and returns it to the caller
+
+=cut
+
sub get_time {
- # Gets the time from the OS and returns it to the caller
my $value = shift;
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime time;
$year += 1900;
View
@@ -31,8 +31,6 @@ =head2 Begining
=cut
BEGIN {
- #Added for Windows compatability, some ports of Perl (Active Perl, Strawberry Perl, etc) on Windows
- #act differently when it comes to using Enviremental data "$ENV{}"
if ( $^O =~ /MSWin32/ ) {
if ( ! $ENV{HOME} ) {
if ( $ENV{USERPROFILE} ) {
Oops, something went wrong.

0 comments on commit 4113375

Please sign in to comment.