30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
34 $langs->loadLangs(array(
"companies",
"projects"));
37 $socid =
GETPOST(
'socid',
'int');
38 if ($user->socid) $socid = $user->socid;
42 $hookmanager->initHooks(array(
'projectthirdparty'));
49 $parameters = array(
'id'=>$socid);
50 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
51 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
59 $contactstatic =
new Contact($db);
61 $form =
new Form($db);
65 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
66 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
68 $langs->load(
"companies");
72 $result = $object->fetch($socid);
74 $title = $langs->trans(
"Projects");
75 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.
" - ".$title;
78 if (!empty($conf->notification->enabled)) $langs->load(
"mails");
83 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
85 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
87 print '<div class="fichecenter">';
89 print '<div class="underbanner clearboth"></div>';
90 print '<table class="border centpercent tableforfield">';
92 if (!empty($conf->global->SOCIETE_USEPREFIX))
94 print '<tr><td>'.$langs->trans(
'Prefix').
'</td><td colspan="3">'.$object->prefix_comm.
'</td></tr>';
99 print '<tr><td class="titlefield">';
100 print $langs->trans(
'CustomerCode').
'</td><td colspan="3">';
101 print $object->code_client;
102 $tmpcheck = $object->check_codeclient();
103 if ($tmpcheck != 0 && $tmpcheck != -5) {
104 print ' <font class="error">('.$langs->trans(
"WrongCustomerCode").
')</font>';
109 if ($object->fournisseur)
111 print '<tr><td class="titlefield">';
112 print $langs->trans(
'SupplierCode').
'</td><td colspan="3">';
113 print $object->code_fournisseur;
114 $tmpcheck = $object->check_codefournisseur();
115 if ($tmpcheck != 0 && $tmpcheck != -5) {
116 print ' <font class="error">('.$langs->trans(
"WrongSupplierCode").
')</font>';
129 $newcardbutton .=
dolGetButtonTitle($langs->trans(
"NewProject"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/projet/card.php?action=create&socid='.$object->id.
'&backtopage='.urlencode($backtopage),
'', 1, $params);
135 $result =
show_projects($conf, $langs, $db, $object,
$_SERVER[
"PHP_SELF"].
'?socid='.$object->id, 1, $newcardbutton);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage third parties objects (customers, suppliers, prospects...)
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
show_projects($conf, $langs, $db, $object, $backtopage= '', $nocreatelink=0, $morehtmlright= '')
Show html area for list of projects.