Merge gitorious.org:owncloud/owncloud into vcategories

This commit is contained in:
Thomas Tanghus 2012-02-20 23:42:06 +01:00
commit 7a49c8e59c
27 changed files with 100 additions and 32 deletions

View File

@ -66,6 +66,7 @@ foreach($current as $item) {
if(is_array($value)) { if(is_array($value)) {
ksort($value); // NOTE: Important, otherwise the compound value will be set in the order the fields appear in the form! ksort($value); // NOTE: Important, otherwise the compound value will be set in the order the fields appear in the form!
$value = array_map('strip_tags', $value);
} else { } else {
$value = strip_tags($value); $value = strip_tags($value);
} }

View File

@ -13,7 +13,13 @@ OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts'); OC_JSON::checkAppEnabled('contacts');
$userid = OC_User::getUser(); $userid = OC_User::getUser();
$bookid = OC_Contacts_Addressbook::add($userid, strip_tags($_POST['name']), null); $name = trim(strip_tags($_POST['name']));
if(!$name) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.'))));
OC_Log::write('contacts','ajax/createaddressbook.php: Cannot add addressbook with an empty name: '.strip_tags($_POST['name']), OC_Log::ERROR);
exit();
}
$bookid = OC_Contacts_Addressbook::add($userid, $name, null);
if(!$bookid) { if(!$bookid) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.')))); OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.'))));
OC_Log::write('contacts','ajax/createaddressbook.php: Error adding addressbook: '.$_POST['name'], OC_Log::ERROR); OC_Log::write('contacts','ajax/createaddressbook.php: Error adding addressbook: '.$_POST['name'], OC_Log::ERROR);

View File

@ -52,6 +52,7 @@ $checksum = isset($_POST['checksum'])?$_POST['checksum']:null;
// } // }
if(is_array($value)){ // FIXME: How to strip_tags for compound values? if(is_array($value)){ // FIXME: How to strip_tags for compound values?
$value = array_map('strip_tags', $value);
ksort($value); // NOTE: Important, otherwise the compound value will be set in the order the fields appear in the form! ksort($value); // NOTE: Important, otherwise the compound value will be set in the order the fields appear in the form!
$value = OC_VObject::escapeSemicolons($value); $value = OC_VObject::escapeSemicolons($value);
} else { } else {

View File

@ -15,7 +15,14 @@ OC_JSON::checkAppEnabled('contacts');
$bookid = $_POST['id']; $bookid = $_POST['id'];
OC_Contacts_App::getAddressbook($bookid); // is owner access check OC_Contacts_App::getAddressbook($bookid); // is owner access check
if(!OC_Contacts_Addressbook::edit($bookid, $_POST['name'], null)) { $name = trim(strip_tags($_POST['name']));
if(!$name) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot update addressbook with an empty name.'))));
OC_Log::write('contacts','ajax/updateaddressbook.php: Cannot update addressbook with an empty name: '.strip_tags($_POST['name']), OC_Log::ERROR);
exit();
}
if(!OC_Contacts_Addressbook::edit($bookid, $name, null)) {
OC_JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.')))); OC_JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.'))));
OC_Log::write('contacts','ajax/updateaddressbook.php: Error adding addressbook: ', OC_Log::ERROR); OC_Log::write('contacts','ajax/updateaddressbook.php: Error adding addressbook: ', OC_Log::ERROR);
//exit(); //exit();

View File

