X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=sql-ledger%2Fbin%2Fmozilla%2Fhr.pl;fp=sql-ledger%2Fbin%2Fmozilla%2Fhr.pl;h=0000000000000000000000000000000000000000;hp=497daa1f7fd5f9af12aa63e3f3da683257d1a7ef;hb=86b1b489a4ed2f9bc0cba6cafeab0d6eca5584dc;hpb=948b8acdd4b9b3864342062d0c397a11f57c5700 diff --git a/sql-ledger/bin/mozilla/hr.pl b/sql-ledger/bin/mozilla/hr.pl deleted file mode 100644 index 497daa1f7..000000000 --- a/sql-ledger/bin/mozilla/hr.pl +++ /dev/null @@ -1,1217 +0,0 @@ -#===================================================================== -# SQL-Ledger, Accounting -# Copyright (c) 2004 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#====================================================================== -# -# payroll module -# -#====================================================================== - -use SL::HR; -use SL::User; - -1; -# end of main - - - -sub add { - - $label = "Add ".ucfirst $form->{db}; - $form->{title} = $locale->text($label); - - $form->{callback} = "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}" unless $form->{callback}; - - &{ "$form->{db}_links" }; - -} - - -sub search { &{ "search_$form->{db}" } }; - - -sub search_employee { - - $form->{title} = $locale->text('Employees'); - - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - -
$form->{title}
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
|.$locale->text('Employee Number').qq|
|.$locale->text('Employee Name').qq|
|.$locale->text('Startdate').qq|{startdate}>|.$locale->text('Enddate').qq|{enddate}>
|.$locale->text('Notes').qq|
 |.$locale->text('All').qq| -  |.$locale->text('Sales').qq| -  |.$locale->text('Orphaned').qq|
|.$locale->text('Include in Report').qq| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|.$locale->text('ID').qq| |.$locale->text('Employee Number').qq| |.$locale->text('Employee Name').qq| |.$locale->text('Address').qq| |.$locale->text('City').qq|
|.$locale->text('State/Province').qq| |.$locale->text('Zip/Postal Code').qq| |.$locale->text('Country').qq| |.$locale->text('Work Phone').qq|
|.$locale->text('Home Phone').qq| |.$locale->text('Startdate').qq| |.$locale->text('Enddate').qq| |.$locale->text('Sales').qq|
|.$locale->text('Manager').qq| |.$locale->text('Role').qq| |.$locale->text('Login').qq| |.$locale->text('E-mail').qq|
|.$locale->text('SSN').qq| |.$locale->text('DOB').qq| |.$locale->text('IBAN').qq| |.$locale->text('BIC').qq| |.$locale->text('Notes').qq|
-
-

