add new rule

This commit is contained in:
Frédéric FRANCE
2020-05-21 00:47:16 +02:00
parent 43dcd9beb5
commit ccadb1ec7a
24 changed files with 149 additions and 366 deletions

View File

@@ -71,9 +71,7 @@ if ($action == 'updateall')
{ {
setEventMessages('ErrorFailedToSaveDate', null, 'errors'); setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback(); $db->rollback();
} } else {
else
{
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit(); $db->commit();
} }
@@ -101,9 +99,7 @@ if ($action == 'update' || $action == 'add')
if (!$error) if (!$error)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} } else {
else
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@@ -199,9 +195,7 @@ if ($conf->facture->enabled)
print '<td>'; print '<td>';
print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0); print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
print '</td>'; print '</td>';
} } else {
else
{
print '<td class="right">'; print '<td class="right">';
print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name")); print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name"));
print '</td>'; print '</td>';
@@ -234,12 +228,12 @@ print '<br>';
*/ */
$constantes = array( $constantes = array(
'ADHERENT_CARD_TYPE', 'ADHERENT_CARD_TYPE',
// 'ADHERENT_CARD_BACKGROUND', //'ADHERENT_CARD_BACKGROUND',
'ADHERENT_CARD_HEADER_TEXT', 'ADHERENT_CARD_HEADER_TEXT',
'ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT',
'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_CARD_TEXT_RIGHT',
'ADHERENT_CARD_FOOTER_TEXT' 'ADHERENT_CARD_FOOTER_TEXT'
); );
print load_fiche_titre($langs->trans("MembersCards"), '', ''); print load_fiche_titre($langs->trans("MembersCards"), '', '');

View File

@@ -74,9 +74,7 @@ if ($action == 'updateall')
{ {
setEventMessages('ErrorFailedToSaveDate', null, 'errors'); setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback(); $db->rollback();
} } else {
else
{
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit(); $db->commit();
} }
@@ -102,8 +100,7 @@ if ($action == 'update' || $action == 'add')
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} }
else else {
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }

View File

@@ -61,16 +61,16 @@ if ($action == 'update')
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
if ($forcetype < 0) $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); if ($forcetype < 0) $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
else $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); else {
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity);
}
if (!$res > 0) $error++; if (!$res > 0) $error++;
if (!$error) if (!$error)
{ {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} } else {
else
{
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
@@ -145,9 +145,7 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=1'.$param.'">'; $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=1'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml .= '</a>'; $enabledisablehtml .= '</a>';
} } else {
else
{
// Button on, click to disable // Button on, click to disable
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=0'.$param.'">'; $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=0'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');

View File

@@ -53,9 +53,7 @@ if (GETPOST('actioncode', 'array'))
{ {
$actioncode = GETPOST('actioncode', 'array', 3); $actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0'; if (!count($actioncode)) $actioncode = '0';
} } else {
else
{
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
} }
$search_agenda_label = GETPOST('search_agenda_label'); $search_agenda_label = GETPOST('search_agenda_label');

View File

@@ -118,9 +118,7 @@ abstract class ActionsAdherentCardCommon
{ {
$this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company'] = $objsoc->getNomUrl(1);
$this->tpl['company_id'] = $objsoc->id; $this->tpl['company_id'] = $objsoc->id;
} } else {
else
{
$this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1);
} }
@@ -190,9 +188,7 @@ abstract class ActionsAdherentCardCommon
$objsoc->fetch($this->object->socid); $objsoc->fetch($this->object->socid);
$this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company'] = $objsoc->getNomUrl(1);
} } else {
else
{
$this->tpl['company'] = $langs->trans("AdherentNotLinkedToThirdParty"); $this->tpl['company'] = $langs->trans("AdherentNotLinkedToThirdParty");
} }
@@ -273,9 +269,7 @@ abstract class ActionsAdherentCardCommon
$this->object->country_code = $obj->code; $this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->libelle; $this->object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->libelle;
} } else {
else
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }

View File

@@ -105,9 +105,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
$this->tpl['actionstodo'] = show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1); $this->tpl['actionstodo'] = show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1);
$this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1);
} } else {
else
{
// Confirm delete contact // Confirm delete contact
if ($action == 'delete' && $user->rights->adherent->supprimer) if ($action == 'delete' && $user->rights->adherent->supprimer)
{ {

View File

@@ -209,9 +209,7 @@ if (empty($reshook))
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans($nuser->error), null, 'errors'); setEventMessages($langs->trans($nuser->error), null, 'errors');
} }
} } else {
else
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -231,9 +229,7 @@ if (empty($reshook))
setEventMessages($langs->trans($company->error), null, 'errors'); setEventMessages($langs->trans($company->error), null, 'errors');
setEventMessages($company->error, $company->errors, 'errors'); setEventMessages($company->error, $company->errors, 'errors');
} }
} } else {
else
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -376,21 +372,15 @@ if (empty($reshook))
if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0) if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0)
{ {
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
} } else {
else
{
// Create thumbs // Create thumbs
$object->addThumbs($newfile); $object->addThumbs($newfile);
} }
} }
} } else {
else
{
setEventMessages("ErrorBadImageFormat", null, 'errors'); setEventMessages("ErrorBadImageFormat", null, 'errors');
} }
} } else {
else
{
switch ($_FILES['photo']['error']) switch ($_FILES['photo']['error'])
{ {
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
@@ -412,15 +402,11 @@ if (empty($reshook))
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
} } else {
else
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }
} } else {
else
{
$action = 'edit'; $action = 'edit';
} }
} }
@@ -527,8 +513,7 @@ if (empty($reshook))
if (empty($login)) { if (empty($login)) {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")), null, 'errors');
} } else {
else {
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'"; $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
@@ -588,9 +573,7 @@ if (empty($reshook))
$rowid = $object->id; $rowid = $object->id;
$id = $object->id; $id = $object->id;
$action = ''; $action = '';
} } else {
else
{
$db->rollback(); $db->rollback();
if ($object->error) { if ($object->error) {
@@ -616,15 +599,11 @@ if (empty($reshook))
{ {
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} } else {
else
{
header("Location: list.php"); header("Location: list.php");
exit; exit;
} }
} } else {
else
{
$errmesg = $object->error; $errmesg = $object->error;
} }
} }
@@ -689,9 +668,7 @@ if (empty($reshook))
} }
} }
} }
} } else {
else
{
$error++; $error++;
if ($object->error) { if ($object->error) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@@ -703,9 +680,7 @@ if (empty($reshook))
if (!$error) if (!$error)
{ {
$db->commit(); $db->commit();
} } else {
else
{
$db->rollback(); $db->rollback();
} }
$action = ''; $action = '';
@@ -770,9 +745,7 @@ if (empty($reshook))
} }
} }
} }
} } else {
else
{
$error++; $error++;
if ($object->error) { if ($object->error) {
@@ -857,9 +830,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
} }
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
$objcanvas->display_canvas($action); // Show template $objcanvas->display_canvas($action); // Show template
} } else {
else
{
// ----------------------------------------- // -----------------------------------------
// When used in standard mode // When used in standard mode
// ----------------------------------------- // -----------------------------------------
@@ -1027,9 +998,7 @@ else
if ($object->country_id) if ($object->country_id)
{ {
print $formcompany->select_state(GETPOST('state_id', 'int') ?GETPOST('state_id', 'int') : $object->state_id, $object->country_code); print $formcompany->select_state(GETPOST('state_id', 'int') ?GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
} } else {
else
{
print $countrynotdefined; print $countrynotdefined;
} }
print '</td></tr>'; print '</td></tr>';
@@ -1084,9 +1053,7 @@ else
if (!empty($backtopage)) if (!empty($backtopage))
{ {
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">'; print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
} } else {
else
{
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">'; print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
} }
print '</div>'; print '</div>';
@@ -1123,9 +1090,7 @@ else
if ($resql) if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }
$object->country_id = $obj->rowid; $object->country_id = $obj->rowid;
@@ -1204,9 +1169,7 @@ else
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ?GETPOST("typeid", 'int') : $object->typeid)); print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ?GETPOST("typeid", 'int') : $object->typeid));
} } else {
else
{
print $adht->getNomUrl(1); print $adht->getNomUrl(1);
print '<input type="hidden" name="typeid" value="'.$object->typeid.'">'; print '<input type="hidden" name="typeid" value="'.$object->typeid.'">';
} }
@@ -1334,9 +1297,7 @@ else
$company = new Societe($db); $company = new Societe($db);
$result = $company->fetch($object->socid); $result = $company->fetch($object->socid);
print $company->getNomUrl(1); print $company->getNomUrl(1);
} } else {
else
{
print $langs->trans("NoThirdPartyAssociatedToMember"); print $langs->trans("NoThirdPartyAssociatedToMember");
} }
print '</td></tr>'; print '</td></tr>';
@@ -1432,9 +1393,7 @@ else
{ {
$companyname = $object->company; $companyname = $object->company;
if (!empty($fullname)) $companyalias = $fullname; if (!empty($fullname)) $companyalias = $fullname;
} } else {
else
{
$companyname = $fullname; $companyname = $fullname;
if (!empty($object->company)) $companyalias = $object->company; if (!empty($object->company)) $companyalias = $object->company;
} }
@@ -1629,8 +1588,7 @@ else
{ {
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 ($object->pass) print preg_replace('/./i', '*', $object->pass); if ($object->pass) print preg_replace('/./i', '*', $object->pass);
else else {
{
if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
else print $langs->trans("Hidden"); else print $langs->trans("Hidden");
} }
@@ -1651,9 +1609,7 @@ else
if ($object->hasDelay()) { if ($object->hasDelay()) {
print " ".img_warning($langs->trans("Late")); print " ".img_warning($langs->trans("Late"));
} }
} } else {
else
{
if ($object->need_subscription == 0) if ($object->need_subscription == 0)
{ {
print $langs->trans("SubscriptionNotNeeded"); print $langs->trans("SubscriptionNotNeeded");
@@ -1662,9 +1618,7 @@ else
{ {
print $langs->trans("SubscriptionNotRecorded"); print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
} } else {
else
{
print $langs->trans("SubscriptionNotReceived"); print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
} }
@@ -1691,17 +1645,12 @@ else
print '</td>'; print '</td>';
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table></form>';
} } else {
else if ($object->socid) {
{
if ($object->socid)
{
$company = new Societe($db); $company = new Societe($db);
$result = $company->fetch($object->socid); $result = $company->fetch($object->socid);
print $company->getNomUrl(1); print $company->getNomUrl(1);
} } else {
else
{
print $langs->trans("NoThirdPartyAssociatedToMember"); print $langs->trans("NoThirdPartyAssociatedToMember");
} }
} }
@@ -1716,14 +1665,13 @@ else
if ($action == 'editlogin') if ($action == 'editlogin')
{ {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
} } else {
else
{
if ($object->user_id) if ($object->user_id)
{ {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
} else {
print $langs->trans("NoDolibarrAccess");
} }
else print $langs->trans("NoDolibarrAccess");
} }
print '</td></tr>'; print '</td></tr>';
@@ -1803,9 +1751,7 @@ else
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=edit">'.$langs->trans("Modify")."</a></div>"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=edit">'.$langs->trans("Modify")."</a></div>";
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>'; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>';
} }
@@ -1815,9 +1761,7 @@ else
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate")."</a></div>\n";
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</font></div>'; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</font></div>';
} }
} }
@@ -1828,9 +1772,7 @@ else
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a></div>\n";
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable")."</font></div>"; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable")."</font></div>";
} }
} }
@@ -1841,9 +1783,7 @@ else
if ($user->rights->adherent->supprimer) if ($user->rights->adherent->supprimer)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=resign">'.$langs->trans("Resiliate")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$id.'&action=resign">'.$langs->trans("Resiliate")."</a></div>\n";
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate")."</font></div>"; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate")."</font></div>";
} }
} }
@@ -1855,9 +1795,7 @@ else
{ {
if ($object->statut != -1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>'; if ($object->statut != -1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>'; else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a></div>';
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrThirdParty")."</font></div>"; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrThirdParty")."</font></div>";
} }
} }
@@ -1869,9 +1807,7 @@ else
{ {
if ($object->statut != -1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a></div>'; if ($object->statut != -1) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a></div>'; else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrLogin")."</font></div>"; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrLogin")."</font></div>";
} }
} }
@@ -1880,9 +1816,7 @@ else
if ($user->rights->adherent->supprimer) if ($user->rights->adherent->supprimer)
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>\n"; print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>\n";
} } else {
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete")."</font></div>"; print '<div class="inline-block divButAction"><font class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete")."</font></div>";
} }

