Author Topic: [FULL DEV] Adapting FO for my own "Outsourcing IT company"  (Read 6823 times)

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
[FULL DEV] Adapting FO for my own "Outsourcing IT company"
« on: July 15, 2011, 07:39:28 am »
This post is about Adapting FO for my own "Outsourcing IT company"

I wish to adapt it to have more "Fine Tune Rights Control"

So, i need to understand many things, and crawl the code ...  8)

And i need help from the ancient coders who know well FO  ;)

i work with version 1.7.5

1. Don't want the last name be showed for my employees or customers, just for admin & authorized people

2. Don't want the people can add contacts, etc ... (actually, if some is on "ALL" context, as it own context is part of "ALL", they can add ...)
« Last Edit: July 16, 2011, 05:49:43 am by Captain_FLAM »

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #1 on: July 15, 2011, 07:40:08 am »
Point 1 :

in -> application\models\contacts\Contact.class.php , ~ line 169

Not finished yet, cause :

// || $contact->canEdit(logged_user() commented, can't access object

Code: [Select]
<?php

//****************************************//
//****    © Captain FLAM - 06/2011    ****//

/**
 * Return display name for this contact.
 *
 * @access public
 * @param void
 * @return string
 */
function getDisplayName()
{
$fn '';  $fn parent::getFirstName();  $mn parent::getMiddlename();  $ln parent::getLastName();

if ($ln != '')
{
//$contact = Contacts::findById(get_id());
if (! logged_user()->isAdministrator())
$ln substr_utf($ln01). '.';
}
if ($mn != '' && $fn != ''$fn .= ' ';
$fn .= $mn;
if ($ln != '' && $fn != ''$fn .= ' ';
$fn .= $ln;

return trim($fn);
}

/**
 * Return display name with last name first for this contact
 *
 * @access public
 * @param void
 * @return string
 */
function getReverseDisplayName()
{
$ln '';  $fn parent::getFirstName();  $mn parent::getMiddlename();  $ln parent::getLastName();

if ($ln != '')
{
//$contact = Contacts::findById(get_id());
if (! logged_user()->isAdministrator() && ! logged_user()->isAccountOwner()) // && ! $contact->canEdit(logged_user()))
$ln substr_utf($ln01). '.';
}
if ($fn != '' && $ln != ''$ln .= ' ';
$ln .= $fn;
if ($mn != '' && $ln != ''$ln .= ' ';
$ln .= $mn;

return trim($ln);
}
//****                                ****//
//****************************************//

?>

(Don't put the PHP tags, it's just here to have hilighted code)
« Last Edit: July 19, 2011, 06:57:12 am by Captain_FLAM »

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #2 on: July 15, 2011, 08:05:46 am »
Point 2 :

Now, i have to control the "ALL" context ...

1st, put some new language strings :

in -> language\en_us\site_interface.php, at the end of the file

Code: [Select]
 'choose something' => 'Please choose one Workspace ...',

For this point, i'm gonna developping a Hook ...

To be followed ...
« Last Edit: July 19, 2011, 06:53:22 am by Captain_FLAM »

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #3 on: July 15, 2011, 08:07:06 am »
Point 3

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #4 on: July 15, 2011, 08:10:27 am »
Point 4

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #5 on: July 15, 2011, 08:13:22 am »
Point 5

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #6 on: July 15, 2011, 08:15:46 am »
Point 6

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #7 on: July 15, 2011, 08:25:06 am »
Point 7

Captain_FLAM

  • Freshman
  • *
  • Posts: 16
    • View Profile
Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
« Reply #8 on: July 15, 2011, 08:38:22 am »
Point 8