]> source.dussan.org Git - nextcloud-server.git/commitdiff
removed description field for calendar
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Sat, 8 Oct 2011 11:28:01 +0000 (13:28 +0200)
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>
Sat, 8 Oct 2011 11:28:01 +0000 (13:28 +0200)
apps/calendar/ajax/createcalendar.php
apps/calendar/ajax/newcalendar.php
apps/calendar/ajax/updatecalendar.php
apps/calendar/appinfo/database.xml
apps/calendar/import.php
apps/calendar/lib/calendar.php
apps/calendar/lib/connector_sabre.php
apps/calendar/templates/part.editcalendar.php
apps/calendar/templates/part.import.php

index 82176d4368aeaede37e8e390f074718ce35d6208..3fb2e8398a3cacf0e0a1d434102a7c3e079dcb37 100644 (file)
@@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('calendar');
 
 $userid = OC_User::getUser();
-$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
+$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
 OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
 $calendar = OC_Calendar_Calendar::findCalendar($calendarid);
 $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
index e01ae01ee8a9905e6fbe797c2e7bdcd36c411429..f00dd0fb86284821831859643de23917b94ed2c3 100644 (file)
@@ -15,7 +15,6 @@ OC_JSON::checkAppEnabled('calendar');
 $calendar = array(
        'id' => 'new',
        'displayname' => '',
-       'description' => '',
        'calendarcolor' => '',
 );
 $tmpl = new OC_Template('calendar', 'part.editcalendar');
index 5cf48d50ea12eabb074760284861028fc21b40d2..a81644ded173b04d5522ec5490bb5e99b51b0e7e 100644 (file)
@@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('calendar');
 
 $calendarid = $_POST['id'];
-OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
+OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], null, null, null, $_POST['color']);
 OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
 $calendar = OC_Calendar_Calendar::findCalendar($calendarid);
 $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
index bf92179c40b45e0ac7a5cb69ddd99c8704f97e67..7f7b6457559c207e779a7c3d70c5084231e25989 100644 (file)
     <length>4</length>
    </field>
 
-   <field>
-    <name>description</name>
-    <type>clob</type>
-    <notnull>false</notnull>
-   </field>
-
    <field>
     <name>calendarorder</name>
     <type>integer</type>
