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

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



Revision: 4908
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4908&view=rev
Author:   einhverfr
Date:     2012-06-18 08:17:51 +0000 (Mon, 18 Jun 2012)
Log Message:
-----------
errors saving/getting users fixed

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Entity/Person/Employee.pm
    trunk/LedgerSMB/DBObject/Report/Contact/Search.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/UI/Contact/divs/employee.html
    trunk/sql/modules/Employee.sql
    trunk/sql/modules/Entity.sql
    trunk/sql/modules/Roles.sql

Modified: trunk/LedgerSMB/DBObject/Entity/Person/Employee.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Entity/Person/Employee.pm	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/LedgerSMB/DBObject/Entity/Person/Employee.pm	2012-06-18 08:17:51 UTC (rev 4908)
@@ -151,7 +151,7 @@
     my ($ref) = $self->exec_method({funcname => 'person__save'});
     my ($id) = values(%$ref);
     $self->entity_id($id);
-    my ($ref) = $self->exec_method({funcname => 'employee__save'});
+    $self->exec_method({funcname => 'employee__save'});
 }
 
 =back

Modified: trunk/LedgerSMB/DBObject/Report/Contact/Search.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Contact/Search.pm	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/LedgerSMB/DBObject/Report/Contact/Search.pm	2012-06-18 08:17:51 UTC (rev 4908)
@@ -58,12 +58,16 @@
 
        {col_id => 'entity_control_code',
             type => 'href',
-       href_base =>"contact.pl?action=get&entity_class=".$self->entity_class,
+       href_base =>($self->entity_class == 3)
+                    ? "employee.pl?action=get"
+                    :"contact.pl?action=get&entity_class=".$self->entity_class,
             name => $locale->text('Control Code') },
 
        {col_id => 'meta_number',
             type => 'href',
-       href_base =>"contact.pl?action=get&entity_class=".$self->entity_class,
+       href_base => ($self->entity_class == 3) 
+                    ? "employee.pl?action=get"
+                    : "contact.pl?action=get&entity_class=".$self->entity_class,
             name => $locale->text('Credit Account Number') },
 
        {col_id => 'credit_description',

Modified: trunk/LedgerSMB/Scripts/employee.pm
===================================================================
--- trunk/LedgerSMB/Scripts/employee.pm	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/LedgerSMB/Scripts/employee.pm	2012-06-18 08:17:51 UTC (rev 4908)
@@ -84,7 +84,7 @@
     # DIVS logic
     my @DIVS;
     if ($employee->{entity_id}){
-       @DIVS = qw(employee address contact_info bank_act notes);
+       @DIVS = qw(employee user address contact_info bank_act notes);
     } else {
        @DIVS = qw(employee);
     }
@@ -92,6 +92,7 @@
 
     my %DIV_LABEL = (
             employee => $locale->text('Employee'),
+                user => $locale->text('User'),
              address => $locale->text('Addresses'),
         contact_info => $locale->text('Contact Info'),
             bank_act => $locale->text('Bank Accounts'),

Modified: trunk/UI/Contact/divs/employee.html
===================================================================
--- trunk/UI/Contact/divs/employee.html	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/UI/Contact/divs/employee.html	2012-06-18 08:17:51 UTC (rev 4908)
@@ -22,7 +22,7 @@
 <?lsmb PROCESS input element_data = {
 	label = text('First Name') #'
 	name = "first_name"
-	value = first_name
+	value = employee.first_name
 	type = "text"
 	size = 20
 } ?>
@@ -31,7 +31,7 @@
 <?lsmb PROCESS input element_data = {
 	label = text('Middle Name') #'
 	name = "middle_name"
-	value = middle_name
+	value = employee.middle_name
 	type = "text"
 	size = 20
 } ?>
@@ -42,7 +42,7 @@
 <?lsmb PROCESS input element_data = {
 	label = text('Last Name') #'
 	name = "last_name"
-	value = last_name
+	value = employee.last_name
 	type = "text"
 	size = 20
 } ?>
@@ -53,7 +53,7 @@
 <?lsmb PROCESS input element_data = {
 	label = text('Job Title')
 	name = "role"
-	value = role
+	value = employee.role
 	type = "text"
 	size = 20
 } # ' ?>
@@ -65,7 +65,7 @@
 	label = text('Sales')
 	value = 1
 	type = "checkbox"
-	checked = sales
+	checked = employee.sales
 	name = "sales"
 } ?>
 </div>
@@ -74,7 +74,7 @@
         label = text('Manager')
         value = 'manager'
         type = "checkbox"
-        checked = is_manager
+        checked = employee.is_manager
         name = "is_manager"
 } ?>
 </div>
