summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2011-10-05 20:49:08 +0100
committerTom Needham <needham.thomas@gmail.com>2011-10-05 20:49:08 +0100
commit30343f15e206de739fda126417cf7392d8de5c8a (patch)
treeb8c4c10cf25815acd8c9c35d52cd38d68c5071bf
parentedd958836e3cef5e93ae3ee59b4db398f8f86cad (diff)
parentaf6eb52b5ee8616d4dc36d51956b96345d9b26fb (diff)
downloadnextcloud-server-30343f15e206de739fda126417cf7392d8de5c8a.tar.gz
nextcloud-server-30343f15e206de739fda126417cf7392d8de5c8a.zip
Merge branch 'master' of gitorious.org:owncloud/owncloud into ace-editor
-rw-r--r--apps/calendar/templates/settings.php23
-rw-r--r--apps/contacts/ajax/addproperty.php11
-rw-r--r--apps/contacts/js/interface.js2
-rw-r--r--apps/contacts/lib/vcard.php22
-rw-r--r--apps/contacts/templates/part.addcardform.php36
-rw-r--r--apps/gallery/ajax/cover.php2
-rw-r--r--apps/gallery/ajax/getAlbums.php4
-rw-r--r--apps/gallery/ajax/getCovers.php2
-rw-r--r--apps/gallery/appinfo/info.xml3
-rw-r--r--apps/gallery/lib_scanner.php10
-rw-r--r--apps/remoteStorage/lib_remoteStorage.php2
11 files changed, 71 insertions, 46 deletions
diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php
index 3bfda702e9b..19a1a543b46 100644
--- a/apps/calendar/templates/settings.php
+++ b/apps/calendar/templates/settings.php
@@ -36,29 +36,6 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
</select>
</td></tr>
- <tr><td><label for="firstdayofweek" class="bold"><?php echo $l->t('First day of the week');?></label></td><td>
- <select style="display: none;" id="firstdayofweek" name="firstdayofweek">
- <?php
- $weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
- for($i = 0;$i <= 6;$i++){
- echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
- }
- ?>
- </select>
- </td></tr>
-
- <tr><td><label for="weekend" class="bold"><?php echo $l->t('Days of weekend');?></label></td><td>
- <select id="weekend" name="weekend[]" style="width: 30em;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
- <?php
- $weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
- for($i = 0;$i <= 6;$i++){
- echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
- }
- ?>
- </select>
- </td></tr>
-
- <tr><td><label for="duration" class="bold"><?php echo $l->t('Event duration');?></label></td><td><input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?></td></tr>
</table>
<?php echo $l->t('Calendar CalDAV syncing address:');?>
diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php
index 0b218c6298f..68c4f65fa5c 100644
--- a/apps/contacts/ajax/addproperty.php
+++ b/apps/contacts/ajax/addproperty.php
@@ -53,16 +53,7 @@ $name = $_POST['name'];
$value = $_POST['value'];
$parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
-if(is_array($value)){
- $value = OC_Contacts_VCard::escapeSemicolons($value);
-}
-$property = new Sabre_VObject_Property( $name, $value );
-$parameternames = array_keys($parameters);
-foreach($parameternames as $i){
- $property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
-}
-
-$vcard->add($property);
+OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters);
$line = count($vcard->children) - 1;
$checksum = md5($property->serialize());
diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js
index 3ec84a3c8ba..47e9bb10b1f 100644
--- a/apps/contacts/js/interface.js
+++ b/apps/contacts/js/interface.js
@@ -104,6 +104,8 @@ $(document).ready(function(){
if(jsondata.status == 'success'){
$('#rightcontent').data('id',jsondata.data.id);
$('#rightcontent').html(jsondata.data.page);
+ $('#leftcontent .active').removeClass('active');
+ $('#leftcontent ul').append('<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'">'+jsondata.data.name+'</a></li>');
}
else{
alert(jsondata.data.message);
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 1c9a8049f73..bff2897384f 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -246,7 +246,7 @@ class OC_Contacts_VCard{
public static function escapeSemicolons($value){
foreach($value as &$i ){
$i = implode("\\\\;", explode(';', $i));
- } unset($i);
+ }
return implode(';',$value);
}
@@ -273,6 +273,26 @@ class OC_Contacts_VCard{
}
/**
+ * @brief Add property to vcard object
+ * @param object $vcard
+ * @param object $name of property
+ * @param object $value of property
+ * @param object $paramerters of property
+ */
+ public static function addVCardProperty($vcard, $name, $value, $parameters=array()){
+ if(is_array($value)){
+ $value = OC_Contacts_VCard::escapeSemicolons($value);
+ }
+ $property = new Sabre_VObject_Property( $name, $value );
+ $parameternames = array_keys($parameters);
+ foreach($parameternames as $i){
+ $property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
+ }
+
+ $vcard->add($property);
+ }
+
+ /**
* @brief Data structure of vCard
* @param object $property
* @return associative array
diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php
index e87c64507dc..c7d668fae58 100644
--- a/apps/contacts/templates/part.addcardform.php
+++ b/apps/contacts/templates/part.addcardform.php
@@ -11,5 +11,41 @@
<?php endif; ?>
<label for="fn"><?php echo $l->t('Name'); ?></label>
<input type="text" name="fn" value=""><br>
+ <label for="ADR"><?php echo $l->t('Address'); ?></label>
+ <div id="contacts_addresspart">
+ <select id="ADR" name="parameters[ADR][TYPE]" size="1">
+ <option value="adr_work"><?php echo $l->t('Work'); ?></option>
+ <option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
+ </select>
+ <p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[ADR][0]" value=""></p>
+ <p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[ADR][1]" value=""></p>
+ <p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[ADR][2]" value=""></p>
+ <p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[ADR][3]" value=""></p>
+ <p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[ADR][4]" value=""></p>
+ <p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[ADR][5]" value=""></p>
+ <p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[ADR][6]" value=""></p>
+ </div>
+ <label for="TEL"><?php echo $l->t('Telephone'); ?></label>
+ <div id="contacts_phonepart">
+ <select id="TEL" name="parameters[TEL][TYPE]" size="1">
+ <option value="home"><?php echo $l->t('Home'); ?></option>
+ <option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
+ <option value="work"><?php echo $l->t('Work'); ?></option>
+ <option value="text"><?php echo $l->t('Text'); ?></option>
+ <option value="voice"><?php echo $l->t('Voice'); ?></option>
+ <option value="fax"><?php echo $l->t('Fax'); ?></option>
+ <option value="video"><?php echo $l->t('Video'); ?></option>
+ <option value="pager"><?php echo $l->t('Pager'); ?></option>
+ </select>
+ <input type="text" name="value[TEL]" value="">
+ </div>
+ <label for="EMAIL"><?php echo $l->t('Email'); ?></label>
+ <div id="contacts_email">
+ <input id="EMAIL" type="text" name="value[EMAIL]" value="">
+ </div>
+ <label for="ORG"><?php echo $l->t('Organization'); ?></label>
+ <div id="contacts_organisation">
+ <input id="ORG" type="text" name="value[ORG]" value="">
+ </div>
<input type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>">
</form>
diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php
index 375905ec520..44d73028510 100644
--- a/apps/gallery/ajax/cover.php
+++ b/apps/gallery/ajax/cover.php
@@ -45,7 +45,7 @@ $box_size = 200;
$album_name = $_GET['album'];
$x = $_GET['x'];
-$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
+$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` == *PREFIX*gallery_albums.`album_id`');
$result = $stmt->execute(array(OC_User::getUser(), $album_name));
$x = min((int)($x/($box_size/$result->numRows())), $result->numRows()-1); // get image to display
$result->seek($x); // never throws
diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php
index 6b551ac49d5..2829dae81f3 100644
--- a/apps/gallery/ajax/getAlbums.php
+++ b/apps/gallery/ajax/getAlbums.php
@@ -7,12 +7,12 @@ if (!OC_User::IsLoggedIn()) {
}
$a = array();
-$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?');
+$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?');
$result = $stmt->execute(array(OC_User::getUser()));
while ($r = $result->fetchRow()) {
$album_name = $r['album_name'];
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ?');
$tmp_res = $stmt->execute(array($r['album_id']));
$a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10));
}
diff --git a/apps/gallery/ajax/getCovers.php b/apps/gallery/ajax/getCovers.php
index d56bf6fa4b7..57737f2fdd6 100644
--- a/apps/gallery/ajax/getCovers.php
+++ b/apps/gallery/ajax/getCovers.php
@@ -46,7 +46,7 @@ if( !OC_User::isLoggedIn()){
$box_size = 200;
$album_name= $_GET['album_name'];
-$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
+$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` = *PREFIX*gallery_albums.`album_id`');
$result = $stmt->execute(array(OC_User::getUser(), $album_name));
$numOfItems = min($result->numRows(),10);
diff --git a/apps/gallery/appinfo/info.xml b/apps/gallery/appinfo/info.xml
index 154b5fcf7ae..054ddb6f139 100644
--- a/apps/gallery/appinfo/info.xml
+++ b/apps/gallery/appinfo/info.xml
@@ -7,5 +7,4 @@
<author>Bartosz Przybylski</author>
<require>2</require>
<description></description>
- <default_enable/>
-</info>
+</info> \ No newline at end of file
diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php
index fe14b68add1..fcd9b0acb65 100644
--- a/apps/gallery/lib_scanner.php
+++ b/apps/gallery/lib_scanner.php
@@ -28,21 +28,21 @@ class OC_GALLERY_SCANNER {
}
$current_album['imagesCount'] = count($current_album['images']);
$albums[] = $current_album;
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
if ($result->numRows() == 0 && count($current_album['images'])) {
- $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES (?, ?)');
+ $stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)');
$stmt->execute(array(OC_User::getUser(), $current_album['name']));
}
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
$albumId = $result->fetchRow();
$albumId = $albumId['album_id'];
foreach ($current_album['images'] as $img) {
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE "album_id" = ? AND "file_path" = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?');
$result = $stmt->execute(array($albumId, $img));
if ($result->numRows() == 0) {
- $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_photos ("album_id", "file_path") VALUES (?, ?)');
+ $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)');
$stmt->execute(array($albumId, $img));
}
}
diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php
index 259efb0da69..5677ab3c6e0 100644
--- a/apps/remoteStorage/lib_remoteStorage.php
+++ b/apps/remoteStorage/lib_remoteStorage.php
@@ -3,7 +3,7 @@
class OC_remoteStorage {
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
- $result=$query->execute(array($user,$userAddress,$dataScope));
+ $result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';