View File

@@ -162,11 +162,9 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg)
'photo'=>$objp->photo 'photo'=>$objp->photo
); );
} }
} } else {
else
{
$arrayofmembers[] = array( $arrayofmembers[] = array(
'textleft'=>$textleft, 'textleft'=>$textleft,
'textheader'=>$textheader, 'textheader'=>$textheader,
'textfooter'=>$textfooter, 'textfooter'=>$textfooter,
'textright'=>$textright, 'textright'=>$textright,
@@ -226,9 +224,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg)
{ {
dol_print_error('', $result); dol_print_error('', $result);
} }
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }

View File

@@ -1282,10 +1282,11 @@ class Adherent extends CommonObject
$this->country_id = $obj->country_id; $this->country_id = $obj->country_id;
$this->country_code = $obj->country_code; $this->country_code = $obj->country_code;
if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) {
$this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code); $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code);
else } else {
$this->country = $obj->country; $this->country = $obj->country;
}
$this->phone = $obj->phone; $this->phone = $obj->phone;
$this->phone_perso = $obj->phone_perso; $this->phone_perso = $obj->phone_perso;
@@ -2037,12 +2038,13 @@ class Adherent extends CommonObject
if ($withpictoimg > -2 && $withpictoimg != 2) { if ($withpictoimg > -2 && $withpictoimg != 2) {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '<span class="nopadding valignmiddle'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled'). if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '<span class="nopadding valignmiddle'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').
($morecss ? ' usertext'.$morecss : '').'">'; ($morecss ? ' usertext'.$morecss : '').'">';
if ($mode == 'login') if ($mode == 'login') {
$result .= dol_trunc($this->login, $maxlen); $result .= dol_trunc($this->login, $maxlen);
elseif ($mode == 'ref') } elseif ($mode == 'ref') {
$result .= $this->id; $result .= $this->id;
else } else {
$result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen); $result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen);
}
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '</span>'; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '</span>';
} }
if ($withpictoimg) $result .= '</div>'; if ($withpictoimg) $result .= '</div>';
@@ -2803,10 +2805,11 @@ class Adherent extends CommonObject
$listofids .= ', ...'; $listofids .= ', ...';
break; break;
} }
if (empty($listofids)) if (empty($listofids)) {
$listofids .= ' ['; $listofids .= ' [';
else } else {
$listofids .= ', '; $listofids .= ', ';
}
$listofids .= $idmember; $listofids .= $idmember;
$i++; $i++;
} }
@@ -2823,10 +2826,11 @@ class Adherent extends CommonObject
$listofids .= ', ...'; $listofids .= ', ...';
break; break;
} }
if (empty($listofids)) if (empty($listofids)) {
$listofids .= ' ['; $listofids .= ' [';
else } else {
$listofids .= ', '; $listofids .= ', ';
}
$listofids .= $idmember; $listofids .= $idmember;
$i++; $i++;
} }

