phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sync/inc/class.ui_sync.inc.php, 1.14


From: nomail
Subject: [Phpgroupware-cvs] sync/inc/class.ui_sync.inc.php, 1.14
Date: Sun, 23 May 2004 04:53:27 -0000

Update of /sync/inc
Modified Files:
        Branch: 
          class.ui_sync.inc.php

date: 2004/04/30 13:54:00;  author: mleonhardt;  state: Exp;  lines: +102 -20

Log Message:
- extended sync ui
  - conflicthandling for devices
  - lastsync overview
=====================================================================
Index: sync/inc/class.ui_sync.inc.php
diff -u sync/inc/class.ui_sync.inc.php:1.13 sync/inc/class.ui_sync.inc.php:1.14
--- sync/inc/class.ui_sync.inc.php:1.13 Thu Apr 29 14:03:26 2004
+++ sync/inc/class.ui_sync.inc.php      Fri Apr 30 13:54:00 2004
@@ -89,7 +89,13 @@
                                )
                        );
 
+    // prepare blocks
     $this->template->set_block('sync_template','page_header','page_header');
+    $this->template->set_block('sync_template','status','status');
+    $this->template->set_block('sync_template','table_header','table_header');
+    
$this->template->set_block('sync_template','lastsync_device','lastsync_device');
+    
$this->template->set_block('sync_template','lastsync_list','lastsync_list');
+    $this->template->set_block('sync_template','table_footer','table_footer');
     $this->template->set_block('sync_template','page_footer','page_footer');
 
     if ($this->debug) {
@@ -99,9 +105,15 @@
     
     $this->insert_navigation();
 
+    // parse
+    $this->template->set_var('sync', lang('sync'));
     $body = $this->template->fp('sync_template','page_header');
-    if ($this->debug) $body .= $this->template->fp('sync_template','debug');
+    // parse status
+    $this->template->set_var('last_operation_status', 
$this->last_operation_status);
+    $body .= $this->template->fp('sync_template','status');
+    $body .= $this->insert_lastsynctable();
     $body .= $this->template->fp('sync_template','navigation');
+    if ($this->debug) $body .= $this->template->fp('sync_template','debug');
     $body .= $this->template->fp('sync_template','page_footer');
 
     echo $body;
@@ -109,6 +121,56 @@
                $GLOBALS['phpgw']->common->phpgw_footer();
        }
 
