Login or Register

RSS IconRecent posts in this topic

avatar
adamld on Oct 21. 2007. 11:19 pm
Can we have the Project Image automatically taken from the default Client image?

It would save some time as it stands you add a client, add an image, and then have to add the same image for each project.
avatar
caffeine_twitch on Oct 25. 2007. 1:34 pm
I agree. By default it should take the client's image, but have the option to add a different one if you so choose.
avatar
cyandesign on Oct 25. 2007. 8:11 pm
That would be cool. I'd actually use the images then.

+1
avatar
Sebastian Tänzer on Oct 26. 2007. 4:49 pm
+1

Really useful!
avatar
kthomas on Nov 2. 2007. 12:21 am
1++
avatar
Valdemar on Nov 2. 2007. 2:42 pm
Where there's a will, there's a way.

Add these lines DIRECTLY after line 397 in /activecollab/application/modules/system/models/projects/Project.class.php (the one saying "$size = $large ? '40x40' : '16x16';" in the beginning of the getIconUrl() function)

      $company_id = $this->getCompanyId();
      if (is_file(ENVIRONMENT_PATH . '/' . PUBLIC_FOLDER_NAME . '/logos/' . $company_id . ".$size.jpg")) {
          return ROOT_URL . '/' . PUBLIC_FOLDER_NAME .'/logos/'. $company_id .".$size.jpg";
        } else {
          return ROOT_URL . '/' . PUBLIC_FOLDER_NAME ."/logos/default.$size.gif";
      } // if


Please note, messing with the core breaks updates! - Works here on 1.0.3, haven't updated to 1.0.4, tho I don't see why it wouldn't work there aswell. It's a dirty and very quick hack, and normal project icons won't work afterwards. But it should point you in the right direction if you really need this.
Casper Valdemar
avatar
cyandesign on Nov 4. 2007. 5:30 am
Hey Valdemar, This worked great in 1.0.4.

I had to remove the

'/' . PUBLIC_FOLDER_NAME .

Because my config file had "/public" in the URL. But other than that, it works great.

Thanks.
avatar
adamld on Nov 5. 2007. 12:59 am
I have too many changes to keep track of as it is that I need to change back once I apply 1.0.4

I will just wait and hope they see the sense of implementing this in a future update not too far away.

I hope they have documented all the changes in this update so I know what not to fix.
avatar
Valdemar on Apr 16. 2008. 7:28 am
Just added this to our current installation, to make it easier for the finance dept. to find client project among regular projects, works on 1.0.6. Replace the getIconUrl() function at around line ~397 in /activecollab/application/modules/system/models/projects/Project.class.php:

    function getIconUrl($large = false) {
      $size = $large ? '40x40' : '16x16';
      $company_id = $this->getCompanyId();
      if(is_file($this->getIconPath($large))) {
        return ROOT_URL . '/projects_icons/' . $this->getId() . ".$size.gif";
      } elseif(is_file(ENVIRONMENT_PATH . '/' . PUBLIC_FOLDER_NAME . '/logos/' . $company_id . ".$size.jpg")) {
            return ROOT_URL . '/' . PUBLIC_FOLDER_NAME .'/logos/'. $company_id .".$size.jpg";
      } else {
        return ROOT_URL . "/projects_icons/default.$size.gif";
      } // if
    } // getAvatarUrl


Ilija, please consider patching this in 1.1, and making it a switch in Administration, if possible.
Casper Valdemar

RSS IconRecent posts in this topic