View File

@@ -146,9 +146,7 @@ class AdherentType extends CommonObject
$this->multilangs["$obj->lang"]["email"] = $obj->email; $this->multilangs["$obj->lang"]["email"] = $obj->email;
} }
return 1; return 1;
} } else {
else
{
$this->error = "Error: ".$this->db->lasterror()." - ".$sql; $this->error = "Error: ".$this->db->lasterror()." - ".$sql;
return -1; return -1;
} }
@@ -184,9 +182,7 @@ class AdherentType extends CommonObject
$sql2 .= " label='".$this->db->escape($this->label)."',"; $sql2 .= " label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'"; $sql2 .= " description='".$this->db->escape($this->description)."'";
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'"; $sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
} } else {
else
{
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
$sql2 .= ")"; $sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',"; $sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
@@ -214,9 +210,7 @@ class AdherentType extends CommonObject
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; $sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'"; $sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
} } else {
else
{
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
$sql2 .= ")"; $sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
@@ -231,9 +225,7 @@ class AdherentType extends CommonObject
return -1; return -1;
} }
} }
} } else {
else
{
// language is not current language and we didn't provide a multilang description for this language // language is not current language and we didn't provide a multilang description for this language
} }
} }
@@ -274,9 +266,7 @@ class AdherentType extends CommonObject
} }
// End call triggers // End call triggers
return 1; return 1;
} } else {
else
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR); dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR);
return -1; return -1;
@@ -336,16 +326,12 @@ class AdherentType extends CommonObject
{ {
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} } else {
else
{
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} } else {
else
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@@ -418,16 +404,12 @@ class AdherentType extends CommonObject
{ {
$this->db->commit(); $this->db->commit();
return 1; return 1;
} } else {
else
{
$this->db->rollback(); $this->db->rollback();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -$error; return -$error;
} }
} } else {
else
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@@ -458,9 +440,7 @@ class AdherentType extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} } else {
else
{
$this->db->rollback(); $this->db->rollback();
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
@@ -511,9 +491,7 @@ class AdherentType extends CommonObject
} }
return 1; return 1;
} } else {
else
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }
@@ -552,9 +530,7 @@ class AdherentType extends CommonObject
$i++; $i++;
} }
} }
} } else {
else
{
print $this->db->error(); print $this->db->error();
} }
return $adherenttypes; return $adherenttypes;
@@ -608,9 +584,7 @@ class AdherentType extends CommonObject
$this->members = $ret; $this->members = $ret;
return $ret; return $ret;
} } else {
else
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }

View File

@@ -239,10 +239,8 @@ class Members extends DolibarrApi
if ($member->update(DolibarrApiAccess::$user) >= 0) if ($member->update(DolibarrApiAccess::$user) >= 0)
{ {
return $this->get($id); return $this->get($id);
} } else {
else throw new RestException(500, $member->error);
{
throw new RestException(500, $member->error);
} }
} }

View File

@@ -207,10 +207,8 @@ class MembersTypes extends DolibarrApi
if ($membertype->update(DolibarrApiAccess::$user) >= 0) if ($membertype->update(DolibarrApiAccess::$user) >= 0)
{ {
return $this->get($id); return $this->get($id);
} } else {
else throw new RestException(500, $membertype->error);
{
throw new RestException(500, $membertype->error);
} }
} }

View File

@@ -196,10 +196,8 @@ class Subscriptions extends DolibarrApi
if ($subscription->update(DolibarrApiAccess::$user) > 0) if ($subscription->update(DolibarrApiAccess::$user) > 0)
{ {
return $this->get($id); return $this->get($id);
} } else {
else throw new RestException(500, $subscription->error);
{
throw new RestException(500, $subscription->error);
} }
} }

View File

@@ -232,14 +232,10 @@ class Subscription extends CommonObject
$this->note = $obj->note; $this->note = $obj->note;
$this->fk_bank = $obj->fk_bank; $this->fk_bank = $obj->fk_bank;
return 1; return 1;
} } else {
else
{
return 0; return 0;
} }
} } else {
else
{
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
return -1; return -1;
} }
@@ -286,9 +282,7 @@ class Subscription extends CommonObject
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
// End call triggers // End call triggers
} }
} } else {
else
{
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
} }
@@ -355,28 +349,20 @@ class Subscription extends CommonObject
{ {
$this->db->commit(); $this->db->commit();
return 1; return 1;
} } else {
else
{
$this->error = $accountline->error; $this->error = $accountline->error;
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
} } else {
else
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
} } else {
else
{
$this->db->commit(); $this->db->commit();
return 0; return 0;
} }
} } else {
else
{
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
} }
@@ -488,9 +474,7 @@ class Subscription extends CommonObject
} }
$this->db->free($result); $this->db->free($result);
} } else {
else
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }

