35require
'../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/societe/class/societeaccount.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/website/class/website.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
51$langs->loadLangs(array(
"companies",
"website"));
54$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
56$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'websitelist';
57$backtopage =
GETPOST(
'backtopage',
'alpha');
58$optioncss =
GETPOST(
'optioncss',
'aZ');
59$toselect =
GETPOST(
'toselect',
'array:int');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69if (empty($page) || $page == -1) {
72$offset = $limit * $page;
76 $sortfield =
't.login';
81if (!isset($massaction)) {
90$diroutputmassaction =
isModEnabled(
'website') ?
$conf->website->dir_output.
'/temp/massgeneration/'.$user->id :
'';
91$hookmanager->initHooks(array(
'thirdpartywebsite',
'websitethirdpartylist'));
94$extrafields->fetch_name_optionals_label($objectwebsiteaccount->table_element);
96$search_array_options = $extrafields->getOptionalsFromPost($objectwebsiteaccount->table_element,
'',
'search_');
98unset($objectwebsiteaccount->fields[
'fk_soc']);
101$search_all =
GETPOST(
"search_all",
'alpha');
104foreach ($objectwebsiteaccount->fields as $key => $val) {
105 $value =
GETPOST(
'search_'.$key,
'alpha');
107 $search[$key] = $value;
112$fieldstosearchall = array();
113foreach ($objectwebsiteaccount->fields as $key => $val) {
114 if (!empty($val[
'searchall'])) {
115 $fieldstosearchall[
't.'.$key] = $val[
'label'];
120$arrayfields = array();
121foreach ($objectwebsiteaccount->fields as $key => $val) {
123 if (!empty($val[
'visible'])) {
124 $arrayfields[
't.'.$key] = array(
'label' => $val[
'label'],
'checked' => (($val[
'visible'] < 0) ? 0 : 1),
'enabled' => $val[
'enabled']);
129include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
138if (!(
$object->id > 0) && $action ==
'view') {
149$permissiontoread = $user->hasRight(
'societe',
'lire');
150$permissiontoadd = $user->hasRight(
'societe',
'create');
151$permissiontodelete = $user->hasRight(
'societe',
'supprimer');
158$parameters = array(
'id' => $id);
159$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
164if (empty($reshook)) {
166 if (
GETPOST(
'cancel',
'alpha') && !empty($backtopage)) {
167 header(
"Location: ".$backtopage);
172 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
175 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
176 foreach ($objectwebsiteaccount->fields as $key => $val) {
178 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
179 $search[$key.
'_dtstart'] =
'';
180 $search[$key.
'_dtend'] =
'';
185 $search_array_options = array();
187 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
188 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
193 $objectclass =
'WebsiteAccount';
194 $objectlabel =
'WebsiteAccount';
197 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
208$langs->load(
"companies");
210$title = $langs->trans(
"WebsiteAccounts");
212 $title =
$object->name.
' - '.$langs->trans(
"WebsiteAccounts");
219$site_filter_list = array();
221 $site_filter_list[] =
'dolibarr_website';
224 $site_filter_list[] =
'dolibarr_portal';
227$sql .= $objectwebsiteaccount->getFieldList(
't');
229if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
230 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
231 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
235$parameters = array();
236$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $objectwebsiteaccount, $action);
237$sql .= $hookmanager->resPrint;
238$sql = preg_replace(
'/,\s*$/',
'', $sql);
242$sql .=
" FROM ".MAIN_DB_PREFIX.
"societe_account as t";
243if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
244 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
247$parameters = array();
248$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
249$sql .= $hookmanager->resPrint;
250if ($objectwebsiteaccount->ismultientitymanaged == 1) {
251 $sql .=
" WHERE t.entity IN (".getEntity(
'thirdpartyaccount').
")";
253 $sql .=
" WHERE 1 = 1";
255$sql .=
" AND fk_soc = ".((int)
$object->id);
256if (!empty($site_filter_list)) {
257 $sql .=
" AND t.site IN (".$db->sanitize(
"'".implode(
"','", $site_filter_list).
"'", 1).
")";
259foreach ($search as $key => $val) {
260 if (array_key_exists($key, $objectwebsiteaccount->fields)) {
261 if ($key ==
'status' && $search[$key] == -1) {
264 $mode_search = (($objectwebsiteaccount->isInt($objectwebsiteaccount->fields[$key]) || $objectwebsiteaccount->isFloat($objectwebsiteaccount->fields[$key])) ? 1 : 0);
265 if ((strpos($objectwebsiteaccount->fields[$key][
'type'],
'integer:') === 0) || (strpos($objectwebsiteaccount->fields[$key][
'type'],
'sellist:') === 0) || !empty($objectwebsiteaccount->fields[$key][
'arrayofkeyval'])) {
266 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($objectwebsiteaccount->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $objectwebsiteaccount->fields[$key][
'arrayofkeyval'])))) {
271 if ($search[$key] !=
'') {
272 $sql .=
natural_search(
"t.".
$db->sanitize($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
275 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
276 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
277 if (preg_match(
'/^(date|timestamp|datetime)/', $objectwebsiteaccount->fields[$columnName][
'type'])) {
278 if (preg_match(
'/_dtstart$/', $key)) {
279 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".
$db->idate((
int) $search[$key]).
"'";
281 if (preg_match(
'/_dtend$/', $key)) {
282 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".
$db->idate((
int) $search[$key]).
"'";
292 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
295include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
297$parameters = array();
298$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $objectwebsiteaccount, $action);
299$sql .= $hookmanager->resPrint;
316$nbtotalofrecords =
'';
318 $resql =
$db->query($sql);
319 $nbtotalofrecords =
$db->num_rows($resql);
320 if (($page * $limit) > (
int) $nbtotalofrecords) {
328$sql .=
$db->order($sortfield, $sortorder);
330 $sql .=
$db->plimit($limit + 1, $offset);
333$resql =
$db->query($sql);
339$num =
$db->num_rows($resql);
347$arrayofselected = is_array($toselect) ? $toselect : array();
349$param =
'id='.$object->id;
351 $param .=
'&mode='.urlencode($mode);
353if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
354 $param .=
'&contextpage='.urlencode($contextpage);
356if ($limit > 0 && $limit !=
$conf->liste_limit) {
357 $param .=
'&limit='.((int) $limit);
359if ($optioncss !=
'') {
360 $param .=
'&optioncss='.urlencode($optioncss);
362foreach ($search as $key => $val) {
363 if (is_array($search[$key])) {
364 foreach ($search[$key] as $skey) {
366 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
369 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
370 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
371 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
372 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
373 } elseif ($search[$key] !=
'') {
374 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
378include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
382print
dol_get_fiche_head($head,
'website', $langs->trans(
"ThirdParty"), - 1,
'company');
384$linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
386dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
388print
'<div class="fichecenter">';
390print
'<div class="underbanner clearboth"></div>';
391print
'<table class="border centpercent tableforfield">';
396print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
397print $socstat->getTypeUrl(1);
401if ($socstat->client && !empty($socstat->code_client)) {
402 print
'<tr><td class="titlefield">';
403 print $langs->trans(
'CustomerCode').
'</td><td>';
405 $tmpcheck = $socstat->check_codeclient();
406 if ($tmpcheck != 0 && $tmpcheck != -5) {
407 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
413if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
414 print
'<tr><td class="titlefield">';
415 print $langs->trans(
'SupplierCode').
'</td><td>';
417 $tmpcheck = $socstat->check_codefournisseur();
418 if ($tmpcheck != 0 && $tmpcheck != -5) {
419 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
433 if ($user->hasRight(
'societe',
'lire')) {
434 $newcardbutton .= dolGetButtonTitle($langs->trans(
"AddWebsiteAccount"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/website/websiteaccount_card.php?action=create&fk_soc='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id));
436 $newcardbutton .= dolGetButtonTitle($langs->trans(
"AddAction"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/website/websiteaccount_card.php?action=create&fk_soc='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', 0);
445$arrayofmassactions = array(
449if ($user->hasRight(
'mymodule',
'delete')) {
450 $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
452if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
453 $arrayofmassactions = array();
455$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
457print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
458if ($optioncss !=
'') {
459 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
461print
'<input type="hidden" name="token" value="'.newToken().
'">';
462print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
463print
'<input type="hidden" name="action" value="list">';
464print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
465print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
466print
'<input type="hidden" name="page" value="'.$page.
'">';
467print
'<input type="hidden" name="id" value="'.$id.
'">';
468print
'<input type="hidden" name="page_y" value="">';
469print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
471print_barre_liste($langs->trans(
"WebsiteAccounts"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'website', 0, $newcardbutton,
'', $limit);
473$topicmail =
"Information";
474$modelmail =
"societeaccount";
476$trackid =
'thi'.$object->id;
477include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
490$parameters = array();
491$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $objectwebsiteaccount, $action);
492if (empty($reshook)) {
493 $moreforfilter .= $hookmanager->resPrint;
495 $moreforfilter = $hookmanager->resPrint;
498if (!empty($moreforfilter)) {
499 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
500 print $moreforfilter;
504$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
505$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
506$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
507$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
509print
'<div class="div-table-responsive">';
510print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
515print
'<tr class="liste_titre_filter">';
517if (
$conf->main_checkbox_left_column) {
518 print
'<td class="liste_titre center maxwidthsearch">';
519 $searchpicto = $form->showFilterButtons(
'left');
523foreach ($objectwebsiteaccount->fields as $key => $val) {
525 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
526 if ($key ==
'status') {
527 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
528 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
529 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
530 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
531 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
532 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
533 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
535 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
536 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
537 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
538 print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], (isset($search[$key]) ? $search[$key] :
''), 1, 0, 0,
'', 1, 0, 0,
'',
'maxwidth100'.($key ==
'status' ?
' search_status width100 onrightofpage' :
''), 1);
539 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
541 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
542 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
543 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
551 } elseif ($key ==
'lang') {
552 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
554 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, array(), 1, 0, 0,
'minwidth100imp maxwidth125', 2);
556 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
562include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
564$parameters = array(
'arrayfields' => $arrayfields);
565$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $objectwebsiteaccount, $action);
566print $hookmanager->resPrint;
568if (!
$conf->main_checkbox_left_column) {
569 print
'<td class="liste_titre center maxwidthsearch">';
570 $searchpicto = $form->showFilterButtons();
582print
'<tr class="liste_titre">';
584if (
$conf->main_checkbox_left_column) {
585 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
588foreach ($objectwebsiteaccount->fields as $key => $val) {
589 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
590 if ($key ==
'status') {
591 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
592 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
593 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
594 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
595 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
596 } elseif (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && $val[
'label'] !=
'TechnicalID' && empty($val[
'arrayofkeyval'])) {
597 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
599 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
600 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
601 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
''), 0, (empty($val[
'helplist']) ?
'' : $val[
'helplist'])).
"\n";
606include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
608$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
609$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $objectwebsiteaccount, $action);
610print $hookmanager->resPrint;
612if (!
$conf->main_checkbox_left_column) {
613 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
620$needToFetchEachLine = 0;
621if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
622 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
623 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
624 $needToFetchEachLine++;
635$imaxinloop = ($limit ? min($num, $limit) : $num);
636while ($i < $imaxinloop) {
637 $obj =
$db->fetch_object($resql);
643 $objectwebsiteaccount->id = $obj->rowid;
644 $objectwebsiteaccount->login = $obj->login;
645 $objectwebsiteaccount->ref = $obj->login;
646 foreach ($objectwebsiteaccount->fields as $key => $val) {
647 if (property_exists($objectwebsiteaccount, $key)) {
648 $objectwebsiteaccount->$key = $obj->$key;
653 print
'<tr data-rowid="'.$objectwebsiteaccount->id.
'" class="oddeven">';
655 if (
$conf->main_checkbox_left_column) {
656 print
'<td class="nowrap center">';
657 if ($massactionbutton || $massaction) {
659 if (in_array($obj->rowid, $arrayofselected)) {
662 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
669 foreach ($objectwebsiteaccount->fields as $key => $val) {
670 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
671 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
672 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
673 } elseif ($key ==
'status') {
674 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
676 if (in_array($val[
'type'], array(
'timestamp'))) {
677 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
678 } elseif ($key ==
'ref') {
679 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
682 if (in_array($val[
'type'], array(
'double(24,8)',
'double(6,3)',
'integer',
'real',
'price')) && !in_array($key, array(
'id',
'rowid',
'ref',
'status')) && empty($val[
'arrayofkeyval'])) {
683 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
686 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
687 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
688 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
689 print
' title="'.dol_escape_htmltag((
string)
$object->$key).
'"';
692 if ($key ==
'login') {
693 print $objectwebsiteaccount->getNomUrl(1,
'', 0,
'', 1);
694 } elseif ($key ==
'fk_website') {
695 if ($obj->$key > 0) {
697 $tmpwebsite->fetch($obj->$key);
698 print $tmpwebsite->getNomUrl(1);
701 print $objectwebsiteaccount->showOutputField($val, $key, $obj->$key,
'');
707 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
711 if (!isset($totalarray[
'val'])) {
714 if (!isset($totalarray[
'val'][
't.'.$key])) {
717 $totalarray[
'val'][
't.'.$key] += $objectwebsiteaccount->$key;
722 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
724 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $objectwebsiteaccount,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
725 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objectwebsiteaccount, $action);
726 print $hookmanager->resPrint;
728 if (!
$conf->main_checkbox_left_column) {
729 print
'<td class="nowrap center">';
730 if ($massactionbutton || $massaction) {
732 if (in_array($obj->rowid, $arrayofselected)) {
735 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
748include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
754 foreach ($arrayfields as $key => $val) {
755 if (!empty($val[
'checked'])) {
759 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
765$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
766$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $objectwebsiteaccount, $action);
767print $hookmanager->resPrint;
769print
'</table>'.
"\n";
774if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
775 $hidegeneratedfilelistifempty = 1;
776 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
777 $hidegeneratedfilelistifempty = 0;
780 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
784 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
785 $urlsource .= str_replace(
'&',
'&', $param);
787 $filedir = $diroutputmassaction;
788 $genallowed = $permissiontoread;
789 $delallowed = $permissiontoadd;
791 print $formfile->showdocuments(
'massfilesarea_mymodule',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class for SocieteAccount.
Class to manage third parties objects (customers, suppliers, prospects...)
societe_prepare_head(Societe $object, $subtabs='')
Return array of tabs to used on pages for third parties cards.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.