25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societeaccount.class.php';
29 require_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');
56 foreach ($object->fields as $key => $val)
58 if (
GETPOST(
'search_'.$key,
'alpha')) $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
61 if (empty($action) && empty($id) && empty($ref)) $action =
'view';
68 $permissionnote = $user->rights->websiteaccount->write;
69 $permissiondellink = $user->rights->websiteaccount->write;
70 $permissiontoadd = $user->rights->websiteaccount->write;
73 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
81 $parameters = array();
82 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
83 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
89 $permissiontoadd = $user->rights->website->write;
90 $permissiontodelete = $user->rights->website->delete;
91 $backurlforlist =
dol_buildpath(
'/website/websiteaccount_list.php', 1);
94 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
97 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
100 $triggersendname =
'WEBSITEACCOUNT_SENTBYMAIL';
101 $autocopy =
'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
102 $trackid =
'websiteaccount'.$object->id;
103 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
111 $form =
new Form($db);
117 print '<script type="text/javascript" language="javascript">
118 jQuery(document).ready(function() {
119 function init_myfunc()
121 jQuery("#myid").removeAttr(\'disabled\');
122 jQuery("#myid").attr(\'disabled\',\'disabled\');
125 jQuery("#mybutton").click(function() {
133 if ($action ==
'create')
137 print '<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
138 print '<input type="hidden" name="token" value="'.newToken().
'">';
139 print '<input type="hidden" name="action" value="add">';
140 print '<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
144 print '<table class="border centpercent">'.
"\n";
147 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
150 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
152 print '</table>'.
"\n";
156 print '<div class="center">';
157 print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans(
"Create")).
'">';
159 print '<input type="'.($backtopage ?
"submit" :
"button").
'" class="button button-cancel" name="cancel" value="'.
dol_escape_htmltag($langs->trans(
"Cancel")).
'"'.($backtopage ?
'' :
' onclick="javascript:history.go(-1)"').
'>';
166 if (($id || $ref) && $action ==
'edit')
170 print '<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
171 print '<input type="hidden" name="action" value="update">';
172 print '<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
173 print '<input type="hidden" name="id" value="'.$object->id.
'">';
177 print '<table class="border centpercent">'.
"\n";
180 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
183 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
189 print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Save").
'">';
190 print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
197 if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create')))
199 if ($object->fk_soc > 0 && empty($socid)) $socid = $object->fk_soc;
201 $res = $object->fetch_optionals();
209 if ($action ==
'delete') {
210 $formconfirm = $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteWebsiteAccount'), $langs->trans(
'ConfirmDeleteWebsiteAccount'),
'confirm_delete',
'', 0, 1);
214 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
215 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
216 if (empty($reshook)) $formconfirm .= $hookmanager->resPrint;
217 elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint;
226 if ($socid) $linkback = '<a href="'.DOL_URL_ROOT.'/societe/website.php?socid='.$socid.'&restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToListForThirdParty").'</a>';
227 if ($fk_website) $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>';
229 $morehtmlref = '<div class="refidno">';
271 $morehtmlref .= '</div>';
273 if ($socid > 0) $object->next_prev_filter = 'te.fk_soc = '.$socid;
278 print '<div class="fichecenter">';
279 print '<div class="fichehalfleft">';
280 print '<div class="underbanner clearboth"></div>';
281 print '<table class="border centpercent">'."\
n";
284 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
287 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
294 print '<div class="clearboth"></div><br>';
300 if ($action != 'presend' && $action != 'editline') {
301 print '<div class="tabsAction">'.
"\n";
302 $parameters = array();
303 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
304 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
309 if (empty($user->socid)) {
310 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";
313 if ($user->rights->website->write)
315 print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit">'.$langs->trans(
"Modify").
'</a></div>'.
"\n";
332 if ($user->rights->website->delete)
334 print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken().
'">'.$langs->trans(
'Delete').
'</a></div>'.
"\n";
342 if (
GETPOST(
'modelselected')) {
346 if ($action !=
'presend')
348 print '<div class="fichecenter"><div class="fichehalfleft">';
349 print '<a name="builddoc"></a>';
351 print '</div><div class="fichehalfright"><div class="ficheaddleft">';
362 print '</div></div></div>';
366 $modelmail =
'websiteaccount';
367 $defaulttopic =
'Information';
368 $diroutput = $conf->website->dir_output;
369 $trackid =
'websiteaccount'.$object->id;
371 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
websiteaccountPrepareHead($object)
Prepare array of tabs for SocieteAccount.
</td >< tdcolspan="3">< spanclass="opacitymedium"></span ></td ></tr >< trclass="liste_total"> CREANCES DETTES< tdcolspan="3"class="right"></td >< tdcolspan="3"class="right"></td ></tr > CREANCES DETTES RECETTES DEPENSES trips CREANCES DETTES Y m expensereport p date_valid Y m expensereport pe datep $db idate($date_start)."' AND $column < p rowid
Class for SocieteAccount.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
print $_SERVER["PHP_SELF"] n
Edit parameters.
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.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...