32 require
'../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35 $action =
GETPOST(
'action',
'aZ09');
36 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'admincompany';
39 $langs->loadLangs(array(
'admin',
'companies'));
47 $hookmanager->initHooks(array(
'adminsocialnetworkscompany',
'globaladmin'));
53 $parameters = array();
54 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
58 if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))) {
59 foreach ($listofnetworks as $key => $value) {
60 if (!empty($value[
'active'])) {
61 $networkconstname =
'MAIN_INFO_SOCIETE_'.strtoupper($key).
'_URL';
62 $networkconstid =
'MAIN_INFO_SOCIETE_'.strtoupper($key);
67 if (!empty($listofnetworks[$key][
'url'])) {
68 $url = str_replace(
'{socialid}',
GETPOST($key,
'alpha'), $listofnetworks[$key][
'url']);
87 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
90 print
load_fiche_titre($langs->trans(
"CompanyFoundation"),
'',
'title_setup');
96 print
'<span class="opacitymedium">'.$langs->trans(
"CompanyFundationDesc", $langs->transnoentities(
"Save")).
"</span><br>\n";
97 print
'<span class="opacitymedium">'.$langs->trans(
"MoreNetworksAvailableWithModule").
"</span><br>\n";
105 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
106 print
'<input type="hidden" name="token" value="'.newToken().
'">';
107 print
'<input type="hidden" name="action" value="update">';
110 print
'<div class="div-table-responsive-no-min">';
111 print
'<table class="noborder centpercent editmode">';
112 print
'<tr class="liste_titre">';
113 print
'<td class="titlefieldcreate">'.$langs->trans(
"SocialNetworksInformation").
'</td>';
114 print
'<td>'.$langs->trans(
"SocialNetworkId").
'</td>';
115 print
'<td>'.$form->textwithpicto($langs->trans(
"Url"), $langs->trans(
"KeepEmptyToUseDefault")).
'</td>';
122 foreach ($listofnetworks as $key => $value) {
123 if (!empty($value[
'active'])) {
124 print
'<tr class="oddeven">';
125 print
'<td><label for="'.$key.
'url">'.$langs->trans(ucfirst($key)).
'</label></td>';
126 $networkconstname =
'MAIN_INFO_SOCIETE_'.strtoupper($key).
'_URL';
127 $networkconstid =
'MAIN_INFO_SOCIETE_'.strtoupper($key);
128 print
'<td class="nowraponall"><span class="fa paddingright '.($value[
'icon'] ? $value[
'icon'] :
'fa-link').
'"></span>';
129 print
'<input name="'.$key.
'" id="'.$key.
'" class="minwidth300" value="'.(!empty($conf->global->$networkconstid) ?
dol_escape_htmltag($conf->global->$networkconstid) :
'').
'">';
131 print
'<input name="'.$key.
'url" id="'.$key.
'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ?
dol_escape_htmltag($conf->global->$networkconstname) :
'').
'">';
133 print
'<td class="nowraponall">'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ?
dol_escape_htmltag($conf->global->$networkconstid) :
''), 0, 0, $key, $listofnetworks).
'</td>';
142 print
$form->buttonsSaveCancel(
"Save",
'');
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
company_admin_prepare_head()
Return array head with list of tabs to view object informations.
if($actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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='')
Show tabs of a record.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
getArrayOfSocialNetworks()
Get array of social network dictionary.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.