R48957 - in /branches/14.1/etemplate/inc: class.etemplate_widget_date.inc.php class.etemplate_widget_nextmatch.inc.php

Author: ralfbecker
New Revision: 48957

URL: http://svn.stylite.de/viewvc/egroupware?rev=48957&view=rev
Log:
reverting accidently commited date+nextmatch widget

Modified:
branches/14.1/etemplate/inc/class.etemplate_widget_date.inc.php
branches/14.1/etemplate/inc/class.etemplate_widget_nextmatch.inc.php

Modified: branches/14.1/etemplate/inc/class.etemplate_widget_date.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.1/etemplate/inc/class.etemplate_widget_date.inc.php?rev=48957&r1=48956&r2=48957&view=diff

— branches/14.1/etemplate/inc/class.etemplate_widget_date.inc.php (original)
+++ branches/14.1/etemplate/inc/class.etemplate_widget_date.inc.php Wed Oct 8 11:12:09 2014
@@ -65,62 +65,30 @@

	$form_name = self::form_name($cname, $this->id, $expand);
	$value =& self::get_array(self::$request->content, $form_name, false, true);
  •   if($this->type != 'date-duration' && $value)
      {
    
  •   	$value = $this->format_date($value);
    
  •   	// string with formatting letters like for php's date() method
    
  •   	if ($this->attrs['dataformat'] && !is_numeric($value))
    
  •   	{
    
  •   		$date = date_create_from_format($this->attrs['dataformat'], $value, egw_time::$user_timezone);
    
  •   	}
    
  •   	else
    
  •   	{
    
  •   		$date = new egw_time($value);
    
  •   	}
    
  •   	if($this->type == 'date-timeonly')
    
  •   	{
    
  •   		$date->setDate(1970, 1, 1);
    
  •   	}
    
  •   	if($date)
    
  •   	{
    
  •   		// postfix date-string with "Z" so javascript doesn't add/subtract anything
    
  •   		$value = $date->format('Y-m-d\TH:i:s\Z');
    
  •   	}
      }
    
    }
  • /**
    • Perform any needed data manipulation on each row
    • before sending it to client.
    • This is used by etemplate_widget_nextmatch on each row to do any needed
    • adjustments. If not needed, don’t implement it.
    • @param type $cname
    • @param array $expand
    • @param array $data Row data
    • @return type
  • */
  • public function set_row_value($cname, Array $expand, Array &$data)
  • {
  •   if($this->type == 'date-duration') return;
    
  •   $form_name = self::form_name($cname, $this->id, $expand);
    
  •   $value =& $this->get_array($data, $form_name, true);
    
  •   $value = $this->format_date($value);
    
  • }
  • /**
    • Put date in the proper format for sending to client
    • @param string|int $value
    • @param string $format
  • */
  • public function format_date($value)
  • {
  •   if ($this->attrs['dataformat'] && !is_numeric($value))
    
  •   {
    
  •   	$date = date_create_from_format($this->attrs['dataformat'], $value, egw_time::$user_timezone);
    
  •   }
    
  •   else
    
  •   {
    
  •   	$date = new egw_time($value);
    
  •   }
    
  •   if($this->type == 'date-timeonly')
    
  •   {
    
  •   	$date->setDate(1970, 1, 1);
    
  •   }
    
  •   if($date)
    
  •   {
    
  •   	// postfix date-string with "Z" so javascript doesn't add/subtract anything
    
  •   	$value = $date->format('Y-m-d\TH:i:s\Z');
    
  •   }
    
  •   return $value;
    
  • }
  • /**
    • Validate input

Modified: branches/14.1/etemplate/inc/class.etemplate_widget_nextmatch.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.1/etemplate/inc/class.etemplate_widget_nextmatch.inc.php?rev=48957&r1=48956&r2=48957&view=diff

— branches/14.1/etemplate/inc/class.etemplate_widget_nextmatch.inc.php (original)
+++ branches/14.1/etemplate/inc/class.etemplate_widget_nextmatch.inc.php Wed Oct 8 11:12:09 2014
@@ -356,24 +356,6 @@

	$row_id = isset($value['row_id']) ? $value['row_id'] : 'id';
	$row_modified = $value['row_modified'];
  •   if($template && $template->attrs['template'])
    
  •   {
    
  •   	$row_template = $template->getElementById($template->attrs['template']);
    
  •   	if(!$row_template)
    
  •   	{
    
  •   		$row_template = etemplate_widget_template::instance($template->attrs['template']);
    
  •   	}
    
  •   	// Try to find just the repeating part
    
  •   	$repeating_child = null;
    
  •   	// First child should be a grid, we want last row
    
  •   	foreach($row_template->children[0]->children[1]->children as $child)
    
  •   	{
    
  •   		if($child->type == 'row') $repeating_child = $child;
    
  •   	}
    
  •   	$row_template = $repeating_child ? $repeating_child : null;
    
  •   }
    
      foreach($rows as $n => $row)
      {
    

@@ -391,21 +373,8 @@
if (!$row_id || !$knownUids || ($kUkey = array_search($id, $knownUids)) === false ||
!$lastModified || !isset($row[$row_modified]) || $row[$row_modified] > $lastModified)
{

  •   			if($row_template)
    
  •   			{
    
  •   				// Change anything by widget for each row ($row set to 1)
    
  •   				$_row = array(1 => &$row);
    
  •   				$row_template->run('set_row_value', array('',array('row' => 1), &$_row), true);
    
  •   				$result['data'][$id] = $row;
    
  •   			}
    
  •   			else if (!$template && !get_class($template) != 'etemplate_widget_historylog')
    
  •   			{
    
  •   				// Fallback based on widget names
    
  •   				error_log(self::$request->template['name'] . ' had to fallback to run_beforeSendToClient() because it could not find the row' );
    
  •   				$result['data'][$id] = self::run_beforeSendToClient($row);
    
  •   			}
    
  •   		}
    
  •   			$result['data'][$id] = self::run_beforeSendToClient($row);
    
  •   		}
      		if ($kUkey !== false) unset($knownUids[$kUkey]);
      	}
      	else	// non-row data set by get_rows method
    

Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs