32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35$action =
GETPOST(
'action',
'aZ09');
36$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'admincompany';
47$langs->loadLangs(array(
'admin',
'companies'));
55$hookmanager->initHooks(array(
'adminsocialnetworkscompany',
'globaladmin'));
62$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
66if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))) {
67 foreach ($listofnetworks as $key => $value) {
68 if (!empty($value[
'active'])) {
69 $networkconstname =
'MAIN_INFO_SOCIETE_'.strtoupper($key).
'_URL';
70 $networkconstid =
'MAIN_INFO_SOCIETE_'.strtoupper($key);
71 if (GETPOSTISSET($key.
'url') &&
GETPOST($key.
'url',
'alpha') !=
'') {
74 } elseif (GETPOSTISSET($key) &&
GETPOST($key,
'alpha') !=
'') {
75 if (!empty($listofnetworks[$key][
'url'])) {
76 $url = str_replace(
'{socialid}',
GETPOST($key,
'alpha'), $listofnetworks[$key][
'url']);
97$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
98llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-company_socialnetworks');
100print
load_fiche_titre($langs->trans(
"CompanyFoundation"),
'',
'title_setup');
106print
'<span class="opacitymedium">'.$langs->trans(
"CompanyFundationDesc", $langs->transnoentities(
"Save")).
"</span><br>\n";
107print
'<span class="opacitymedium">'.$langs->trans(
"MoreNetworksAvailableWithModule").
"</span><br>\n";
115print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
116print
'<input type="hidden" name="token" value="'.newToken().
'">';
117print
'<input type="hidden" name="action" value="update">';
120print
'<div class="div-table-responsive-no-min">';
121print
'<table class="noborder centpercent editmode">';
122print
'<tr class="liste_titre">';
123print
'<td class="titlefieldcreate">'.$langs->trans(
"SocialNetworksInformation").
'</td>';
124print
'<td>'.$langs->trans(
"SocialNetworkId").
'</td>';
125print
'<td>'.$form->textwithpicto($langs->trans(
"Url"), $langs->trans(
"KeepEmptyToUseDefault")).
'</td>';
131foreach ($listofnetworks as $key => $value) {
132 if (!empty($value[
'active'])) {
133 print
'<tr class="oddeven">';
134 print
'<td><label for="'.$key.
'url">'.$langs->trans(ucfirst($key)).
'</label></td>';
135 $networkconstname =
'MAIN_INFO_SOCIETE_'.strtoupper($key).
'_URL';
136 $networkconstid =
'MAIN_INFO_SOCIETE_'.strtoupper($key);
137 print
'<td class="nowraponall"><span class="paddingright fab '.($value[
'icon'] ? $value[
'icon'] :
'fa-link').
'"></span>';
151print $form->buttonsSaveCancel(
"Save",
'');
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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 information.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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_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...
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.
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...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.