index 46822349448cdc20a011aba341b7d70944a83a30..211791f551b151a23ba37ccaf97a206cde7007e5 100644 (file)
@@ -23,7 +23,7 @@ if($_GET["import"] == "existing"){
                $filename = "/" . $_GET["file"];
        }
 }else{
-       $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname'], $_POST['description']);
+       $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']);
        OC_Calendar_Calendar::setCalendarActive($id, 1);
        $calid = $id;
        if($_POST["path"] != ""){
index 4549af8b3c0c8bc0282adb73d9d8542001ee1b93..959cb14bf8f194ed3093f500777b69c73623d6d1 100644 (file)
@@ -30,7 +30,6 @@
  *     uri VARCHAR(100),
  *     active INTEGER UNSIGNED NOT NULL DEFAULT '0',
  *     ctag INTEGER UNSIGNED NOT NULL DEFAULT '0',
- *     description TEXT,
  *     calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0',
  *     calendarcolor VARCHAR(10),
  *     timezone TEXT,
@@ -94,14 +93,13 @@ class OC_Calendar_Calendar{
         * @brief Creates a new calendar
         * @param string $userid
         * @param string $name
-        * @param string $description
         * @param string $components Default: "VEVENT,VTODO,VJOURNAL"
         * @param string $timezone Default: null
         * @param integer $order Default: 1
         * @param string $color Default: null
         * @return insertid
         */
-       public static function addCalendar($userid,$name,$description,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
+       public static function addCalendar($userid,$name,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){
                $all = self::allCalendars($userid);
                $uris = array();
                foreach($all as $i){
@@ -110,8 +108,8 @@ class OC_Calendar_Calendar{
 
                $uri = self::createURI($name, $uris );
 
-               $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' );
-               $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components));
+               $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
+               $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
 
                return OC_DB::insertid();
        }
@@ -121,18 +119,17 @@ class OC_Calendar_Calendar{
         * @param string $principaluri
         * @param string $uri
         * @param string $name
-        * @param string $description
         * @param string $components
         * @param string $timezone
         * @param integer $order
         * @param string $color
         * @return insertid
         */
-       public static function addCalendarFromDAVData($principaluri,$uri,$name,$description,$components,$timezone,$order,$color){
+       public static function addCalendarFromDAVData($principaluri,$uri,$name,$components,$timezone,$order,$color){
                $userid = self::extractUserID($principaluri);
 
-               $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' );
-               $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components));
+               $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
+               $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
 
                return OC_DB::insertid();
        }
@@ -141,7 +138,6 @@ class OC_Calendar_Calendar{
         * @brief Edits a calendar
         * @param integer $id
         * @param string $name Default: null
-        * @param string $description Default: null
         * @param string $components Default: null
         * @param string $timezone Default: null
         * @param integer $order Default: null
@@ -150,20 +146,19 @@ class OC_Calendar_Calendar{
         *
         * Values not null will be set
         */
-       public static function editCalendar($id,$name=null,$description=null,$components=null,$timezone=null,$order=null,$color=null){
+       public static function editCalendar($id,$name=null,$components=null,$timezone=null,$order=null,$color=null){
                // Need these ones for checking uri
                $calendar = self::findCalendar($id);
 
                // Keep old stuff
                if(is_null($name)) $name = $calendar['name'];
-               if(is_null($description)) $description = $calendar['description'];
                if(is_null($components)) $components = $calendar['components'];
                if(is_null($timezone)) $timezone = $calendar['timezone'];
                if(is_null($order)) $order = $calendar['calendarorder'];
                if(is_null($color)) $color = $calendar['color'];
 
-               $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,description=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
-               $result = $stmt->execute(array($name,$description,$order,$color,$timezone,$components,$id));
+               $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' );
+               $result = $stmt->execute(array($name,$order,$color,$timezone,$components,$id));
 
                return true;
        }
index b94e6fb3ae79aca7e7108dfc1de41f7d468c51ff..13a542fccad15c3192d3e1f4da45228c114cec0f 100644 (file)
@@ -102,13 +102,12 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
                }
 
                if(!isset($newValues['displayname'])) $newValues['displayname'] = 'unnamed';
-               if(!isset($newValues['description'])) $newValues['description'] = '';
                if(!isset($newValues['components'])) $newValues['components'] = 'VEVENT,VTODO';
                if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
                if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0;
                if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
                
-               return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['description'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
+               return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
        }
 
        /**
@@ -191,12 +190,11 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract {
 
                // Success
                if(!isset($newValues['displayname'])) $newValues['displayname'] = null;
-               if(!isset($newValues['description'])) $newValues['description'] = null;
                if(!isset($newValues['timezone'])) $newValues['timezone'] = null;
                if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null;
                if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null;
 
-               OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],$newValues['description'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
+               OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']);
 
                return true;
 
index c2c22913bee3ddf1e2688e4b3bf917734d216efb..b4ff573ec8139521e78c0ee45f1c0544c5f4b344 100644 (file)
        </td>
 </tr>
 <?php endif; ?>
-<tr>
-       <th><?php echo $l->t('Description') ?></th>
-       <td>
-               <textarea id="description_<?php echo $_['calendar']['id'] ?>"><?php echo $_['calendar']['description'] ?></textarea>
-       </td>
-</tr>
 <tr>
        <th><?php echo $l->t('Calendar color') ?></th>
        <td>
index 374936743719f0945a5a5e8d36bcebc93487b409..b8805e6b6ef3fd8cb10c4ad8e89074d8de9f8e78 100644 (file)
@@ -31,11 +31,6 @@ foreach($calendars as $calendar){
 <input id="displayname" type="text" value="">
 </td>
 </tr>
-<th><?php echo $l->t('Description') ?></th>
-<td>
-<textarea id="description"></textarea>
-</td>
-</tr>
 </table>
 <!-- end of modified part -->
 <br><br>
@@ -65,8 +60,7 @@ function importcal(importtype){
        }
        if(importtype == "new"){
                var calname = $("#displayname").val();
-               var description = $("#description").val();
-               $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file}, function(){
+               $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'path':path, 'file':file}, function(){
                        $("#importdialog").dialog('destroy').remove();
                        $("#importdialogholder").remove();
                });