/** * Return a link to the user card (with optionaly the picto) * Use this->id,this->lastname, this->firstname * * @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo) * @param string $option On what the link point to * @param integer $infologin Add complete info tooltip * @param integer $notooltip 1=Disable tooltip on picto and name * @param int $maxlen Max length of visible user name * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login * @param string $morecss Add more css on link * @return string String with URL */ function getNomUrl($withpictoimg = 0, $option = '', $infologin = 0, $notooltip = 0, $maxlen = 24, $hidethirdpartylogo = 0, $mode = '', $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) { $withpictoimg = 0; } $result = ''; $companylink = ''; $link = ''; $label = '<u>' . $langs->trans("User") . '</u>'; $label .= '<div width="100%">'; $label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs, '', ''); if (!empty($this->login)) { $label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $this->login; } $label .= '<br><b>' . $langs->trans("EMail") . ':</b> ' . $this->email; if (!empty($this->admin)) { $label .= '<br><b>' . $langs->trans("Administrator") . '</b>: ' . yn($this->admin); } if (!empty($this->societe_id)) { $thirdpartystatic = new Societe($db); $thirdpartystatic->fetch($this->societe_id); if (empty($hidethirdpartylogo)) { $companylink = ' ' . $thirdpartystatic->getNomUrl(2); } // picto only of company $company = ' (' . $langs->trans("Company") . ': ' . $thirdpartystatic->name . ')'; } $type = $this->societe_id ? $langs->trans("External") . $company : $langs->trans("Internal"); $label .= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type; $label .= '</div>'; if (!empty($this->photo)) { $label .= '<div class="photointooltip">'; $label .= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1); $label .= '</div><div style="clear: both;"></div>'; } // Info Login if ($infologin) { $label .= '<br>'; $label .= '<br><u>' . $langs->trans("Connection") . '</u>'; $label .= '<br><b>' . $langs->trans("IPAddress") . '</b>: ' . $_SERVER["REMOTE_ADDR"]; if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) { $label .= '<br><b>' . $langs->trans("ConnectedOnMultiCompany") . ':</b> ' . $conf->entity . ' (user entity ' . $this->entity . ')'; } $label .= '<br><b>' . $langs->trans("AuthenticationMode") . ':</b> ' . $_SESSION["dol_authmode"] . (empty($dolibarr_main_demo) ? '' : ' (demo)'); $label .= '<br><b>' . $langs->trans("ConnectedSince") . ':</b> ' . dol_print_date($this->datelastlogin, "dayhour"); $label .= '<br><b>' . $langs->trans("PreviousConnexion") . ':</b> ' . dol_print_date($this->datepreviouslogin, "dayhour"); $label .= '<br><b>' . $langs->trans("CurrentTheme") . ':</b> ' . $conf->theme; $label .= '<br><b>' . $langs->trans("CurrentMenuManager") . ':</b> ' . $menumanager->name; $s = picto_from_langcode($langs->getDefaultLang()); $label .= '<br><b>' . $langs->trans("CurrentUserLanguage") . ':</b> ' . ($s ? $s . ' ' : '') . $langs->getDefaultLang(); $label .= '<br><b>' . $langs->trans("Browser") . ':</b> ' . $conf->browser->name . ($conf->browser->version ? ' ' . $conf->browser->version : '') . ' (' . $_SERVER['HTTP_USER_AGENT'] . ')'; $label .= '<br><b>' . $langs->trans("Layout") . ':</b> ' . $conf->browser->layout; $label .= '<br><b>' . $langs->trans("Screen") . ':</b> ' . $_SESSION['dol_screenwidth'] . ' x ' . $_SESSION['dol_screenheight']; if (!empty($conf->browser->phone)) { $label .= '<br><b>' . $langs->trans("Phone") . ':</b> ' . $conf->browser->phone; } if (!empty($_SESSION["disablemodules"])) { $label .= '<br><b>' . $langs->trans("DisabledModules") . ':</b> <br>' . join(', ', explode(',', $_SESSION["disablemodules"])); } } $link .= '<a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $this->id . '"'; if (empty($notooltip)) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $langs->load("users"); $label = $langs->trans("ShowUser"); $link .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; } $link .= ' title="' . dol_escape_htmltag($label, 1) . '"'; $link .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"'; } $link .= '>'; $linkend = '</a>'; //if ($withpictoimg == -1) $result.='<div class="nowrap">'; $result .= $link; if ($withpictoimg) { $paddafterimage = ''; if (abs($withpictoimg) == 1) { $paddafterimage = 'style="padding-right: 3px;"'; } if ($withpictoimg > 0) { $picto = '<div class="inline-block valignmiddle' . ($morecss ? ' userimg' . $morecss : '') . '">' . img_object('', 'user', $paddafterimage . ' ' . ($notooltip ? '' : 'class="classfortooltip"')) . '</div>'; } else { $picto = '<div class="inline-block valignmiddle' . ($morecss ? ' userimg' . $morecss : '') . '"' . ($paddafterimage ? ' ' . $paddafterimage : '') . '>' . Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1) . '</div>'; } $result .= $picto; } if (abs($withpictoimg) != 2) { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $result .= '<div class="inline-block valignmiddle' . ($morecss ? ' usertext' . $morecss : '') . '">'; } if ($mode == 'login') { $result .= dol_trunc($this->login, $maxlen); } else { $result .= $this->getFullName($langs, '', $mode == 'firstname' ? 2 : -1, $maxlen); } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $result .= '</div>'; } } $result .= $linkend; //if ($withpictoimg == -1) $result.='</div>'; $result .= $companylink; return $result; }
{ $var=true; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td width="25%">'.$langs->trans("Parameter").'</td><td width="25%">'.$langs->trans("DefaultValue").'</td><td> </td><td>'.$langs->trans("PersonalValue").'</td></tr>'; $var=!$var; print '<tr '.$bc[$var].'><td>'.$langs->trans("Language").'</td>'; print '<td>'; $s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print ($s?$s.' ':''); print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print '</td>'; print '<td align="left" nowrap="nowrap" width="20%"><input '.$bc[$var].' type="checkbox" disabled '.(! empty($fuser->conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; print '<td>'; $s=(isset($fuser->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($fuser->conf->MAIN_LANG_DEFAULT) : ''); print ($s?$s.' ':''); print (isset($fuser->conf->MAIN_LANG_DEFAULT) && $fuser->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($fuser->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$fuser->conf->MAIN_LANG_DEFAULT):'')); print '</td></tr>'; $var=!$var; print '<tr '.$bc[$var].'><td>'.$langs->trans("MaxSizeList").'</td>'; print '<td>'.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').'</td>'; print '<td align="left" nowrap="nowrap" width="20%"><input '.$bc[$var].' type="checkbox" disabled '.(! empty($fuser->conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; print '<td>' . (! empty($fuser->conf->MAIN_SIZE_LISTE_LIMIT)?$fuser->conf->MAIN_SIZE_LISTE_LIMIT:' ') . '</td></tr>'; print '</table><br>'; // Skin show_theme($fuser,0,true);
print $form->showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle'); print '</td>'; print '<tr><td>' . $langs->trans("LocationSummary") . '</td><td colspan="3">' . $entrepot->lieu . '</td></tr>'; // Description print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">' . dol_htmlentitiesbr($entrepot->description) . '</td></tr>'; // Address print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3">'; print $entrepot->address; print '</td></tr>'; // Town print '<tr><td width="25%">' . $langs->trans('Zip') . '</td><td width="25%">' . $entrepot->zip . '</td>'; print '<td width="25%">' . $langs->trans('Town') . '</td><td width="25%">' . $entrepot->town . '</td></tr>'; // Country print '<tr><td>' . $langs->trans('Country') . '</td><td colspan="3">'; if (!empty($entrepot->country_code)) { $img = picto_from_langcode($entrepot->country_code); print $img ? $img . ' ' : ''; print $entrepot->country; } print '</td></tr>'; // Status print '<tr><td>' . $langs->trans("Status") . '</td><td colspan="3">' . $entrepot->getLibStatut(4) . '</td></tr>'; $calcproductsunique = $entrepot->nb_different_products(); $calcproducts = $entrepot->nb_products(); // Total nb of different products print '<tr><td valign="top">' . $langs->trans("NumberOfDifferentProducts") . '</td><td colspan="3">'; print empty($calcproductsunique['nb']) ? '0' : $calcproductsunique['nb']; print "</td></tr>"; // Nb of products print '<tr><td valign="top">' . $langs->trans("NumberOfProducts") . '</td><td colspan="3">'; print empty($calcproducts['nb']) ? '0' : $calcproducts['nb'];
/** * Show an HTML header + a BODY + The top menu bar * @param head Lines in the HEAD * @param title Title of web page * @param target Target to use in menu links * @param disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax) * @param disablehead Do not output head section * @param arrayofjs Array of js files to add in header * @param arrayofcss Array of css files to add in header * @param morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) */ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '') { global $user, $conf, $langs, $db, $dolibarr_main_authentication; $html = new Form($db); if (!$conf->top_menu) { $conf->top_menu = 'eldy_backoffice.php'; } // For backward compatibility with old modules if (empty($conf->headerdone)) { top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); } print '<body id="mainbody">'; if ($conf->use_javascript_ajax) { if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) { print '<script type="text/javascript"> jQuery(document).ready(function () { jQuery("body").layout( layoutSettings ); }); var layoutSettings = { name: "mainlayout", defaults: { useStateCookie: true, size: "auto", resizable: false, //paneClass: "none", //resizerClass: "resizer", //togglerClass: "toggler", //buttonClass: "button", //contentSelector: ".content", //contentIgnoreSelector: "span", togglerTip_open: "Close This Pane", togglerTip_closed: "Open This Pane", resizerTip: "Resize This Pane" }, west: { paneClass: "leftContent", spacing_closed: 14, togglerLength_closed: 14, togglerAlign_closed: "top", //togglerLength_open: 0, // effect defaults - overridden on some panes //slideTrigger_open: "mouseover", //initClosed: true, fxName: "drop", fxSpeed: "normal", fxSettings: { easing: "" } }, north: { paneClass: "none", resizerClass: "none", togglerClass: "none", spacing_open: 0, togglerLength_open: 0, togglerLength_closed: -1, slidable: false, fxName: "none" }, center: { paneSelector: "#mainContent" } } </script>'; } if (!empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION)) { print "\n" . '<script type="text/javascript"> jQuery(document).ready(function () { jQuery( ".vmenu" ).accordion({ autoHeight: false, event: "mouseover", //collapsible: true, //active: 2, header: "> .blockvmenupair > .menu_titre" }); }); </script>'; } // Wrapper to show tooltips print "\n" . '<script type="text/javascript"> jQuery(document).ready(function () { jQuery(function() { $(".classfortooltip").tipTip({maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50}); }); }); </script>'; } /* * Top menu */ $top_menu = isset($conf->browser->phone) ? $conf->smart_menu : $conf->top_menu; if (GETPOST('menu')) { $top_menu = GETPOST('menu'); } // menu=eldy_backoffice.php // Load the top menu manager $result = dol_include_once("/includes/menus/standard/" . $top_menu); if (!$result) { $top_menu = 'eldy_backoffice.php'; include_once DOL_DOCUMENT_ROOT . "/includes/menus/standard/" . $top_menu; } print "\n" . '<!-- Start top horizontal menu ' . $top_menu . ' -->' . "\n"; if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) { print '<div class="ui-layout-north"> <!-- Begin top layout -->' . "\n"; } print '<div id="tmenu_tooltip" class="tmenu">' . "\n"; // Show menu $menutop = new MenuTop($db); $menutop->atarget = $target; $menutop->showmenu(); // This contains a \n print "</div>\n"; // Link to login card $loginhtmltext = ''; $logintext = ''; if ($user->societe_id) { $thirdpartystatic = new Societe($db); $thirdpartystatic->fetch($user->societe_id); $companylink = ' (' . $thirdpartystatic->getNomUrl('', '') . ')'; $company = ' (' . $langs->trans("Company") . ': ' . $thirdpartystatic->name . ')'; } $logintext = '<div class="login"><a href="' . DOL_URL_ROOT . '/user/fiche.php?id=' . $user->id . '"'; $logintext .= $menutop->atarget ? ' target="' . $menutop->atarget . '"' : ''; $logintext .= '>' . $user->login . '</a>'; if ($user->societe_id) { $logintext .= $companylink; } $logintext .= '</div>'; $loginhtmltext .= '<u>' . $langs->trans("User") . '</u>'; $loginhtmltext .= '<br><b>' . $langs->trans("Name") . '</b>: ' . $user->getFullName($langs); $loginhtmltext .= '<br><b>' . $langs->trans("Login") . '</b>: ' . $user->login; $loginhtmltext .= '<br><b>' . $langs->trans("Administrator") . '</b>: ' . yn($user->admin); $type = $user->societe_id ? $langs->trans("External") . $company : $langs->trans("Internal"); $loginhtmltext .= '<br><b>' . $langs->trans("Type") . '</b>: ' . $type; $loginhtmltext .= '<br><b>' . $langs->trans("IPAddress") . '</b>: ' . $_SERVER["REMOTE_ADDR"]; $loginhtmltext .= '<br>'; $loginhtmltext .= '<br><u>' . $langs->trans("Connection") . '</u>'; if ($conf->global->MAIN_MODULE_MULTICOMPANY) { $loginhtmltext .= '<br><b>' . $langs->trans("ConnectedOnMultiCompany") . '</b>: ' . $conf->entity . ' (user entity ' . $user->entity . ')'; } $loginhtmltext .= '<br><b>' . $langs->trans("ConnectedSince") . '</b>: ' . dol_print_date($user->datelastlogin, "dayhour"); $loginhtmltext .= '<br><b>' . $langs->trans("PreviousConnexion") . '</b>: ' . dol_print_date($user->datepreviouslogin, "dayhour"); $loginhtmltext .= '<br><b>' . $langs->trans("AuthenticationMode") . '</b>: ' . $_SESSION["dol_authmode"]; $loginhtmltext .= '<br><b>' . $langs->trans("CurrentTheme") . '</b>: ' . $conf->theme; $s = picto_from_langcode($langs->getDefaultLang()); $loginhtmltext .= '<br><b>' . $langs->trans("CurrentUserLanguage") . '</b>: ' . ($s ? $s . ' ' : '') . $langs->getDefaultLang(); $loginhtmltext .= '<br><b>' . $langs->trans("Browser") . '</b>: ' . $conf->browser->name . ' (' . $_SERVER['HTTP_USER_AGENT'] . ')'; if (!empty($conf->browser->phone)) { $loginhtmltext .= '<br><b>' . $langs->trans("Phone") . '</b>: ' . $conf->browser->phone; } if (!empty($_SESSION["disablemodules"])) { $loginhtmltext .= '<br><b>' . $langs->trans("DisabledModules") . '</b>: <br>' . join(', ', explode(',', $_SESSION["disablemodules"])); } // Link info $logouthtmltext = ''; $logouttext = ''; $logouthtmltext = $langs->trans("Logout") . '<br>'; //$logouthtmltext.="<br>"; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { $logouttext .= '<a href="' . DOL_URL_ROOT . '/user/logout.php"'; $logouttext .= $menutop->atarget ? ' target="' . $menutop->atarget . '"' : ''; $logouttext .= '>'; $logouttext .= '<img class="login" border="0" width="14" height="14" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/logout.png"'; $logouttext .= ' alt="' . dol_escape_htmltag($langs->trans("Logout")) . '" title=""'; $logouttext .= '>'; $logouttext .= '</a>'; } else { $logouttext .= '<img class="login" border="0" width="14" height="14" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/logout.png"'; $logouttext .= ' alt="' . dol_escape_htmltag($langs->trans("Logout")) . '" title=""'; $logouttext .= '>'; } print '<div class="login_block">' . "\n"; print '<table class="nobordernopadding" summary=""><tr>'; print $html->textwithtooltip('', $loginhtmltext, 2, 1, $logintext, '', 1); // Select entity if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) { if ($user->admin && !$user->entity) { $res = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); if ($res) { $mc = new ActionsMulticompany($db); $mc->showInfo($conf->entity); } } } print $html->textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, '', 1); // Link to print main content area if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone)) { $qs = $_SERVER["QUERY_STRING"] . ($_SERVER["QUERY_STRING"] ? '&' : '') . $morequerystring; $text = '<a href="' . $_SERVER["PHP_SELF"] . '?' . $qs . ($qs ? '&' : '') . 'optioncss=print" target="_blank">'; $text .= '<img class="printer" border="0" width="14" height="14" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/printer.png"'; $text .= ' title="" alt="">'; $text .= '</a>'; print $html->textwithtooltip('', $langs->trans("PrintContentArea"), 2, 1, $text, '', 1); } print '</tr></table>' . "\n"; print "</div>\n"; if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) { print "</div><!-- End top layout -->\n"; } print "<!-- End top horizontal menu -->\n"; if (!$conf->use_javascript_ajax || !$conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) { print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr>'; } }
$formadmin = new FormAdmin($db); $var = false; print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="search_word">'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td>' . $langs->trans("Parameters") . '</td>' . "\n"; print '<td align="center"> </td>'; print '</tr>'; $stats = ''; if (!empty($lit)) { $stats = '<br>'; $stats .= ' ' . picto_from_langcode($lit->lang); $stats .= ' ' . $langs->trans('NbTerms') . ' : ' . $lit->nbTerms . '<br>'; $stats .= ' ' . picto_from_langcode($lit->lang); $stats .= ' ' . $langs->trans('NbCustomTerms') . ' : ' . $lit->nbTrans . '<br>'; } // Select lang to customize $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td colspan="2">' . $langs->trans("SelectLangToCustomize") . $stats . '</td>'; print '</tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>'; print '<input type="text" class="flat" size="30" name="word" value="' . $word . '">'; print '</td><td>'; print $formadmin->select_language($langtosearch, 'langtosearch'); print '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '>';
print '</td></tr>' . "\n"; print '</table>' . "\n"; print '<br><div class="center">'; print '<input class="button" type="submit" name="submit" value="' . $langs->trans("Save") . '">'; print ' '; print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '</div>'; print '</form>'; } else { $var = true; // Language print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>' . $langs->trans("Parameters") . '</td><td>' . $langs->trans("Value") . '</td><td> </td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DefaultLanguage") . '</td><td>'; $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print $s ? $s . ' ' : ''; print $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . $conf->global->MAIN_LANG_DEFAULT); print '</td>'; print '<td width="20">'; if ($user->admin && $conf->global->MAIN_LANG_DEFAULT != 'auto') { print info_admin($langs->trans("SubmitTranslation" . ($conf->global->MAIN_LANG_DEFAULT == 'en_US' ? 'ENUS' : ''), $conf->global->MAIN_LANG_DEFAULT), 1); } print '</td>'; print "</tr>"; $var = !$var; print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("EnableMultilangInterface") . '</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>'; print '<td width="20"> </td>'; print "</tr>"; print '</table><br>' . "\n"; // Themes
print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td colspan="3">'; print $form->showrefnav($entrepot, 'id', '', 1, 'rowid', 'libelle'); print '</td>'; print '<tr><td>' . $langs->trans("LocationSummary") . '</td><td colspan="3">' . $entrepot->lieu . '</td></tr>'; // Description print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">' . nl2br($entrepot->description) . '</td></tr>'; // Address print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3">'; print $entrepot->address; print '</td></tr>'; // Ville print '<tr><td width="25%">' . $langs->trans('Zip') . '</td><td width="25%">' . $entrepot->cp . '</td>'; print '<td width="25%">' . $langs->trans('Town') . '</td><td width="25%">' . $entrepot->ville . '</td></tr>'; // Country print '<tr><td>' . $langs->trans('Country') . '</td><td colspan="3">'; $img = picto_from_langcode($entrepot->pays_code); print $img ? $img . ' ' : ''; print $entrepot->pays; print '</td></tr>'; // Statut print '<tr><td>' . $langs->trans("Status") . '</td><td colspan="3">' . $entrepot->getLibStatut(4) . '</td></tr>'; $calcproducts = $entrepot->nb_products(); // Nb of products print '<tr><td valign="top">' . $langs->trans("NumberOfProducts") . '</td><td colspan="3">'; print empty($calcproducts['nb']) ? '0' : $calcproducts['nb']; print "</td></tr>"; // Value print '<tr><td valign="top">' . $langs->trans("EstimatedStockValueShort") . '</td><td colspan="3">'; print empty($calcproducts['value']) ? '0' : $calcproducts['value']; print "</td></tr>"; // Last movement
} dol_fiche_end(); print '<div class="center">'; print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">'; print ' '; print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '</div>'; print '</form>'; } else { dol_fiche_head($head, 'translation', $titre, 0, $picto); dol_banner_tab($object, 'ref', '', $user->societe_id ? 0 : 1, 'ref'); $cnt_trans = 0; if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $cnt_trans++; $s = picto_from_langcode($key); print "<br>" . ($s ? $s . ' ' : '') . " <b>" . $langs->trans('Language_' . $key) . ":</b> " . '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&langtodelete=' . $key . '">' . img_delete('', '') . "</a><br>"; print '<table class="border" width="100%">'; print '<tr><td width="15%">' . $langs->trans('Label') . '</td><td>' . $object->multilangs[$key]["label"] . '</td></tr>'; print '<tr><td width="15%">' . $langs->trans('Description') . '</td><td>' . $object->multilangs[$key]["description"] . '</td></tr>'; print '<tr><td width="15%">' . $langs->trans('Note') . '</td><td>' . $object->multilangs[$key]["note"] . '</td></tr>'; print '</table>'; } } if (!$cnt_trans) { print '<br>' . $langs->trans('NoTranslation'); } dol_fiche_end(); } /* ************************************************************************** */ /* */
/** * Show an HTML header + a BODY + The top menu bar * * @param string $head Lines in the HEAD * @param string $title Title of web page * @param string $target Target to use in menu links (Example: '' or '_top') * @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax) * @param int $disablehead Do not output head section * @param array $arrayofjs Array of js files to add in header * @param array $arrayofcss Array of css files to add in header * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) * @return void */ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '') { global $user, $conf, $langs, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; global $hookmanager, $menumanager; // Instantiate hooks of thirdparty module $hookmanager->initHooks(array('toprightmenu')); $toprightmenu = ''; // For backward compatibility with old modules if (empty($conf->headerdone)) { top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); } print '<body id="mainbody">'; if ($conf->use_javascript_ajax) { if (empty($conf->dol_use_jmobile) && !empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print '<script type="text/javascript"> jQuery(document).ready(function () { jQuery("body").layout(layoutSettings); }); var layoutSettings = { name: "mainlayout", defaults: { useStateCookie: true, size: "auto", resizable: false, //paneClass: "none", //resizerClass: "resizer", //togglerClass: "toggler", //buttonClass: "button", //contentSelector: ".content", //contentIgnoreSelector: "span", togglerTip_open: "Close This Pane", togglerTip_closed: "Open This Pane", resizerTip: "Resize This Pane", fxSpeed: "fast" }, west: { paneClass: "leftContent", //spacing_closed: 14, //togglerLength_closed: 14, //togglerAlign_closed: "auto", //togglerLength_open: 0, // effect defaults - overridden on some panes //slideTrigger_open: "mouseover", initClosed: ' . (empty($conf->dol_optimize_smallscreen) ? 'false' : 'true') . ', fxName: "drop", fxSpeed: "fast", fxSettings: { easing: "" } }, north: { paneClass: "none", resizerClass: "none", togglerClass: "none", spacing_open: 0, togglerLength_open: 0, togglerLength_closed: -1, slidable: false, fxName: "none", fxSpeed: "fast" }, center: { paneSelector: "#mainContent" } } </script>'; } // Wrapper to show tooltips print "\n" . '<script type="text/javascript"> jQuery(document).ready(function () { jQuery(function() { jQuery(".classfortooltip").tipTip({maxWidth: "' . dol_size(600, 'width') . 'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50}); }); }); </script>'; } /* * Top menu */ print "\n" . '<!-- Start top horizontal -->' . "\n"; if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print '<div class="ui-layout-north"> <!-- Begin top layout -->' . "\n"; } if (empty($conf->dol_hide_topmenu)) { // Show menu entries print '<div id="tmenu_tooltip' . (empty($conf->global->MAIN_MENU_INVERT) ? '' : 'invert') . '" class="tmenu">' . "\n"; $menumanager->atarget = $target; $menumanager->showmenu('top'); // This contains a \n print "</div>\n"; $form = new Form($db); // Define link to login card $loginhtmltext = ''; $logintext = ''; if ($user->societe_id) { $thirdpartystatic = new Societe($db); $thirdpartystatic->fetch($user->societe_id); $companylink = ' (' . $thirdpartystatic->getNomUrl('', '') . ')'; $company = ' (' . $langs->trans("Company") . ': ' . $thirdpartystatic->name . ')'; } $logintext = '<div class="login"><a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $user->id . '"'; $logintext .= $target ? ' target="' . $target . '"' : ''; $logintext .= '>' . $user->login . '</a>'; if ($user->societe_id) { $logintext .= $companylink; } $logintext .= '</div>'; $loginhtmltext .= '<u>' . $langs->trans("User") . '</u>'; $loginhtmltext .= '<br><b>' . $langs->trans("Name") . '</b>: ' . $user->getFullName($langs); $loginhtmltext .= '<br><b>' . $langs->trans("Login") . '</b>: ' . $user->login; $loginhtmltext .= '<br><b>' . $langs->trans("EMail") . '</b>: ' . $user->email; $loginhtmltext .= '<br><b>' . $langs->trans("Administrator") . '</b>: ' . yn($user->admin); $type = $user->societe_id ? $langs->trans("External") . $company : $langs->trans("Internal"); $loginhtmltext .= '<br><b>' . $langs->trans("Type") . '</b>: ' . $type; $loginhtmltext .= '<br><b>' . $langs->trans("IPAddress") . '</b>: ' . $_SERVER["REMOTE_ADDR"]; $loginhtmltext .= '<br>'; $loginhtmltext .= '<br><u>' . $langs->trans("Connection") . '</u>'; if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) { $loginhtmltext .= '<br><b>' . $langs->trans("ConnectedOnMultiCompany") . '</b>: ' . $conf->entity . ' (user entity ' . $user->entity . ')'; } $loginhtmltext .= '<br><b>' . $langs->trans("AuthenticationMode") . '</b>: ' . $_SESSION["dol_authmode"] . (empty($dolibarr_main_demo) ? '' : ' (demo)'); $loginhtmltext .= '<br><b>' . $langs->trans("ConnectedSince") . '</b>: ' . dol_print_date($user->datelastlogin, "dayhour"); $loginhtmltext .= '<br><b>' . $langs->trans("PreviousConnexion") . '</b>: ' . dol_print_date($user->datepreviouslogin, "dayhour"); $loginhtmltext .= '<br><b>' . $langs->trans("CurrentTheme") . '</b>: ' . $conf->theme; $loginhtmltext .= '<br><b>' . $langs->trans("CurrentMenuManager") . '</b>: ' . $menumanager->name; $s = picto_from_langcode($langs->getDefaultLang()); $loginhtmltext .= '<br><b>' . $langs->trans("CurrentUserLanguage") . '</b>: ' . ($s ? $s . ' ' : '') . $langs->getDefaultLang(); $loginhtmltext .= '<br><b>' . $langs->trans("Browser") . '</b>: ' . $conf->browser->name . ($conf->browser->version ? ' ' . $conf->browser->version : '') . ' (' . $_SERVER['HTTP_USER_AGENT'] . ')'; if (!empty($conf->browser->phone)) { $loginhtmltext .= '<br><b>' . $langs->trans("Phone") . '</b>: ' . $conf->browser->phone; } if (!empty($_SESSION["disablemodules"])) { $loginhtmltext .= '<br><b>' . $langs->trans("DisabledModules") . '</b>: <br>' . join(', ', explode(',', $_SESSION["disablemodules"])); } $appli = 'Dolibarr'; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { $appli = $conf->global->MAIN_APPLICATION_TITLE; if (preg_match('/\\d\\.\\d/', $appli)) { if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli)) { $appli .= " (" . DOL_VERSION . ")"; } // If new title contains a version that is different than core } else { $appli .= " " . DOL_VERSION; } } else { $appli .= " " . DOL_VERSION; } if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { $appli .= "<br>" . $langs->trans("LevelOfFeature") . ': ' . $conf->global->MAIN_FEATURES_LEVEL; } $logouttext = ''; $logouthtmltext = $appli . '<br>'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { $logouthtmltext .= $langs->trans("Logout") . '<br>'; $logouttext .= '<a href="' . DOL_URL_ROOT . '/user/logout.php">'; $logouttext .= img_picto($langs->trans('Logout') . ":" . $langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); $logouttext .= '</a>'; } else { $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); $logouttext .= img_picto($langs->trans('Logout') . ":" . $langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); } print '<div class="login_block">' . "\n"; $toprightmenu .= '<div class="login_block_user">'; // Add login user link $toprightmenu .= $form->textwithtooltip('', $loginhtmltext, 2, 1, $logintext, 'login_block_elem2', 2); // This include div class="login" $toprightmenu .= '</div>'; $toprightmenu .= '<div class="login_block_other">'; // Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>') $parameters = array(); $result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks if (is_numeric($result)) { if (empty($result)) { $toprightmenu .= $hookmanager->resPrint; } else { $toprightmenu = $hookmanager->resPrint; } // replace } else { $toprightmenu .= $result; } // For backward compatibility // Logout link $toprightmenu .= $form->textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem', 2); // Link to print main content area if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone)) { $qs = $_SERVER["QUERY_STRING"]; $qs .= ($qs && $morequerystring ? '&' : '') . $morequerystring; $text = '<a href="' . $_SERVER["PHP_SELF"] . '?' . $qs . ($qs ? '&' : '') . 'optioncss=print" target="_blank">'; $text .= img_picto(":" . $langs->trans("PrintContentArea"), 'printer.png', 'class="printer"'); $text .= '</a>'; $toprightmenu .= $form->textwithtooltip('', $langs->trans("PrintContentArea"), 2, 1, $text, 'login_block_elem', 2); } $toprightmenu .= '</div>'; print $toprightmenu; print "</div>\n"; unset($form); } if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print "</div><!-- End top layout -->\n"; } print '<div style="clear: both;"></div>'; print "<!-- End top horizontal menu -->\n\n"; if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile) && empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print '<div id="id-container">'; } }
if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>'; print '<td colspan="3">'.$account->iban_prefix.'</td></tr>'; print '<tr><td valign="top">'.$langs->trans($bickey).'</td>'; print '<td colspan="3">'.$account->bic.'</td></tr>'; print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">'; print nl2br($account->domiciliation); print "</td></tr>\n"; // Country print '<tr><td valign="top">'.$langs->trans("BankAccountCountry").'</td><td colspan="3">'; $img=picto_from_langcode($account->pays_code); print $img?$img.' ':''; print getCountry($account->getCountryCode(),0,$db); print "</td></tr>\n"; print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td><td colspan="3">'; print $account->proprio; print "</td></tr>\n"; print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">'; print nl2br($account->adresse_proprio); print "</td></tr>\n"; } print '</table>';
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$adh->pass).'</td></tr>'; } // Address print '<tr><td>'.$langs->trans("Address").'</td><td class="valeur">'; dol_print_address($adh->address,'gmap','member',$adh->id); print '</td></tr>'; // Zip / Town print '<tr><td nowrap="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$adh->zip.(($adh->zip && $adh->town)?' / ':'').$adh->town.'</td></tr>'; // Country print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'; $img=picto_from_langcode($adh->pays_code); if ($img) print $img.' '; print getCountry($adh->pays_code); print '</td></tr>'; // State print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$adh->departement.'</td>'; // Tel pro. print '<tr><td>'.$langs->trans("PhonePro").'</td><td class="valeur">'.dol_print_phone($adh->phone,$adh->pays_code,0,$adh->fk_soc,1).'</td></tr>'; // Tel perso print '<tr><td>'.$langs->trans("PhonePerso").'</td><td class="valeur">'.dol_print_phone($adh->phone_perso,$adh->pays_code,0,$adh->fk_soc,1).'</td></tr>'; // Tel mobile print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($adh->phone_mobile,$adh->pays_code,0,$adh->fk_soc,1).'</td></tr>';
{ print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$agf->socid.'">'; print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($agf->socname,20).'</a>'; } else { */ // print ' '; // } print '</tr>'; print '<tr><td rowspan=3 valign="top">' . $langs->trans("Address") . '</td>'; print '<td>' . $agf->adresse . '</td></tr>'; print '<tr>'; print '<td>' . $agf->fk_departement . ' - ' . $agf->town . '</td></tr>'; print '<tr>'; print '<td>'; $img = picto_from_langcode($agf->fk_pays); if ($agf->isInEEC()) { print $form->textwithpicto(($img ? $img . ' ' : '') . $agf->country, $langs->trans("CountryIsInEEC"), 1, 0); } else { print ($img ? $img . ' ' : '') . $agf->fk_pays; } print '</td></tr>'; print '</td></tr>'; print '<tr><td>' . $langs->trans("type") . '</td>'; print '<td>' . $agf->nb_piece . '</td></tr>'; print '<tr><td valign="top">' . $langs->trans("drescriptif") . '</td>'; print '<td>' . nl2br($agf->descriptif) . '</td></tr>'; print '<tr><td valign="top">' . $langs->trans("superficie") . '</td>'; print '<td>' . nl2br($agf->superficie) . '</td></tr>'; print '<tr><td valign="top">' . $langs->trans("dpe") . '</td>'; print '<td>' . nl2br($agf->dpe) . '</td></tr>';
/** * Return a link to the user card (with optionaly the picto) * Use this->id,this->lastname, this->firstname * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to * @param integer $infologin Add connection info to the tooltip * @param integer $notooltip 1=Disable tooltip * @param int $maxlen Max length of visible user name * @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user * @return string String with URL */ function getNomUrl($withpicto = 0, $option = '', $infologin = 0, $notooltip = 0, $maxlen = 24, $hidethirdpartylogo = 0) { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; $result = ''; $companylink = ''; $label = '<u>' . $langs->trans("User") . '</u>'; $label .= '<div width="100%">'; $label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs, '', ''); if (!empty($this->login)) { $label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $this->login; } $label .= '<br><b>' . $langs->trans("EMail") . ':</b> ' . $this->email; if (!empty($this->admin)) { $label .= '<br><b>' . $langs->trans("Administrator") . '</b>: ' . yn($this->admin); } if (!empty($this->societe_id)) { $thirdpartystatic = new Societe($db); $thirdpartystatic->fetch($this->societe_id); if (empty($hidethirdpartylogo)) { $companylink = ' ' . $thirdpartystatic->getNomUrl(2); } // picto only of company $company = ' (' . $langs->trans("Company") . ': ' . $thirdpartystatic->name . ')'; } $type = $this->societe_id ? $langs->trans("External") . $company : $langs->trans("Internal"); $label .= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type; $label .= '</div>'; if (!empty($this->photo)) { $label .= '<div class="photointooltip">'; $label .= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip'); $label .= '</div><div style="clear: both;"></div>'; } // Info Login if ($infologin) { $label .= '<br>'; $label .= '<br><u>' . $langs->trans("Connection") . '</u>'; $label .= '<br><b>' . $langs->trans("IPAddress") . '</b>: ' . $_SERVER["REMOTE_ADDR"]; if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) { $label .= '<br><b>' . $langs->trans("ConnectedOnMultiCompany") . ':</b> ' . $conf->entity . ' (user entity ' . $this->entity . ')'; } $label .= '<br><b>' . $langs->trans("AuthenticationMode") . ':</b> ' . $_SESSION["dol_authmode"] . (empty($dolibarr_main_demo) ? '' : ' (demo)'); $label .= '<br><b>' . $langs->trans("ConnectedSince") . ':</b> ' . dol_print_date($this->datelastlogin, "dayhour"); $label .= '<br><b>' . $langs->trans("PreviousConnexion") . ':</b> ' . dol_print_date($this->datepreviouslogin, "dayhour"); $label .= '<br><b>' . $langs->trans("CurrentTheme") . ':</b> ' . $conf->theme; $label .= '<br><b>' . $langs->trans("CurrentMenuManager") . ':</b> ' . $menumanager->name; $s = picto_from_langcode($langs->getDefaultLang()); $label .= '<br><b>' . $langs->trans("CurrentUserLanguage") . ':</b> ' . ($s ? $s . ' ' : '') . $langs->getDefaultLang(); $label .= '<br><b>' . $langs->trans("Browser") . ':</b> ' . $conf->browser->name . ($conf->browser->version ? ' ' . $conf->browser->version : '') . ' (' . $_SERVER['HTTP_USER_AGENT'] . ')'; if (!empty($conf->browser->phone)) { $label .= '<br><b>' . $langs->trans("Phone") . ':</b> ' . $conf->browser->phone; } if (!empty($_SESSION["disablemodules"])) { $label .= '<br><b>' . $langs->trans("DisabledModules") . ':</b> <br>' . join(', ', explode(',', $_SESSION["disablemodules"])); } } $link = '<a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $this->id . '"'; $link .= $notooltip ? '' : ' title="' . dol_escape_htmltag($label, 1) . '" class="classfortooltip"'; $link .= '>'; $linkend = '</a>'; if ($withpicto) { $result .= $link . img_object($notooltip ? '' : $label, 'user', $notooltip ? '' : 'class="classfortooltip"') . $linkend; if ($withpicto != 2) { $result .= ' '; } } $result .= $link . $this->getFullName($langs, '', -1, $maxlen) . $linkend . $companylink; return $result; }
// Currency print '<tr><td>' . $langs->trans("Currency") . '</td>'; print '<td colspan="3">'; $selectedcode = $account->account_currency_code; if (!$selectedcode) { $selectedcode = $conf->currency; } print $langs->trans("Currency" . $selectedcode); print '</td></tr>'; // Status print '<tr><td>' . $langs->trans("Status") . '</td>'; print '<td colspan="3">' . $account->getLibStatut(4) . '</td></tr>'; // Country print '<tr><td>' . $langs->trans("BankAccountCountry") . '</td><td>'; if ($account->country_id > 0) { $img = picto_from_langcode($account->country_code); print $img ? $img . ' ' : ''; print getCountry($account->getCountryCode(), 0, $db); } print '</td></tr>'; // State print '<tr><td>' . $langs->trans('State') . '</td><td>'; if ($account->state_id > 0) { print getState($account->state_id); } print '</td></tr>'; // Conciliate print '<tr><td>' . $langs->trans("Conciliable") . '</td>'; print '<td colspan="3">'; $conciliate = $account->canBeConciliated(); if ($conciliate == -2) {
/** * Show html area for list of addresses * * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Database handler * @param Object $object Third party object * @param string $backtopage Url to go once address is created * @return void */ function show_addresses($conf, $langs, $db, $object, $backtopage = '') { global $user; global $bc; require_once DOL_DOCUMENT_ROOT . '/societe/class/address.class.php'; $addressstatic = new Address($db); $num = $addressstatic->fetch_lines($object->id); $buttoncreate = ''; if ($user->rights->societe->creer) { $buttoncreate = '<a class="addnewrecord" href="' . DOL_URL_ROOT . '/comm/address.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage) . '">' . $langs->trans("AddAddress") . ' ' . img_picto($langs->trans("AddAddress"), 'filenew') . '</a>' . "\n"; } print "\n"; print_fiche_titre($langs->trans("AddressesForCompany"), $buttoncreate, ''); print "\n" . '<table class="noborder" width="100%">' . "\n"; print '<tr class="liste_titre"><td>' . $langs->trans("Label") . '</td>'; print '<td>' . $langs->trans("CompanyName") . '</td>'; print '<td>' . $langs->trans("Town") . '</td>'; print '<td>' . $langs->trans("Country") . '</td>'; print '<td>' . $langs->trans("Phone") . '</td>'; print '<td>' . $langs->trans("Fax") . '</td>'; print "<td> </td>"; print "</tr>"; if ($num > 0) { $var = true; foreach ($addressstatic->lines as $address) { $var = !$var; print "<tr " . $bc[$var] . ">"; print '<td>'; $addressstatic->id = $address->id; $addressstatic->label = $address->label; print $addressstatic->getNomUrl(1); print '</td>'; print '<td>' . $address->name . '</td>'; print '<td>' . $address->town . '</td>'; $img = picto_from_langcode($address->country_code); print '<td>' . ($img ? $img . ' ' : '') . $address->country . '</td>'; // Lien click to dial print '<td>'; print dol_print_phone($address->phone, $address->country_code, $address->id, $object->id, 'AC_TEL'); print '</td>'; print '<td>'; print dol_print_phone($address->fax, $address->country_code, $address->id, $object->id, 'AC_FAX'); print '</td>'; if ($user->rights->societe->creer) { print '<td align="right">'; print '<a href="' . DOL_URL_ROOT . '/comm/address.php?action=edit&id=' . $address->id . '&socid=' . $object->id . '&backtopage=' . urlencode($backtopage) . '">'; print img_edit(); print '</a></td>'; } print "</tr>\n"; } } else { //print "<tr ".$bc[$var].">"; //print '<td>'.$langs->trans("NoAddressYetDefined").'</td>'; //print "</tr>\n"; } print "\n</table>\n"; print "<br>\n"; return $num; }
print '</div>'; print '</form>'; } else { $var = true; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td width="25%">' . $langs->trans("Parameter") . '</td><td width="25%">' . $langs->trans("DefaultValue") . '</td><td> </td><td>' . $langs->trans("PersonalValue") . '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("Language") . '</td>'; print '<td>'; $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print $s ? $s . ' ' : ''; print isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . $conf->global->MAIN_LANG_DEFAULT); print '</td>'; print '<td align="left" class="nowrap" width="20%"><input ' . $bc[$var] . ' type="checkbox" disabled ' . (!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "") . '> ' . $langs->trans("UsePersonalValue") . '</td>'; print '<td>'; $s = isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : ''; print $s ? $s . ' ' : ''; print isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : (!empty($object->conf->MAIN_LANG_DEFAULT) ? $langs->trans("Language_" . $object->conf->MAIN_LANG_DEFAULT) : ''); print '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("MaxSizeList") . '</td>'; print '<td>' . (!empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? $conf->global->MAIN_SIZE_LISTE_LIMIT : ' ') . '</td>'; print '<td align="left" class="nowrap" width="20%"><input ' . $bc[$var] . ' type="checkbox" disabled ' . (!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "") . '> ' . $langs->trans("UsePersonalValue") . '</td>'; print '<td>' . (!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : ' ') . '</td></tr>'; print '</table><br>'; // Skin show_theme($object, 0, true); dol_fiche_end(); print '<div class="tabsAction">'; if (empty($user->admin) && !empty($dolibarr_main_demo)) { print "<a class=\"butActionRefused\" title=\"" . $langs->trans("FeatureDisabledInDemo") . "\" href=\"#\">" . $langs->trans("Modify") . "</a>";
print '</td>'; print '</tr>'; } // Address print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">'; dol_print_address($societe->address,'gmap','thirdparty',$societe->id); print '</td></tr>'; // Zip / Town print '<tr><td nowrap="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">'.$societe->cp.(($societe->cp && $societe->ville)?' / ':'').$societe->ville.'</td>'; print '</tr>'; // Country print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; $img=picto_from_langcode($societe->pays_code); if ($societe->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$societe->pays,$langs->trans("CountryIsInEEC"),1,0); else print ($img?$img.' ':'').$societe->pays; print '</td></tr>'; // Phone print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').'</td>'; // Fax print '<td>'.$langs->trans("Fax").'</td><td style="min-width: 25%;">'.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id,'AC_FAX').'</td></tr>'; // EMail print '<td>'.$langs->trans('EMail').'</td><td colspan="3">'.dol_print_email($societe->email,0,$societe->id,'AC_EMAIL').'</td></tr>'; // Web print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\">".dol_print_url($societe->url)."</td></tr>";
/** * Assign custom values for canvas (for example into this->tpl to be used by templates) * * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void */ function assign_values(&$action, $id = 0, $ref = '') { global $conf, $langs, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; if ($action == 'add' || $action == 'update') { $this->assign_post($action); } if ($_GET["type"] == 'f') { $this->object->fournisseur = 1; } if ($_GET["type"] == 'c') { $this->object->client = 1; } if ($_GET["type"] == 'p') { $this->object->client = 2; } if ($_GET["type"] == 'cp') { $this->object->client = 3; } if ($_REQUEST["private"] == 1) { $this->object->particulier = 1; } foreach ($this->object as $key => $value) { $this->tpl[$key] = $value; } $this->tpl['error'] = get_htmloutput_errors($this->object->error, $this->object->errors); if (is_array($GLOBALS['errors'])) { $this->tpl['error'] = get_htmloutput_mesg('', $GLOBALS['errors'], 'error'); } if ($action == 'create') { if ($conf->use_javascript_ajax) { $this->tpl['ajax_selecttype'] = "\n" . '<script type="text/javascript" language="javascript"> $(document).ready(function () { $("#radiocompany").click(function() { document.formsoc.action.value="create"; document.formsoc.canvas.value="company"; document.formsoc.private.value=0; document.formsoc.submit(); }); $("#radioprivate").click(function() { document.formsoc.action.value="create"; document.formsoc.canvas.value="individual"; document.formsoc.private.value=1; document.formsoc.submit(); }); }); </script>' . "\n"; } } if ($action == 'create' || $action == 'edit') { if ($conf->use_javascript_ajax) { $this->tpl['ajax_selectcountry'] = "\n" . '<script type="text/javascript" language="javascript"> $(document).ready(function () { $("#selectcountry_id").change(function() { document.formsoc.action.value="' . $action . '"; document.formsoc.canvas.value="' . $canvas . '"; document.formsoc.submit(); }); }) </script>' . "\n"; } // Load object modCodeClient $module = !empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { $res = dol_include_once($dirroot . $module . '.php'); if ($res) { break; } } $modCodeClient = new $module($db); $this->tpl['auto_customercode'] = $modCodeClient->code_auto; // We verified if the tag prefix is used if ($modCodeClient->code_auto) { $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed(); } // TODO create a function $this->tpl['select_customertype'] = '<select class="flat" name="client">'; $this->tpl['select_customertype'] .= '<option value="2"' . ($this->object->client == 2 ? ' selected="selected"' : '') . '>' . $langs->trans('Prospect') . '</option>'; $this->tpl['select_customertype'] .= '<option value="3"' . ($this->object->client == 3 ? ' selected="selected"' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>'; $this->tpl['select_customertype'] .= '<option value="1"' . ($this->object->client == 1 ? ' selected="selected"' : '') . '>' . $langs->trans('Customer') . '</option>'; $this->tpl['select_customertype'] .= '<option value="0"' . ($this->object->client == 0 ? ' selected="selected"' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>'; $this->tpl['select_customertype'] .= '</select>'; // Customer $this->tpl['customercode'] = $this->object->code_client; if ((!$this->object->code_client || $this->object->code_client == -1) && $modCodeClient->code_auto) { $this->tpl['customercode'] = $modCodeClient->getNextValue($this->object, 0); } $this->tpl['ismodifiable_customercode'] = $this->object->codeclient_modifiable(); $s = $modCodeClient->getToolTip($langs, $this->object, 0); $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1); if (!empty($conf->fournisseur->enabled)) { $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur $module = $conf->global->SOCIETE_CODECLIENT_ADDON; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { $res = dol_include_once($dirroot . $module . '.php'); if ($res) { break; } } $modCodeFournisseur = new $module(); $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto; // We verified if the tag prefix is used if ($modCodeFournisseur->code_auto) { $this->tpl['prefix_suppliercode'] = $modCodeFournisseur->verif_prefixIsUsed(); } // Supplier $this->tpl['yn_supplier'] = $form->selectyesno("fournisseur", $this->object->fournisseur, 1); $this->tpl['suppliercode'] = $this->object->code_fournisseur; if ((!$this->object->code_fournisseur || $this->object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { $this->tpl['suppliercode'] = $modCodeFournisseur->getNextValue($this->object, 1); } $this->tpl['ismodifiable_suppliercode'] = $this->object->codefournisseur_modifiable(); $s = $modCodeFournisseur->getToolTip($langs, $this->object, 1); $this->tpl['help_suppliercode'] = $form->textwithpicto('', $s, 1); $this->object->LoadSupplierCateg(); $this->tpl['suppliercategory'] = $this->object->SupplierCategories; } // Zip $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); // Town $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); // Country $this->object->country_id = $this->object->country_id ? $this->object->country_id : $mysoc->country_id; $this->object->country_code = $this->object->country_code ? $this->object->country_code : $mysoc->country_code; $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if ($user->admin) { $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } // State if ($this->object->country_id) { $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id, $this->object->country_code); } else { $this->tpl['select_state'] = $countrynotdefined; } // Language if (!empty($conf->global->MAIN_MULTILANGS)) { $this->tpl['select_lang'] = $formadmin->select_language($this->object->default_lang ? $this->object->default_lang : $conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1); } // VAT $this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value', $this->tpl['tva_assuj'], 1); // Assujeti par defaut en creation // Select users $this->tpl['select_users'] = $form->select_dolusers($this->object->commercial_id, 'commercial_id', 1); // Local Tax // TODO mettre dans une classe propre au pays if ($mysoc->country_code == 'ES') { $this->tpl['localtax'] = ''; if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td>'; $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td>'; $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td></tr>'; } elseif ($mysoc->localtax1_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">'; $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td><tr>'; } elseif ($mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">'; $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td><tr>'; } } } else { $head = societe_prepare_head($this->object); $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company'); $this->tpl['showend'] = dol_get_fiche_end(); $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom'); $this->tpl['checkcustomercode'] = $this->object->check_codeclient(); $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur(); $this->tpl['address'] = dol_nl2br($this->object->address); $img = picto_from_langcode($this->object->country_code); if ($this->object->isInEEC()) { $this->tpl['country'] = $form->textwithpicto(($img ? $img . ' ' : '') . $this->object->country, $langs->trans("CountryIsInEEC"), 1, 0); } $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country; $this->tpl['phone'] = dol_print_phone($this->object->phone, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX'); $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL'); $this->tpl['url'] = dol_print_url($this->object->url); $this->tpl['tva_assuj'] = yn($this->object->tva_assuj); // Third party type $arr = $formcompany->typent_array(1); $this->tpl['typent'] = $arr[$this->object->typent_code]; if (!empty($conf->global->MAIN_MULTILANGS)) { require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; //$s=picto_from_langcode($this->default_lang); //print ($s?$s.' ':''); $langs->load("languages"); $this->tpl['default_lang'] = $this->default_lang ? $langs->trans('Language_' . $this->object->default_lang) : ''; } $this->tpl['image_edit'] = img_edit(); $this->tpl['display_rib'] = $this->object->display_rib(); // Sales representatives $this->tpl['sales_representatives'] = ''; $listsalesrepresentatives = $this->object->getSalesRepresentatives($user); $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) { $this->tpl['sales_representatives'] .= '<a href="' . DOL_URL_ROOT . '/societe/commerciaux.php?socid=' . $this->object->id . '">'; $this->tpl['sales_representatives'] .= $nbofsalesrepresentative; $this->tpl['sales_representatives'] .= '</a>'; } else { if ($nbofsalesrepresentative > 0) { $userstatic = new User($this->db); $i = 0; foreach ($listsalesrepresentatives as $val) { $userstatic->id = $val['id']; $userstatic->lastname = $val['name']; $userstatic->firstname = $val['firstname']; $this->tpl['sales_representatives'] .= $userstatic->getNomUrl(1); $i++; if ($i < $nbofsalesrepresentative) { $this->tpl['sales_representatives'] .= ', '; } } } else { $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected"); } } // Linked member if (!empty($conf->adherent->enabled)) { $langs->load("members"); $adh = new Adherent($this->db); $result = $adh->fetch('', '', $this->object->id); if ($result > 0) { $adh->ref = $adh->getFullName($langs); $this->tpl['linked_member'] = $adh->getNomUrl(1); } else { $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember"); } } // Local Tax // TODO mettre dans une classe propre au pays if ($mysoc->country_code == 'ES') { $this->tpl['localtax'] = ''; if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax1_assuj) . '</td>'; $this->tpl['localtax'] .= '<td>' . $langs->trans("LocalTax2IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax2_assuj) . '</td></tr>'; } elseif ($mysoc->localtax1_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax1_assuj) . '</td></tr>'; } elseif ($mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax2_assuj) . '</td></tr>'; } } } }
print '</center>'; print '</form>'; } else { $var = true; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td width="25%">' . $langs->trans("Parameter") . '</td><td width="25%">' . $langs->trans("DefaultValue") . '</td><td> </td><td>' . $langs->trans("PersonalValue") . '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("Language") . '</td>'; print '<td>'; $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); print $s ? $s . ' ' : ''; print $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . $conf->global->MAIN_LANG_DEFAULT); print '</td>'; print '<td align="left" nowrap="nowrap" width="20%"><input ' . $bc[$var] . ' type="checkbox" disabled ' . ($fuser->conf->MAIN_LANG_DEFAULT ? " checked" : "") . '> ' . $langs->trans("UsePersonalValue") . '</td>'; print '<td>'; $s = picto_from_langcode($fuser->conf->MAIN_LANG_DEFAULT); print $s ? $s . ' ' : ''; print $fuser->conf->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : ($fuser->conf->MAIN_LANG_DEFAULT ? $langs->trans("Language_" . $fuser->conf->MAIN_LANG_DEFAULT) : ''); print '</td></tr>'; $var = !$var; print '<tr ' . $bc[$var] . '><td>' . $langs->trans("MaxSizeList") . '</td>'; print '<td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>'; print '<td align="left" nowrap="nowrap" width="20%"><input ' . $bc[$var] . ' type="checkbox" disabled ' . ($fuser->conf->MAIN_SIZE_LISTE_LIMIT ? " checked" : "") . '> ' . $langs->trans("UsePersonalValue") . '</td>'; print '<td>' . $fuser->conf->MAIN_SIZE_LISTE_LIMIT . '</td></tr>'; print '</table><br>'; // Skin show_theme($fuser, 0, true); print '</div>'; print '<div class="tabsAction">'; if (!empty($dolibarr_main_demo)) { print "<a class=\"butActionRefused\" title=\"" . $langs->trans("FeatureDisabledInDemo") . "\" href=\"#\">" . $langs->trans("Modify") . "</a>";
print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $objsoc->code_compta, 'socid', $objsoc->id, $user->rights->societe->creer); print '</td><td colspan="3">'; print $form->editfieldval("CustomerAccountancyCode", 'customeraccountancycode', $objsoc->code_compta, 'socid', $objsoc->id, $user->rights->societe->creer); print '</td>'; print '</tr>'; } // Address print '<tr><td valign="top">' . $langs->trans('Address') . '</td><td colspan="3">'; dol_print_address($objsoc->address, 'gmap', 'thirdparty', $objsoc->id); print "</td></tr>"; // Zip / Town print '<tr><td nowrap="nowrap">' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . '</td><td colspan="3">' . $objsoc->cp . ($objsoc->cp && $objsoc->ville ? ' / ' : '') . $objsoc->ville . "</td>"; print '</tr>'; // Country print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">'; $img = picto_from_langcode($objsoc->pays_code); if ($objsoc->isInEEC()) { print $form->textwithpicto(($img ? $img . ' ' : '') . $objsoc->pays, $langs->trans("CountryIsInEEC"), 1, 0); } else { print ($img ? $img . ' ' : '') . $objsoc->pays; } print '</td></tr>'; // Phone print '<tr><td>' . $langs->trans('Phone') . '</td><td style="min-width: 25%;">' . dol_print_phone($objsoc->tel, $objsoc->pays_code, 0, $objsoc->id, 'AC_TEL') . '</td>'; // Fax print '<td>' . $langs->trans('Fax') . '</td><td style="min-width: 25%;">' . dol_print_phone($objsoc->fax, $objsoc->pays_code, 0, $objsoc->id, 'AC_FAX') . '</td></tr>'; // EMail print '<td>' . $langs->trans('EMail') . '</td><td colspan="3">' . dol_print_email($objsoc->email, 0, $objsoc->id, 'AC_EMAIL') . '</td></tr>'; // Web print '<tr><td>' . $langs->trans("Web") . '</td><td colspan="3">' . dol_print_url($objsoc->url, '_blank') . '</td></tr>'; // Assujeti a TVA ou pas
print '<tr><td>'.$langs->trans("PostOrFunction" ).'</td><td colspan="3">'.$object->poste.'</td>'; // Address print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">'; dol_print_address($object->address,'gmap','contact',$object->id); print '</td></tr>'; // Zip Town print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">'; print $object->cp; if ($object->cp) print ' '; print $object->ville.'</td></tr>'; // Country print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; $img=picto_from_langcode($object->pays_code); if ($img) print $img.' '; print $object->pays; print '</td></tr>'; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'.$object->departement.'</td>'; } // Phone print '<tr><td>'.$langs->trans("PhonePro").'</td><td>'.dol_print_phone($object->phone_pro,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td>'; print '<td>'.$langs->trans("PhonePerso").'</td><td>'.dol_print_phone($object->phone_perso,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td></tr>'; print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td>'.dol_print_phone($object->phone_mobile,$object->pays_code,$object->id,$object->socid,'AC_TEL').'</td>';
} print '</td></tr>'; } if (!empty($conf->barcode->enabled)) { print '<tr><td>' . $langs->trans('Gencod') . '</td><td colspan="3">' . $soc->barcode . '</td></tr>'; } print "<tr><td valign=\"top\">" . $langs->trans('Address') . "</td><td colspan=\"3\">"; dol_print_address($soc->address, 'gmap', 'thirdparty', $soc->id); print "</td></tr>"; // Zip / Town print '<tr><td width="25%">' . $langs->trans('Zip') . '</td><td width="25%">' . $soc->zip . "</td>"; print '<td width="25%">' . $langs->trans('Town') . '</td><td width="25%">' . $soc->town . "</td></tr>"; // Country if ($soc->country) { print '<tr><td>' . $langs->trans('Country') . '</td><td colspan="3">'; $img = picto_from_langcode($soc->country_code); print $img ? $img . ' ' : ''; print $soc->country; print '</td></tr>'; } // EMail print '<tr><td>' . $langs->trans('EMail') . '</td><td colspan="3">'; print dol_print_email($soc->email, 0, $soc->id, 'AC_EMAIL'); print '</td></tr>'; // Web print '<tr><td>' . $langs->trans('Web') . '</td><td colspan="3">'; print dol_print_url($soc->url); print '</td></tr>'; // Phone / Fax print '<tr><td>' . $langs->trans('Phone') . '</td><td>' . dol_print_phone($soc->tel, $soc->country_code, 0, $soc->id, 'AC_TEL') . '</td>'; print '<td>' . $langs->trans('Fax') . '</td><td>' . dol_print_phone($soc->fax, $soc->country_code, 0, $soc->id, 'AC_FAX') . '</td></tr>';
/** * Set content of ->tpl array, to use into template * * @param string $action Type of action * @param int $id Id * @return string HTML output */ function assign_values(&$action, $id) { global $conf, $langs, $user, $canvas; global $form, $formcompany, $objsoc; if ($action == 'add' || $action == 'update') { $this->assign_post(); } foreach ($this->object as $key => $value) { $this->tpl[$key] = $value; } $this->tpl['error'] = $this->error; $this->tpl['errors'] = $this->errors; if ($action == 'create' || $action == 'edit') { if ($conf->use_javascript_ajax) { $this->tpl['ajax_selectcountry'] = "\n" . '<script type="text/javascript" language="javascript"> jQuery(document).ready(function () { jQuery("#selectcountry_id").change(function() { document.formsoc.action.value="' . $action . '"; document.formsoc.canvas.value="' . $canvas . '"; document.formsoc.submit(); }); }) </script>' . "\n"; } if (is_object($objsoc) && $objsoc->id > 0) { $this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company_id'] = $objsoc->id; } else { $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); } // Civility $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civility_id); // Predefined with third party if (isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) { if (dol_strlen(trim($this->object->address)) == 0) { $this->tpl['address'] = $objsoc->address; } if (dol_strlen(trim($this->object->zip)) == 0) { $this->object->zip = $objsoc->zip; } if (dol_strlen(trim($this->object->town)) == 0) { $this->object->town = $objsoc->town; } if (dol_strlen(trim($this->object->phone_pro)) == 0) { $this->object->phone_pro = $objsoc->phone; } if (dol_strlen(trim($this->object->fax)) == 0) { $this->object->fax = $objsoc->fax; } if (dol_strlen(trim($this->object->email)) == 0) { $this->object->email = $objsoc->email; } } // Zip $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); // Town $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); if (dol_strlen(trim($this->object->country_id)) == 0) { $this->object->country_id = $objsoc->country_id; } // Country $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if ($user->admin) { $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } // State if ($this->object->country_id) { $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement, $this->object->country_code); } else { $this->tpl['select_state'] = $countrynotdefined; } // Public or private $selectarray = array('0' => $langs->trans("ContactPublic"), '1' => $langs->trans("ContactPrivate")); $this->tpl['select_visibility'] = $form->selectarray('priv', $selectarray, $this->object->priv, 0); } if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing if (!empty($conf->mailing->enabled)) { $langs->load("mails"); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); } // Linked element $this->tpl['contact_element'] = array(); $i = 0; $this->object->load_ref_elements(); if (!empty($conf->commande->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $i++; } if (!empty($conf->propal->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $i++; } if (!empty($conf->contrat->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; } if (!empty($conf->facture->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); $i++; } // Dolibarr user if ($this->object->user_id) { $dolibarr_user = new User($this->db); $result = $dolibarr_user->fetch($this->object->user_id); $this->tpl['dolibarr_user'] = $dolibarr_user->getLoginUrl(1); } else { $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess"); } } if ($action == 'view' || $action == 'delete') { $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'id'); if ($this->object->socid > 0) { $objsoc = new Societe($this->db); $objsoc->fetch($this->object->socid); $this->tpl['company'] = $objsoc->getNomUrl(1); } else { $this->tpl['company'] = $langs->trans("ContactNotLinkedToCompany"); } $this->tpl['civility'] = $this->object->getCivilityLabel(); $this->tpl['address'] = dol_nl2br($this->object->address); $this->tpl['zip'] = $this->object->zip ? $this->object->zip . ' ' : ''; $img = picto_from_langcode($this->object->country_code); $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country; $this->tpl['phone_pro'] = dol_print_phone($this->object->phone_pro, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); $this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); $this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX'); $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL'); $this->tpl['visibility'] = $this->object->LibPubPriv($this->object->priv); $this->tpl['note'] = nl2br($this->object->note); } if ($action == 'create_user') { // Full firstname and lastname separated with a dot : firstname.lastname include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; $login = dol_buildlogin($this->object->lastname, $this->object->firstname); $generated_password = getRandomPassword(false); $password = $generated_password; // Create a form array $formquestion = array(array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password)); $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $this->object->id, $langs->trans("CreateDolibarrLogin"), $langs->trans("ConfirmCreateContact"), "confirm_create_user", $formquestion, 'no'); } }
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle'); print '</td>'; print '<tr><td>' . $langs->trans("LocationSummary") . '</td><td colspan="3">' . $object->lieu . '</td></tr>'; // Description print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td colspan="3">' . nl2br($object->description) . '</td></tr>'; // Address print '<tr><td>' . $langs->trans('Address') . '</td><td colspan="3">'; print $object->address; print '</td></tr>'; // Town print '<tr><td width="25%">' . $langs->trans('Zip') . '</td><td width="25%">' . $object->zip . '</td>'; print '<td width="25%">' . $langs->trans('Town') . '</td><td width="25%">' . $object->town . '</td></tr>'; // Country print '<tr><td>' . $langs->trans('Country') . '</td><td colspan="3">'; if (!empty($object->country_code)) { $img = picto_from_langcode($object->country_code); print $img ? $img . ' ' : ''; } print $object->country; print '</td></tr>'; // Status print '<tr><td>' . $langs->trans("Status") . '</td><td colspan="3">' . $object->getLibStatut(4) . '</td></tr>'; $calcproductsunique = $object->nb_different_products(); $calcproducts = $object->nb_products(); // Total nb of different products print '<tr><td valign="top">' . $langs->trans("NumberOfDifferentProducts") . '</td><td colspan="3">'; print empty($calcproductsunique['nb']) ? '0' : $calcproductsunique['nb']; print "</td></tr>"; // Nb of products print '<tr><td valign="top">' . $langs->trans("NumberOfProducts") . '</td><td colspan="3">'; print empty($calcproducts['nb']) ? '0' : $calcproducts['nb'];
print '<tr><td width="15%">' . $langs->trans("UserTitle") . '</td><td colspan="3">'; print $contact->getCivilityLabel(); print '</td></tr>'; print '<tr><td>' . $langs->trans("PostOrFunction") . '</td><td colspan="3">' . $contact->poste . '</td>'; // Address print '<tr><td>' . $langs->trans("Address") . '</td><td colspan="3">' . nl2br($contact->address) . '</td></tr>'; // Zip Town print '<tr><td>' . $langs->trans("Zip") . ' / ' . $langs->trans("Town") . '</td><td colspan="3">'; print $contact->cp; if ($contact->cp) { print ' '; } print $contact->ville . '</td></tr>'; // Country print '<tr><td>' . $langs->trans("Country") . '</td><td colspan="3">'; $img = picto_from_langcode($contact->pays_code); if ($img) { print $img . ' '; } print $contact->pays; print '</td></tr>'; // Department print '<tr><td>' . $langs->trans('State') . '</td><td colspan="3">' . $contact->departement . '</td>'; // Phone print '<tr><td>' . $langs->trans("PhonePro") . '</td><td>' . dol_print_phone($contact->phone_pro, $contact->pays_code, $contact->id, $contact->socid, 'AC_TEL') . '</td>'; print '<td>' . $langs->trans("PhonePerso") . '</td><td>' . dol_print_phone($contact->phone_perso, $contact->pays_code, $contact->id, $contact->socid, 'AC_TEL') . '</td></tr>'; print '<tr><td>' . $langs->trans("PhoneMobile") . '</td><td>' . dol_print_phone($contact->phone_mobile, $contact->pays_code, $contact->id, $contact->socid, 'AC_TEL') . '</td>'; print '<td>' . $langs->trans("Fax") . '</td><td>' . dol_print_phone($contact->fax, $contact->pays_code, $contact->id, $contact->socid, 'AC_FAX') . '</td></tr>'; // Email print '<tr><td>' . $langs->trans("EMail") . '</td><td>' . dol_print_email($contact->email, $contact->id, $contact->socid, 'AC_EMAIL') . '</td>'; if ($conf->mailing->enabled) {