@@ -85,7 +85,7 @@
 		<?lsmb INCLUDE select element_data = {
 			text_attr = "name"
 			value_attr = "id"
-			default_values = [country_id]
+			default_values = [employee.country_id]
 			options = country_list
 			name = "country_id"
 			label = text('Country') 
@@ -95,29 +95,30 @@
 <div id="employee_div">
 <div class="input_group">
 <?lsmb PROCESS input element_data = {
-	label = text('Employee Number')
-	value = employeenumber
+	label = text('Employee Number') #'
+	value = employee.employeenumber
 	name = "employeenumber"
 	type = "text"
 	size = 20
-} # ' ?>
+}  ?>
 </div>
 <div class="input_group">
 <?lsmb PROCESS select element_data = {
          label = text('Manager')
           name = 'manager_id'
        options = all_managers
-default_values = [manager_id]
+default_values = [employee.manager_id]
      text_attr = 'label'
     value_attr = 'id'
 } ?> 
 </div>
+</div>
 <div id="hr_dates_div">
 <div class="input_group">
 <?lsmb PROCESS input element_data = {
 	label = text('DOB')
 	name = "dob"
-	value = dob
+	value = employee.dob
 	type = "text"
 	class = "date"
 	size = 10
@@ -127,7 +128,7 @@
 <?lsmb PROCESS input element_data = {
 	label = text('Start Date')
 	name = "start_date"
-	value = start_date
+	value = employee.start_date
 	type = "text"
 	class = "date"
 	size = 10
@@ -137,7 +138,7 @@
 <?lsmb PROCESS input element_data = {
 	label = text('End Date')
 	name = "end_date"
-	value = end_date
+	value = employee.end_date
 	class = "text"
 	type = "text"
 	size = 10

Modified: trunk/sql/modules/Employee.sql
===================================================================
--- trunk/sql/modules/Employee.sql	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/sql/modules/Employee.sql	2012-06-18 08:17:51 UTC (rev 4908)
@@ -75,6 +75,7 @@
 
 CREATE TYPE employee_result AS (
     entity_id int,
+    control_code text,
     person_id int,
     salutation text,
     first_name text,
@@ -96,7 +97,7 @@
 CREATE OR REPLACE FUNCTION employee__all_managers()
 RETURNS setof employee_result AS
 $$
-   SELECT p.entity_id, p.id, s.salutation,
+   SELECT p.entity_id, e.control_code, 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
@@ -113,7 +114,7 @@
 (in_entity_id integer)
 returns employee_result as
 $$
-   SELECT p.entity_id, p.id, s.salutation, 
+   SELECT p.entity_id, e.control_code, 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
@@ -135,7 +136,7 @@
 in_notes text)
 RETURNS SETOF employee_result as
 $$
-SELECT p.entity_id, p.id, s.salutation,
+SELECT p.entity_id, e.control_code, 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

Modified: trunk/sql/modules/Entity.sql
===================================================================
--- trunk/sql/modules/Entity.sql	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/sql/modules/Entity.sql	2012-06-18 08:17:51 UTC (rev 4908)
@@ -55,12 +55,13 @@
 BEGIN
 	FOR out_row IN 
 		SELECT * FROM entity_class
-             LEFT JOIN defaults ON setting_key = 'roll_prefix';
+             LEFT JOIN defaults ON setting_key = 'roll_prefix'
 		WHERE active and pg_has_role(SESSION_USER, 
                                      coalesce(defaults.value, 
-                                     'lsmb_' || current_database || '__') ||
+                                     'lsmb_' || current_database() || '__') ||
                                      'contact_class_' ||
-                                     lower(preg_replace(class, ' ', '_'))
+                                     lower(regexp_replace(class, ' ', '_')), 
+                                     'USAGE')
 		ORDER BY id
 	LOOP
 		RETURN NEXT out_row;

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2012-06-18 06:52:13 UTC (rev 4907)
+++ trunk/sql/modules/Roles.sql	2012-06-18 08:17:51 UTC (rev 4908)
@@ -122,6 +122,8 @@
 CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_class_employee" 
 WITH INHERIT NOLOGIN;
 CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_class_contact" WITH INHERIT NOLOGIN;
+CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_class_referral" 
+WITH INHERIT NOLOGIN;
 CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_class_lead" WITH INHERIT NOLOGIN;
 CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_class_hot_lead" 
 WITH INHERIT NOLOGIN;

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