Feng Forum

Other Topics => Development => : Captain_FLAM July 15, 2011, 07:39:28 AM

: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM 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 ...)
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM 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

:
<?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)
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM 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

:
 'choose something' => 'Please choose one Workspace ...',

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

To be followed ...
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM July 15, 2011, 08:07:06 AM
Point 3
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM July 15, 2011, 08:10:27 AM
Point 4
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM July 15, 2011, 08:13:22 AM
Point 5
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM July 15, 2011, 08:15:46 AM
Point 6
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM July 15, 2011, 08:25:06 AM
Point 7
: Re: [FULL DEV] Adapting FO for my own "Outsourcing IT company"
: Captain_FLAM July 15, 2011, 08:38:22 AM
Point 8