|
diff -r -x '*.log' -x '*.rej' -x 'composer.*' '--exclude=data' '--exclude=plugins' '--exclude=vendor' galette/galette/lib/Galette/Entity/Contribution.php galette0941_avantmodif/galette/lib/Galette/Entity/Contribution.php
|
|
213a214,229
|
|
> if ($preferences->pref_beg_membership != '') {
|
|
> //case beginning of membership
|
|
> list($j, $m) = explode('/', $preferences->pref_beg_membership);
|
|
> $edate = new \DateTime($bdate->format('Y') . '-' . $m . '-' . $j);
|
|
> while ($edate <= $bdate) {
|
|
> $edate->modify('+1 year');
|
|
> }
|
|
>
|
|
> if ($preferences->pref_membership_offermonths > 0) {
|
|
> //count days until end of membership date
|
|
> $diff1 = (int)$bdate->diff($edate)->format('%a');
|
|
>
|
|
> //count days beetween end of membership date and offered months
|
|
> $tdate = clone $edate;
|
|
> $tdate->modify('-' . $preferences->pref_membership_offermonths . ' month');
|
|
> $diff2 = (int)$edate->diff($tdate)->format('%a');
|
|
215,221c231,232
|
|
< if ($preferences->pref_beg_membership != '') { //adhésion classique de date à date + 1 an
|
|
< if ($this->_type->extension==-1) //C'est une adhésion classique en année
|
|
< {
|
|
< //case beginning of membership
|
|
< list($j, $m) = explode('/', $preferences->pref_beg_membership);
|
|
< $edate = new \DateTime($bdate->format('Y') . '-' . $m . '-' . $j);
|
|
< while ($edate <= $bdate) {
|
|
---
|
|
> //when number of days until end of membership is less than for offered months, it's free :)
|
|
> if ($diff1 <= $diff2) {
|
|
224,240d234
|
|
<
|
|
< if ($preferences->pref_membership_offermonths > 0) {
|
|
< //count days until end of membership date
|
|
< $diff1 = (int)$bdate->diff($edate)->format('%a');
|
|
<
|
|
< //count days beetween end of membership date and offered months
|
|
< $tdate = clone $edate;
|
|
< $tdate->modify('-' . $preferences->pref_membership_offermonths . ' month');
|
|
< $diff2 = (int)$edate->diff($tdate)->format('%a');
|
|
<
|
|
< //when number of days until end of membership is less than for offered months, it's free :)
|
|
< if ($diff1 <= $diff2) {
|
|
< $edate->modify('+1 year');
|
|
< }
|
|
< }
|
|
<
|
|
< $this->_end_date = $edate->format('Y-m-d');
|
|
242,248c236,238
|
|
< else
|
|
< {
|
|
< $dext = new \DateInterval('P' . $this->_type->extension . 'M');
|
|
< $edate = $bdate->add($dext);
|
|
< $this->_end_date = $edate->format('Y-m-d');
|
|
< }
|
|
< } elseif ($preferences->pref_membership_ext != '') { //adhésion classique de date à date + N mois
|
|
---
|
|
>
|
|
> $this->_end_date = $edate->format('Y-m-d');
|
|
> } elseif ($preferences->pref_membership_ext != '') {
|
|
251,254c241
|
|
< if ($this->_type->extension==-1)
|
|
< $this->_extension = $preferences->pref_membership_ext;
|
|
< else
|
|
< $this->_extension = $this->_type->extension;
|
|
---
|
|
> $this->_extension = $preferences->pref_membership_ext;
|
|
534,535c521
|
|
< //->where(array('cotis_extension' => new Expression('true')))
|
|
< ->where->notEqualTo('cotis_extension', 0)
|
|
---
|
|
> ->where(array('cotis_extension' => new Expression('true')))
|
|
847,849c833
|
|
< )->where->notEqualTo('cotis_extension', 0);
|
|
<
|
|
< /*->where(
|
|
---
|
|
> )->where(
|
|
851c835
|
|
< );*/
|
|
---
|
|
> );
|
|
1255c1239
|
|
< if ($this->$rname->extension != 0) {//== 1) {
|
|
---
|
|
> if ($this->$rname->extension == 1) {
|
|
diff -r -x '*.log' -x '*.rej' -x 'composer.*' '--exclude=data' '--exclude=plugins' '--exclude=vendor' galette/galette/lib/Galette/Entity/ContributionsTypes.php galette0941_avantmodif/galette/lib/Galette/Entity/ContributionsTypes.php
|
|
130,131d129
|
|
<
|
|
<
|
|
diff -r -x '*.log' -x '*.rej' -x 'composer.*' '--exclude=data' '--exclude=plugins' '--exclude=vendor' galette/galette/lib/Galette/Entity/Entitled.php galette0941_avantmodif/galette/lib/Galette/Entity/Entitled.php
|
|
253,254c253
|
|
< //$select->where(array($this->fthird => new Expression('true')));
|
|
< $select->where->notEqualTo($this->fthird, 0);
|
|
---
|
|
> $select->where(array($this->fthird => new Expression('true')));
|
|
256,257c255
|
|
< //$select->where(array($this->fthird => new Expression('false')));
|
|
< $select->where->equalTo($this->fthird, 0);
|
|
---
|
|
> $select->where(array($this->fthird => new Expression('false')));
|
|
diff -r -x '*.log' -x '*.rej' -x 'composer.*' '--exclude=data' '--exclude=plugins' '--exclude=vendor' galette/galette/templates/default/editer_intitule.tpl galette0941_avantmodif/galette/templates/default/editer_intitule.tpl
|
|
28,38c28
|
|
<
|
|
< <select name="{$field}">
|
|
< <option value="0" {if $entry->$field == 0}selected="selected"{/if}>{_T string="No"}</option>
|
|
< <option value="-1" {if $entry->$field == -1}selected="selected"{/if}>{_T string="By default"}</option>
|
|
< {for $m=12 to 2 step -1}
|
|
< <option value="{$m}" {if $entry->$field == $m}selected="selected"{/if} >{$m} {_T string="months"}</option>
|
|
< {/for}
|
|
< <option value="1" {if $entry->$field == 1}selected="selected"{/if} >1 {_T string="month"}</option>
|
|
< </select>
|
|
<
|
|
<
|
|
---
|
|
> <input type="checkbox" name="{$field}" id="{$field}" value="1"{if $entry->$field == 1} checked="checked"{/if} />
|
|
diff -r -x '*.log' -x '*.rej' -x 'composer.*' '--exclude=data' '--exclude=plugins' '--exclude=vendor' galette/galette/templates/default/gestion_intitule_content.tpl galette0941_avantmodif/galette/templates/default/gestion_intitule_content.tpl
|
|
36d35
|
|
<
|
|
38,44c37,38
|
|
< <option value="-1">{_T string="By default"}</option>
|
|
< {for $m=12 to 2 step -1}
|
|
< <option value="{$m}">{$m} {_T string="months"}</option>
|
|
< {/for}
|
|
< <option value="1">1 {_T string="month"}</option>
|
|
<
|
|
< </select>
|
|
---
|
|
> <option value="1">{_T string="Yes"}</option>
|
|
> </select>
|
|
83,88c77,78
|
|
< {if $entry.extra eq 0}
|
|
< {_T string="No"}
|
|
< {elseif $entry.extra eq -1}
|
|
< {_T string="By default"}
|
|
< {elseif $entry.extra eq 1}
|
|
< {$entry.extra} {_T string="month"}
|
|
---
|
|
> {if $entry.extra eq 1}
|
|
> {_T string="Yes"}
|
|
90c80
|
|
< {$entry.extra} {_T string="months"}
|
|
---
|
|
> {_T string="No"}
|