Merge github.com:Dolibarr/dolibarr into dev_new_add_desc_when_select_product

This commit is contained in:
Florian HENRY 2020-10-28 08:52:29 +01:00
commit a3073be8e4
704 changed files with 8683 additions and 8630 deletions

View File

@ -222,6 +222,7 @@ NEW: standardizes API thirdparties by email like other object
NEW: thirdparty REST API: endpoint to set price level NEW: thirdparty REST API: endpoint to set price level
NEW: Use new category API for project list view NEW: Use new category API for project list view
NEW: Triggers Attributes and Attributes values NEW: Triggers Attributes and Attributes values
NEW: Add hooks on newpayment page to allow external payment modules
WARNING: WARNING:

View File

@ -252,7 +252,7 @@ if ($action == 'create') {
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
@ -314,7 +314,7 @@ if ($action == 'create') {
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
@ -364,7 +364,7 @@ if ($action == 'create') {
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
/* /*
* Actions buttons * Actions buttons

View File

@ -146,7 +146,7 @@ if (!empty($cat_id))
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '</form>'; print '</form>';

View File

@ -187,7 +187,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
@ -248,7 +248,7 @@ if ($action == 'create')
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
} else { } else {
/* /*
* Confirm delete * Confirm delete
@ -296,7 +296,7 @@ if ($action == 'create')
print "</table>"; print "</table>";
dol_fiche_end(); print dol_get_fiche_end();
if (!empty($user->rights->accounting->fiscalyear->write)) if (!empty($user->rights->accounting->fiscalyear->write))
{ {

View File

@ -386,7 +386,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
@ -573,7 +573,7 @@ if ($action == 'create')
print '</div></div><!-ee-->'; print '</div></div><!-ee-->';
dol_fiche_end(); print dol_get_fiche_end();
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
@ -719,7 +719,7 @@ if ($action == 'create')
} }
} }
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -141,7 +141,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_value
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
dol_fiche_end(); print dol_get_fiche_end();
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";

View File

@ -140,7 +140,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_value
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
dol_fiche_end(); print dol_get_fiche_end();
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";

View File

@ -453,21 +453,22 @@ class AccountingAccount extends CommonObject
*/ */
public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
{ {
global $langs, $conf, $user; global $langs, $conf;
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
$result = ''; $result = '';
$url = '';
if (empty($option) || $option == 'ledger') { if (empty($option) || $option == 'ledger') {
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; $url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
$labelurl = $langs->trans("ShowAccountingAccountInLedger"); $labelurl = $langs->trans("ShowAccountingAccountInLedger");
} elseif ($option == 'journals') { } elseif ($option == 'journals') {
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; $url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
$labelurl = $langs->trans("ShowAccountingAccountInJournals"); $labelurl = $langs->trans("ShowAccountingAccountInJournals");
} elseif ($option == 'accountcard') { } elseif ($option == 'accountcard') {
$url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id; $url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id);
$labelurl = $langs->trans("ShowAccountingAccount"); $labelurl = $langs->trans("ShowAccountingAccount");
} }

View File

@ -137,7 +137,7 @@ if (!empty($id)) {
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';

View File

@ -146,7 +146,7 @@ if (!empty($id)) {
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';

View File

@ -141,7 +141,7 @@ if (!empty($id)) {
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';

View File

@ -246,7 +246,7 @@ $helptext .= '__YEAR__, __MONTH__, __DAY__';
form_constantes($constantes, 0, $helptext); form_constantes($constantes, 0, $helptext);
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -136,7 +136,7 @@ form_constantes($constantes, 0, $helptext);
//print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>'; //print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
//print '</form>'; //print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -74,7 +74,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("Members"), -1, 'use
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -77,7 +77,7 @@ print dol_get_fiche_head($head, 'attributes_type', $langs->trans("Members"), -1,
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -208,7 +208,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
} }
dol_fiche_end(); print dol_get_fiche_end();
print '</form>'; print '</form>';

View File

@ -133,7 +133,7 @@ if ($object->id > 0) {
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
//print '<div class="tabsAction">'; //print '<div class="tabsAction">';

View File

@ -969,7 +969,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<tbody>'; print '<tbody>';
print "</table>\n"; print "</table>\n";
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">'; print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
@ -1229,7 +1229,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
@ -1608,7 +1608,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</div></div></div>\n"; print "</div></div></div>\n";
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
dol_fiche_end(); print dol_get_fiche_end();
/* /*

View File

@ -145,7 +145,7 @@ if ($id > 0) {
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
$modulepart = 'member'; $modulepart = 'member';
$permission = $user->rights->adherent->creer; $permission = $user->rights->adherent->creer;

View File

@ -285,6 +285,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.gender, a.email, a.photo, a.morphy,";
$sql .= " a.tms as datem, datefin as date_end_subscription,"; $sql .= " a.tms as datem, datefin as date_end_subscription,";
$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; $sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
@ -307,8 +308,13 @@ if ($resql) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
$staticmember->id = $obj->rowid; $staticmember->id = $obj->rowid;
$staticmember->ref = $obj->rowid;
$staticmember->lastname = $obj->lastname; $staticmember->lastname = $obj->lastname;
$staticmember->firstname = $obj->firstname; $staticmember->firstname = $obj->firstname;
$staticmember->gender = $obj->gender;
$staticmember->email = $obj->email;
$staticmember->photo = $obj->photo;
$staticmember->morphy = $obj->morphy;
if (!empty($obj->fk_soc)) { if (!empty($obj->fk_soc)) {
$staticmember->fk_soc = $obj->fk_soc; $staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty(); $staticmember->fetch_thirdparty();
@ -316,10 +322,9 @@ if ($resql) {
} else { } else {
$staticmember->name = $obj->company; $staticmember->name = $obj->company;
} }
$staticmember->ref = $staticmember->getFullName($langs);
$statictype->id = $obj->typeid; $statictype->id = $obj->typeid;
$statictype->label = $obj->label; $statictype->label = $obj->label;
print '<td class="nowraponall">'.$staticmember->getNomUrl(1, 32).'</td>'; print '<td class="nowraponall">'.$staticmember->getNomUrl(-1, 32).'</td>';
print '<td>'.$statictype->getNomUrl(1, 32).'</td>'; print '<td>'.$statictype->getNomUrl(1, 32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).'</td>'; print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).'</td>';
@ -340,7 +345,8 @@ if ($resql) {
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " datefin as date_end_subscription,"; $sql .= " a.gender, a.email, a.photo, a.morphy,";
$sql .= " a.datefin as date_end_subscription,";
$sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription"; $sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c";
$sql .= " WHERE a.entity IN (".getEntity('adherent').")"; $sql .= " WHERE a.entity IN (".getEntity('adherent').")";
@ -364,8 +370,13 @@ if ($resql) {
$subscriptionstatic->id = $obj->cid; $subscriptionstatic->id = $obj->cid;
$subscriptionstatic->ref = $obj->cid; $subscriptionstatic->ref = $obj->cid;
$staticmember->id = $obj->rowid; $staticmember->id = $obj->rowid;
$staticmember->ref = $obj->rowid;
$staticmember->lastname = $obj->lastname; $staticmember->lastname = $obj->lastname;
$staticmember->firstname = $obj->firstname; $staticmember->firstname = $obj->firstname;
$staticmember->gender = $obj->gender;
$staticmember->email = $obj->email;
$staticmember->photo = $obj->photo;
$staticmember->morphy = $obj->morphy;
if (!empty($obj->fk_soc)) { if (!empty($obj->fk_soc)) {
$staticmember->fk_soc = $obj->fk_soc; $staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty(); $staticmember->fetch_thirdparty();
@ -373,9 +384,8 @@ if ($resql) {
} else { } else {
$staticmember->name = $obj->company; $staticmember->name = $obj->company;
} }
$staticmember->ref = $staticmember->getFullName($langs);
print '<td class="nowraponall">'.$subscriptionstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall">'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>'; print '<td class="nowraponall">'.$staticmember->getNomUrl(-1, 32, 'subscription').'</td>';
print '<td class="nowraponall">'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>'; print '<td class="nowraponall">'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
print '<td class="right">'.price($obj->subscription).'</td>'; print '<td class="right">'.price($obj->subscription).'</td>';
//print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>'; //print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';

View File

@ -128,7 +128,7 @@ print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
/* /*
* Barre d'actions * Barre d'actions

View File

@ -656,6 +656,7 @@ while ($i < min($num, $limit)) {
$memberstatic->datefin = $datefin; $memberstatic->datefin = $datefin;
$memberstatic->socid = $obj->fk_soc; $memberstatic->socid = $obj->fk_soc;
$memberstatic->photo = $obj->photo; $memberstatic->photo = $obj->photo;
$memberstatic->email = $obj->email;
$memberstatic->morphy = $obj->morphy; $memberstatic->morphy = $obj->morphy;
$memberstatic->note_public = $obj->note_public; $memberstatic->note_public = $obj->note_public;
$memberstatic->note_private = $obj->note_private; $memberstatic->note_private = $obj->note_private;
@ -725,12 +726,10 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['d.morphy']['checked'])) { if (!empty($arrayfields['d.morphy']['checked'])) {
print '<td class="center">'; print '<td class="center">';
$s = ''; $s = '';
if ($obj->morphy == 'phy') if ($obj->morphy == 'phy') {
{
$s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>'; $s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>';
} }
if ($obj->morphy == 'mor') if ($obj->morphy == 'mor') {
{
$s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>'; $s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>';
} }
print $s; print $s;

View File

@ -112,7 +112,7 @@ if ($id) {
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
} }
// End of page // End of page

View File

@ -173,7 +173,7 @@ foreach ($data as $val) {
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -299,7 +299,7 @@ if ($mode) {
} }
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -219,7 +219,7 @@ print '</div></div></div>';
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -76,26 +76,26 @@ $defaultdelay = 1;
$defaultdelayunit = 'y'; $defaultdelayunit = 'y';
if ($rowid) { if ($rowid) {
// Load member // Load member
$result = $object->fetch($rowid); $result = $object->fetch($rowid);
// Define variables to know what current user can do on users // Define variables to know what current user can do on users
$canadduser = ($user->admin || $user->rights->user->user->creer); $canadduser = ($user->admin || $user->rights->user->user->creer);
// Define variables to know what current user can do on properties of user linked to edited member // Define variables to know what current user can do on properties of user linked to edited member
if ($object->user_id) { if ($object->user_id) {
// $user is the user editing, $object->user_id is the user's id linked to the edited member // $user is the user editing, $object->user_id is the user's id linked to the edited member
$caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer) $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer)
|| (($user->id != $object->user_id) && $user->rights->user->user->creer)); || (($user->id != $object->user_id) && $user->rights->user->user->creer));
$caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password) $caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|| (($user->id != $object->user_id) && $user->rights->user->user->password)); || (($user->id != $object->user_id) && $user->rights->user->user->password));
} }
} }
// Define variables to know what current user can do on members // Define variables to know what current user can do on members
$canaddmember = $user->rights->adherent->creer; $canaddmember = $user->rights->adherent->creer;
// Define variables to know what current user can do on properties of a member // Define variables to know what current user can do on properties of a member
if ($rowid) { if ($rowid) {
$caneditfieldmember = $user->rights->adherent->creer; $caneditfieldmember = $user->rights->adherent->creer;
} }
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@ -130,242 +130,242 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
} }
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) { if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) {
$error = 0; $error = 0;
if (empty($user->rights->user->user->creer)) { // If can edit only itself user, we can link to itself only if (empty($user->rights->user->user->creer)) { // If can edit only itself user, we can link to itself only
if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) { if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) {
$error++; $error++;
setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors');
} }
} }
if (!$error) { if (!$error) {
if ($_POST["userid"] != $object->user_id) { // If link differs from currently in database if ($_POST["userid"] != $object->user_id) { // If link differs from currently in database
$result = $object->setUserId($_POST["userid"]); $result = $object->setUserId($_POST["userid"]);
if ($result < 0) dol_print_error('', $object->error); if ($result < 0) dol_print_error('', $object->error);
$_POST['action'] = ''; $_POST['action'] = '';
$action = ''; $action = '';
} }
} }
} }
if ($action == 'setsocid') { if ($action == 'setsocid') {
$error = 0; $error = 0;
if (!$error) { if (!$error) {
if (GETPOST('socid', 'int') != $object->fk_soc) { // If link differs from currently in database if (GETPOST('socid', 'int') != $object->fk_soc) { // If link differs from currently in database
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
$sql .= " WHERE fk_soc = '".GETPOST('socid', 'int')."'"; $sql .= " WHERE fk_soc = '".GETPOST('socid', 'int')."'";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($obj && $obj->rowid > 0) { if ($obj && $obj->rowid > 0) {
$othermember = new Adherent($db); $othermember = new Adherent($db);
$othermember->fetch($obj->rowid); $othermember->fetch($obj->rowid);
$thirdparty = new Societe($db); $thirdparty = new Societe($db);
$thirdparty->fetch(GETPOST('socid', 'int')); $thirdparty->fetch(GETPOST('socid', 'int'));
$error++; $error++;
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors');
} }
} }
if (!$error) { if (!$error) {
$result = $object->setThirdPartyId(GETPOST('socid', 'int')); $result = $object->setThirdPartyId(GETPOST('socid', 'int'));
if ($result < 0) dol_print_error('', $object->error); if ($result < 0) dol_print_error('', $object->error);
$_POST['action'] = ''; $_POST['action'] = '';
$action = ''; $action = '';
} }
} }
} }
} }
if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !$_POST["cancel"]) { if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !$_POST["cancel"]) {
$error = 0; $error = 0;
$langs->load("banks"); $langs->load("banks");
$result = $object->fetch($rowid); $result = $object->fetch($rowid);
$result = $adht->fetch($object->typeid); $result = $adht->fetch($object->typeid);
// Subscription informations // Subscription informations
$datesubscription = 0; $datesubscription = 0;
$datesubend = 0; $datesubend = 0;
$paymentdate = 0; $paymentdate = 0;
if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"]) { if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"]) {
$datesubscription = dol_mktime(0, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $datesubscription = dol_mktime(0, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
} }
if ($_POST["endyear"] && $_POST["endmonth"] && $_POST["endday"]) { if ($_POST["endyear"] && $_POST["endmonth"] && $_POST["endday"]) {
$datesubend = dol_mktime(0, 0, 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); $datesubend = dol_mktime(0, 0, 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
} }
if ($_POST["paymentyear"] && $_POST["paymentmonth"] && $_POST["paymentday"]) { if ($_POST["paymentyear"] && $_POST["paymentmonth"] && $_POST["paymentday"]) {
$paymentdate = dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]); $paymentdate = dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
} }
$amount = price2num(GETPOST("subscription", 'alpha')); // Amount of subscription $amount = price2num(GETPOST("subscription", 'alpha')); // Amount of subscription
$label = $_POST["label"]; $label = $_POST["label"];
// Payment informations // Payment informations
$accountid = $_POST["accountid"]; $accountid = $_POST["accountid"];
$operation = $_POST["operation"]; // Payment mode $operation = $_POST["operation"]; // Payment mode
$num_chq = GETPOST("num_chq", "alphanohtml"); $num_chq = GETPOST("num_chq", "alphanohtml");
$emetteur_nom = $_POST["chqemetteur"]; $emetteur_nom = $_POST["chqemetteur"];
$emetteur_banque = $_POST["chqbank"]; $emetteur_banque = $_POST["chqbank"];
$option = $_POST["paymentsave"]; $option = $_POST["paymentsave"];
if (empty($option)) $option = 'none'; if (empty($option)) $option = 'none';
$sendalsoemail = GETPOST("sendmail", 'alpha'); $sendalsoemail = GETPOST("sendmail", 'alpha');
// Check parameters // Check parameters
if (!$datesubscription) { if (!$datesubscription) {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
$errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateSubscription")); $errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateSubscription"));
setEventMessages($errmsg, null, 'errors'); setEventMessages($errmsg, null, 'errors');
$action = 'addsubscription'; $action = 'addsubscription';
} }
if (GETPOST('end') && !$datesubend) { if (GETPOST('end') && !$datesubend) {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
$errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateEndSubscription")); $errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateEndSubscription"));
setEventMessages($errmsg, null, 'errors'); setEventMessages($errmsg, null, 'errors');
$action = 'addsubscription'; $action = 'addsubscription';
} }
if (!$datesubend) { if (!$datesubend) {
$datesubend = dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd'); $datesubend = dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd');
} }
if (($option == 'bankviainvoice' || $option == 'bankdirect') && !$paymentdate) { if (($option == 'bankviainvoice' || $option == 'bankdirect') && !$paymentdate) {
$error++; $error++;
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")); $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
setEventMessages($errmsg, null, 'errors'); setEventMessages($errmsg, null, 'errors');
$action = 'addsubscription'; $action = 'addsubscription';
} }
// Check if a payment is mandatory or not // Check if a payment is mandatory or not
if (!$error && $adht->subscription) { // Member type need subscriptions if (!$error && $adht->subscription) { // Member type need subscriptions
if (!is_numeric($amount)) { if (!is_numeric($amount)) {
// If field is '' or not a numeric value // If field is '' or not a numeric value
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
setEventMessages($errmsg, null, 'errors'); setEventMessages($errmsg, null, 'errors');
$error++; $error++;
$action = 'addsubscription'; $action = 'addsubscription';
} else { } else {
if (!empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') { if (!empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') {
if ($_POST["subscription"]) { if ($_POST["subscription"]) {
if (!$_POST["label"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); if (!$_POST["label"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
if ($_POST["paymentsave"] != 'invoiceonly' && !$_POST["operation"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); if ($_POST["paymentsave"] != 'invoiceonly' && !$_POST["operation"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
if ($_POST["paymentsave"] != 'invoiceonly' && !($_POST["accountid"] > 0)) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); if ($_POST["paymentsave"] != 'invoiceonly' && !($_POST["accountid"] > 0)) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
} else { } else {
if ($_POST["accountid"]) $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); if ($_POST["accountid"]) $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
} }
if ($errmsg) { if ($errmsg) {
$error++; $error++;
setEventMessages($errmsg, null, 'errors'); setEventMessages($errmsg, null, 'errors');
$error++; $error++;
$action = 'addsubscription'; $action = 'addsubscription';
} }
} }
} }
} }
// Record the subscription then complementary actions // Record the subscription then complementary actions
if (!$error && $action == 'subscription') { if (!$error && $action == 'subscription') {
$db->begin(); $db->begin();
// Create subscription // Create subscription
$crowid = $object->subscription($datesubscription, $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend); $crowid = $object->subscription($datesubscription, $amount, $accountid, $operation, $label, $num_chq, $emetteur_nom, $emetteur_banque, $datesubend);
if ($crowid <= 0) { if ($crowid <= 0) {
$error++; $error++;
$errmsg = $object->error; $errmsg = $object->error;
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
if (!$error) { if (!$error) {
$result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque); $result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
// If an invoice was created, it is into $object->invoice // If an invoice was created, it is into $object->invoice
} }
} }
if (!$error) { if (!$error) {
$db->commit(); $db->commit();
} else { } else {
$db->rollback(); $db->rollback();
$action = 'addsubscription'; $action = 'addsubscription';
} }
if (!$error) { if (!$error) {
setEventMessages("SubscriptionRecorded", null, 'mesgs'); setEventMessages("SubscriptionRecorded", null, 'mesgs');
} }
// Send email // Send email
if (!$error) { if (!$error) {
// Send confirmation Email // Send confirmation Email
if ($object->email && $sendalsoemail) { // $object is 'Adherent' if ($object->email && $sendalsoemail) { // $object is 'Adherent'
$subject = ''; $subject = '';
$msg = ''; $msg = '';
// Send subscription email // Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db); $formmail = new FormMail($db);
// Set output language // Set output language
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members"));
// Get email content from template // Get email content from template
$arraydefaultmessage = null; $arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
$subject = $arraydefaultmessage->topic; $subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content; $msg = $arraydefaultmessage->content;
} }
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs);
// Attach a file ? // Attach a file ?
$file = ''; $file = '';
$listofpaths = array(); $listofpaths = array();
$listofnames = array(); $listofnames = array();
$listofmimes = array(); $listofmimes = array();
if (is_object($object->invoice)) { if (is_object($object->invoice)) {
$invoicediroutput = $conf->facture->dir_output; $invoicediroutput = $conf->facture->dir_output;
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+'); $fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
$file = $fileparams['fullname']; $file = $fileparams['fullname'];
$listofpaths = array($file); $listofpaths = array($file);
$listofnames = array(basename($file)); $listofnames = array(basename($file));
$listofmimes = array(dol_mimetype($file)); $listofmimes = array(dol_mimetype($file));
} }
$moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n"; $moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n";
$result = $object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1, '', $moreinheader); $result = $object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1, '', $moreinheader);
if ($result < 0) { if ($result < 0) {
$errmsg = $object->error; $errmsg = $object->error;
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs'); setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs');
} }
} else { } else {
setEventMessages($langs->trans("NoEmailSentToMember"), null, 'mesgs'); setEventMessages($langs->trans("NoEmailSentToMember"), null, 'mesgs');
} }
} }
// Clean some POST vars // Clean some POST vars
if (!$error) { if (!$error) {
$_POST["subscription"] = ''; $_POST["subscription"] = '';
$_POST["accountid"] = ''; $_POST["accountid"] = '';
$_POST["operation"] = ''; $_POST["operation"] = '';
$_POST["label"] = ''; $_POST["label"] = '';
$_POST["num_chq"] = ''; $_POST["num_chq"] = '';
} }
} }
} }
@ -393,32 +393,32 @@ if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
if ($rowid > 0) { if ($rowid > 0) {
$res = $object->fetch($rowid); $res = $object->fetch($rowid);
if ($res < 0) { dol_print_error($db, $object->error); exit; } if ($res < 0) { dol_print_error($db, $object->error); exit; }
$adht->fetch($object->typeid); $adht->fetch($object->typeid);
$head = member_prepare_head($object); $head = member_prepare_head($object);
$rowspan = 10; $rowspan = 10;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if (!empty($conf->societe->enabled)) $rowspan++; if (!empty($conf->societe->enabled)) $rowspan++;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="rowid" value="'.$object->id.'">'; print '<input type="hidden" name="rowid" value="'.$object->id.'">';
print dol_get_fiche_head($head, 'subscription', $langs->trans("Member"), -1, 'user'); print dol_get_fiche_head($head, 'subscription', $langs->trans("Member"), -1, 'user');
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback); dol_banner_tab($object, 'rowid', $linkback);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
// Login // Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
@ -443,20 +443,20 @@ if ($rowid > 0) {
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass); print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) { if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
$langs->load("errors"); $langs->load("errors");
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount"); $htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning'); print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
} }
print '</td></tr>'; print '</td></tr>';
} }
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">'; print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Birthday // Birthday
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
@ -472,25 +472,25 @@ if ($rowid > 0) {
print '</td></tr>'; print '</td></tr>';
} }
// Other attributes // Other attributes
$cols = 2; $cols = 2;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Date end subscription // Date end subscription
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">'; print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
if ($object->datefin) { if ($object->datefin) {
print dol_print_date($object->datefin, 'day'); print dol_print_date($object->datefin, 'day');
if ($object->hasDelay()) { if ($object->hasDelay()) {
print " ".img_warning($langs->trans("Late")); print " ".img_warning($langs->trans("Late"));
} }
} else { } else {
if (!$adht->subscription) { if (!$adht->subscription) {
print $langs->trans("SubscriptionNotRecorded"); print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
} else { } else {
print $langs->trans("SubscriptionNotReceived"); print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
} }
} }
print '</td></tr>'; print '</td></tr>';
@ -555,7 +555,7 @@ if ($rowid > 0) {
print "</div></div></div>\n"; print "</div></div></div>\n";
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
dol_fiche_end(); print dol_get_fiche_end();
print '</form>'; print '</form>';
@ -660,71 +660,71 @@ if ($rowid > 0) {
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
} }
$accountstatic->ref = $objp->ref; $accountstatic->ref = $objp->ref;
print $accountstatic->getNomUrl(1); print $accountstatic->getNomUrl(1);
} else { } else {
print '&nbsp;'; print '&nbsp;';
} }
print '</td>'; print '</td>';
} }
print "</tr>"; print "</tr>";
$i++; $i++;
} }
if (empty($num)) { if (empty($num)) {
$colspan = 6; $colspan = 6;
if (!empty($conf->banque->enabled)) $colspan++; if (!empty($conf->banque->enabled)) $colspan++;
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
} }
print "</table>"; print "</table>";
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} }
if (($action != 'addsubscription' && $action != 'create_thirdparty')) { if (($action != 'addsubscription' && $action != 'create_thirdparty')) {
// Shon online payment link // Shon online payment link
$useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled));
if ($useonlinepayment) { if ($useonlinepayment) {
print '<br>'; print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref); print showOnlinePaymentUrl('membersubscription', $object->ref);
print '<br>'; print '<br>';
} }
} }
/* /*
* Add new subscription form * Add new subscription form
*/ */
if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->rights->adherent->cotisation->creer) { if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->rights->adherent->cotisation->creer) {
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("NewCotisation")); print load_fiche_titre($langs->trans("NewCotisation"));
// Define default choice for complementary actions // Define default choice for complementary actions
$bankdirect = 0; // 1 means option by default is write to bank direct with no invoice $bankdirect = 0; // 1 means option by default is write to bank direct with no invoice
$invoiceonly = 0; // 1 means option by default is invoice only $invoiceonly = 0; // 1 means option by default is invoice only
$bankviainvoice = 0; // 1 means option by default is write to bank via invoice $bankviainvoice = 0; // 1 means option by default is write to bank via invoice
if (GETPOST('paymentsave')) { if (GETPOST('paymentsave')) {
if (GETPOST('paymentsave') == 'bankdirect') $bankdirect = 1; if (GETPOST('paymentsave') == 'bankdirect') $bankdirect = 1;
if (GETPOST('paymentsave') == 'invoiceonly') $invoiceonly = 1; if (GETPOST('paymentsave') == 'invoiceonly') $invoiceonly = 1;
if (GETPOST('paymentsave') == 'bankviainvoice') $bankviainvoice = 1; if (GETPOST('paymentsave') == 'bankviainvoice') $bankviainvoice = 1;
} else { } else {
if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $bankviainvoice = 1; if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $bankviainvoice = 1;
elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) $bankdirect = 1; elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) $bankdirect = 1;
elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $invoiceonly = 1; elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $invoiceonly = 1;
} }
print "\n\n<!-- Form add subscription -->\n"; print "\n\n<!-- Form add subscription -->\n";
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
//var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE)); //var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE));
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () { print '$(document).ready(function () {
$(".bankswitchclass, .bankswitchclass2").'.(($bankdirect || $bankviainvoice) ? 'show()' : 'hide()').'; $(".bankswitchclass, .bankswitchclass2").'.(($bankdirect || $bankviainvoice) ? 'show()' : 'hide()').';
$("#none, #invoiceonly").click(function() { $("#none, #invoiceonly").click(function() {
$(".bankswitchclass").hide(); $(".bankswitchclass").hide();
@ -750,10 +750,10 @@ if ($rowid > 0) {
} }
}); });
'; ';
if (GETPOST('paymentsave')) print '$("#'.GETPOST('paymentsave').'").prop("checked",true);'; if (GETPOST('paymentsave')) print '$("#'.GETPOST('paymentsave').'").prop("checked",true);';
print '});'; print '});';
print '</script>'."\n"; print '</script>'."\n";
} }
// Confirm create third party // Confirm create third party
@ -778,16 +778,16 @@ if ($rowid > 0) {
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) { if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) {
$tmpcompany = new Societe($db); $tmpcompany = new Societe($db);
$tmpcompany->name = $companyname; $tmpcompany->name = $companyname;
$tmpcompany->get_codeclient($tmpcompany, 0); $tmpcompany->get_codeclient($tmpcompany, 0);
$customercode = $tmpcompany->code_client; $customercode = $tmpcompany->code_client;
$formquestion[] = array( $formquestion[] = array(
'label' => $langs->trans("CustomerCode"), 'label' => $langs->trans("CustomerCode"),
'type' => 'text', 'type' => 'text',
'name' => 'customercode', 'name' => 'customercode',
'value' => $customercode, 'value' => $customercode,
'morecss' => 'minwidth300', 'morecss' => 'minwidth300',
'moreattr' => 'maxlength="128"', 'moreattr' => 'maxlength="128"',
); );
} }
// @todo Add other extrafields mandatory for thirdparty creation // @todo Add other extrafields mandatory for thirdparty creation
@ -795,99 +795,99 @@ if ($rowid > 0) {
} }
print '<form name="subscription" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="subscription" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="subscription">'; print '<input type="hidden" name="action" value="subscription">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">'; print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->company).'">'; print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->company).'">';
print dol_get_fiche_head(''); print dol_get_fiche_head('');
print "<table class=\"border\" width=\"100%\">\n"; print "<table class=\"border\" width=\"100%\">\n";
print '<tbody>'; print '<tbody>';
$today = dol_now(); $today = dol_now();
$datefrom = 0; $datefrom = 0;
$dateto = 0; $dateto = 0;
$paymentdate = -1; $paymentdate = -1;
// Date payment // Date payment
if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday')) { if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday')) {
$paymentdate = dol_mktime(0, 0, 0, GETPOST('paymentmonth'), GETPOST('paymentday'), GETPOST('paymentyear')); $paymentdate = dol_mktime(0, 0, 0, GETPOST('paymentmonth'), GETPOST('paymentday'), GETPOST('paymentyear'));
} }
print '<tr>'; print '<tr>';
// Date start subscription // Date start subscription
print '<td class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>'; print '<td class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>';
if (GETPOST('reday')) { if (GETPOST('reday')) {
$datefrom = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
} }
if (!$datefrom) { if (!$datefrom) {
$datefrom = $object->datevalid; $datefrom = $object->datevalid;
if ($object->datefin > 0) { if ($object->datefin > 0) {
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd'); $datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} }
} }
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1); print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
print "</td></tr>"; print "</td></tr>";
// Date end subscription // Date end subscription
if (GETPOST('endday')) { if (GETPOST('endday')) {
$dateto = dol_mktime(0, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $dateto = dol_mktime(0, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
} }
if (!$dateto) { if (!$dateto) {
$dateto = -1; // By default, no date is suggested $dateto = -1; // By default, no date is suggested
} }
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>'; print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0); print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0);
print "</td></tr>"; print "</td></tr>";
if ($adht->subscription) { if ($adht->subscription) {
// Amount // Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.GETPOST('subscription').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.GETPOST('subscription').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Label // Label
print '<tr><td>'.$langs->trans("Label").'</td>'; print '<tr><td>'.$langs->trans("Label").'</td>';
print '<td><input name="label" type="text" size="32" value="'; print '<td><input name="label" type="text" size="32" value="';
if (empty($conf->global->MEMBER_NO_DEFAULT_LABEL)) print $langs->trans("Subscription").' '.dol_print_date(($datefrom ? $datefrom : time()), "%Y"); if (empty($conf->global->MEMBER_NO_DEFAULT_LABEL)) print $langs->trans("Subscription").' '.dol_print_date(($datefrom ? $datefrom : time()), "%Y");
print '"></td></tr>'; print '"></td></tr>';
// Complementary action // Complementary action
if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) {
$company = new Societe($db); $company = new Societe($db);
if ($object->fk_soc) { if ($object->fk_soc) {
$result = $company->fetch($object->fk_soc); $result = $company->fetch($object->fk_soc);
} }
// Title payments // Title payments
//print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>'; //print '<tr><td colspan="2"><b>'.$langs->trans("Payment").'</b></td></tr>';
// No more action // No more action
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions'); print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>'; print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>';
// Add entry into bank accoun // Add entry into bank accoun
if (!empty($conf->banque->enabled)) { if (!empty($conf->banque->enabled)) {
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : ''); print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
print '> '.$langs->trans("MoreActionBankDirect").'<br>'; print '> '.$langs->trans("MoreActionBankDirect").'<br>';
} }
// Add invoice with no payments // Add invoice with no payments
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : ''); print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled'; //if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionInvoiceOnly"); print '> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else { else {
print ' ('; print ' (';
if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
print $langs->trans("NoThirdPartyAssociatedToMember"); print $langs->trans("NoThirdPartyAssociatedToMember");
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'; print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">';
print $langs->trans("CreateDolibarrThirdParty"); print $langs->trans("CreateDolibarrThirdParty");
print '</a>)'; print '</a>)';
} }
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>'; if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>';
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
$prodtmp = new Product($db); $prodtmp = new Product($db);
$result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); $result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
@ -896,23 +896,23 @@ if ($rowid > 0) {
} }
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
} }
print '<br>'; print '<br>';
} }
// Add invoice with payments // Add invoice with payments
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : ''); print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled'; //if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionBankViaInvoice"); print '> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else { else {
print ' ('; print ' (';
if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
print $langs->trans("NoThirdPartyAssociatedToMember"); print $langs->trans("NoThirdPartyAssociatedToMember");
print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'; print ' - <a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">';
print $langs->trans("CreateDolibarrThirdParty"); print $langs->trans("CreateDolibarrThirdParty");
print '</a>)'; print '</a>)';
} }
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>'; if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. <span class="opacitymedium">'.$langs->trans("NoVatOnSubscription", 0).'</span>';
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
$prodtmp = new Product($db); $prodtmp = new Product($db);
$result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); $result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
@ -1020,7 +1020,7 @@ if ($rowid > 0) {
print '</tbody>'; print '</tbody>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.$langs->trans("AddSubscription").'">'; print '<input type="submit" class="button" name="add" value="'.$langs->trans("AddSubscription").'">';

View File

@ -232,7 +232,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
@ -335,7 +335,7 @@ if ($rowid && $action != 'edit') {
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
/* /*
* Barre d'actions * Barre d'actions

View File

@ -72,7 +72,7 @@ print '</td></tr></table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -142,6 +142,7 @@ $now = dol_now();
// List of subscriptions // List of subscriptions
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,"; $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,";
$sql .= " d.gender, d.email, d.morphy,";
$sql .= " c.rowid as crowid, c.fk_type, c.subscription,"; $sql .= " c.rowid as crowid, c.fk_type, c.subscription,";
$sql .= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,"; $sql .= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
$sql .= " c.fk_bank as bank, c.note,"; $sql .= " c.fk_bank as bank, c.note,";
@ -151,8 +152,7 @@ $sql .= " JOIN ".MAIN_DB_PREFIX."subscription as c on d.rowid = c.fk_adherent";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")";
if (isset($date_select) && $date_select != '') if (isset($date_select) && $date_select != '') {
{
$sql .= " AND c.dateadh >= '".((int) $date_select)."-01-01 00:00:00'"; $sql .= " AND c.dateadh >= '".((int) $date_select)."-01-01 00:00:00'";
$sql .= " AND c.dateadh < '".((int) $date_select + 1)."-01-01 00:00:00'"; $sql .= " AND c.dateadh < '".((int) $date_select + 1)."-01-01 00:00:00'";
} }
@ -403,6 +403,9 @@ while ($i < min($num, $limit)) {
$adherent->statut = $obj->statut; $adherent->statut = $obj->statut;
$adherent->login = $obj->login; $adherent->login = $obj->login;
$adherent->photo = $obj->photo; $adherent->photo = $obj->photo;
$adherent->gender = $obj->gender;
$adherent->morphy = $obj->morphy;
$adherent->email = $obj->email;
$adherent->typeid = $obj->type; $adherent->typeid = $obj->type;
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid); $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);

View File

@ -358,7 +358,7 @@ if ($action == 'create') {
print '<tbody>'; print '<tbody>';
print "</table>\n"; print "</table>\n";
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
@ -433,7 +433,7 @@ if ($rowid > 0) {
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
/* /*
* Buttons * Buttons
@ -759,7 +759,7 @@ if ($rowid > 0) {
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';

View File

@ -114,7 +114,7 @@ print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
/* /*
* Action bar * Action bar

View File

@ -166,7 +166,7 @@ $linkback = '<a href="'.dol_buildpath('/adherents/type.php', 1).'">'.$langs->tra
dol_banner_tab($object, 'rowid', $linkback); dol_banner_tab($object, 'rowid', $linkback);
dol_fiche_end(); print dol_get_fiche_end();
@ -272,7 +272,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';

View File

@ -197,7 +197,7 @@ if (!empty($triggers))
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">'; print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';

View File

@ -78,7 +78,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("Agenda"), -1, 'acti
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -224,7 +224,7 @@ while ($i <= $MAXAGENDA)
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">'; print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';

View File

@ -376,7 +376,7 @@ print '</td></tr>'."\n";
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>'; print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';

View File

@ -229,7 +229,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2)
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
//print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>'; //print '<div class="center"><input class="button" type="submit" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'"></div>';

View File

@ -135,7 +135,7 @@ print "</tr>";
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";

View File

@ -495,7 +495,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
print "</tr>\n"; print "</tr>\n";
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">'; print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';

View File

@ -75,7 +75,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("BankSetupModule"),
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -74,7 +74,7 @@ print dol_get_fiche_head($head, 'bom_extrafields', $langs->trans("ExtraFields"),
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -266,7 +266,7 @@ print "<br>";
print '</table>'."\n"; print '</table>'."\n";
dol_fiche_end(); print dol_get_fiche_end();
print '</form>'; print '</form>';

View File

@ -83,7 +83,7 @@ print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Rece
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -88,9 +88,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity); dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity);
} }
$db->begin(); $db->begin();
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
@ -141,8 +141,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
// Create thumbs of logo (Note that PDF use original file and not thumbs) // Create thumbs of logo (Note that PDF use original file and not thumbs)
if ($isimage > 0) if ($isimage > 0)
{ {
// Create thumbs // Create thumbs
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get... //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get...
// Create small thumb, Used on logon for example // Create small thumb, Used on logon for example
$imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
@ -269,7 +269,7 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb
$reg = array(); $reg = array();
// Create thumbs // Create thumbs
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get... //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get...
// Create small thumb. Used on logon for example // Create small thumb. Used on logon for example
@ -777,8 +777,8 @@ if ($mysoc->useLocalTax(2))
$tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i>\n" : ""); $tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i>\n" : "");
if (!isOnlyOneLocalTax(2)) if (!isOnlyOneLocalTax(2))
{ {
print '<br><label for="lt2">'.$langs->trans("LTRate").'</label>: '; print '<br><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
} }
print '<br><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: '; print '<br><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);

View File

@ -488,7 +488,7 @@ print '</div>';
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -148,7 +148,7 @@ if ($action == 'edit')
} }
dol_fiche_end(); print dol_get_fiche_end();
/*print '<div class="center">'; /*print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";

View File

@ -401,7 +401,7 @@ if ($result)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
print "</form>\n"; print "</form>\n";

View File

@ -80,7 +80,7 @@ print dol_get_fiche_head($head, 'attributes_receivings', $langs->trans("Receivin
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -81,7 +81,7 @@ print dol_get_fiche_head($head, 'attributeslines_receivings', $langs->trans("Rec
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -881,7 +881,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if (in_array($rowidcol, array('code', 'code_iso'))) { if (in_array($rowidcol, array('code', 'code_iso'))) {
$sql .= " WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; $sql .= " WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
} else { } else {
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid); $sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
} }
if (in_array('entity', $listfieldmodify)) $sql .= " AND entity = '".getEntity($tabname[$id])."'"; if (in_array('entity', $listfieldmodify)) $sql .= " AND entity = '".getEntity($tabname[$id])."'";

View File

@ -84,7 +84,7 @@ print dol_get_fiche_head($head, 'attributes_ecm_directories', $langs->trans("ECM
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -84,7 +84,7 @@ print dol_get_fiche_head($head, 'attributes_ecm_files', $langs->trans("ECM"), -1
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -261,7 +261,7 @@ if ($action == 'create') {
print '</table>'."\n"; print '</table>'."\n";
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">';
@ -295,7 +295,7 @@ if (($id || $ref) && $action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print ' &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
@ -655,7 +655,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="clearboth"></div><br>'; print '<div class="clearboth"></div><br>';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons for actions // Buttons for actions
if ($action != 'presend' && $action != 'editline') { if ($action != 'presend' && $action != 'editline') {

View File

@ -125,7 +125,7 @@ foreach ($eventstolog as $key => $arr)
} }
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";

View File

@ -80,7 +80,7 @@ print dol_get_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings")
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -81,7 +81,7 @@ print dol_get_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendi
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -480,7 +480,7 @@ print '</div>';
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -74,7 +74,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), -
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -180,7 +180,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -338,7 +338,7 @@ echo '<script type="text/javascript"> $(function() {
}); </script>'; }); </script>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -103,7 +103,7 @@ print '</table>';
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -802,7 +802,7 @@ print '</table>';
print "</div>\n"; print "</div>\n";
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -140,7 +140,7 @@ _updateBtn();
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -282,7 +282,7 @@ print '<br>';
if ($conf->global->MAIN_FEATURES_LEVEL < 2) { if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();
@ -501,7 +501,7 @@ print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -74,7 +74,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("Holidays"), -1, 'ho
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -93,7 +93,7 @@ print '</table>';
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -251,7 +251,7 @@ print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -246,7 +246,7 @@ print '</table>';
print info_admin($langs->trans("LDAPDescValues")); print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -180,7 +180,7 @@ print '</table>';
print info_admin($langs->trans("LDAPDescValues")); print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -366,7 +366,7 @@ print '</table>';
print info_admin($langs->trans("LDAPDescValues")); print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -162,7 +162,7 @@ print '</table>';
print info_admin($langs->trans("LDAPDescValues")); print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -336,7 +336,7 @@ print '</table>';
print info_admin($langs->trans("LDAPDescValues")); print info_admin($langs->trans("LDAPDescValues"));
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -201,7 +201,7 @@ if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY
{ {
if (!empty($aCurrencies) && count($aCurrencies) > 1) if (!empty($aCurrencies) && count($aCurrencies) > 1)
{ {
dol_fiche_end(); print dol_get_fiche_end();
} }
} }

View File

@ -198,7 +198,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN))
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>'; print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
@ -212,7 +212,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN))
$link .= '</a>'; $link .= '</a>';
print load_fiche_titre($langs->trans('MailmanTitle'), $link, ''); print load_fiche_titre($langs->trans('MailmanTitle'), $link, '');
dol_fiche_end(); print dol_get_fiche_end();
} }

View File

@ -506,7 +506,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
@ -529,211 +529,215 @@ if ($action == 'edit')
if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) print img_warning($langs->trans("Disabled")); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) print img_warning($langs->trans("Disabled"));
print '</td></tr>'; print '</td></tr>';
// Force e-mail recipient if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.$conf->global->MAIN_MAIL_FORCE_SENDTO; // Force e-mail recipient
if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.$conf->global->MAIN_MAIL_FORCE_SENDTO;
{ if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail")); {
else print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail"));
else print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
}
print '</td></tr>';
} }
print '</td></tr>';
print '</table>'; print '</table>';
print '<br>'; if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
print '<br>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td></td></tr>'; print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td></td></tr>';
// Method // Method
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE];
if (empty($text)) $text = $langs->trans("Undefined").img_warning(); if (empty($text)) $text = $langs->trans("Undefined").img_warning();
print $text; print $text;
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
print $form->textwithpicto('', $langs->trans("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD"), 1, 'warning'); print $form->textwithpicto('', $langs->trans("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD"), 1, 'warning');
} }
print '</td></tr>'; print '</td></tr>';
// Host server // Host server
if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} else {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'</td></tr>';
}
// Port
if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} else {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'</td></tr>';
}
// SMTPS ID
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.$conf->global->MAIN_MAIL_SMTPS_ID.'</td></tr>';
}
// SMTPS PW
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'</td></tr>';
}
// TLS
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
if (function_exists('openssl_open'))
{ {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS); print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } else {
} else print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'</td></tr>';
print '</td></tr>'; }
// STARTTLS // Port
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>'; if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail'))
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
if (function_exists('openssl_open'))
{ {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS); print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } else {
} else print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'</td></tr>';
print '</td></tr>'; }
// SMTP_ALLOW_SELF_SIGNED // SMTPS ID
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>'; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
if (function_exists('openssl_open'))
{ {
print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED); print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.$conf->global->MAIN_MAIL_SMTPS_ID.'</td></tr>';
} else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; }
} else print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '</td></tr>';
// SMTPS PW
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'</td></tr>';
}
if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') // TLS
{ print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
// DKIM if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer')))
{ {
if (function_exists('openssl_open')) if (function_exists('openssl_open'))
{ {
print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED); print yn($conf->global->MAIN_MAIL_EMAIL_TLS);
} else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
} else print yn(0).' ('.$langs->trans("NotSupported").')'; } else print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '</td></tr>'; print '</td></tr>';
// Domain // STARTTLS
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
print '</td></tr>';
// Selector
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR;
print '</td></tr>';
// PRIVATE KEY
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY;
print '</td></tr>';
}
print '</table>';
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
print info_admin($langs->trans("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning');
}
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
// From
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_FROM;
if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
print '</td></tr>';
// Default from type
$liste = array();
$liste['user'] = $langs->trans('UserEmail');
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
$sql .= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')';
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{ {
$obj = $db->fetch_object($resql); if (function_exists('openssl_open'))
if ($obj)
{ {
$liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS);
} } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
$i++; } else print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
} print '</td></tr>';
} else dol_print_error($db);
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td>'; // SMTP_ALLOW_SELF_SIGNED
print '<td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))
{
print $langs->trans('RobotEmail');
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
{
print $langs->trans('UserEmail');
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
{
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
} else {
$id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE);
if ($id > 0)
{ {
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; if (function_exists('openssl_open'))
$emailsenderprofile = new EmailSenderProfile($db); {
$emailsenderprofile->fetch($id); print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED);
print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
} else print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '</td></tr>';
if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer')
{
// DKIM
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer')))
{
if (function_exists('openssl_open'))
{
print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED);
} else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
} else print yn(0).' ('.$langs->trans("NotSupported").')';
print '</td></tr>';
// Domain
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN;
print '</td></tr>';
// Selector
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR;
print '</td></tr>';
// PRIVATE KEY
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY;
print '</td></tr>';
} }
print '</table>';
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
print info_admin($langs->trans("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning');
}
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
// From
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).'</td>';
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_FROM;
if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
print '</td></tr>';
// Default from type
$liste = array();
$liste['user'] = $langs->trans('UserEmail');
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
$sql .= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')';
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
$liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>';
}
$i++;
}
} else dol_print_error($db);
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td>';
print '<td>';
if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot')
{
print $langs->trans('RobotEmail');
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
{
print $langs->trans('UserEmail');
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
{
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
} else {
$id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE);
if ($id > 0)
{
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
$emailsenderprofile = new EmailSenderProfile($db);
$emailsenderprofile->fetch($id);
print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>');
}
}
print '</td></tr>';
// Errors To
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_ERRORS_TO;
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail"));
print '</td></tr>';
// Autocopy to
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'</td>';
print '<td>';
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO))
{
print $conf->global->MAIN_MAIL_AUTOCOPY_TO;
if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
} else {
print '&nbsp;';
}
print '</td></tr>';
//Add user to select destinaries list
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'</td></tr>';
print '</table>';
} }
print '</td></tr>';
// Errors To print dol_get_fiche_end();
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
print '<td>'.$conf->global->MAIN_MAIL_ERRORS_TO;
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail"));
print '</td></tr>';
// Autocopy to
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'</td>';
print '<td>';
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO))
{
print $conf->global->MAIN_MAIL_AUTOCOPY_TO;
if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
} else {
print '&nbsp;';
}
print '</td></tr>';
//Add user to select destinaries list
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'</td></tr>';
print '</table>';
dol_fiche_end();
// Actions button // Actions button
@ -741,21 +745,23 @@ if ($action == 'edit')
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
{ if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike)
if (function_exists('fsockopen') && $port && $server)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>'; if (function_exists('fsockopen') && $port && $server)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
}
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
} }
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
}
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init#formmailbeforetitle">'.$langs->trans("DoTestSend").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init#formmailbeforetitle">'.$langs->trans("DoTestSend").'</a>';
if (!empty($conf->fckeditor->enabled)) if (!empty($conf->fckeditor->enabled))
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&mode=init#formmailbeforetitle">'.$langs->trans("DoTestSendHTML").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&mode=init#formmailbeforetitle">'.$langs->trans("DoTestSendHTML").'</a>';
}
} }
print '</div>'; print '</div>';
@ -886,7 +892,7 @@ if ($action == 'edit')
print $formmail->get_form('addfile', 'removefile'); print $formmail->get_form('addfile', 'removefile');
dol_fiche_end(); print dol_get_fiche_end();
// References // References
print '<span class="opacitymedium">'.$langs->trans("EMailsWillHaveMessageID").': '; print '<span class="opacitymedium">'.$langs->trans("EMailsWillHaveMessageID").': ';

View File

@ -384,7 +384,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
@ -475,7 +475,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
@ -599,7 +599,7 @@ if ($action == 'edit')
print $formmail->get_form('addfile', 'removefile'); print $formmail->get_form('addfile', 'removefile');
dol_fiche_end(); print dol_get_fiche_end();
} }
} }

View File

@ -645,7 +645,7 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n
print $formfile->showdocuments('massfilesarea_emailsenderprofile', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); print $formfile->showdocuments('massfilesarea_emailsenderprofile', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
} }
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -953,7 +953,7 @@ print '</div>';
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -361,7 +361,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
@ -441,7 +441,7 @@ if ($action == 'edit')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
if ($conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) if ($conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
@ -565,7 +565,7 @@ if ($action == 'edit')
print $formmail->get_form('addfile', 'removefile'); print $formmail->get_form('addfile', 'removefile');
dol_fiche_end(); print dol_get_fiche_end();
} }
} }

View File

@ -206,7 +206,7 @@ print '</tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';

View File

@ -398,7 +398,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
@ -507,7 +507,7 @@ if ($action == 'create')
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
// Bouton // Bouton
print '<div class="center">'; print '<div class="center">';

View File

@ -554,7 +554,7 @@ if ($mode == 'changelog')
print $text; print $text;
dol_fiche_end(); print dol_get_fiche_end();
print '</div>'; print '</div>';

View File

@ -883,7 +883,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
} }
} }
dol_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';
@ -916,7 +916,7 @@ if ($mode == 'marketplace')
print "</table>\n"; print "</table>\n";
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';
@ -1136,7 +1136,7 @@ if ($mode == 'deploy')
} }
} }
dol_fiche_end(); print dol_get_fiche_end();
} }
if ($mode == 'develop') if ($mode == 'develop')
@ -1170,7 +1170,7 @@ if ($mode == 'develop')
print "</table>\n"; print "</table>\n";
dol_fiche_end(); print dol_get_fiche_end();
} }
// End of page // End of page

View File

@ -74,7 +74,7 @@ print dol_get_fiche_head($head, 'mrp_extrafields', $langs->trans("ExtraFields"),
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -141,7 +141,7 @@ foreach ($list as $key)
print '</table>'."\n"; print '</table>'."\n";
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';

View File

@ -402,7 +402,7 @@ if ($mode == 'userconf' && $user->admin)
print '</table>'; print '</table>';
} }
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -77,7 +77,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("Orders"), -1, 'orde
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -78,7 +78,7 @@ print dol_get_fiche_head($head, 'attributeslines', $langs->trans("Orders"), -1,
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -262,7 +262,7 @@ print "</td></tr>\n";
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';

View File

@ -361,7 +361,7 @@ foreach ($dirmodels as $reldir)
*/ */
dol_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';

View File

@ -260,7 +260,7 @@ if ($result)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir)
*/ */
dol_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';

View File

@ -197,7 +197,7 @@ print '</tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';

View File

@ -354,7 +354,7 @@ if ($mode == 'config' && $user->admin) {
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '</form>'; print '</form>';
@ -460,7 +460,7 @@ if ($mode == 'template' && $user->admin) {
} }
print '</form>'; print '</form>';
dol_fiche_end(); print dol_get_fiche_end();
print '<br>'; print '<br>';

View File

@ -83,7 +83,7 @@ print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Reception
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -142,7 +142,7 @@ print '</form>';
//RESOURCE_HIDE_ADD_CONTACT_USER //RESOURCE_HIDE_ADD_CONTACT_USER
//RESOURCE_HIDE_ADD_CONTACT_THIPARTY //RESOURCE_HIDE_ADD_CONTACT_THIPARTY
dol_fiche_end(); print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -77,7 +77,7 @@ print dol_get_fiche_head($head, 'attributes', $langs->trans("ResourceSingular"),
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
dol_fiche_end(); print dol_get_fiche_end();
// Buttons // Buttons

View File

@ -177,7 +177,7 @@ print '</tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'"></div>';

View File

@ -184,7 +184,7 @@ print '</tr>';
print '</table>'; print '</table>';
dol_fiche_end(); print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'"></div>';

Some files were not shown because too many files have changed in this diff Show More