29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
36 $langs->loadLangs(array(
'members',
'languages'));
39 $action =
GETPOST(
'action',
'aZ09');
40 $cancel =
GETPOST(
'cancel',
'alpha');
41 $ref =
GETPOST(
'ref',
'alphanohtml');
44 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
45 $fieldtype = (!empty($ref) ?
'ref' :
'rowid');
47 $socid = $user->socid;
58 if ($cancel == $langs->trans(
"Cancel")) {
62 if ($action ==
'delete' &&
GETPOST(
'langtodelete',
'alpha')) {
65 $result = $object->delMultiLangs(
GETPOST(
'langtodelete',
'alpha'), $user);
68 header(
"Location: ".$_SERVER[
"PHP_SELF"].
'?id='.$id);
74 if ($action ==
'vadd' && $cancel != $langs->trans(
"Cancel") && $user->hasRight(
'adherent',
'configurer')) {
77 $current_lang = $langs->getDefaultLang();
79 $forcelangprod =
GETPOST(
"forcelangprod",
'aZ09');
82 if ($forcelangprod == $current_lang) {
83 $object->label =
GETPOST(
"libelle",
'alphanohtml');
87 $object->multilangs[$forcelangprod][
"label"] =
GETPOST(
"libelle",
'alphanohtml');
93 if ($object->setMultiLangs($user) > 0) {
102 if ($action ==
'vedit' && $cancel != $langs->trans(
"Cancel") && $user->hasRight(
'adherent',
'configurer')) {
105 $current_lang = $langs->getDefaultLang();
107 foreach ($object->multilangs as $key => $value) {
108 if ($key == $current_lang) {
109 $object->label =
GETPOST(
"libelle-".$key,
'alphanohtml');
113 $object->multilangs[$key][
"label"] =
GETPOST(
"libelle-".$key,
'alphanohtml');
119 if ($object->setMultiLangs($user) > 0) {
128 if ($action ==
'vdelete' && $cancel != $langs->trans(
"Cancel") && $user->hasRight(
'adherent',
'configurer')) {
131 $langtodelete =
GETPOST(
'langdel',
'alpha');
134 if ($object->delMultiLangs($langtodelete, $user) > 0) {
143 $result = $object->fetch($id);
150 $title = $langs->trans(
'MemberTypeCard');
154 $shortlabel =
dol_trunc($object->label, 16);
156 $title = $langs->trans(
'MemberType').
" ".$shortlabel.
" - ".$langs->trans(
'Translation');
158 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder';
166 $titre = $langs->trans(
"MemberType".$object->id);
170 if (!empty($object->multilangs)) {
171 foreach ($object->multilangs as $key => $value) {
179 $linkback =
'<a href="'.dol_buildpath(
'/adherents/type.php', 1).
'">'.$langs->trans(
"BackToList").
'</a>';
190 print
"\n<div class=\"tabsAction\">\n";
193 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
194 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/adherents/type_translation.php?action=create&token='.
newToken().
'&rowid='.$object->id.
'">'.$langs->trans(
"Add").
'</a>';
195 if ($cnt_trans > 0) {
196 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/adherents/type_translation.php?action=edit&token='.
newToken().
'&rowid='.$object->id.
'">'.$langs->trans(
"Update").
'</a>';
205 if ($action ==
'edit') {
207 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
209 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
210 print
'<input type="hidden" name="token" value="'.newToken().
'">';
211 print
'<input type="hidden" name="action" value="vedit">';
212 print
'<input type="hidden" name="rowid" value="'.$object->id.
'">';
214 if (!empty($object->multilangs)) {
215 foreach ($object->multilangs as $key => $value) {
218 print
'<div class="inline-block marginbottomonly">';
219 print ($s ? $s.
' ' :
'').
'<b>'.$langs->trans(
'Language_'.$key).
':</b>';
221 print
'<div class="inline-block marginbottomonly floatright">';
222 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=delete&token='.
newToken().
'&langtodelete='.$key.
'">'.
img_delete(
'',
'class="valigntextbottom"').
"</a><br>";
225 print
'<div class="underbanner clearboth"></div>';
226 print
'<table class="border centpercent">';
227 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>';
228 print
'<tr><td class="tdtop">'.$langs->trans(
'Description').
'</td><td>';
229 $doleditor =
new DolEditor(
"desc-$key", $object->multilangs[$key][
"description"],
'', 160,
'dolibarr_notes',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_3,
'90%');
230 $doleditor->Create();
237 print
$form->buttonsSaveCancel();
240 } elseif ($action !=
'create') {
241 if (!empty($object->multilangs)) {
242 foreach ($object->multilangs as $key => $value) {
244 print
'<div class="inline-block marginbottomonly">';
245 print ($s ? $s.
' ' :
'').
'<b>'.$langs->trans(
'Language_'.$key).
':</b>';
247 print
'<div class="inline-block marginbottomonly floatright">';
248 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?rowid='.$object->id.
'&action=delete&token='.
newToken().
'&langtodelete='.$key.
'">'.
img_delete(
'',
'class="valigntextbottom"').
'</a>';
252 print
'<div class="fichecenter">';
253 print
'<div class="underbanner clearboth"></div>';
254 print
'<table class="border centpercent">';
255 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
'Label').
'</td><td>'.$object->multilangs[$key][
"label"].
'</td></tr>';
256 print
'<tr><td class="tdtop">'.$langs->trans(
'Description').
'</td><td>'.$object->multilangs[$key][
"description"].
'</td></tr>';
263 if (!$cnt_trans && $action !=
'create') {
264 print
'<div class="opacitymedium">'.$langs->trans(
'NoTranslation').
'</div>';
274 if ($action ==
'create' && $user->hasRight(
'adherent',
'configurer')) {
276 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
279 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
280 print
'<input type="hidden" name="token" value="'.newToken().
'">';
281 print
'<input type="hidden" name="action" value="vadd">';
282 print
'<input type="hidden" name="rowid" value="'.GETPOST(
"rowid",
'int').
'">';
286 print
'<table class="border centpercent">';
287 print
'<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans(
'Language').
'</td><td>';
288 print $formadmin->select_language(
'',
'forcelangprod', 0, $object->multilangs, 1);
290 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>';
291 print
'<tr><td class="tdtop">'.$langs->trans(
'Description').
'</td><td>';
292 $doleditor =
new DolEditor(
'desc',
'',
'', 160,
'dolibarr_notes',
'',
false,
true, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, ROWS_3,
'90%');
293 $doleditor->Create();
300 print
$form->buttonsSaveCancel();
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.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members type.
Class to manage a WYSIWYG editor.
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.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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_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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object informations.
restrictedArea(User $user, $features, $object=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.