Changeset 2414
- Timestamp:
- 06/24/20 22:12:43 (4 years ago)
- Location:
- trunk/LATMOS-Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/Changes
r2413 r2414 16 16 - add groupOfnames object support for LDAP 17 17 - always try to create missing object in destination (regardless recent changes) 18 - Fix: dynamics attributes not properly compute after object creation 18 - Fix: dynamics attributes not properly compute after object creation and employment changes 19 19 - add support objects (hardare support contact) 20 20 -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r2403 r2414 1746 1746 # If an employement apply we set the value to the user object 1747 1747 1748 $self->_computeEmploymentDate;1748 my $res = $self->_computeEmploymentDate; 1749 1749 1750 1750 my %attrsets = ( … … 1770 1770 1771 1771 if (keys %attrsets) { 1772 if (my $res = $self->set_fields(%attrsets)) { 1772 if (my $cres = $self->set_fields(%attrsets)) { 1773 $res += $cres; 1773 1774 $self->ReportChange('Update', 'Attr %s updated to match Employment %s', join(', ', sort keys %attrsets), $currentemployment->id); 1774 $self->PostSetAttribute();1775 return $res;1776 1775 } 1777 } else {1778 return 1; 1779 }1776 } 1777 1778 $self->PostSetAttribute() if ($res); 1780 1779 } else { 1781 1780 # No current employment, resetting values: … … 1783 1782 return $self->resetEmployment; 1784 1783 } 1785 1786 1784 } 1787 1785 … … 1795 1793 my ($self) = @_; 1796 1794 1797 $self->_computeEmploymentDate;1795 my $res = $self->_computeEmploymentDate; 1798 1796 1799 1797 my %changes = ( … … 1836 1834 1837 1835 if (%changes) { 1838 if ($self->set_fields(%changes)) { 1836 if (my $cres += $self->set_fields(%changes)) { 1837 $res += $cres; 1839 1838 $self->base->log(LA_NOTICE, "Updating user %s to match unemployment", $self->id); 1840 1839 $self->ReportChange('Update', 'Update %s to match unemployment', join(', ', sort keys %changes)); 1841 $self->PostSetAttribute(); 1842 return 1; 1843 } else { 1844 return 0; 1845 } 1846 } else { 1847 return 1; 1848 } 1849 1840 } 1841 } 1842 $self->PostSetAttribute() if ($res); 1843 1844 return $res; 1850 1845 } 1851 1846 … … 1918 1913 } 1919 1914 1915 my $res = 0; 1920 1916 if (keys %changes) { 1921 1917 $self->base->log(LA_DEBUG, 'Applying employment state to user %s for field %s', $self->id, join(', ', keys %changes)); … … 1925 1921 $self->base->log(LA_DEBUG, 'New expiration is %s for user %s', ($changes{expire} || '(none)'), $self->id); 1926 1922 } 1927 $ self->set_fields(%changes);1923 $res += $self->set_fields(%changes); 1928 1924 } else { 1929 1925 $self->base->log(LA_DEBUG, 'No employment change for user %s', $self->id); … … 1932 1928 $self->_computeEmploymentHistory(); 1933 1929 1934 return 1;1930 return $res; 1935 1931 } 1936 1932 -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r2410 r2414 839 839 my %data; 840 840 841 $self->base->log(LA_DEBUG, "Running PostSetAttribute for %s/%s", $self->type, $self->id); 842 841 843 my %AttrToCompute; 842 844 foreach my $attr ($self->base->list_canonical_fields($self->type, 'r')) {
Note: See TracChangeset
for help on using the changeset viewer.