commit 66e50a3b8b44ea5347610eaec233883d35539567
parent 3a7b70d2c80effd31deffe8d23d6df69fd42eeb6
Author: dankert <devnull@localhost>
Date: Sat, 17 Nov 2007 21:56:35 +0100
Fehlerhandling verbessert wenn Projektname nicht eingegeben.
Diffstat:
3 files changed, 103 insertions(+), 12 deletions(-)
diff --git a/actionClasses/ProjectAction.class.php b/actionClasses/ProjectAction.class.php
@@ -20,6 +20,9 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
+// Revision 1.16 2007-11-17 20:55:41 dankert
+// Fehlerhandling verbessert wenn Projektname nicht eingegeben.
+//
// Revision 1.15 2007-11-05 20:51:03 dankert
// Aufruf von "addValidationError(...)" bei Eingabefehlern.
//
@@ -134,9 +137,8 @@ class ProjectAction extends Action
{
$this->addValidationError('name');
$this->callSubAction('add');
+ return;
}
-
- $this->callSubAction('listing');
}
diff --git a/themes/default/pages/html/project/add.tpl.php b/themes/default/pages/html/project/add.tpl.php
@@ -138,7 +138,7 @@
<tr class="notice_<?php echo $notice['status'] ?>">
<td style="padding:10px;" width="30px"><img src="<?php echo $image_dir.'notice_'.$notice['status'].IMG_ICON_EXT ?>" style="padding:10px" /></td>
<td style="padding:10px;padding-right:10px;padding-bottom:10px;"><?php if ($notice['status']=='error') { ?><strong><?php } ?><?php echo $notice['text'] ?><?php if ($notice['status']=='error') { ?></strong><?php } ?>
- <?php if (!empty($notice['log'])) { ?><pre><?php echo nl2br(htmlentities(implode("\n",$notice['log']))) ?></pre><?php } ?>
+ <?php if (!empty($notice['log'])) { ?><pre><?php echo htmlentities(implode("\n",$notice['log'])) ?></pre><?php } ?>
</td>
</tr>
</table>
@@ -161,7 +161,7 @@
global $cell_column_nr;
$cell_column_nr=0;
$column_class_idx = 999;
-?><tr class="<?php echo $attr4_class ?>"><?php unset($attr4) ?><?php $attr5_debug_info = 'a:1:{s:5:"class";s:2:"fx";}' ?><?php $attr5 = array('class'=>'fx') ?><?php $attr5_class='fx' ?><?php
+?><tr class="<?php echo $attr4_class ?>"><?php unset($attr4) ?><?php $attr5_debug_info = 'a:0:{}' ?><?php $attr5 = array() ?><?php
$column_class_idx++;
if ($column_class_idx > count($column_classes))
$column_class_idx=1;
@@ -172,7 +172,87 @@
$cell_column_nr++;
if ( isset($column_widths[$cell_column_nr-1]) && !isset($attr5_rowspan) )
$attr5['width']=$column_widths[$cell_column_nr-1];
-?><td <?php foreach( $attr5 as $a_name=>$a_value ) echo " $a_name=\"$a_value\"" ?>><?php unset($attr5) ?><?php unset($attr5_class) ?><?php $attr6_debug_info = 'a:8:{s:5:"class";s:0:"";s:7:"default";s:0:"";s:4:"type";s:4:"text";s:4:"name";s:4:"name";s:4:"size";s:2:"40";s:9:"maxlength";s:3:"256";s:8:"onchange";s:0:"";s:8:"readonly";s:5:"false";}' ?><?php $attr6 = array('class'=>'','default'=>'','type'=>'text','name'=>'name','size'=>'40','maxlength'=>'256','onchange'=>'','readonly'=>false) ?><?php $attr6_class='' ?><?php $attr6_default='' ?><?php $attr6_type='text' ?><?php $attr6_name='name' ?><?php $attr6_size='40' ?><?php $attr6_maxlength='256' ?><?php $attr6_onchange='' ?><?php $attr6_readonly=false ?><?php if(!isset($attr6_default)) $attr6_default='';
+?><td <?php foreach( $attr5 as $a_name=>$a_value ) echo " $a_name=\"$a_value\"" ?>><?php unset($attr5) ?><?php $attr6_debug_info = 'a:3:{s:5:"class";s:4:"text";s:4:"text";s:12:"message:name";s:6:"escape";s:4:"true";}' ?><?php $attr6 = array('class'=>'text','text'=>lang('name'),'escape'=>true) ?><?php $attr6_class='text' ?><?php $attr6_text=lang('name') ?><?php $attr6_escape=true ?><?php
+ if ( isset($attr6_prefix)&& isset($attr6_key))
+ $attr6_key = $attr6_prefix.$attr6_key;
+ if ( isset($attr6_suffix)&& isset($attr6_key))
+ $attr6_key = $attr6_key.$attr6_suffix;
+ if(empty($attr6_title))
+ if (!empty($attr6_key))
+ $attr6_title = lang($attr6_key.'_HELP');
+ else
+ $attr6_title = '';
+ if (empty($attr6_type))
+ $tmp_tag = 'span';
+ else
+ switch( $attr6_type )
+ {
+ case 'emphatic':
+ case 'italic':
+ $tmp_tag = 'em';
+ break;
+ case 'strong':
+ case 'bold':
+ $tmp_tag = 'strong';
+ break;
+ case 'tt':
+ case 'teletype':
+ $tmp_tag = 'tt';
+ break;
+ default:
+ $tmp_tag = 'span';
+ }
+?><<?php echo $tmp_tag ?> class="<?php echo $attr6_class ?>" title="<?php echo $attr6_title ?>"><?php
+ $attr6_title = '';
+ if (!empty($attr6_array))
+ {
+ $tmpArray = $$attr6_array;
+ if (!empty($attr6_var))
+ $tmp_text = $tmpArray[$attr6_var];
+ else
+ $tmp_text = lang($tmpArray[$attr6_text]);
+ }
+ elseif (!empty($attr6_text))
+ if ( isset($$attr6_text))
+ $tmp_text = lang($$attr6_text);
+ else
+ $tmp_text = lang($attr6_text);
+ elseif (!empty($attr6_textvar))
+ $tmp_text = lang($$attr6_textvar);
+ elseif (!empty($attr6_key))
+ $tmp_text = lang($attr6_key);
+ elseif (!empty($attr6_var))
+ $tmp_text = isset($$attr6_var)?$$attr6_var:'?'.$attr6_var.'?';
+ elseif (!empty($attr6_raw))
+ $tmp_text = str_replace('_',' ',$attr6_raw);
+ elseif (!empty($attr6_value))
+ $tmp_text = $attr6_value;
+ else
+ $tmp_text = ' ';
+ if ( $attr6_escape && empty($attr6_raw) && $tmp_text!=' ' )
+ $tmp_text = htmlentities($tmp_text);
+ if ( !empty($attr6_maxlength) && intval($attr6_maxlength)!=0 )
+ $tmp_text = Text::maxLength( $tmp_text,intval($attr6_maxlength) );
+ if (isset($attr6_accesskey))
+ {
+ $pos = strpos(strtolower($tmp_text),strtolower($attr6_accesskey));
+ if ( $pos !== false )
+ $tmp_text = substr($tmp_text,0,max($pos,0)).'<span class="accesskey">'.substr($tmp_text,$pos,1).'</span>'.substr($tmp_text,$pos+1);
+ }
+ echo $tmp_text;
+ unset($tmp_text);
+?></<?php echo $tmp_tag ?>><?php unset($attr6) ?><?php unset($attr6_class) ?><?php unset($attr6_text) ?><?php unset($attr6_escape) ?><?php $attr4_debug_info = 'a:0:{}' ?><?php $attr4 = array() ?></td><?php unset($attr4) ?><?php $attr5_debug_info = 'a:0:{}' ?><?php $attr5 = array() ?><?php
+ $column_class_idx++;
+ if ($column_class_idx > count($column_classes))
+ $column_class_idx=1;
+ $column_class=$column_classes[$column_class_idx-1];
+ if (empty($attr5_class))
+ $attr5['class']=$column_class;
+ global $cell_column_nr;
+ $cell_column_nr++;
+ if ( isset($column_widths[$cell_column_nr-1]) && !isset($attr5_rowspan) )
+ $attr5['width']=$column_widths[$cell_column_nr-1];
+?><td <?php foreach( $attr5 as $a_name=>$a_value ) echo " $a_name=\"$a_value\"" ?>><?php unset($attr5) ?><?php $attr6_debug_info = 'a:8:{s:5:"class";s:0:"";s:7:"default";s:0:"";s:4:"type";s:4:"text";s:4:"name";s:4:"name";s:4:"size";s:2:"40";s:9:"maxlength";s:3:"256";s:8:"onchange";s:0:"";s:8:"readonly";s:5:"false";}' ?><?php $attr6 = array('class'=>'','default'=>'','type'=>'text','name'=>'name','size'=>'40','maxlength'=>'256','onchange'=>'','readonly'=>false) ?><?php $attr6_class='' ?><?php $attr6_default='' ?><?php $attr6_type='text' ?><?php $attr6_name='name' ?><?php $attr6_size='40' ?><?php $attr6_maxlength='256' ?><?php $attr6_onchange='' ?><?php $attr6_readonly=false ?><?php if(!isset($attr6_default)) $attr6_default='';
?><input<?php if ($attr6_readonly) echo ' disabled="true"' ?> id="id_<?php echo $attr6_name ?><?php if ($attr6_readonly) echo '_disabled' ?>" name="<?php echo $attr6_name ?><?php if ($attr6_readonly) echo '_disabled' ?>" type="<?php echo $attr6_type ?>" size="<?php echo $attr6_size ?>" maxlength="<?php echo $attr6_maxlength ?>" class="<?php echo $attr6_class ?>" value="<?php echo isset($$attr6_name)?$$attr6_name:$attr6_default ?>" <?php if (in_array($attr6_name,$errors)) echo 'style="border-rightx:10px solid red; background-colorx:yellow; border:2px dashed red;"' ?> /><?php
if ($attr6_readonly) {
?><input type="hidden" id="id_<?php echo $attr6_name ?>" name="<?php echo $attr6_name ?>" value="<?php echo isset($$attr6_name)?$$attr6_name:$attr6_default ?>" /><?php
@@ -186,7 +266,7 @@ if ($attr6_readonly) {
global $cell_column_nr;
$cell_column_nr=0;
$column_class_idx = 999;
-?><tr class="<?php echo $attr4_class ?>"><?php unset($attr4) ?><?php $attr5_debug_info = 'a:1:{s:5:"class";s:3:"act";}' ?><?php $attr5 = array('class'=>'act') ?><?php $attr5_class='act' ?><?php
+?><tr class="<?php echo $attr4_class ?>"><?php unset($attr4) ?><?php $attr5_debug_info = 'a:2:{s:5:"class";s:3:"act";s:7:"colspan";s:1:"2";}' ?><?php $attr5 = array('class'=>'act','colspan'=>'2') ?><?php $attr5_class='act' ?><?php $attr5_colspan='2' ?><?php
$column_class_idx++;
if ($column_class_idx > count($column_classes))
$column_class_idx=1;
@@ -197,7 +277,7 @@ if ($attr6_readonly) {
$cell_column_nr++;
if ( isset($column_widths[$cell_column_nr-1]) && !isset($attr5_rowspan) )
$attr5['width']=$column_widths[$cell_column_nr-1];
-?><td <?php foreach( $attr5 as $a_name=>$a_value ) echo " $a_name=\"$a_value\"" ?>><?php unset($attr5) ?><?php unset($attr5_class) ?><?php $attr6_debug_info = 'a:4:{s:4:"type";s:2:"ok";s:5:"class";s:2:"ok";s:5:"value";s:2:"ok";s:4:"text";s:9:"button_ok";}' ?><?php $attr6 = array('type'=>'ok','class'=>'ok','value'=>'ok','text'=>'button_ok') ?><?php $attr6_type='ok' ?><?php $attr6_class='ok' ?><?php $attr6_value='ok' ?><?php $attr6_text='button_ok' ?><?php
+?><td <?php foreach( $attr5 as $a_name=>$a_value ) echo " $a_name=\"$a_value\"" ?>><?php unset($attr5) ?><?php unset($attr5_class) ?><?php unset($attr5_colspan) ?><?php $attr6_debug_info = 'a:4:{s:4:"type";s:2:"ok";s:5:"class";s:2:"ok";s:5:"value";s:2:"ok";s:4:"text";s:9:"button_ok";}' ?><?php $attr6 = array('type'=>'ok','class'=>'ok','value'=>'ok','text'=>'button_ok') ?><?php $attr6_type='ok' ?><?php $attr6_class='ok' ?><?php $attr6_value='ok' ?><?php $attr6_text='button_ok' ?><?php
if ($attr6_type=='ok')
$attr6_type = 'submit';
if (isset($attr6_src))
@@ -217,5 +297,11 @@ if ($attr6_readonly) {
echo floor($dur/60).':'.str_pad($dur%60,2,'0',STR_PAD_LEFT); ?></small></center>
<?php } ?>
<?php unset($attr2) ?><?php $attr1_debug_info = 'a:0:{}' ?><?php $attr1 = array() ?></form>
-<?php unset($attr1) ?><?php $attr0_debug_info = 'a:0:{}' ?><?php $attr0 = array() ?></body>
+<?php unset($attr1) ?><?php $attr2_debug_info = 'a:1:{s:5:"field";s:4:"name";}' ?><?php $attr2 = array('field'=>'name') ?><?php $attr2_field='name' ?><?php
+if (isset($errors[0])) $attr2_field = $errors[0];
+?><script name="JavaScript" type="text/javascript"><!--
+document.forms[0].<?php echo $attr2_field ?>.focus();
+document.forms[0].<?php echo $attr2_field ?>.select();
+</script>
+<?php unset($attr2) ?><?php unset($attr2_field) ?><?php $attr0_debug_info = 'a:0:{}' ?><?php $attr0 = array() ?></body>
</html><?php unset($attr0) ?>
\ No newline at end of file
diff --git a/themes/default/templates/project/add.tpl.src.php b/themes/default/templates/project/add.tpl.src.php
@@ -3,8 +3,11 @@ page
window icon:project name:GLOBAL_PROJECTS
row
- cell class:fx
+ cell
+ text text:message:name
+ cell
input name:name
row
- cell class:act
- button type:ok-
\ No newline at end of file
+ cell class:act colspan:2
+ button type:ok
+ focus field:name+
\ No newline at end of file