MantisBT - v1.2 Release (Closed)
View Issue Details
0000329v1.2 Release (Closed)[All Projects] Generalpublic2009-12-10 21:012010-01-06 19:52
ReporterFran 
Assigned Tocaseydk 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.2 
Target VersionFixed in Version1.2.1 
Summary0000329: Trying to add a new department is not possible. Department Company field not populated.
DescriptionWhenever I try to add a new department I get the error message:

This company is invalid. You cannot add a department.

Reason being I can't assign the department to any company and Department Company name doesn't show up at all.
TagsNo tags attached.
Attached Files

Notes
(0000640)
blienard   
2009-12-10 23:34   
You can correct this by patching the modules/departments/departments.class.php
line 134 replace
if ($this->dept_id == $this->dept_parent)
by
if ($this->dept_id && $this->dept_id == $this->dept_parent)
has in previous releases.
(0000641)
Fran   
2009-12-10 23:59   
Hi blienard!

Thanks for your support!

Just tried your solution, but does not work (for me at least). Changing this line 134 in department.class.php has not changed this issue. It keeps showing nothing in Department Company field.

Happens to me even if I download the 1.0, 1.1 or 1.2 release version no matter if I test it locally or in my remote hosted app. In all versions I'm not being able to create Departments
(0000642)
blienard   
2009-12-11 00:33   
(Last edited: 2009-12-11 00:34)
Hi Fran !

This is true, Company name is not filled out when you click on "new department" but submit works in my case after this fix.

However if you want company name in the form, even if it is not the best fix, you can add following code in departments/addedit.php

after line 39 : $company_id = $dept_id ? $department->dept_company : $company_id;

add code

        if($company_id && $department->company_name=='')
        {
                $company = new CCompany();
                $company->loadFull($AppUI,$company_id);
                $department->company_name = $company->company_name;
        }

(0000643)
Fran   
2009-12-11 01:27   
What you are pointing is also true in my case...Company Department name still doesn't appear but if I enter the name of a new Department, now the application is not giving back the error message any more.

Also tried your piece of code in addedit.php, but at first sight I couldn't figure out what has changed. The issue with the Company Department name still there but at least we can now input new Departments through the GUI.

I wish I could help you more but my php knowledge is so limited, but my ears are wide open to try to get what you are doing. I'll check the effect of the modification in addedit later today.

Thanks in advance.
(0000644)
caseydk   
2009-12-11 20:40   
If you look at revision 848, I've made the changes that are necessary and added more validation in general.
(0000645)
Fran   
2009-12-12 18:05   
Thanks to caseydk...

As in the solution provided by blienard I can enter new departments now...but Company Name doesn't appear anyway.

Thanks again
(0000674)
caseydk   
2009-12-19 22:10   
This is resolved in trunk as of r871. This fix - along with a number of others - are likely to be rolled into a 1.2.1 release.
(0000685)
caseydk   
2009-12-24 20:52   
Merged the relevant changes from r848 and r871 in r883 into the version1.2.x branch in svn. A new release should come early next week.
(0000728)
caseydk   
2010-01-06 19:52   
In v1.2.1 release.

Issue History
2009-12-10 21:01FranNew Issue
2009-12-10 23:34blienardNote Added: 0000640
2009-12-10 23:59FranNote Added: 0000641
2009-12-11 00:33blienardNote Added: 0000642
2009-12-11 00:34blienardNote Edited: 0000642
2009-12-11 01:27FranNote Added: 0000643
2009-12-11 20:40caseydkStatusnew => resolved
2009-12-11 20:40caseydkResolutionopen => fixed
2009-12-11 20:40caseydkAssigned To => caseydk
2009-12-11 20:40caseydkNote Added: 0000644
2009-12-12 18:05FranStatusresolved => feedback
2009-12-12 18:05FranResolutionfixed => reopened
2009-12-12 18:05FranNote Added: 0000645
2009-12-19 22:10caseydkStatusfeedback => resolved
2009-12-19 22:10caseydkResolutionreopened => fixed
2009-12-19 22:10caseydkNote Added: 0000674
2009-12-24 20:52caseydkNote Added: 0000685
2010-01-06 19:52caseydkNote Added: 0000728
2010-01-06 19:52caseydkStatusresolved => closed
2010-01-06 19:52caseydkFixed in Version => 1.2.1