diff options
author | Georg Ehrke <georg.stefan.germany@googlemail.com> | 2011-10-06 13:21:38 +0200 |
---|---|---|
committer | Georg Ehrke <georg.stefan.germany@googlemail.com> | 2011-10-06 13:21:38 +0200 |
commit | bf017fb4bdae355675d5b81755ed0c738cf58d2e (patch) | |
tree | 79e82b5f8cb7d455c8d5b47921168781ecb2c66b /apps | |
parent | 55ab68a3326f6900faac3bf1779346013e6bac9a (diff) | |
parent | f92fa6989e4d784f57bdbe4f9d9f9da0faa5bf47 (diff) | |
download | nextcloud-server-bf017fb4bdae355675d5b81755ed0c738cf58d2e.tar.gz nextcloud-server-bf017fb4bdae355675d5b81755ed0c738cf58d2e.zip |
Merge branch 'master' of gitorious.org:owncloud/owncloud
Diffstat (limited to 'apps')
-rw-r--r-- | apps/calendar/templates/settings.php | 42 | ||||
-rw-r--r-- | apps/contacts/ajax/addproperty.php | 11 | ||||
-rw-r--r-- | apps/contacts/js/interface.js | 2 | ||||
-rw-r--r-- | apps/contacts/lib/vcard.php | 22 | ||||
-rw-r--r-- | apps/contacts/templates/part.addcardform.php | 36 | ||||
-rw-r--r-- | apps/gallery/ajax/cover.php | 2 | ||||
-rw-r--r-- | apps/gallery/ajax/getAlbums.php | 4 | ||||
-rw-r--r-- | apps/gallery/ajax/getCovers.php | 2 | ||||
-rw-r--r-- | apps/gallery/appinfo/info.xml | 3 | ||||
-rw-r--r-- | apps/gallery/lib_scanner.php | 10 | ||||
-rw-r--r-- | apps/media/css/music.css | 2 | ||||
-rw-r--r-- | apps/remoteStorage/lib_remoteStorage.php | 2 |
12 files changed, 85 insertions, 53 deletions
diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index 44fbb230a43..19a1a543b46 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -11,8 +11,8 @@ OC_UTIL::addStyle('', 'jquery.multiselect'); ?> <form id="calendar"> <fieldset class="personalblock"> - <label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label> - <select style="display: none;" id="timezone" name="timezone"> + <table class="nostyle"> + <tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone"> <?php $continent = ''; foreach($_['timezones'] as $timezone): @@ -27,33 +27,17 @@ OC_UTIL::addStyle('', 'jquery.multiselect'); echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>'; endif; endforeach;?> - </select> - <label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label> - <select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat"> - <option value="24" id="24h"><?php echo $l->t("24h"); ?></option> - <option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option> - </select><br /> - <label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label> - <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><br /> - <label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label> - <select id="weekend" name="weekend[]" style="width: 50%;" 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><br /> - <label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label> - <input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?> - <br /> + </select></td></tr> + + <tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td> + <select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat"> + <option value="24" id="24h"><?php echo $l->t("24h"); ?></option> + <option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option> + </select> + </td></tr> + + </table> + <?php echo $l->t('Calendar CalDAV syncing address:');?> <?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br /> </fieldset> 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..5490c4a55ad 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('REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)'); $stmt->execute(array($albumId, $img)); } } diff --git a/apps/media/css/music.css b/apps/media/css/music.css index c4db4e05855..8575e6334a5 100644 --- a/apps/media/css/music.css +++ b/apps/media/css/music.css @@ -18,7 +18,7 @@ a.jp-mute,a.jp-unmute { left:24em; } div.jp-volume-bar { position:absolute; overflow:hidden; background:#eee; width:4em; height:0.4em; cursor:pointer; top:1.3em; left:27em; } div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; } -#collection { padding-top:1em; position:relative; width:70em; float:left; } +#collection { padding-top:1em; position:relative; width:100%; float:left; } #collection li.album,#collection li.song { margin-left:3em; } #leftcontent img.remove { display:none; float:right; cursor:pointer; } #leftcontent li:hover img.remove { display:inline; } 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 />'; |