@ -1043,13 +1043,13 @@ Contacts={
return false; return false;
}else{ }else{
$.post(OC.filePath('contacts', 'ajax', 'deletebook.php'), { id: bookid}, $.post(OC.filePath('contacts', 'ajax', 'deletebook.php'), { id: bookid},
function(data) { function(jsondata) {
if (data.status == 'success'){ if (jsondata.status == 'success'){
$('#chooseaddressbook_dialog').dialog('destroy').remove(); $('#chooseaddressbook_dialog').dialog('destroy').remove();
Contacts.UI.Contacts.update(); Contacts.UI.Contacts.update();
Contacts.UI.Addressbooks.overview(); Contacts.UI.Addressbooks.overview();
} else { } else {
Contacts.UI.messageBox(t('contacts', 'Error'), data.message); Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
//alert('Error: ' + data.message); //alert('Error: ' + data.message);
} }
}); });
@ -1059,10 +1059,14 @@ Contacts={
Contacts.UI.notImplemented(); Contacts.UI.notImplemented();
}, },
submit:function(button, bookid){ submit:function(button, bookid){
var displayname = $("#displayname_"+bookid).val(); var displayname = $("#displayname_"+bookid).val().trim();
var active = $("#edit_active_"+bookid+":checked").length; var active = $("#edit_active_"+bookid+":checked").length;
var description = $("#description_"+bookid).val(); var description = $("#description_"+bookid).val();
if(displayname.length == 0) {
Contacts.UI.messageBox(t('contacts', 'Error'), t('contacts', 'Displayname cannot be empty.'));
return false;
}
var url; var url;
if (bookid == 'new'){ if (bookid == 'new'){
url = OC.filePath('contacts', 'ajax', 'createaddressbook.php'); url = OC.filePath('contacts', 'ajax', 'createaddressbook.php');
@ -1070,12 +1074,14 @@ Contacts={
url = OC.filePath('contacts', 'ajax', 'updateaddressbook.php'); url = OC.filePath('contacts', 'ajax', 'updateaddressbook.php');
} }
$.post(url, { id: bookid, name: displayname, active: active, description: description }, $.post(url, { id: bookid, name: displayname, active: active, description: description },
function(data){ function(jsondata){
if(data.status == 'success'){ if(jsondata.status == 'success'){
$(button).closest('tr').prev().html(data.page).show().next().remove(); $(button).closest('tr').prev().html(data.page).show().next().remove();
Contacts.UI.Contacts.update();
} else {
Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
} }
}); });
Contacts.UI.Contacts.update();
}, },
cancel:function(button, bookid){ cancel:function(button, bookid){
$(button).closest('tr').prev().show().next().remove(); $(button).closest('tr').prev().show().next().remove();

View File

@ -124,12 +124,14 @@ Contacts={
url = OC.filePath('contacts', 'ajax', 'updateaddressbook.php'); url = OC.filePath('contacts', 'ajax', 'updateaddressbook.php');
} }
$.post(url, { id: bookid, name: displayname, active: active, description: description }, $.post(url, { id: bookid, name: displayname, active: active, description: description },
function(data){ function(jsondata){
if(data.status == 'success'){ if(jsondata.status == 'success'){
$(button).closest('tr').prev().html(data.page).show().next().remove(); $(button).closest('tr').prev().html(data.page).show().next().remove();
Contacts.UI.Contacts.update();
} else {
Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
} }
}); });
Contacts.UI.Contacts.update();
}, },
cancel:function(button, bookid){ cancel:function(button, bookid){
$(button).closest('tr').prev().show().next().remove(); $(button).closest('tr').prev().show().next().remove();

View File

@ -5,18 +5,40 @@
*/ */
(function ($) { (function ($) {
var inviewObjects = {}, viewportSize, viewportOffset, var inviewObjects = {}, viewportSize, viewportOffset,
d = document, w = window, documentElement = d.documentElement, expando = $.expando; d = document, w = window, documentElement = d.documentElement, expando = $.expando, isFiring = false, $elements = {};
$.event.special.inview = { $.event.special.inview = {
add: function(data) { add: function(data) {
inviewObjects[data.guid + "-" + this[expando]] = { data: data, $element: $(this) }; var inviewObject = { data: data, $element: $(this) }
inviewObjects[data.guid + "-" + this[expando]] = inviewObject;
var selector = inviewObject.data.selector,
$element = inviewObject.$element;
var hash = parseInt(getHash( data.guid + this[expando]));
$elements[hash] = selector ? $element.find(selector) : $element;
}, },
remove: function(data) { remove: function(data) {
try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {} try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {}
try {
var hash = parseInt(getHash(data.guid + this[expando]));
delete($elements[hash]);
} catch (e){}
} }
}; };
function getHash(str){
str = str+'';
var hash = 0;
if (str.length == 0) return hash;
for (i = 0; i < str.length; i++) {
char = str.charCodeAt(i);
hash = ((hash<<5)-hash)+char;
hash = hash & hash; // Convert to 32bit integer
}
return Math.abs(hash);
}
function getViewportSize() { function getViewportSize() {
var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth }; var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth };
@ -46,22 +68,15 @@
} }
function checkInView() { function checkInView() {
var $elements = $(), elementsLength, i = 0; if (isFiring){
return;
$.each(inviewObjects, function(i, inviewObject) { }
var selector = inviewObject.data.selector, isFiring = true;
$element = inviewObject.$element;
$elements = $elements.add(selector ? $element.find(selector) : $element);
});
elementsLength = $elements.length;
if (elementsLength) {
viewportSize = viewportSize || getViewportSize(); viewportSize = viewportSize || getViewportSize();
viewportOffset = viewportOffset || getViewportOffset(); viewportOffset = viewportOffset || getViewportOffset();
for (; i<elementsLength; i++) { for (var i in $elements) {
// Ignore elements that are not in the DOM tree if (isNaN(parseInt(i))) {
if (!$.contains(documentElement, $elements[i])) {
continue; continue;
} }
@ -79,6 +94,7 @@
// It seems that the execution of this function is interferred by the onresize/onscroll event // It seems that the execution of this function is interferred by the onresize/onscroll event
// where viewportOffset and viewportSize are unset // where viewportOffset and viewportSize are unset
if (!viewportOffset || !viewportSize) { if (!viewportOffset || !viewportSize) {
isFiring = false;
return; return;
} }
@ -100,7 +116,7 @@
$element.data('inview', false).trigger('inview', [false]); $element.data('inview', false).trigger('inview', [false]);
} }
} }
} isFiring = false;
} }
$(w).bind("scroll resize", function() { $(w).bind("scroll resize", function() {

View File

@ -309,7 +309,7 @@ class OC_Contacts_VCard{
* @return boolean * @return boolean
*/ */
public static function delete($id){ public static function delete($id){
// FIXME: Add error checking. // FIXME: Add error checking. Touch addressbook.
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' ); $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' );
$stmt->execute(array($id)); $stmt->execute(array($id));
@ -334,6 +334,7 @@ class OC_Contacts_VCard{
// FIXME: Add error checking. Deleting a card gives an Kontact/Akonadi error. // FIXME: Add error checking. Deleting a card gives an Kontact/Akonadi error.
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' ); $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' );
$stmt->execute(array($aid,$uri)); $stmt->execute(array($aid,$uri));
OC_Contacts_Addressbook::touch($aid);
return true; return true;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

View File

@ -0,0 +1,28 @@
15.02.2012
Following new icons have been added:
core/img/filetypes/application-vnd.oasis.opendocument.formula.png
core/img/filetypes/application-vnd.oasis.opendocument.graphics.png
core/img/filetypes/application-vnd.oasis.opendocument.presentation.png
core/img/filetypes/application-vnd.oasis.opendocument.spreadsheet.png
core/img/filetypes/application-vnd.oasis.opendocument.text.png
Download: http://odftoolkit.org/ODF-Icons#ODF_Icons
License: Apache 2.0
core/img/filetypes/application-x-7z-compressed.png
core/img/filetypes/application-x-bzip-compressed-tar.png
core/img/filetypes/application-x-bzip.png
core/img/filetypes/application-x-compressed-tar.png
core/img/filetypes/application-x-deb.png
core/img/filetypes/application-x-debian-package.png
core/img/filetypes/application-x-gzip.png
core/img/filetypes/application-x-lzma-compressed-tar.png
core/img/filetypes/application-x-rar.png
core/img/filetypes/application-x-rpm.png
core/img/filetypes/application-x-tar.png
core/img/filetypes/application-x-tarz.png
core/img/filetypes/application-zip.png
Author: Gomez Hyuuga
License: Creative Commons Attribution-Share Alike 3.0 Unported License
Download: http://kde-look.org/content/show.php/?content=101767