View File

@@ -158,14 +158,10 @@ if ($id > 0)
$param = '&id='.$object->id; $param = '&id='.$object->id;
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
print "<br><br>"; print "<br><br>";
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }
} } else {
else
{
$langs->load("errors"); $langs->load("errors");
print $langs->trans("ErrorRecordNotFound"); print $langs->trans("ErrorRecordNotFound");
} }

View File

@@ -79,9 +79,7 @@ if ($resql)
$i++; $i++;
} }
print "<hr>\n"; print "<hr>\n";
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }

View File

@@ -331,9 +331,7 @@ if ($resql)
$staticmember->fk_soc = $obj->fk_soc; $staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty(); $staticmember->fetch_thirdparty();
$staticmember->name = $staticmember->thirdparty->name; $staticmember->name = $staticmember->thirdparty->name;
} } else {
else
{
$staticmember->name = $obj->company; $staticmember->name = $obj->company;
} }
$staticmember->ref = $staticmember->getFullName($langs); $staticmember->ref = $staticmember->getFullName($langs);
@@ -349,9 +347,7 @@ if ($resql)
} }
print "</table></div>"; print "</table></div>";
print "<br>"; print "<br>";
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }
@@ -411,9 +407,7 @@ if ($resql)
} }
print "</table></div>"; print "</table></div>";
print "<br>"; print "<br>";
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }

View File

@@ -176,9 +176,7 @@ if ($result > 0)
{ {
$langs->load("errors"); $langs->load("errors");
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>'; print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>';
} } else {
else
{
$records = $ldap->getAttribute($dn, $search); $records = $ldap->getAttribute($dn, $search);
//print_r($records); //print_r($records);
@@ -189,23 +187,17 @@ if ($result > 0)
if (!is_array($records)) if (!is_array($records))
{ {
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>'; print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
} } else {
else
{
$result = show_ldap_content($records, 0, $records['count'], true); $result = show_ldap_content($records, 0, $records['count'], true);
} }
} } else {
else
{
print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>'; print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>';
} }
} }
$ldap->unbind(); $ldap->unbind();
$ldap->close(); $ldap->close();
} } else {
else
{
setEventMessages($ldap->error, $ldap->errors, 'errors'); setEventMessages($ldap->error, $ldap->errors, 'errors');
} }

View File

@@ -214,9 +214,7 @@ if (empty($reshook))
if ($result < 0 && !count($tmpmember->errors)) if ($result < 0 && !count($tmpmember->errors))
{ {
setEventMessages($tmpmember->error, $tmpmember->errors, 'errors'); setEventMessages($tmpmember->error, $tmpmember->errors, 'errors');
} } else {
else
{
if ($result > 0) $nbclose++; if ($result > 0) $nbclose++;
} }
} }
@@ -226,9 +224,7 @@ if (empty($reshook))
setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs'); setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs');
$db->commit(); $db->commit();
} } else {
else
{
$db->rollback(); $db->rollback();
} }
} }
@@ -858,17 +854,13 @@ while ($i < min($num, $limit))
print " ".img_warning($langs->trans("SubscriptionLate").$textlate); print " ".img_warning($langs->trans("SubscriptionLate").$textlate);
} }
print '</td>'; print '</td>';
} } else {
else
{
print '<td class="nowrap left">'; print '<td class="nowrap left">';
if ($obj->subscription == 'yes') if ($obj->subscription == 'yes')
{ {
print $langs->trans("SubscriptionNotReceived"); print $langs->trans("SubscriptionNotReceived");
if ($obj->statut > 0) print " ".img_warning(); if ($obj->statut > 0) print " ".img_warning();
} } else {
else
{
print '&nbsp;'; print '&nbsp;';
} }
print '</td>'; print '</td>';

View File

@@ -93,9 +93,7 @@ if ($resql)
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }
@@ -106,13 +104,10 @@ dol_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), -1, 'use
// Print title // Print title
if (!count($data)) if (!count($data)) {
{
print $langs->trans("NoValidatedMemberYet").'<br>'; print $langs->trans("NoValidatedMemberYet").'<br>';
print '<br>'; print '<br>';
} } else {
else
{
print $langs->trans("MembersByNature").'<br>'; print $langs->trans("MembersByNature").'<br>';
print '<br>'; print '<br>';
} }

