From d619eb975cf65d126c978ecffa90663884f0637e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2007 23:29:41 +0000 Subject: [PATCH] New: Bouton "Supprimer type" --- htdocs/adherents/card_subscriptions.php | 14 ++-- htdocs/adherents/fiche.php | 100 ------------------------ htdocs/adherents/type.php | 14 +++- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/mails.lang | 1 + htdocs/langs/en_US/members.lang | 1 + htdocs/langs/fr_FR/admin.lang | 4 +- htdocs/langs/fr_FR/mails.lang | 1 + htdocs/langs/fr_FR/members.lang | 1 + 9 files changed, 24 insertions(+), 114 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 3a35960dd86..0051b2d1cc9 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -93,18 +93,18 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) if ($adht->cotisation) { + if ($conf->global->ADHERENT_BANK_USE) + { + if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); + if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); + if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); + if ($errmsg) $action='addsubscription'; + } if (! $_POST["cotisation"] > 0) { $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); $action='addsubscription'; } - if ($conf->global->ADHERENT_BANK_USE) - { - if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("FinancialAccount")); - if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); - if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")); - if ($errmsg) $action='addsubscription'; - } } if ($action=='cotisation') diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 7e855650360..1a6d2698cef 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -69,77 +69,6 @@ if ($_POST["action"] == 'confirm_sendinfo' && $_POST["confirm"] == 'yes') } } -/* -if ($_POST["action"] == 'cotisation') -{ - $adh->id = $rowid; - $adh->fetch($rowid); - - $reday=$_POST["reday"]; - $remonth=$_POST["remonth"]; - $reyear=$_POST["reyear"]; - if ($_POST["reyear"] && $_POST["remonth"] && $_POST["reday"]) - { - $datecotisation=dolibarr_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); - } - $cotisation=$_POST["cotisation"]; - - $accountid=$_POST["accountid"]; - $operation=$_POST["operation"]; - $label=$_POST["label"]; - $num_chq=$_POST["num_chq"]; - - - if (! $datecotisation) - { - $errmsg=$langs->trans("BadDateFormat"); - $action=''; - } - - if (! $_POST["cotisation"] > 0) - { - $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount")); - $action=''; - } - if ($conf->global->ADHERENT_BANK_USE) - { - if (! $_POST["accountid"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("FinancialAccount")); - if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("PaymentMode")); - if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->trans("Label")); - if ($errmsg) $action=''; - } - - if ($action) - { - $db->begin(); - - $crowid=$adh->cotisation($datecotisation, $cotisation, $accountid, $operation, $label, $num_chq); - - if ($crowid > 0) - { - $db->commit(); - - // Envoi mail - if ($adh->email && $conf->global->ADHERENT_MAIL_COTIS) - { - $adh->send_an_email($adh->email,$conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT); - } - - $_POST["cotisation"]=''; - $_POST["accountid"]=''; - $_POST["operation"]=''; - $_POST["label"]=''; - $_POST["num_chq"]=''; - } - else - { - $db->rollback(); - dolibarr_print_error($db,$adh->error); - } - } -} -*/ - if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"]) { $datenaiss=''; @@ -789,35 +718,6 @@ if ($action == 'create') print "\n"; print '
'; -/* - // Boite cotisations - print ''; - print "\n"; - - if ($conf->global->ADHERENT_BANK_USE) - { - print '\n"; - - print '\n"; - - print '\n"; - - print ''; - } - print ''; - - print "
".$langs->trans("DateSubscription")."\n"; - $htmls->select_date('','','','','','add'); - print "
'.$langs->trans("PaymentMode").''; - $htmls->select_types_paiements('','operation'); - print "
'.$langs->trans("FinancialAccount").''; - $htmls->select_comptes('','accountid'); - print "
'.$langs->trans("Numero").''; - print ''; - print "
'.$langs->trans("Label").'
'.$langs->trans("Subscription").' '.$langs->trans("Currency".$conf->monnaie).'
\n"; - print '
'; -*/ - print '
'; print "\n"; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 7c061637998..9e810f64780 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -95,9 +95,9 @@ if ($_POST["action"] == 'update') if ($_GET["action"] == 'delete') { - $adh = new Adherent($db); - $adh->delete($rowid); - Header("Location: liste.php"); + $adht = new AdherentType($db); + $adht->delete($rowid); + Header("Location: ".$_SERVER["PHP_SELF"]); exit; } @@ -284,9 +284,15 @@ if ($rowid > 0) print "id."\">".$langs->trans("Edit").""; } - // Add member + // Add print "id."\">".$langs->trans("AddMember").""; + // Delete + if ($user->rights->adherent->configurer) + { + print "id."\">".$langs->trans("DeleteType").""; + } + print ""; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a62e02e4bbc..4641ea1163d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -113,7 +113,7 @@ ModuleFamilyFinancial=Financial Modules (Accountancy/Treasury) # Modules Module0Name=Users & groups Module0Desc=Users and groups management -Module1Name=Companies +Module1Name=Third parties Module1Desc=Companies and contacts' management Module2Name=Commercial Module2Desc=Commercial management diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index c9e861b77ef..50c9bb16098 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -6,6 +6,7 @@ EMailings=EMailings MailCard=EMailing card MailTargets=Targets MailRecipients=Recipients +MailRecipient=Recipient MailTitle=Title MailFrom=Sender MailReply=Reply to diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 71e7f4b1c71..a133d7b5795 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -76,6 +76,7 @@ NewMemberType=New member type WelcomeEMail=Welcome e-mail SubscriptionRequired=Subscription required EditType=Edit member type +DeleteType=Delete VoteAllowed=Vote allowed Physical=Physical Moral=Moral diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 5d9fa8d7dfb..e6c541fbd9c 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -112,8 +112,8 @@ ModuleFamilyFinancial=Modules financiers (Compta/tr # Modules Module0Name=Utilisateurs & groupes Module0Desc=Gestion des utilisateurs et groupes -Module1Name=Sociétés -Module1Desc=Gestion des sociétés et contacts +Module1Name=Tiers +Module1Desc=Gestion des tiers (sociétés, particuliers) et contacts Module2Name=Commercial Module2Desc=Gestion commerciale Module10Name=Comptabilité diff --git a/htdocs/langs/fr_FR/mails.lang b/htdocs/langs/fr_FR/mails.lang index 1dbb6b48393..94fe1ac4d1c 100644 --- a/htdocs/langs/fr_FR/mails.lang +++ b/htdocs/langs/fr_FR/mails.lang @@ -6,6 +6,7 @@ EMailings=Mailings MailCard=Fiche mailing MailTargets=Destinataires MailRecipients=Destinataires +MailRecipient=Destinataire MailTitle=Titre MailFrom=Émetteur MailReply=Réponse à diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 647c2e5335d..3ce99f1e0ea 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -76,6 +76,7 @@ NewMemberType=Nouveau type de membre WelcomeEMail=Email d'accueil SubscriptionRequired=Soumis à cotisation EditType=Édition du type d'adhérent +DeleteType=Supprimer VoteAllowed=Vote autorisé Physical=Physique Moral=Morale