Go to the documentation of this file.
28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
35 $langs->loadLangs(array(
'members',
'languages'));
38 $action =
GETPOST(
'action',
'aZ09');
39 $cancel =
GETPOST(
'cancel',
'alpha');
40 $ref =
GETPOST(
'ref',
'alphanohtml');
43 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
44 $fieldtype = (!empty($ref) ?
'ref' :
'rowid');
46 $socid = $user->socid;
57 if ($cancel == $langs->trans(
"Cancel")) {
61 if ($action ==
'delete' &&
GETPOST(
'langtodelete',
'alpha')) {
64 $result = $object->delMultiLangs(
GETPOST(
'langtodelete',
'alpha'), $user);
67 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?id='.$id);
73 if ($action ==
'vadd' && $cancel != $langs->trans(
"Cancel") && $user->rights->adherent->configurer) {
76 $current_lang = $langs->getDefaultLang();
78 $forcelangprod =
GETPOST(
"forcelangprod",
'aZ09');
81 if ($forcelangprod == $current_lang) {
82 $object->label =
GETPOST(
"libelle",
'alphanohtml');
86 $object->multilangs[$forcelangprod][
"label"] =
GETPOST(
"libelle",
'alphanohtml');
92 if ($object->setMultiLangs($user) > 0) {
101 if ($action ==
'vedit' && $cancel != $langs->trans(
"Cancel") && $user->rights->adherent->configurer) {
104 $current_lang = $langs->getDefaultLang();
106 foreach ($object->multilangs as $key => $value) {
107 if ($key == $current_lang) {
108 $object->label =
GETPOST(
"libelle-".$key,
'alphanohtml');
112 $object->multilangs[$key][
"label"] =
GETPOST(
"libelle-".$key,
'alphanohtml');
118 if ($object->setMultiLangs($user) > 0) {
127 if ($action ==
'vdelete' && $cancel != $langs->trans(
"Cancel") && $user->rights->adherent->configurer) {
130 $langtodelete =
GETPOST(
'langdel',
'alpha');
133 if ($object->delMultiLangs($langtodelete, $user) > 0) {
142 $result = $object->fetch($id);
149 $title = $langs->trans(
'MemberTypeCard');
153 $shortlabel =
dol_trunc($object->label, 16);
155 $title = $langs->trans(
'MemberType').
" ".$shortlabel.
" - ".$langs->trans(
'Translation');
157 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder';
165 $titre = $langs->trans(
"MemberType".$object->id);
169 if (!empty($object->multilangs)) {
170 foreach ($object->multilangs as $key => $value) {
178 $linkback =
'<a href="'.dol_buildpath(
'/adherents/type.php', 1).
'">'.$langs->trans(
"BackToList").
'</a>';
189 print
"\n<div class=\"tabsAction\">\n";
192 if ($user->rights->produit->creer || $user->rights->service->creer) {
193 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/adherents/type_translation.php?action=create&token='.
newToken().
'&rowid='.$object->id.
'">'.$langs->trans(
"Add").
'</a>';
194 if ($cnt_trans > 0) {
195 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/adherents/type_translation.php?action=edit&token='.
newToken().
'&rowid='.$object->id.
'">'.$langs->trans(
"Update").
'</a>';
204 if ($action ==
'edit') {
206 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
208 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
209 print
'<input type="hidden" name="token" value="'.newToken().
'">';
210 print
'<input type="hidden" name="action" value="vedit">';
211 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
213 if (!empty($object->multilangs)) {
214 foreach ($object->multilangs as $key => $value) {
217 print
'<div class="inline-block marginbottomonly">';
218 print ($s ? $s.
' ' :
'').
'<b>'.$langs->trans(
'Language_'.$key).
':</b>';
220 print
'<div class="inline-block marginbottomonly floatright">';
221 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=delete&token='.
newToken().
'&langtodelete='.$key.
'">'.
img_delete(
'',
'class="valigntextbottom"').
"</a><br>";
224 print
'<div class="underbanner clearboth"></div>';
225 print
'<table class="border centpercent">';
226 print
'<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans(
'Label').
'</td><td><input name="libelle-'.$key.
'" class="minwidth300" value="'.
dol_escape_htmltag($object->multilangs[$key][
"label"]).
'"></td></tr>';
227 print
'<tr><td class="tdtop">'.$langs->trans(
'Description').
'</td><td>';
228 $doleditor =
new DolEditor(
"desc-$key", $object->multilangs[$key][
"description"],
'', 160,
'dolibarr_notes',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3,
'90%');
229 $doleditor->Create();
236 print
$form->buttonsSaveCancel();
239 } elseif ($action !=
'create') {
240 if (!empty($object->multilangs)) {
241 foreach ($object->multilangs as $key => $value) {
243 print
'<div class="inline-block marginbottomonly">';
244 print ($s ? $s.
' ' :
'').
'<b>'.$langs->trans(
'Language_'.$key).
':</b>';
246 print
'<div class="inline-block marginbottomonly floatright">';
247 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=delete&token='.
newToken().
'&langtodelete='.$key.
'">'.
img_delete(
'',
'class="valigntextbottom"').
'</a>';
251 print
'<div class="fichecenter">';
252 print
'<div class="underbanner clearboth"></div>';
253 print
'<table class="border centpercent">';
254 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
'Label').
'</td><td>'.$object->multilangs[$key][
"label"].
'</td></tr>';
255 print
'<tr><td class="tdtop">'.$langs->trans(
'Description').
'</td><td>'.$object->multilangs[$key][
"description"].
'</td></tr>';
262 if (!$cnt_trans && $action !=
'create') {
263 print
'<div class="opacitymedium">'.$langs->trans(
'NoTranslation').
'</div>';
273 if ($action ==
'create' && $user->rights->adherent->configurer) {
275 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
278 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
279 print
'<input type="hidden" name="token" value="'.newToken().
'">';
280 print
'<input type="hidden" name="action" value="vadd">';
281 print
'<input type="hidden" name="rowid" value="'.GETPOST(
"rowid",
'int').
'">';
285 print
'<table class="border centpercent">';
286 print
'<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans(
'Language').
'</td><td>';
287 print $formadmin->select_language(
'',
'forcelangprod', 0, $object->multilangs, 1);
289 print
'<tr><td class="tdtop fieldrequired">'.$langs->trans(
'Label').
'</td><td><input name="libelle" class="minwidth300" value="'.
dol_escape_htmltag(
GETPOST(
"libelle",
'alphanohtml')).
'"></td></tr>';
290 print
'<tr><td class="tdtop">'.$langs->trans(
'Description').
'</td><td>';
291 $doleditor =
new DolEditor(
'desc',
'',
'', 160,
'dolibarr_notes',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3,
'90%');
292 $doleditor->Create();
299 print
$form->buttonsSaveCancel();
Class to manage members type.
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.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
restrictedArea($user, $features, $objectid=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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object informations.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.