[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4429] trunk



Revision: 4429
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4429&view=rev
Author:   einhverfr
Date:     2012-03-10 09:42:29 +0000 (Sat, 10 Mar 2012)
Log Message:
-----------
merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Employee.pm
    trunk/UI/Contact/contact.html
    trunk/UI/form-dynatable.html
    trunk/UI/lib/dynatable.html
    trunk/sql/modules/Employee.sql

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/account.pm
    trunk/LedgerSMB/Scripts/admin.pm
    trunk/LedgerSMB/Scripts/customer.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Scripts/journal.pm
    trunk/LedgerSMB/Scripts/login.pm
    trunk/LedgerSMB/Scripts/menu.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/recon.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Scripts/taxform.pm
    trunk/LedgerSMB/Scripts/vendor.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-4422
   + /branches/1.3:3711-4428

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-03-10 09:32:28 UTC (rev 4428)
+++ trunk/Changelog	2012-03-10 09:42:29 UTC (rev 4429)
@@ -43,6 +43,7 @@
 * Corrected character encoding issue with backup scripts (Chris T)
 * Changes in the single payment UI to minimize mouse movements (Erik H)
 * Adding link to employee edit screen from user page (h/t H Sorli) (Chris T)
+* Fixed: Can't designate managers (Chris T, bug  3486840)
 
 Changelog for 1.3.12
 * Corrected processing of <?lsmb tags in order/invoice numbers (Chris T)

Modified: trunk/LedgerSMB/DBObject/Employee.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Employee.pm	2012-03-10 09:32:28 UTC (rev 4428)
+++ trunk/LedgerSMB/DBObject/Employee.pm	2012-03-10 09:42:29 UTC (rev 4429)
@@ -96,12 +96,34 @@
 sub save {
    my ($self) = @_;
    $self->set_entity_class();
+   if ($self->{is_manager}) {
+       $self->{role} = 'manager';
+   } else {
+       $self->{role} = 'user';
+   }
    my ($ref) = $self->exec_method(funcname => 'person__save');
    $self->{entity_id} = $ref->{'person__save'};
    $self->exec_method(funcname => 'employee__save');
    $self->{dbh}->commit;
 }
 
+
+=item get_managers 
+
+Retrieves a set of managers and attaches to $self->{all_managers}
+
+=cut
+
+sub get_managers {
+    my ($self) = @_;
+    my @results = $self->exec_method(funcname => 'employee__all_managers');
+    for my $ref (@results) {
+        $ref->{label} = $ref->{employeenumber} . '--' . $ref->{last_name};
+    }
+    $self->{all_managers} = ..hidden..;
+    return @results;
+}
+
 =item save_location
 
 Saves the location data for the contact.
@@ -170,7 +192,7 @@
 
 sub get_metadata {
     my $self = shift @_;
-
+    $self->get_managers;
     @{$self->{entity_classes}} = 
 		$self->exec_method(funcname => 'entity__list_classes');
 
@@ -220,6 +242,9 @@
 sub get {
     my $self = shift @_;
     my ($ref) = $self->exec_method(funcname => 'employee__get');
+    if ($ref->{role} eq 'manager'){
+        $ref->{is_manager} = 1;
+    }
     $self->merge($ref);
     @{$self->{locations}} = $self->exec_method(
 		funcname => 'person__list_locations');


Property changes on: trunk/LedgerSMB/Scripts/account.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4422
/branches/1.3/scripts/account.pl:3711-4368
   + /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4428
/branches/1.3/scripts/account.pl:3711-4368


Property changes on: trunk/LedgerSMB/Scripts/admin.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4422
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4428
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/customer.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4422
/branches/1.3/scripts/customer.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4428
/branches/1.3/scripts/customer.pl:4273-4287


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4422
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4428
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310


Property changes on: trunk/LedgerSMB/Scripts/file.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4422
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4428
/branches/1.3/scripts/file.pl:3711-4138


Property changes on: trunk/LedgerSMB/Scripts/journal.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4422
/branches/1.3/scripts/journal.pl:3711-4328
   + /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4428
/branches/1.3/scripts/journal.pl:3711-4328


Property changes on: trunk/LedgerSMB/Scripts/login.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4422
/branches/1.3/scripts/login.pl:3711-4192
   + /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4428
/branches/1.3/scripts/login.pl:3711-4192


Property changes on: trunk/LedgerSMB/Scripts/menu.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4422
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4428
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/payment.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4422
/branches/1.3/scripts/payment.pl:3711-4310
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4428
/branches/1.3/scripts/payment.pl:3711-4310


Property changes on: trunk/LedgerSMB/Scripts/recon.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4422
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4428
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4422
/branches/1.3/scripts/setup.pl:3711-4391
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4428
/branches/1.3/scripts/setup.pl:3711-4391


Property changes on: trunk/LedgerSMB/Scripts/taxform.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4422
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4428
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/vendor.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4422
/branches/1.3/scripts/vendor.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4428
/branches/1.3/scripts/vendor.pl:4273-4287

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2012-03-10 09:32:28 UTC (rev 4428)
+++ trunk/UI/Contact/contact.html	2012-03-10 09:42:29 UTC (rev 4429)
@@ -100,7 +100,7 @@
                 name = "entity_id"
                value = entity_id
 } ?>	
-<div class="input" id="person_name_div"><?lsmb #text('Name:')?>&nbsp;
+<div class="input_line" id="person_name_div"><?lsmb #text('Name:')?>&nbsp;
 <div class="input_group">
 <!-- TODO:  Add Saluatation -->
 <?lsmb PROCESS input element_data = {
@@ -120,6 +120,8 @@
 	size = 20
 } ?>
 </div>
+</div>
+<div class="input_line" id='person_name2_div'>
 <div class="input_group">
 <?lsmb PROCESS input element_data = {
 	label = text('Last Name') #'
@@ -129,8 +131,6 @@
 	size = 20
 } ?>
 </div>
-</div>
-<div id="job_title_div">
 <!-- Note that the strange # ' constructs are only necessary to help VIM avoid
 problems with multi-word single-quoted constructs in PI tags. -CT  -->
 <div class="input_group">
@@ -142,6 +142,8 @@
 	size = 20
 } # ' ?>
 </div>
