From: Johan Cwiklinski Date: Sun, 18 Oct 2020 08:25:00 +0000 (+0200) Subject: Drop useless code in dependencies; fix call on models reset X-Git-Tag: 0.9.4.1~8 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=eaf5d3da17c26a1987d3adb9d85cf67e67c1a300;p=galette.git Drop useless code in dependencies; fix call on models reset --- diff --git a/galette/includes/dependencies.php b/galette/includes/dependencies.php index 3e1902db5..e56259491 100644 --- a/galette/includes/dependencies.php +++ b/galette/includes/dependencies.php @@ -272,274 +272,6 @@ $container['members_fields_cats'] = function ($c) { return $members_fields_cats; }; -$container['pdfmodels_fields'] = function ($c) { - //include_once GALETTE_ROOT . 'includes/fields_defs/pdfmodels_fields.php'; - $pdfmodels_fields = array( - array( - 'model_id' => PdfModel::MAIN_MODEL, - 'model_name' => '_T("Main")', - 'model_title' => null, - 'model_type' => PdfModel::MAIN_MODEL, - 'model_header' => ' - - - - -
{ASSO_NAME}
{ASSO_SLOGAN}
', - 'model_footer' => '', - 'model_body' => null, - 'model_styles' => 'div#pdf_title { - font-size: 1.4em; - font-wieght:bold; - text-align: center; - } - - div#pdf_subtitle { - text-align: center; - } - - div#pdf_footer { - text-align: center; - font-size: 0.7em; - } - - td#pdf_assoname { - width: 75%; - font-size: 1.1em; - } - - strong#asso_name { - font-size: 1.6em; - } - - td#pdf_logo { - text-align: right; - width: 25%; - }', - 'model_parent' => null - ), - array( - 'model_id' => PdfModel::INVOICE_MODEL, - 'model_name' => '_T("Invoice")', - 'model_title' => '_T("Invoice") {CONTRIBUTION_YEAR}-{CONTRIBUTION_ID}', - 'model_type' => PdfModel::INVOICE_MODEL, - 'model_header' => null, - 'model_footer' => null, - 'model_body' => ' - - - - - - - - - - -
{NAME_ADH}
- {ADDRESS_ADH}
- {ZIP_ADH} {TOWN_ADH} -
- - - - - - - - - - - - - -
_T("Label")_T("Amount")
- {CONTRIBUTION_LABEL} (_T("on") {CONTRIBUTION_DATE})
- _T("from") {CONTRIBUTION_BEGIN_DATE} _T("to") {CONTRIBUTION_END_DATE}
- {CONTRIBUTION_PAYMENT_TYPE}
- {CONTRIBUTION_COMMENT} -
{CONTRIBUTION_AMOUNT}
-
', - 'model_styles' => null, - 'model_parent' => PdfModel::MAIN_MODEL - ), - array( - 'model_id' => PdfModel::RECEIPT_MODEL, - 'model_name' => '_T("Receipt")', - 'model_title' => '_T("Receipt") {CONTRIBUTION_YEAR}-{CONTRIBUTION_ID}', - 'model_type' => PdfModel::RECEIPT_MODEL, - 'model_header' => null, - 'model_footer' => null, - 'model_body' => ' - - - - - - - - - - -
{NAME_ADH}
- {ADDRESS_ADH}
- {ZIP_ADH} {TOWN_ADH} -
- - - - - - - - - - - - - -
_T("Label")_T("Amount")
- {CONTRIBUTION_LABEL} (_T("on") {CONTRIBUTION_DATE})
- _T("from") {CONTRIBUTION_BEGIN_DATE} _T("to") {CONTRIBUTION_END_DATE}
- {CONTRIBUTION_PAYMENT_TYPE}
- {CONTRIBUTION_COMMENT} -
{CONTRIBUTION_AMOUNT}
-
', - 'model_styles' => null, - 'model_parent' => PdfModel::MAIN_MODEL - ), - array( - 'model_id' => PdfModel::ADHESION_FORM_MODEL, - 'model_name' => '_T("Adhesion form")', - 'model_title' => '_T("Adhesion form")', - 'model_type' => PdfModel::ADHESION_FORM_MODEL, - 'model_header' => null, - 'model_footer' => null, - 'model_body' => '
-
_T("Complete the following form and send it with your funds, in order to complete your subscription.")
- - - - - -
{ASSO_ADDRESS_MULTI}
-
- - - - - - - - - - -
_T("Required membership:") -
- _T("Active member") - _T("Benefactor member") - _T("Donation") -
_T("The minimum contribution for each type of membership are defined on the website of the association. The amount of donations are free to be decided by the generous donor.")
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_T("Politeness"){TITLE_ADH}
_T("Name"){LAST_NAME_ADH}
_T("First name"){FIRST_NAME_ADH}
_T("Company name") *{COMPANY_ADH}
_T("Address"){ADDRESS_ADH}
_T("Zip Code"){ZIP_ADH}_T("City"){TOWN_ADH}
_T("Country"){COUNTRY_ADH}
_T("Email address"){EMAIL_ADH}
_T("Username") **{LOGIN_ADH}
_T("Amount")
-

str_replace(\'%s\', \'{ASSO_NAME}\', \'_T("Hereby, I agree to comply to %s association statutes and its rules.")\')

_T("At ................................................")

_T("On .......... / .......... / .......... ")

_T("Signature")

-

_T("* Only for compagnies")
_T("** Galette identifier, if applicable")

', - 'model_styles' => 'td.label { - width: 20%; - font-weight: bold; - } - td.input { - width: 80%; - border-bottom: 1px dotted black; - } - - td.cpinput { - width: 10%; - border-bottom: 1px dotted black; - } - - td.towninput { - width: 50%; - border-bottom: 1px dotted black; - } - - div.infos { - font-size: .8em; - } - - p.notes { - font-size: 0.6em; - text-align: right; - } - - .member td { - line-height: 20px; - height: 20px; - }', - 'model_parent' => PdfModel::MAIN_MODEL - ) - ); - return $pdfmodels_fields; -}; - // ----------------------------------------------------------------------------- // Service factories // ----------------------------------------------------------------------------- diff --git a/galette/lib/Galette/Controllers/AdminToolsController.php b/galette/lib/Galette/Controllers/AdminToolsController.php index 8bf2c0c62..49e83de73 100644 --- a/galette/lib/Galette/Controllers/AdminToolsController.php +++ b/galette/lib/Galette/Controllers/AdminToolsController.php @@ -131,7 +131,7 @@ class AdminToolsController extends AbstractController if (isset($post['initpdfmodels'])) { //proceed emails texts reinitialization $models = new PdfModels($this->zdb, $this->preferences, $this->login); - $res = $models->installInit($this->pdfmodels_fields, false); + $res = $models->installInit(false); if ($res === true) { $success_detected[] = _T("PDF models has been successfully reinitialized."); } else {