View File

@@ -200,9 +200,7 @@ if ($mode)
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }
} }
@@ -218,15 +216,12 @@ if ($mode && !count($data))
{ {
print $langs->trans("NoValidatedMemberYet").'<br>'; print $langs->trans("NoValidatedMemberYet").'<br>';
print '<br>'; print '<br>';
} } else {
else
{
if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'<br>'; if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'<br>';
elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>'; elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>'; elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>'; //+ elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>'; //+
else else {
{
print $langs->trans("MembersStatisticsDesc").'<br>'; print $langs->trans("MembersStatisticsDesc").'<br>';
print '<br>'; print '<br>';
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbycountry">'.$langs->trans("MembersStatisticsByCountries").'</a><br>'; print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbycountry">'.$langs->trans("MembersStatisticsByCountries").'</a><br>';

View File

@@ -128,13 +128,11 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
$langs->load("errors"); $langs->load("errors");
setEventMessages($company->error, $company->errors, 'errors'); setEventMessages($company->error, $company->errors, 'errors');
} }
else else {
{
$action = 'addsubscription'; $action = 'addsubscription';
} }
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@@ -276,8 +274,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$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"])
@@ -286,8 +283,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
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)
@@ -323,8 +319,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$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
} }
} }
@@ -333,8 +328,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$db->commit(); $db->commit();
} }
else else {
{
$db->rollback(); $db->rollback();
$action = 'addsubscription'; $action = 'addsubscription';
} }
@@ -403,13 +397,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$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');
} }
} }
@@ -548,15 +540,13 @@ if ($rowid > 0)
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
} }
@@ -587,16 +577,14 @@ if ($rowid > 0)
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table></form>';
} }
else else {
{
if ($object->fk_soc) if ($object->fk_soc)
{ {
$company = new Societe($db); $company = new Societe($db);
$result = $company->fetch($object->fk_soc); $result = $company->fetch($object->fk_soc);
print $company->getNomUrl(1); print $company->getNomUrl(1);
} }
else else {
{
print $langs->trans("NoThirdPartyAssociatedToMember"); print $langs->trans("NoThirdPartyAssociatedToMember");
} }
} }
@@ -623,8 +611,7 @@ if ($rowid > 0)
{ {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
} }
else else {
{
if ($object->user_id) if ($object->user_id)
{ {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
@@ -755,9 +742,7 @@ if ($rowid > 0)
$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>';
@@ -773,9 +758,7 @@ if ($rowid > 0)
} }
print "</table>"; print "</table>";
} } else {
else
{
dol_print_error($db); dol_print_error($db);
} }
} }
@@ -814,9 +797,7 @@ if ($rowid > 0)
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;
@@ -870,9 +851,7 @@ if ($rowid > 0)
{ {
$companyname = $object->company; $companyname = $object->company;
if (!empty($fullname)) $companyalias = $fullname; if (!empty($fullname)) $companyalias = $fullname;
} } else {
else
{
$companyname = $fullname; $companyname = $fullname;
if (!empty($object->company)) $companyalias = $object->company; if (!empty($object->company)) $companyalias = $object->company;
} }
@@ -999,8 +978,7 @@ if ($rowid > 0)
//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");
@@ -1009,8 +987,7 @@ if ($rowid > 0)
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);
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
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
@@ -1024,8 +1001,7 @@ if ($rowid > 0)
//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");
@@ -1083,9 +1059,7 @@ if ($rowid > 0)
if (!$object->email) if (!$object->email)
{ {
print $langs->trans("NoEMail"); print $langs->trans("NoEMail");
} } else {
else
{
$adht = new AdherentType($db); $adht = new AdherentType($db);
$adht->fetch($object->typeid); $adht->fetch($object->typeid);
@@ -1158,9 +1132,7 @@ if ($rowid > 0)
//print '</td></tr>'; //print '</td></tr>';
//print '</table>'; //print '</table>';
} } else {
else
{
$langs->load("errors"); $langs->load("errors");
print $langs->trans("ErrorRecordNotFound"); print $langs->trans("ErrorRecordNotFound");
} }

