34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/societe/class/societeaccount.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/website/class/website.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
52$langs->loadLangs(array(
"companies",
"website"));
58$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
60$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'websitelist';
61$backtopage =
GETPOST(
'backtopage',
'alpha');
62$optioncss =
GETPOST(
'optioncss',
'aZ');
63$toselect =
GETPOST(
'toselect',
'array');
64$optioncss =
GETPOST(
'optioncss',
'aZ');
68$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71if (empty($page) || $page == -1) {
74$offset = $limit * $page;
78 $sortfield =
't.login';
89$diroutputmassaction = isModEnabled(
'website') ?
$conf->website->dir_output.
'/temp/massgeneration/'.$user->id :
'';
90$hookmanager->initHooks(array(
'websitethirdpartylist'));
93$extrafields->fetch_name_optionals_label($objectwebsiteaccount->table_element);
95$search_array_options = $extrafields->getOptionalsFromPost($objectwebsiteaccount->table_element,
'',
'search_');
97unset($objectwebsiteaccount->fields[
'fk_soc']);
100$search_all =
GETPOST(
"search_all",
'alpha');
103foreach ($objectwebsiteaccount->fields as $key => $val) {
104 $value =
GETPOST(
'search_'.$key,
'alpha');
106 $search[$key] = $value;
111$fieldstosearchall = array();
112foreach ($objectwebsiteaccount->fields as $key => $val) {
113 if (!empty($val[
'searchall'])) {
114 $fieldstosearchall[
't.'.$key] = $val[
'label'];
119$arrayfields = array();
120foreach ($objectwebsiteaccount->fields as $key => $val) {
122 if (!empty($val[
'visible'])) {
123 $arrayfields[
't.'.$key] = array(
'label' => $val[
'label'],
'checked' => (($val[
'visible'] < 0) ? 0 : 1),
'enabled' => $val[
'enabled']);
128include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
137if (!(
$object->id > 0) && $action ==
'view') {
148$permissiontoread = $user->hasRight(
'societe',
'lire');
149$permissiontoadd = $user->hasRight(
'societe',
'create');
150$permissiontodelete = $user->hasRight(
'societe',
'supprimer');
157$parameters = array(
'id' => $id);
158$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
163if (empty($reshook)) {
165 if (
GETPOST(
'cancel',
'alpha') && !empty($backtopage)) {
166 header(
"Location: ".$backtopage);
171 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
174 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
175 foreach ($objectwebsiteaccount->fields as $key => $val) {
177 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
178 $search[$key.
'_dtstart'] =
'';
179 $search[$key.
'_dtend'] =
'';
184 $search_array_options = array();
186 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
187 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
192 $objectclass =
'WebsiteAccount';
193 $objectlabel =
'WebsiteAccount';
194 $uploaddir = empty(
$conf->societe->multidir_output[
$object->entity]) ?
$conf->societe->dir_output :
$conf->societe->multidir_output[
$object->entity];
196 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
205$form =
new Form($db);
207$langs->load(
"companies");
209$title = $langs->trans(
"WebsiteAccounts");
215$site_filter_list = array();
216if (isModEnabled(
'website')) {
217 $site_filter_list[] =
'dolibarr_website';
219if (isModEnabled(
'webportal')) {
220 $site_filter_list[] =
'dolibarr_portal';
223$sql .= $objectwebsiteaccount->getFieldList(
't');
225if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
226 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
227 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
231$parameters = array();
232$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $objectwebsiteaccount, $action);
233$sql .= $hookmanager->resPrint;
234$sql = preg_replace(
'/,\s*$/',
'', $sql);
238$sql .=
" FROM ".MAIN_DB_PREFIX.
"societe_account as t";
239if (isset($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
240 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
243$parameters = array();
244$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
245$sql .= $hookmanager->resPrint;
246if ($objectwebsiteaccount->ismultientitymanaged == 1) {
247 $sql .=
" WHERE t.entity IN (".getEntity(
'thirdpartyaccount').
")";
249 $sql .=
" WHERE 1 = 1";
251$sql .=
" AND fk_soc = ".((int)
$object->id);
252if (!empty($site_filter_list)) {
253 $sql .=
" AND t.site IN (".$db->sanitize(
"'".implode(
"','", $site_filter_list).
"'", 1).
")";
255foreach ($search as $key => $val) {
256 if (array_key_exists($key, $objectwebsiteaccount->fields)) {
257 if ($key ==
'status' && $search[$key] == -1) {
260 $mode_search = (($objectwebsiteaccount->isInt($objectwebsiteaccount->fields[$key]) || $objectwebsiteaccount->isFloat($objectwebsiteaccount->fields[$key])) ? 1 : 0);
261 if ((strpos($objectwebsiteaccount->fields[$key][
'type'],
'integer:') === 0) || (strpos($objectwebsiteaccount->fields[$key][
'type'],
'sellist:') === 0) || !empty($objectwebsiteaccount->fields[$key][
'arrayofkeyval'])) {
262 if ($search[$key] ==
'-1' || ($search[$key] ===
'0' && (empty($objectwebsiteaccount->fields[$key][
'arrayofkeyval']) || !array_key_exists(
'0', $objectwebsiteaccount->fields[$key][
'arrayofkeyval'])))) {
267 if ($search[$key] !=
'') {
268 $sql .=
natural_search(
"t.".$db->sanitize($key), $search[$key], (($key ==
'status') ? 2 : $mode_search));
271 if (preg_match(
'/(_dtstart|_dtend)$/', $key) && $search[$key] !=
'') {
272 $columnName = preg_replace(
'/(_dtstart|_dtend)$/',
'', $key);
273 if (preg_match(
'/^(date|timestamp|datetime)/', $objectwebsiteaccount->fields[$columnName][
'type'])) {
274 if (preg_match(
'/_dtstart$/', $key)) {
275 $sql .=
" AND t.".$db->sanitize($columnName).
" >= '".$db->idate($search[$key]).
"'";
277 if (preg_match(
'/_dtend$/', $key)) {
278 $sql .=
" AND t.".$db->sanitize($columnName).
" <= '".$db->idate($search[$key]).
"'";
288 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
291include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
293$parameters = array();
294$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $objectwebsiteaccount, $action);
295$sql .= $hookmanager->resPrint;
312$nbtotalofrecords =
'';
314 $resql = $db->query($sql);
315 $nbtotalofrecords = $db->num_rows($resql);
316 if (($page * $limit) > $nbtotalofrecords) {
324$sql .= $db->order($sortfield, $sortorder);
326 $sql .= $db->plimit($limit + 1, $offset);
329$resql = $db->query($sql);
335$num = $db->num_rows($resql);
343$arrayofselected = is_array($toselect) ? $toselect : array();
345$param =
'id='.$object->id;
347 $param .=
'&mode='.urlencode($mode);
349if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
350 $param .=
'&contextpage='.urlencode($contextpage);
352if ($limit > 0 && $limit !=
$conf->liste_limit) {
353 $param .=
'&limit='.((int) $limit);
355if ($optioncss !=
'') {
356 $param .=
'&optioncss='.urlencode($optioncss);
358foreach ($search as $key => $val) {
359 if (is_array($search[$key])) {
360 foreach ($search[$key] as $skey) {
362 $param .=
'&search_'.$key.
'[]='.urlencode($skey);
365 } elseif (preg_match(
'/(_dtstart|_dtend)$/', $key) && !empty($val)) {
366 $param .=
'&search_'.$key.
'month='.((int)
GETPOST(
'search_'.$key.
'month',
'int'));
367 $param .=
'&search_'.$key.
'day='.((int)
GETPOST(
'search_'.$key.
'day',
'int'));
368 $param .=
'&search_'.$key.
'year='.((int)
GETPOST(
'search_'.$key.
'year',
'int'));
369 } elseif ($search[$key] !=
'') {
370 $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
374include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
378print
dol_get_fiche_head($head,
'website', $langs->trans(
"ThirdParty"), - 1,
'company');
380$linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
382dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
384print
'<div class="fichecenter">';
386print
'<div class="underbanner clearboth"></div>';
387print
'<table class="border centpercent tableforfield">';
392print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
393print $socstat->getTypeUrl(1);
397if ($socstat->client && !empty($socstat->code_client)) {
398 print
'<tr><td class="titlefield">';
399 print $langs->trans(
'CustomerCode').
'</td><td>';
401 $tmpcheck = $socstat->check_codeclient();
402 if ($tmpcheck != 0 && $tmpcheck != -5) {
403 print
' <span class="error">('.$langs->trans(
"WrongCustomerCode").
')</span>';
409if ($socstat->fournisseur && !empty($socstat->code_fournisseur)) {
410 print
'<tr><td class="titlefield">';
411 print $langs->trans(
'SupplierCode').
'</td><td>';
413 $tmpcheck = $socstat->check_codefournisseur();
414 if ($tmpcheck != 0 && $tmpcheck != -5) {
415 print
' <span class="error">('.$langs->trans(
"WrongSupplierCode").
')</span>';
428if (isModEnabled(
'website') || isModEnabled(
'webportal')) {
429 if ($user->hasRight(
'societe',
'lire')) {
430 $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));
432 $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);
441$arrayofmassactions = array(
445if ($user->hasRight(
'mymodule',
'delete')) {
446 $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
448if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
449 $arrayofmassactions = array();
451$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
453print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
454if ($optioncss !=
'') {
455 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
457print
'<input type="hidden" name="token" value="'.newToken().
'">';
458print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
459print
'<input type="hidden" name="action" value="list">';
460print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
461print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
462print
'<input type="hidden" name="page" value="'.$page.
'">';
463print
'<input type="hidden" name="id" value="'.$id.
'">';
464print
'<input type="hidden" name="page_y" value="">';
465print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
467print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'', 0, $newcardbutton,
'', $limit);
469$topicmail =
"Information";
470$modelmail =
"societeaccount";
472$trackid =
'thi'.$object->id;
473include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
486$parameters = array();
487$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $objectwebsiteaccount, $action);
488if (empty($reshook)) {
489 $moreforfilter .= $hookmanager->resPrint;
491 $moreforfilter = $hookmanager->resPrint;
494if (!empty($moreforfilter)) {
495 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
496 print $moreforfilter;
500$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
501$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
502$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
503$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
505print
'<div class="div-table-responsive">';
506print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
511print
'<tr class="liste_titre_filter">';
514 print
'<td class="liste_titre center maxwidthsearch">';
515 $searchpicto = $form->showFilterButtons(
'left');
519foreach ($objectwebsiteaccount->fields as $key => $val) {
521 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
522 if ($key ==
'status') {
523 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
524 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
525 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
526 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
527 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
528 } 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'])) {
529 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
531 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
532 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').($key ==
'status' ?
' parentonrightofpage' :
'').
'">';
533 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
534 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);
535 } elseif ((strpos($val[
'type'],
'integer:') === 0) || (strpos($val[
'type'],
'sellist:') === 0)) {
537 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
538 } elseif (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
539 print
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag(empty($search[$key]) ?
'' : $search[$key]).
'">';
547 } elseif ($key ==
'lang') {
548 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
550 print $formadmin->select_language((isset($search[$key]) ? $search[$key] :
''),
'search_lang', 0, null, 1, 0, 0,
'minwidth100imp maxwidth125', 2);
552 print
'<input type="text" class="flat maxwidth'.($val[
'type'] ==
'integer' ?
'50' :
'75').
'" name="search_'.$key.
'" value="'.
dol_escape_htmltag(isset($search[$key]) ? $search[$key] :
'').
'">';
558include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
560$parameters = array(
'arrayfields' => $arrayfields);
561$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $objectwebsiteaccount, $action);
562print $hookmanager->resPrint;
565 print
'<td class="liste_titre center maxwidthsearch">';
566 $searchpicto = $form->showFilterButtons();
573$totalarray = array();
574$totalarray[
'nbfield'] = 0;
578print
'<tr class="liste_titre">';
581 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
582 $totalarray[
'nbfield']++;
584foreach ($objectwebsiteaccount->fields as $key => $val) {
585 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
586 if ($key ==
'status') {
587 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
588 } elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
589 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
590 } elseif (in_array($val[
'type'], array(
'timestamp'))) {
591 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowrap';
592 } 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'])) {
593 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
595 $cssforfield = preg_replace(
'/small\s*/',
'', $cssforfield);
596 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
597 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";
598 $totalarray[
'nbfield']++;
602include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
604$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
605$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $objectwebsiteaccount, $action);
606print $hookmanager->resPrint;
609 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
610 $totalarray[
'nbfield']++;
616$needToFetchEachLine = 0;
617if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
618 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
619 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
620 $needToFetchEachLine++;
628$savnbfield = $totalarray[
'nbfield'];
629$totalarray = array();
630$totalarray[
'nbfield'] = 0;
631$imaxinloop = ($limit ? min($num, $limit) : $num);
632while ($i < $imaxinloop) {
633 $obj = $db->fetch_object($resql);
639 $objectwebsiteaccount->id = $obj->rowid;
640 $objectwebsiteaccount->login = $obj->login;
641 $objectwebsiteaccount->ref = $obj->login;
642 foreach ($objectwebsiteaccount->fields as $key => $val) {
643 if (property_exists($objectwebsiteaccount, $key)) {
644 $objectwebsiteaccount->$key = $obj->$key;
649 print
'<tr data-rowid="'.$objectwebsiteaccount->id.
'" class="oddeven">';
652 print
'<td class="nowrap center">';
653 if ($massactionbutton || $massaction) {
655 if (in_array($obj->rowid, $arrayofselected)) {
658 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
662 $totalarray[
'nbfield']++;
665 foreach ($objectwebsiteaccount->fields as $key => $val) {
666 $cssforfield = (empty($val[
'csslist']) ? (empty($val[
'css']) ?
'' : $val[
'css']) : $val[
'csslist']);
667 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) {
668 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
669 } elseif ($key ==
'status') {
670 $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
672 if (in_array($val[
'type'], array(
'timestamp'))) {
673 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
674 } elseif ($key ==
'ref') {
675 $cssforfield .= ($cssforfield ?
' ' :
'').
'nowraponall';
678 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'])) {
679 $cssforfield .= ($cssforfield ?
' ' :
'').
'right';
682 if (!empty($arrayfields[
't.'.$key][
'checked'])) {
683 print
'<td'.($cssforfield ?
' class="'.$cssforfield.((preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) ?
' classfortooltip' :
'').
'"' :
'');
684 if (preg_match(
'/tdoverflow/', $cssforfield) && !in_array($val[
'type'], array(
'ip',
'url')) && !is_numeric(
$object->$key)) {
685 print
' title="'.dol_escape_htmltag(
$object->$key).
'"';
688 if ($key ==
'login') {
689 print $objectwebsiteaccount->getNomUrl(1,
'', 0,
'', 1);
690 } elseif ($key ==
'fk_website') {
691 if ($obj->$key > 0) {
692 $tmpwebsite =
new Website($db);
693 $tmpwebsite->fetch($obj->$key);
694 print $tmpwebsite->getNomUrl(1);
697 print $objectwebsiteaccount->showOutputField($val, $key, $obj->$key,
'');
701 $totalarray[
'nbfield']++;
703 if (!empty($val[
'isameasure']) && $val[
'isameasure'] == 1) {
705 $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
707 if (!isset($totalarray[
'val'])) {
708 $totalarray[
'val'] = array();
710 if (!isset($totalarray[
'val'][
't.'.$key])) {
711 $totalarray[
'val'][
't.'.$key] = 0;
713 $totalarray[
'val'][
't.'.$key] += $objectwebsiteaccount->$key;
718 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
720 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $objectwebsiteaccount,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
721 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objectwebsiteaccount, $action);
722 print $hookmanager->resPrint;
725 print
'<td class="nowrap center">';
726 if ($massactionbutton || $massaction) {
728 if (in_array($obj->rowid, $arrayofselected)) {
731 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
735 $totalarray[
'nbfield']++;
744include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
750 foreach ($arrayfields as $key => $val) {
751 if (!empty($val[
'checked'])) {
755 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
761$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
762$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $objectwebsiteaccount, $action);
763print $hookmanager->resPrint;
765print
'</table>'.
"\n";
770if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
771 $hidegeneratedfilelistifempty = 1;
772 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
773 $hidegeneratedfilelistifempty = 0;
776 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
780 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
781 $urlsource .= str_replace(
'&',
'&', $param);
783 $filedir = $diroutputmassaction;
784 $genallowed = $permissiontoread;
785 $delallowed = $permissiontoadd;
787 print $formfile->showdocuments(
'massfilesarea_mymodule',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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)
Return array of tabs to used on pages for third parties cards.
recordNotFound($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Displays an error page when a record is not found.
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.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0)
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.