- - -{db}> - -{path}> -{login}> -{sessionid}> - -
- -
- - - -|; -} - - -sub list_employees { - - HR->employees(\%myconfig, \%$form); - - $href = "$form->{script}?action=list_employees&direction=$form->{direction}&oldsort=$form->{oldsort}&db=$form->{db}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&status=$form->{status}"; - - $form->sort_order(); - - $callback = "$form->{script}?action=list_employees&direction=$form->{direction}&oldsort=$form->{oldsort}&db=$form->{db}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&status=$form->{status}"; - - @columns = $form->sort_columns(qw(id employeenumber name address city state zipcode country workphone homephone email startdate enddate ssn dob iban bic sales role manager login notes)); - - foreach $item (@columns) { - if ($form->{"l_$item"} eq "Y") { - push @column_index, $item; - - # add column to href and callback - $callback .= "&l_$item=Y"; - $href .= "&l_$item=Y"; - } - } - - %role = ( user => $locale->text('User'), - supervisor => $locale->text('Supervisor'), - manager => $locale->text('Manager'), - admin => $locale->text('Administrator') - ); - - $option = $locale->text('All'); - - if ($form->{status} eq 'sales') { - $option = $locale->text('Sales'); - } - if ($form->{status} eq 'orphaned') { - $option = $locale->text('Orphaned'); - } - if ($form->{employeenumber}) { - $callback .= "&employeenumber=".$form->escape($form->{employeenumber},1); - $href .= "&employeenumber=".$form->escape($form->{employeenumber}); - $option .= "\n
".$locale->text('Employee Number')." : $form->{employeenumber}"; - } - if ($form->{name}) { - $callback .= "&name=".$form->escape($form->{name},1); - $href .= "&name=".$form->escape($form->{name}); - $option .= "\n
".$locale->text('Employee Name')." : $form->{name}"; - } - if ($form->{startdate}) { - $callback .= "&startdate=$form->{startdate}"; - $href .= "&startdate=$form->{startdate}"; - $option .= "\n
" if ($option); - $option .= $locale->text('Startdate')." ".$locale->date(\%myconfig, $form->{startdate}, 1); - } - if ($form->{enddate}) { - $callback .= "&enddate=$form->{enddate}"; - $href .= "&enddate=$form->{enddate}"; - $option .= "\n
" if ($option); - $option .= $locale->text('Enddate')." ".$locale->date(\%myconfig, $form->{enddate}, 1); - } - if ($form->{notes}) { - $callback .= "¬es=".$form->escape($form->{notes},1); - $href .= "¬es=".$form->escape($form->{notes}); - $option .= "\n
" if $option; - $option .= $locale->text('Notes')." : $form->{notes}"; - } - - $form->{callback} = "$callback&sort=$form->{sort}"; - $callback = $form->escape($form->{callback}); - - $column_header{id} = qq||.$locale->text('ID').qq||; - $column_header{employeenumber} = qq||.$locale->text('Number').qq||; - $column_header{name} = qq||.$locale->text('Name').qq||; - $column_header{manager} = qq||.$locale->text('Manager').qq||; - $column_header{address} = qq||.$locale->text('Address').qq||; - $column_header{city} = qq||.$locale->text('City').qq||; - $column_header{state} = qq||.$locale->text('State/Province').qq||; - $column_header{zipcode} = qq||.$locale->text('Zip/Postal Code').qq||; - $column_header{country} = qq||.$locale->text('Country').qq||; - $column_header{workphone} = qq||.$locale->text('Work Phone').qq||; - $column_header{homephone} = qq||.$locale->text('Home Phone').qq||; - - $column_header{startdate} = qq||.$locale->text('Startdate').qq||; - $column_header{enddate} = qq||.$locale->text('Enddate').qq||; - $column_header{notes} = qq||.$locale->text('Notes').qq||; - $column_header{role} = qq||.$locale->text('Role').qq||; - $column_header{login} = qq||.$locale->text('Login').qq||; - - $column_header{sales} = qq||.$locale->text('S').qq||; - $column_header{email} = qq||.$locale->text('E-mail').qq||; - $column_header{ssn} = qq||.$locale->text('SSN').qq||; - $column_header{dob} = qq||.$locale->text('DOB').qq||; - $column_header{iban} = qq||.$locale->text('IBAN').qq||; - $column_header{bic} = qq||.$locale->text('BIC').qq||; - - $form->{title} = $locale->text('Employees'); - - $form->header; - - print qq| - - - - - - - - - - - - - - - - -
$form->{title}
$option
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - foreach $ref (@{ $form->{all_employee} }) { - - map { $column_data{$_} = "" } @column_index; - - $column_data{sales} = ($ref->{sales}) ? "" : ""; - $column_data{role} = qq||; - $column_date{address} = qq|$ref->{address1} $ref->{address2}|; - - $column_data{name} = ""; - - if ($ref->{email}) { - $email = $ref->{email}; - $email =~ s//\>/; - - $column_data{email} = qq||; - } - - $i++; $i %= 2; - print " - -"; - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; - - } - - $i = 1; - $button{'HR--Employees--Add Employee'}{code} = qq| |; - $button{'HR--Employees--Add Employee'}{order} = $i++; - - foreach $item (split /;/, $myconfig{acs}) { - delete $button{$item}; - } - - print qq| -
$ref->{$_} x $role{"$ref->{role}"} {script}?action=edit&db=employee&id=$ref->{id}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&status=$form->{status}&callback=$callback>$ref->{name} $email
-

- -
-
{script}> - - - -{db}> - -{path}> -{login}> -{sessionid}> -|; - - foreach $item (sort { $a->{order} <=> $b->{order} } %button) { - print $item->{code}; - } - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| -
- - - -|; - -} - - -sub edit { - -# $locale->text('Edit Employee') -# $locale->text('Edit Deduction') - - $label = ucfirst $form->{db}; - $form->{title} = "Edit $label"; - - &{ "$form->{db}_links" }; - -} - - -sub employee_links { - -#$form->{deductions} = 1; - HR->get_employee(\%myconfig, \%$form); - - map { $form->{$_} = $form->quote($form->{$_}) } keys %$form; - - if ($form->{all_deduction}) { - $form->{selectdeduction} = "