25require
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/societe/class/societeaccount.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/website/lib/websiteaccount.lib.php';
32$langs->loadLangs(array(
"website",
"other"));
37$action =
GETPOST(
'action',
'aZ09');
38$confirm =
GETPOST(
'confirm',
'alpha');
39$cancel =
GETPOST(
'cancel',
'aZ09');
40$backtopage =
GETPOST(
'backtopage',
'alpha');
45$diroutputmassaction = $conf->website->dir_output.
'/temp/massgeneration/'.$user->id;
46$hookmanager->initHooks(array(
'websiteaccountcard'));
49$extrafields->fetch_name_optionals_label($object->table_element);
51$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
54$search_all =
GETPOST(
"search_all",
'alpha');
56foreach ($object->fields as $key => $val) {
57 if (
GETPOST(
'search_'.$key,
'alpha')) {
58 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
62if (empty($action) && empty($id) && empty($ref)) {
67include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
73if (!$user->hasRight(
'website',
'read')) {
78$permissionnote = $user->hasRight(
'website',
'write');
79$permissiondellink = $user->hasRight(
'website',
'write');
80$permissiontoadd = $user->hasRight(
'website',
'write');
81$permissiontodelete = $user->hasRight(
'website',
'delete');
89$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
97 $permissiontoadd = $user->hasRight(
'website',
'write');
98 $permissiontodelete = $user->hasRight(
'website',
'delete');
99 $backurlforlist =
dol_buildpath(
'/website/websiteaccount_list.php', 1);
102 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
105 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
108 $triggersendname =
'WEBSITEACCOUNT_SENTBYMAIL';
109 $autocopy =
'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
110 $trackid =
'websiteaccount'.$object->id;
111 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
119$form =
new Form($db);
125if ($action ==
'create') {
126 print
load_fiche_titre($langs->trans(
"NewObject", $langs->transnoentitiesnoconv(
"WebsiteAccount")));
128 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
129 print
'<input type="hidden" name="token" value="'.newToken().
'">';
130 print
'<input type="hidden" name="action" value="add">';
131 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
135 print
'<table class="border centpercent">'.
"\n";
138 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
141 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
143 print
'</table>'.
"\n";
147 print $form->buttonsSaveCancel(
"Create");
153if (($id || $ref) && $action ==
'edit') {
156 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
157 print
'<input type="hidden" name="action" value="update">';
158 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
159 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
163 print
'<table class="border centpercent">'.
"\n";
166 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
169 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
175 print $form->buttonsSaveCancel();
181if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
182 if ($object->fk_soc > 0 && empty($socid)) {
183 $socid = $object->fk_soc;
186 $res = $object->fetch_optionals();
189 print
dol_get_fiche_head($head,
'card', $langs->trans(
"WebsiteAccount"), -1,
'websiteaccount@website');
194 if ($action ==
'delete') {
195 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteWebsiteAccount'), $langs->trans(
'ConfirmDeleteWebsiteAccount'),
'confirm_delete',
'', 0, 1);
199 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
200 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
201 if (empty($reshook)) {
202 $formconfirm .= $hookmanager->resPrint;
203 } elseif ($reshook > 0) {
204 $formconfirm = $hookmanager->resPrint;
215 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/website.php?socid='.$socid.
'&restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToListForThirdParty").
'</a>';
218 $linkback =
'<a href="'.DOL_URL_ROOT.
'/website/website_card.php?fk_website='.$fk_website.
'&restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
221 $morehtmlref =
'<div class="refidno">';
263 $morehtmlref .=
'</div>';
266 $object->next_prev_filter =
'te.fk_soc = '.((int) $socid);
269 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'rowid', $morehtmlref);
272 print
'<div class="fichecenter">';
273 print
'<div class="fichehalfleft">';
274 print
'<div class="underbanner clearboth"></div>';
275 print
'<table class="border centpercent">'.
"\n";
278 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
281 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
288 print
'<div class="clearboth"></div><br>';
294 if ($action !=
'presend' && $action !=
'editline') {
295 print
'<div class="tabsAction">'.
"\n";
296 $parameters = array();
297 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
302 if (empty($reshook)) {
304 if (empty($user->socid)) {
305 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendMail').
'</a></div>'.
"\n";
308 if ($user->hasRight(
'website',
'write')) {
309 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a></div>'.
"\n";
326 if ($permissiontodelete) {
327 print
dolGetButtonAction($langs->trans(
"Delete"),
'',
'delete', $_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.newToken(),
'delete', $permissiontodelete);
335 if (
GETPOST(
'modelselected')) {
339 if ($action !=
'presend') {
340 print
'<div class="fichecenter"><div class="fichehalfleft">';
341 print
'<a name="builddoc"></a>';
343 print
'</div><div class="fichehalfright">';
354 print
'</div></div>';
358 $modelmail =
'websiteaccount';
359 $defaulttopic =
'Information';
360 $diroutput = $conf->website->dir_output;
361 $trackid =
'websiteaccount'.$object->id;
363 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class for SocieteAccount.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
websiteaccountPrepareHead($object)
Prepare array of tabs for SocieteAccount.