35 require
'../main.inc.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
44 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
45 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
47 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
51 $langs->loadLangs(array(
"companies",
"commercial",
"bills",
"banks",
"users"));
54 $langs->load(
"categories");
57 $langs->load(
"incoterm");
60 $langs->load(
"mails");
63 $mesg =
''; $error = 0; $errors = array();
67 $action = (
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view');
68 $cancel =
GETPOST(
'cancel',
'alpha');
69 $backtopage =
GETPOST(
'backtopage',
'alpha');
74 $socid = $user->socid;
77 if (empty($socid) && $action ==
'view') {
86 $extrafields->fetch_name_optionals_label($object->table_element);
89 $hookmanager->initHooks(array(
'thirdpartycontact',
'globalcard'));
91 if ($object->fetch($socid) <= 0 && $action ==
'view') {
92 $langs->load(
"errors");
93 print($langs->trans(
'ErrorRecordNotFound'));
98 $canvas = $object->canvas ? $object->canvas :
GETPOST(
"canvas");
100 if (!empty($canvas)) {
101 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
102 $objcanvas =
new Canvas($db, $action);
103 $objcanvas->getCanvas(
'thirdparty',
'card', $canvas);
107 $result =
restrictedArea($user,
'societe', $socid,
'&societe',
'',
'fk_soc',
'rowid', 0);
108 if (empty($user->rights->societe->contact->lire)) {
117 $parameters = array(
'id'=>$socid,
'objcanvas'=>$objcanvas);
118 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
123 if (empty($reshook)) {
126 if (!empty($backtopage)) {
127 header(
"Location: ".$backtopage);
133 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
146 if ($socid > 0 && empty($object->id)) {
147 $result = $object->fetch($socid);
153 $title = $langs->trans(
"ThirdParty");
154 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
155 $title = $object->name.
" - ".$langs->trans(
'ContactsAddresses');
157 $help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
160 $countrynotdefined = $langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')';
163 if (!empty($object->id)) {
164 $res = $object->fetch_optionals();
171 print
dol_get_fiche_head($head,
'contact', $langs->trans(
"ThirdParty"), 0,
'company');
173 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
175 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom',
'',
'', 0,
'',
'',
'arearefnobottom');
181 if ($action !=
'presend') {
183 if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
184 $result =
show_contacts($conf, $langs, $db, $object, $_SERVER[
"PHP_SELF"].
'?socid='.$object->id, 1);
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage third parties objects (customers, suppliers, prospects...)
show_contacts($conf, $langs, $db, $object, $backtopage='', $showuserlogin=0)
Show html area for list of contacts.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
isModEnabled($module)
Is Dolibarr module enabled.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.