+</div>
+<div class="input_line" id="person-role-div">
 <div class="input_group">
 <?lsmb PROCESS input element_data = {
 	label = text('Sales')
@@ -152,6 +154,17 @@
 } ?>
 </div>
 <div class="input_group">
+<?lsmb PROCESS input element_data = {
+        label = text('Manager')
+        value = 'manager'
+        type = "checkbox"
+        checked = is_manager
+        name = "is_manager"
+} ?>
+</div>
+</div>
+<div class="input_line" id="person-country-div">
+<div class="input_group">
        <?lsmb country_list.unshift({}) ?>
 		<?lsmb INCLUDE select element_data = {
 			text_attr = "name"
@@ -174,14 +187,15 @@
 } # ' ?>
 </div>
 <div class="input_group">
-<label for="manager_select"><?lsmb text('Manager') ?></label>
-<select id="manager_select" name="manager_id">
-<?lsmb FOREACH e = employee ?>
-<option value = e.entity_id <?lsmb (manager_id == e.entity_id) ? "SELECTED" : ""?><?lsmb e.name ?></option>
-<?lsmb END ?>
-</select>
+<?lsmb PROCESS select element_data = {
+         label = text('Manager')
+          name = 'manager_id'
+       options = all_managers
+default_values = [manager_id]
+     text_attr = 'label'
+    value_attr = 'id'
+} ?> 
 </div>
-</div>
 <div id="hr_dates_div">
 <div class="input_group">
 <?lsmb PROCESS input element_data = {

Modified: trunk/UI/form-dynatable.html
===================================================================
--- trunk/UI/form-dynatable.html	2012-03-10 09:32:28 UTC (rev 4428)
+++ trunk/UI/form-dynatable.html	2012-03-10 09:42:29 UTC (rev 4429)
@@ -1,10 +1,11 @@
 <?lsmb PROCESS 'ui-header.html' ?>
 <?lsmb PROCESS elements.html ?> 
+<?lsmb PROCESS 'dynatable.html' ?>
 
 <body>
 <form method="post" action="<?lsmb form.script ?>">
 
-<?lsmb PROCESS 'dynatable.html' ?>
+<?lsmb PROCESS 'dynatable' ?>
 <br />
 
 <?lsmb FOREACH hidden IN hiddens.keys;

Modified: trunk/UI/lib/dynatable.html
===================================================================
--- trunk/UI/lib/dynatable.html	2012-03-10 09:32:28 UTC (rev 4428)
+++ trunk/UI/lib/dynatable.html	2012-03-10 09:42:29 UTC (rev 4429)
@@ -1,4 +1,4 @@
-
+<?lsmb BLOCK dynatable ?>
 <table width="100%">
   <tr>
     <th class="listtop" colspan="<?lsmb columns.size ?>"><?lsmb form.title ?></th>
@@ -65,3 +65,4 @@
   <tr><td colspan="<?lsmb columns.size ?>"><hr size="3" /></td></tr>
 </table>
 
+<?lsmb END # BLOCK ?>

Modified: trunk/sql/modules/Employee.sql
===================================================================
--- trunk/sql/modules/Employee.sql	2012-03-10 09:32:28 UTC (rev 4428)
+++ trunk/sql/modules/Employee.sql	2012-03-10 09:42:29 UTC (rev 4429)
@@ -88,6 +88,22 @@
     country_id int
 );
 
+CREATE OR REPLACE FUNCTION employee__all_managers()
+RETURNS setof employee_result AS
+$$
+   SELECT p.entity_id, p.id, s.salutation,
+          p.first_name, p.middle_name, p.last_name,
+          ee.startdate, ee.enddate, ee.role, ee.ssn, ee.sales, ee.manager_id,
+          mp.first_name, mp.last_name, ee.employeenumber, ee.dob, e.country_id
+     FROM person p
+     JOIN entity_employee ee on (ee.entity_id = p.entity_id)
+     JOIN entity e ON (p.entity_id = e.id)
+LEFT JOIN salutation s on (p.salutation_id = s.id)
+LEFT JOIN person mp ON ee.manager_id = p.entity_id
+    WHERE ee.role = 'manager'
+ ORDER BY ee.employeenumber;
+$$ LANGUAGE SQL; 
+
 CREATE OR REPLACE FUNCTION employee__get
 (in_entity_id integer)
 returns employee_result as


Property changes on: trunk/sql/upgrade/1.2-1.3-manual.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4422
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710
   + /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4428
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.