Skip to content

Commit

Permalink
Fix some bugs and update to 2.55
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrauen committed Mar 31, 2015
1 parent a5e38a0 commit 891aa45
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 28 deletions.
14 changes: 1 addition & 13 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
Das gesamte Changelog ist hier zu finden:
https://intern.churchtools.de/?q=churchwiki#WikiView/filterWikicategory_id:0/doc:Changelog/

v2.54b
- (CDB) Fehler "Zoom nicht erlaubt" behoben bei dem Recht "view address"
- (CDB) Fehler der Sortierung in der Statistik behoben
- (Cal) Fehler beim Enddatum in der Eventanzeige-Dialogbox behoben
- (Cal) Das Recht persönliche Kalender erstellen wurde nicht korrekt abgefragt
- (CS) Fehler bei Agenda beim Herausnehmen von Uhrzeiten vor einem Event behoben.
- (CS) Fehler bei Agenda wenn man eine Agenda kopiert hat wies der alte Integrationsmerkmale auf.
- Fehler beim Löschen von Stammdaten behoben

v2.54c
- (Cal) Problem beim Löschen von Serientermine von "diesen und zukünfitge" behoben.
https://intern.churchtools.de/?q=churchwiki#WikiView/filterWikicategory_id:0/doc:Changelog/
2 changes: 1 addition & 1 deletion system/churchcal/classes/CTChurchCalModule.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getMasterData() {
public function getAllowedPeopleForCalender($params) {
include_once ('./' . CHURCHDB . '/churchdb_db.php');
$db = db_query("SELECT * FROM {cc_domain_auth}
WHERE daten_id=:daten_id AND auth_id=403",
WHERE daten_id=:daten_id AND (auth_id=403 || auth_id=404)",
array (":daten_id" => $params["category_id"]));
$res = array ();
foreach ($db as $d) {
Expand Down
11 changes: 11 additions & 0 deletions system/churchcore/cc_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ function CCEvent(source) {
});
}

/**
* Delete all functions of the event object
*/
CCEvent.prototype.clean = function() {
var c = this.clone();
each(c, function(k, a) {
if ($.isFunction(a)) delete c[k];
});
return c;
}

CCEvent.prototype.clone = function () {
var t = this;
var e = jQuery.extend(true, {}, this);
Expand Down
13 changes: 13 additions & 0 deletions system/churchcore/churchcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ function churchcore_sortData(data, sortVariable, reverse, alphanumeric, sortVari
return churchcore_sortData_numeric(data, sortVariable, reverse, sortVariable2);
}

function churchcore_getLast(obj, max) {
var countObjects = churchcore_countObjectElements(obj);
var newObj = new Object();
var i = 0;
each (obj, function(k, o) {
if (i >= countObjects - max) {
newObj[k] = o;
}
i++;
})
return newObj;
}

function churchcore_isObjectEmpty(obj) {
if (obj==null) return false;
var ret = true;
Expand Down
3 changes: 1 addition & 2 deletions system/churchcore/churchcore_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,6 @@ function churchcore_sendEMailToPersonIDs($ids, $subject, $content, $from = null,
else {
$mailtxt = str_replace('\"', '"', $mailtxt);
$mailtxt = churchcore_personalizeTemplate($mailtxt, $p);
// ct_log("[ChurchCore] - Sende Mail an $p->email $mailtxt",2,-1,"mail");

churchcore_mail($from, $p->email, $subject, $mailtxt, $htmlmail, $withtemplate);
}
Expand All @@ -980,7 +979,7 @@ function churchcore_personalizeTemplate($txt, $p) {
$txt = str_replace("[Nachname]", ( isset($p->name) ? $p->name : ""), $txt);
$txt = str_replace("[Name]", ( isset($p->name) ? $p->name : ""), $txt);
$txt = str_replace("[Titel]", ( isset($p->titel) ? $p->titel : ""), $txt);
$txt = str_replace("[Spitzname]", ( isset($p->spitzname) ? $p->spitzname : (isset ( $p->vorname ) ? $p->vorname : "")), $txt);
$txt = str_replace("[Spitzname]", ( !empty($p->spitzname) ? $p->spitzname : (isset ( $p->vorname ) ? $p->vorname : "")), $txt);
$txt = str_replace("[Id]", ( isset($p->id) ? $p->id : ""), $txt);
$txt = str_replace("[Initialen]", ( isset($p->vorname) ? substr($p->vorname,0,1) : "")
. ( isset($p->name) ? substr($p->name,0,1) : ""), $txt);
Expand Down
6 changes: 3 additions & 3 deletions system/churchcore/test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ QUnit.test( "Test Event Split", function( assert ) {

// Test One Day in series
cal_series.doSplit(new Date('2014-01-09 10:00'), false, function(newEvent, pastEvent, splitDate) {
assert.deepEqual(pastEvent, cal_series_with_exception.clone(), "pastEvent: Test one day in series");
assert.deepEqual(pastEvent.clean(), cal_series_with_exception.clean(), "pastEvent: Test one day in series");
});
cal_series.doSplit(new Date('2014-01-09 10:00'), false, function(newEvent, pastEvent, splitDate) {
assert.deepEqual(newEvent, cal_single.clone(), "NewEvent: Test one day in series");
assert.deepEqual(newEvent.clean(), cal_single.clean(), "NewEvent: Test one day in series");
});

// Test rest of series
Expand All @@ -70,7 +70,7 @@ QUnit.test( "Test Event Split", function( assert ) {
assert.deepEqual(pastEvent, d, "pastEvent: Test rest of series");
});
cal_series.doSplit(new Date('2014-01-09 10:00'), true, function(newEvent, pastEvent, splitDate) {
assert.deepEqual(newEvent, cal_series_2nd.clone(), "Test rest of series");
assert.deepEqual(newEvent.clean(), cal_series_2nd.clean(), "Test rest of series");
});

// Test special case first element edited!
Expand Down
2 changes: 1 addition & 1 deletion system/churchdb/cdb_groupview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ GroupView.prototype.renderEntryDetail = function(pos_id, data_id) {
info=info+"<br/>";
var count_dabei=0;
var count_stattgefunden=0;
each(churchcore_sortData(masterData.groups[g_id].meetingList,"datumvon"), function(k,a) {
each(churchcore_getLast(churchcore_sortData(masterData.groups[g_id].meetingList, "datumvon"), 16), function(k,a) {
if (a.eintragerfolgt_yn=="0")
info=info+'<img title="Eintrag noch nicht erfolgt f�r '+a.datumvon.toDateEn().toStringDe(false)+'" src="'+masterData.modulespath+'/images/box_white.png'+'"/>';
if (a.ausgefallen_yn=="1")
Expand Down
7 changes: 1 addition & 6 deletions system/churchdb/churchdb_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,7 @@ function churchdb_sendsms($ids, $txt) {
}
else {
$param["to"] = $p->telefonhandy;
$mailtxt = $txt;
$mailtxt = str_replace("[Vorname]", $p->vorname, $mailtxt);
$mailtxt = str_replace("[Nachname]", $p->name, $mailtxt);
$mailtxt = str_replace("[Spitzname]", $p->spitzname, $mailtxt);
$mailtxt = str_replace("[Id]", $p->id, $mailtxt);
$param["message"] = $mailtxt;
$param["message"] = churchcore_personalizeTemplate($txt, $p);
$res[$p->id] = churchdb_smspromote($param);
$res["smscount"]++;
}
Expand Down
2 changes: 1 addition & 1 deletion system/churchtools.mapping
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; $Id$
; Be careful, this setting controls the database structure updates
churchtools_version=2.54
churchtools_version=2.55

home = main/home.php
home/ajax = main/home.php
Expand Down
2 changes: 1 addition & 1 deletion system/includes/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* constants to use anywhere
*/
// To prevent Browser caching old versions of JS and CSS Files
define('JS_VERSION', '25403');
define('JS_VERSION', '25500');

//TODO: next two maybe not needed?
define('SITES', 'sites');
Expand Down
6 changes: 6 additions & 0 deletions system/includes/db_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,12 @@ function run_db_updates($db_version) {
db_query("ALTER TABLE {cdb_log} ENGINE = MyISAM");
db_query("ALTER TABLE {cc_mail_queue} ENGINE = MyISAM");
set_version("2.54");

case '2.54':
db_query("UPDATE {cdb_feld} set langtext='Familienstand' where langtext='Familenstand'");
db_query("UPDATE {cdb_feld} set kurztext='Familienstand' where kurztext='Familenstand'");
set_version("2.55");

} //end switch

$a=db_query("select * from {cc_config} where name='version'",null,false);
Expand Down

0 comments on commit 891aa45

Please sign in to comment.