--- /tmp/dsg/dolibarr/htdocs/adherents/admin/github_adherent.php +++ /tmp/dsg/dolibarr/htdocs/adherents/admin/client_adherent.php @@ -7,8 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,125 +39,93 @@ if (!$user->admin) accessforbidden(); -$choices = array('yesno', 'texte', 'chaine'); - -$value = GETPOST('value', 'alpha'); -$label = GETPOST('label', 'alpha'); -$scandir = GETPOST('scandir', 'alpha'); -$type = 'member'; - -$action = GETPOST('action', 'aZ09'); +$type = array('yesno', 'texte', 'chaine'); + +$action = GETPOST('action', 'alpha'); /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; - -if ($action == 'set_default') { - $ret = addDocumentModel($value, $type, $label, $scandir); - $res = true; -} elseif ($action == 'del_default') { - $ret = delDocumentModel($value, $type); - if ($ret > 0) { - if ($conf->global->MEMBER_ADDON_PDF_ODT == "$value") { - dolibarr_del_const($db, 'MEMBER_ADDON_PDF_ODT', $conf->entity); - } - } - $res = true; -} elseif ($action == 'setdoc') { - // Set default model - if (dolibarr_set_const($db, "MEMBER_ADDON_PDF_ODT", $value, 'chaine', 0, '', $conf->entity)) { - // La constante qui a ete lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage coherent - $conf->global->MEMBER_ADDON_PDF_ODT = $value; - } - - // On active le modele - $ret = delDocumentModel($value, $type); - if ($ret > 0) { - $ret = addDocumentModel($value, $type, $label, $scandir); - } - $res = true; -} elseif (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { - $code = $reg[1]; - if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } else { - dol_print_error($db); - } -} elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { - $code = $reg[1]; - if (dolibarr_del_const($db, $code, $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } else { - dol_print_error($db); - } -} elseif ($action == 'updateall') { - $db->begin(); - $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; - $res1 = dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha') ? 0 : 1, 'chaine', 0, '', $conf->entity); - $res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - $res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); - $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); - // Use vat for invoice creation - if ($conf->facture->enabled) { - $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { - $res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - } - } - if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) { - setEventMessages('ErrorFailedToSaveDate', null, 'errors'); - $db->rollback(); - } else { - setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); - $db->commit(); - } +// +if ($action == 'updateall') +{ + $db->begin(); + $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; + $res1 = dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha') ? 0 : 1, 'chaine', 0, '', $conf->entity); + $res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); + $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); + // Use vat for invoice creation + if ($conf->facture->enabled) + { + $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); + $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); + if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) + { + $res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); + } + } + if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) + { + setEventMessages('ErrorFailedToSaveDate', null, 'errors'); + $db->rollback(); + } + else + { + setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); + $db->commit(); + } } // Action to update or add a constant -if ($action == 'update' || $action == 'add') { +if ($action == 'update' || $action == 'add') +{ $constname = GETPOST('constname', 'alpha'); $constvalue = (GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue')); if (($constname == 'ADHERENT_CARD_TYPE' || $constname == 'ADHERENT_ETIQUETTE_TYPE' || $constname == 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue = ''; - if ($constname == 'ADHERENT_LOGIN_NOT_REQUIRED') { // Invert choice + if ($constname == 'ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice + { if ($constvalue) $constvalue = 0; else $constvalue = 1; } $consttype = GETPOST('consttype', 'alpha'); $constnote = GETPOST('constnote'); - $res = dolibarr_set_const($db, $constname, $constvalue, $choices[$consttype], 0, $constnote, $conf->entity); - - if (!($res > 0)) $error++; - - if (!$error) { + $res = dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); + + if (!$res > 0) $error++; + + if (!$error) + { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { + } + else + { setEventMessages($langs->trans("Error"), null, 'errors'); } } // Action to enable of a submodule of the adherent module -if ($action == 'set') { - $result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity); - if ($result < 0) { - print $db->error(); - } +if ($action == 'set') +{ + $result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity); + if ($result < 0) + { + print $db->error(); + } } // Action to disable a submodule of the adherent module -if ($action == 'unset') { - $result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity); - if ($result < 0) { - print $db->error(); - } +if ($action == 'unset') +{ + $result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity); + if ($result < 0) + { + print $db->error(); + } } @@ -180,7 +147,7 @@ $head = member_admin_prepare_head(); -print dol_get_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user'); +dol_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user'); print '
'; print ''; @@ -216,27 +183,33 @@ if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); print ''; print $form->selectarray('ADHERENT_BANK_USE', $arraychoices, $conf->global->ADHERENT_BANK_USE, 0); -if ($conf->global->ADHERENT_BANK_USE == 'bankdirect' || $conf->global->ADHERENT_BANK_USE == 'bankviainvoice') { - print '
'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'
'; +if ($conf->global->ADHERENT_BANK_USE == 'bankdirect' || $conf->global->ADHERENT_BANK_USE == 'bankviainvoice') +{ + print '
'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'
'; } print ''; print "\n"; // Use vat for invoice creation -if ($conf->facture->enabled) { +if ($conf->facture->enabled) +{ print ''.$langs->trans("VATToUseForSubscriptions").''; - if (!empty($conf->banque->enabled)) { + if (!empty($conf->banque->enabled)) + { print ''; print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0); print ''; - } else { + } + else + { print ''; print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name")); print ''; } print "\n"; - if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { + if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) + { print ''.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").''; print ''; $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0); @@ -261,12 +234,12 @@ */ $constantes = array( 'ADHERENT_CARD_TYPE', - //'ADHERENT_CARD_BACKGROUND', +// 'ADHERENT_CARD_BACKGROUND', 'ADHERENT_CARD_HEADER_TEXT', 'ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_CARD_FOOTER_TEXT' -); + ); print load_fiche_titre($langs->trans("MembersCards"), '', ''); @@ -293,139 +266,8 @@ $helptext .= '__YEAR__, __MONTH__, __DAY__'; form_constantes($constantes, 0, $helptext); -$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); - -// Defini tableau def des modeles -$def = array(); -$sql = "SELECT nom"; -$sql .= " FROM ".MAIN_DB_PREFIX."document_model"; -$sql .= " WHERE type = '".$db->escape($type)."'"; -$sql .= " AND entity = ".$conf->entity; -$resql = $db->query($sql); -if ($resql) { - $i = 0; - $num_rows = $db->num_rows($resql); - while ($i < $num_rows) { - $array = $db->fetch_array($resql); - array_push($def, $array[0]); - $i++; - } -} else { - dol_print_error($db); -} - -print load_fiche_titre($langs->trans("MembersDocModules"), '', ''); - -print ''; -print ''; -print ''; -print ''; -print '\n"; -print '\n"; -print ''; -print ''; -print "\n"; - -clearstatcache(); - -foreach ($dirmodels as $reldir) { - foreach (array('', '/doc') as $valdir) { - $dir = dol_buildpath($reldir."core/modules/member".$valdir); - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - $filelist[] = $file; - } - closedir($handle); - arsort($filelist); - foreach ($filelist as $file) { - if (preg_match('/\.class\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { - if (file_exists($dir.'/'.$file)) { - $name = substr($file, 4, dol_strlen($file) - 14); - $classname = substr($file, 0, dol_strlen($file) - 10); - - require_once $dir.'/'.$file; - $module = new $classname($db); - - $modulequalified = 1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { - $modulequalified = 0; - } - - if ($modulequalified) { - print ''; - - // Active - if (in_array($name, $def)) { - print ''; - } else { - print '"; - } - - // Defaut - print ''; - - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); - if ($module->type == 'pdf') { - $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - } - $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - - - print ''; - - // Preview - print ''; - - print "\n"; - } - } - } - } - } - } - } -} - -print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
'; - print (empty($module->name) ? $name : $module->name); - print "\n"; - if (method_exists($module, 'info')) { - print $module->info($langs); - } else { - print $module->description; - } - print ''."\n"; - print ''; - print img_picto($langs->trans("Enabled"), 'switch_on'); - print ''; - print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; - print "'; - if ($conf->global->MEMBER_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"), 'on'); - } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; - } - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print ''; - if ($module->type == 'pdf') - { - print ''.img_object($langs->trans("Preview"), 'contract').''; - } else { - print img_object($langs->trans("PreviewNotAvailable"), 'generic'); - } - print '
'; -print "
"; - -print dol_get_fiche_end(); + +dol_fiche_end(); // End of page llxFooter(); --- /tmp/dsg/dolibarr/htdocs/adherents/admin/github_adherent_emails.php +++ /tmp/dsg/dolibarr/htdocs/adherents/admin/client_adherent_emails.php @@ -41,21 +41,21 @@ $oldtypetonewone = array('texte'=>'text', 'chaine'=>'string'); // old type to new ones -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); $error = 0; // Editing global variables not related to a specific theme $constantes = array( - 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), - 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', - 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ - 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ - 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ - 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ - 'ADHERENT_MAIL_FROM'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', + 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), + 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ + 'ADHERENT_MAIL_FROM'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', ); @@ -65,41 +65,69 @@ */ // -if ($action == 'updateall') { - $db->begin(); - $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; - $res1 = dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) { - setEventMessages('ErrorFailedToSaveDate', null, 'errors'); - $db->rollback(); - } else { - setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); - $db->commit(); +if ($action == 'updateall') +{ + $db->begin(); + $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; + $res1 = dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); + if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) + { + setEventMessages('ErrorFailedToSaveDate', null, 'errors'); + $db->rollback(); + } + else + { + setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); + $db->commit(); + } +} + +// Action to update or add a constant +if ($action == 'update' || $action == 'add') +{ + $constlineid = GETPOST('rowid', 'int'); + $constname = GETPOST('constname', 'alpha'); + + $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); + $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); + $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote')); + + $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; + + $res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); + + if (!$res > 0) $error++; + + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); } } -// Action to update or add a constant -if ($action == 'update' || $action == 'add') { - $constlineid = GETPOST('rowid', 'int'); - $constname = GETPOST('constname', 'alpha'); +// Action to enable a submodule of the adherent module +if ($action == 'set') +{ + $result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity); + if ($result < 0) + { + print $db->error(); + } +} - $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alphanohtml') : GETPOST('constvalue')); - $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); - $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'restricthtml') : GETPOST('constnote')); +// Action to disable a submodule of the adherent module +if ($action == 'unset') +{ + $result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity); + if ($result < 0) + { + print $db->error(); + } +} - $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; - $constvalue = preg_replace('/:member$/', '', $constvalue); - - $res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); - - if (!($res > 0)) $error++; - - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} /* @@ -119,7 +147,7 @@ $head = member_admin_prepare_head(); -print dol_get_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); +dol_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); // TODO Use global form //print ''; @@ -136,7 +164,7 @@ //print '
'; //print '
'; -print dol_get_fiche_end(); +dol_fiche_end(); // End of page llxFooter(); --- /tmp/dsg/dolibarr/htdocs/adherents/admin/github_adherent_extrafields.php +++ /tmp/dsg/dolibarr/htdocs/adherents/admin/client_adherent_extrafields.php @@ -39,7 +39,7 @@ $type2label = array(''); foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'adherent'; //Must be the $table_element of the class that manage extrafield @@ -70,15 +70,16 @@ $head = member_admin_prepare_head(); -print dol_get_fiche_head($head, 'attributes', $langs->trans("Members"), -1, 'user'); +dol_fiche_head($head, 'attributes', $langs->trans("Members"), -1, 'user'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -print dol_get_fiche_end(); +dol_fiche_end(); // Buttons -if ($action != 'create' && $action != 'edit') { +if ($action != 'create' && $action != 'edit') +{ print '"; @@ -91,11 +92,12 @@ /* */ /* ************************************************************************** */ -if ($action == 'create') { +if ($action == 'create') +{ print '

'; print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -103,11 +105,12 @@ /* Edition of an optional field */ /* */ /* ************************************************************************** */ -if ($action == 'edit' && !empty($attrname)) { +if ($action == 'edit' && !empty($attrname)) +{ print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page --- /tmp/dsg/dolibarr/htdocs/adherents/admin/github_adherent_type_extrafields.php +++ /tmp/dsg/dolibarr/htdocs/adherents/admin/client_adherent_type_extrafields.php @@ -42,7 +42,7 @@ $type2label = array(''); foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'adherent_type'; //Must be the $table_element of the class that manage extrafield @@ -73,15 +73,16 @@ $head = member_admin_prepare_head(); -print dol_get_fiche_head($head, 'attributes_type', $langs->trans("Members"), -1, 'user'); +dol_fiche_head($head, 'attributes_type', $langs->trans("Members"), -1, 'user'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -print dol_get_fiche_end(); +dol_fiche_end(); // Buttons -if ($action != 'create' && $action != 'edit') { +if ($action != 'create' && $action != 'edit') +{ print '"; @@ -94,7 +95,8 @@ /* */ /* ************************************************************************** */ -if ($action == 'create') { +if ($action == 'create') +{ print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,7 +108,8 @@ /* Edition of an optional field */ /* */ /* ************************************************************************** */ -if ($action == 'edit' && !empty($attrname)) { +if ($action == 'edit' && !empty($attrname)) +{ print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); --- /tmp/dsg/dolibarr/htdocs/adherents/admin/github_website.php +++ /tmp/dsg/dolibarr/htdocs/adherents/admin/client_website.php @@ -33,7 +33,7 @@ // Load translation files required by the page $langs->loadLangs(array("admin", "members")); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); if (!$user->admin) accessforbidden(); @@ -42,34 +42,37 @@ * Actions */ -if ($action == 'setMEMBER_ENABLE_PUBLIC') { +if ($action == 'setMEMBER_ENABLE_PUBLIC') +{ if (GETPOST('value')) dolibarr_set_const($db, 'MEMBER_ENABLE_PUBLIC', 1, 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, 'MEMBER_ENABLE_PUBLIC', 0, 'chaine', 0, '', $conf->entity); } -if ($action == 'update') { +if ($action == 'update') +{ $public = GETPOST('MEMBER_ENABLE_PUBLIC'); $amount = GETPOST('MEMBER_NEWFORM_AMOUNT'); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE'); - $res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); - if ($forcetype < 0) $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); - else { - $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); - } - - if (!($res > 0)) $error++; - - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } + $res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); + if ($forcetype < 0) $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); + else $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); + + if (!$res > 0) $error++; + + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } } @@ -94,11 +97,12 @@ print ''; print ''; -print dol_get_fiche_head($head, 'website', $langs->trans("Members"), -1, 'user'); - -if ($conf->use_javascript_ajax) { - print "\n".''."\n"; + print ''."\n"; } @@ -135,14 +139,17 @@ $enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; -if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { +if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) +{ // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; -} else { +} +else +{ // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } @@ -152,7 +159,8 @@ print '
'; -if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { +if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) +{ print '
'; print ''; @@ -208,12 +216,13 @@ } -print dol_get_fiche_end(); +dol_fiche_end(); print ''; -if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { +if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) +{ print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':
';