+ /**
+   * insert a table which shows the last synchronisations done by actual user
+   *
+   * @access  private
+   */
+  function insert_lastsynctable()
+  {
+    // get actual user ID
+    $phpgw_userid = $GLOBALS['phpgw_info']['user']['account_id'];
+    //getallsyncsources()
+    $sources = array('Addressbuch', 'Notes', 'Kalender');
+    
+    // table header
+    $this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
+    $this->template->set_var('last_sync_status',lang('last_sync_status'));
+    // account, uri, description, username, edit, delete
+    $this->template->set_var('head_source', lang('head_source'));
+    $this->template->set_var('head_lastsync', lang('head_lastsync'));
+    $this->template->set_var('head_fullsync', lang('head_fullsync'));
+    $lastsynctable = $this->template->fp('sync_template','table_header');
+
+    // all devices of user $phpgw_userlid
+    $devicelist = array();
+    if ($this->so->GetDeviceList($phpgw_userid, $devicelist)) {
+
+      // device
+      foreach($devicelist as $device) {
+        $this->template->set_var('lastsync_devicelabel', 
lang('sync_devicelabel'));
+        $this->template->set_var('lastsync_devicename', $device[1]);
+        $lastsynctable .= 
$this->template->fp('sync_template','lastsync_device');
+
+        // table body
+        foreach($sources as $source) {
+          $tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+          $this->template->set_var('tr_color', $tr_color);
+          $this->template->set_var('lastsync_source', $source);
+          $this->template->set_var('lastsync_lastsync', 'heute');
+          $this->template->set_var('lastsync_fullsync', 'fullsync bla');
+          $lastsynctable .= 
$this->template->fp('sync_template','lastsync_list');
+        }
+
+      }
+    }
+    
+    // table footer
+    $lastsynctable .= $this->template->fp('sync_template','table_footer');
+    
+    return $lastsynctable; 
+  }
+
   /**
    * insert a link to the template that user can start the testcase
    *
@@ -302,6 +364,7 @@
     $this->template->set_var('GoBackLink',$IndexLink);
     $this->template->set_var('link_back', lang('link_back'));
     // parse header
+    $this->template->set_var('sync', lang('sync'));
     $body = $this->template->fp('sync_template','page_header');
 
     // parse status
@@ -372,6 +435,7 @@
     $this->template->set_block('sync_template','status','status');
     
$this->template->set_block('sync_template','conflicthandling','conflicthandling');
     $this->template->set_block('sync_template','table_header','table_header');
+    
$this->template->set_block('sync_template','conflicthandling_device','conflicthandling_device');
     
$this->template->set_block('sync_template','conflicthandling_list','conflicthandling_list');
     $this->template->set_block('sync_template','table_footer','table_footer');
     $this->template->set_block('sync_template','page_footer','page_footer');
@@ -385,6 +449,12 @@
     $body .= $this->template->fp('sync_template','status');
     
     $body .= $this->insert_conflicthandling();
+    
+    // footer
+    $this->template->set_var('syncmoduleLink', 
+       $GLOBALS['phpgw']->link('/index.php',"menuaction=sync.ui_sync.init"));
+    $backtosyncmainstring = sprintf(lang('link_syncmodule'), lang('sync'));
+    $this->template->set_var('link_syncmodule', $backtosyncmainstring);
     $body .= $this->template->fp('sync_template','page_footer');
 
     echo $body;
@@ -401,10 +471,10 @@
   function insert_conflicthandling()
   {
     //prepare variables
-    $this->template->set_var('conflicthandling', lang('conflicthandling'));
     //table header
+    $this->template->set_var('conflicthandling', lang('conflicthandling'));
     $this->template->set_var('conflicthandlingformaction', 
-         
$GLOBALS['phpgw']->link('/index.php',"menuaction=sync.ui_sync.saveconflicthandling"));
+        
$GLOBALS['phpgw']->link('/index.php',"menuaction=sync.ui_sync.saveconflicthandling"));
     $this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
     $this->template->set_var('head_source', lang('head_source'));
     $this->template->set_var('head_conflicthandling', 
lang('head_conflicthandling'));
@@ -412,7 +482,6 @@
     $this->template->set_var('reset', lang('reset'));
     
     //parse
-    $conflicthandlingtable = 
$this->template->fp('sync_template','conflicthandling');
     $conflicthandlingtable .= 
$this->template->fp('sync_template','table_header');
     $conflicthandlingtable .= $this->insert_conflicthandling_list();
     $conflicthandlingtable .= 
$this->template->fp('sync_template','table_footer');
@@ -427,27 +496,40 @@
 
   function insert_conflicthandling_list()
   {
+    // get actual user ID
+    $phpgw_userid = $GLOBALS['phpgw_info']['user']['account_id'];
     //getallsyncsources()
     $sources = array('Addressbuch', 'Notes', 'Kalender');
     //get-/setconflicthandlingsettings(source, handlingtype)
     $conflictsolutions = array(serverwins, clientwins, duplicate, donothing);
     
-    $conflicthandlinglist = '';
-    foreach($sources as $source) {
-      $tr_color = $this->nextmatchs->alternate_row_color($tr_color);
-      $this->template->set_var('tr_color', $tr_color);
-      $this->template->set_var('source', $source);
-      $this->template->set_var('sourceidentifier', "conflict_$source");
-      $selected = $conflictsolutions[rand(0, 3)]; //!!TODO
-      $selectoptions = '';
-      foreach ($conflictsolutions as $solution)
-      { 
-        $selectedstring = $solution==$selected?' selected':'';
-        $listtext = lang("conflict_$solution");
-        $selectoptions .= "<option $selectedstring 
value=\"$solution\">$listtext</option>";
+    // all devices of user $phpgw_userlid
+    $devicelist = array();
+    if ($this->so->GetDeviceList($phpgw_userid, $devicelist)) {
+
+      // device
+      foreach($devicelist as $device) {
+        $this->template->set_var('conflicthandling_devicelabel', 
lang('sync_devicelabel'));
+        $this->template->set_var('conflicthandling_devicename', $device[1]);
+        $conflicthandlinglist .= 
$this->template->fp('sync_template','conflicthandling_device');
+
+        foreach($sources as $source) {
+          $tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+          $this->template->set_var('tr_color', $tr_color);
+          $this->template->set_var('source', $source);
+          $this->template->set_var('sourceidentifier', "conflict_$source");
+          $selected = $conflictsolutions[rand(0, 3)]; //!!TODO
+          $selectoptions = '';
+          foreach ($conflictsolutions as $solution)
+          { 
+            $selectedstring = $solution==$selected?' selected':'';
+            $listtext = lang("conflict_$solution");
+            $selectoptions .= "<option $selectedstring 
value=\"$solution\">$listtext</option>";
+          }
+          $this->template->set_var('conflicthandlingtype', $selectoptions);
+          $conflicthandlinglist .= 
$this->template->fp('sync_template','conflicthandling_list');
+        }
       }
-      $this->template->set_var('conflicthandlingtype', $selectoptions);
-      $conflicthandlinglist .= 
$this->template->fp('sync_template','conflicthandling_list');
     }
     return $conflicthandlinglist; 
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]