View File

@@ -85,9 +85,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
if ($accountline->rappro) if ($accountline->rappro)
{ {
$errmsg = $langs->trans("SubscriptionLinkedToConciliatedTransaction"); $errmsg = $langs->trans("SubscriptionLinkedToConciliatedTransaction");
} } else {
else
{
$accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
$accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
$accountline->amount = $_POST["amount"]; $accountline->amount = $_POST["amount"];
@@ -116,17 +114,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
header("Location: card.php?rowid=".$object->id); header("Location: card.php?rowid=".$object->id);
exit; exit;
} } else {
else
{
$db->rollback(); $db->rollback();
if ($object->error) if ($object->error)
{ {
$errmsg = $object->error; $errmsg = $object->error;
} } else {
else
{
foreach ($object->errors as $error) foreach ($object->errors as $error)
{ {
if ($errmsg) $errmsg .= '<br>'; if ($errmsg) $errmsg .= '<br>';
@@ -135,9 +129,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
} }
$action = ''; $action = '';
} }
} } else {
else
{
$db->rollback(); $db->rollback();
} }
} }
@@ -151,9 +143,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent-
{ {
header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent); header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent);
exit; exit;
} } else {
else
{
$mesg = $adh->error; $mesg = $adh->error;
} }
} }
@@ -248,9 +238,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank); $result = $bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1, 0, 'showall'); print $bankline->getNomUrl(1, 0, 'showall');
} } else {
else
{
print $langs->trans("NoneF"); print $langs->trans("NoneF");
} }
print '</td></tr>'; print '</td></tr>';
@@ -355,9 +343,7 @@ if ($rowid && $action != 'edit')
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank); $result = $bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1, 0, 'showall'); print $bankline->getNomUrl(1, 0, 'showall');
} } else {
else
{
print $langs->trans("NoneF"); print $langs->trans("NoneF");
} }
print '</td></tr>'; print '</td></tr>';
@@ -382,9 +368,7 @@ if ($rowid && $action != 'edit')
if (!$bankline->rappro) if (!$bankline->rappro)
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id."&action=edit\">".$langs->trans("Modify")."</a></div>"; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id."&action=edit\">".$langs->trans("Modify")."</a></div>";
} } else {
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.$langs->trans("BankLineConciliated")."\" href=\"#\">".$langs->trans("Modify")."</a></div>"; print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.$langs->trans("BankLineConciliated")."\" href=\"#\">".$langs->trans("Modify")."</a></div>";
} }
} }

View File

@@ -4047,8 +4047,8 @@ function dol_print_error($db = '', $error = '', $errors = null)
} }
if (empty($dolibarr_main_prod)) print $out; if (empty($dolibarr_main_prod)) print $out;
else // This should not happen, except if there is a bug somewhere. Enabled and check log in such case. else {
{ // This should not happen, except if there is a bug somewhere. Enabled and check log in such case.
print 'This website or feature is currently temporarly not available.<br><br>This may be due to a maintenance operation. Current status of operation are on next line...<br><br>'."\n"; print 'This website or feature is currently temporarly not available.<br><br>This may be due to a maintenance operation. Current status of operation are on next line...<br><br>'."\n";
$langs->load("errors"); $langs->load("errors");
print $langs->trans("DolibarrHasDetectedError").'. '; print $langs->trans("DolibarrHasDetectedError").'. ';