index : flyspray | |
Archlinux32 customized Flyspray installation | gitolite user |
summaryrefslogtreecommitdiff |
diff --git a/themes/CleanFS/templates/admin.cat.tpl b/themes/CleanFS/templates/admin.cat.tpl new file mode 100644 index 0000000..02492b4 --- /dev/null +++ b/themes/CleanFS/templates/admin.cat.tpl @@ -0,0 +1,4 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('categorylist')); ?></h3> + <?php $this->display('common.cat.tpl'); ?> +</div> diff --git a/themes/CleanFS/templates/admin.checks.tpl b/themes/CleanFS/templates/admin.checks.tpl new file mode 100644 index 0000000..37ebc30 --- /dev/null +++ b/themes/CleanFS/templates/admin.checks.tpl @@ -0,0 +1,99 @@ +<div id="toolbox"> +<div>PHP version: <?php echo PHP_VERSION; ?></div> +<?php if(isset($utf8mb4upgradable)) { echo '<div class="error">'.Filters::noXSS($utf8mb4upgradable).'</div>'; } ?> +<?php if(isset($oldmysqlversion)) { echo '<div class="error">'.Filters::noXSS($oldmysqlversion).'</div>'; } ?> +<div>ADOdb version: <?php if(isset($adodbversion)) { echo Filters::noXSS($adodbversion); } ?></div> +<div>HTMLPurifier version: <?php if(isset($htmlpurifierversion)) { echo Filters::noXSS($htmlpurifierversion); } ?></div> +<div>passwdcrypt: <?php echo Filters::noXSS($passwdcrypt); ?></div> +<?php if(isset($hashlengths)) { echo '<div>password hash lengths: '.$hashlengths.'</div>'; } ?> + +<?php if(isset($registrations)): ?> +<h4><?= $regcount ?> unfinished registrations</h4> +<table> +<thead> +<tr> +<th>reg_time</th> +<th>user_name</th> +<th>email_address</th> +</tr> +</thead> +<tbody> +<?php foreach($registrations as $reg): ?> +<tr> +<td><?= formatDate($reg['reg_time']) ?></td> +<td><?= Filters::noXSS($reg['user_name']) ?></td> +<td><?= Filters::noXSS($reg['email_address']) ?></td> +</tr> +<?php endforeach; ?> +<?php endif; ?> +</tbody> +</table> + +<?php if(isset($fstables)): ?> +<style> +.dbtable{ background-color:#ccc;} +.dbtable td {border-bottom:1px solid #999;} +.dbfield{ background-color:#eee;} +#togglefields { display:none; } +#togglefields ~ label:after { content:'Hide Fields'; } +#togglefields:checked ~ label:after { content:'Show Fields'; } +#togglefields:checked ~ #dbtables .dbfield { display:none; } +</style> +<div> +<div>default_character_set_name: <?=$fsdb['default_character_set_name'] ?></div> +<div>default_collation_name: <?=$fsdb['default_collation_name'] ?></div> +</div> +<input type="checkbox" id="togglefields" name="togglefields" checked="checked" /> +<label for="togglefields" class="button"></label> +<table id="dbtables"> +<thead> +<tr class="dbtable"> +<th>tabl_name</th> +<th>table_type</th> +<th></th> +<th>default collation</th> +<th>comment</th> +</tr> +<tr class="dbfield"> +<th>column_name</th> +<th>data_type</th> +<th>character_set_name</th> +<th>collation_name</th> +<th>comment</th> +</tr> +</thead> +<tbody> +<?php +$lasttable=''; +$ti=-1; # $fstables index +foreach($fsfields as $f): + # Show table info row if not yet for that field + # This logic fails if there exists a table within $fstables without fields in $fsfields + # But for our usecase this should be ok. + if ($lasttable != $f['table_name']): + $ti++; + ?> + <tr class="dbtable"> + <td><?= Filters::noXSS($fstables[$ti]['table_name']) ?></td> + <td><?= $fstables[$ti]['table_type'] ?></td> + <td></td> + <td><?= $fstables[$ti]['table_collation'] ?></td> + <td><?= Filters::noXSS($fstables[$ti]['table_comment']) ?></td> + </tr> + <?php endif; ?> +<tr class="dbfield"> +<td><?= Filters::noXSS($f['column_name']) ?></td> +<td><?= $f['column_type'] ?></td> +<td><?= $f['character_set_name'] ?></td> +<td><?= $f['collation_name'] ?></td> +<td><?= Filters::noXSS($f['column_comment']) ?></td> +</tr> +<?php +$lasttable=$f['table_name']; +endforeach; +?> +</tbody> +</table> +<?php endif; ?> + +</div> diff --git a/themes/CleanFS/templates/admin.editallusers.tpl b/themes/CleanFS/templates/admin.editallusers.tpl new file mode 100644 index 0000000..e78edec --- /dev/null +++ b/themes/CleanFS/templates/admin.editallusers.tpl @@ -0,0 +1,4 @@ +<div id="toolbox"> + <h3><?= eL('admintoolbox') ?> :: <?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?= eL('editallusers') ?></h3> + <?php $this->display('common.editallusers.tpl'); ?> +</div> diff --git a/themes/CleanFS/templates/admin.editgroup.tpl b/themes/CleanFS/templates/admin.editgroup.tpl new file mode 100644 index 0000000..6bfbca8 --- /dev/null +++ b/themes/CleanFS/templates/admin.editgroup.tpl @@ -0,0 +1,4 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('admintoolboxlong')); ?> :: <?php echo Filters::noXSS(L('editgroup')); ?></h3> + <?php $this->display('common.editgroup.tpl'); ?> +</div> diff --git a/themes/CleanFS/templates/admin.groups.tpl b/themes/CleanFS/templates/admin.groups.tpl new file mode 100644 index 0000000..0d66177 --- /dev/null +++ b/themes/CleanFS/templates/admin.groups.tpl @@ -0,0 +1,147 @@ +<div id="toolbox"> + <ul id="submenu"> + <li><a href="#users_tab"><?php echo Filters::noXSS(L('users')); ?></a></li> + <li><a href="#groups_tab"><?php echo Filters::noXSS(L('globalgroups')); ?></a></li> + </ul> + <div id="users_tab" class="tab"> + <a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'newuser', $proj->id)); ?>"><i class="good fa fa-user-plus fa-lg fa-fw"></i><?php echo L('newuser'); ?></a> + <a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'newuserbulk', $proj->id)); ?>"><i class="good fa fa-user-times fa-lg fa-fw"></i><?php echo L('newuserbulk'); ?></a> + <a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'editallusers', $proj->id)); ?>"><i class="fa fa-group fa-lg fa-fw"></i><?php echo L('editallusers'); ?></a> + <div class="groupedit"> +<!-- + <form action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> + <label for="selectgroup"><?php echo Filters::noXSS(L('editgroup')); ?></label> + <select name="id" id="selectgroup"><?php echo tpl_options(Flyspray::ListGroups()); ?></select> + <button type="submit"><?php echo Filters::noXSS(L('edit')); ?></button> + <input type="hidden" name="do" value="admin" /> + <input type="hidden" name="area" value="editgroup" /> + <input type="hidden" name="project" value="<?php echo $proj->id; ?>" /> + </form> +--> + <form action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> + <label for="edit_user"><?php echo Filters::noXSS(L('edituser')); ?></label> + <?php echo tpl_userselect('user_name', '', 'edit_user'); ?> + <button type="submit"><?php echo Filters::noXSS(L('edit')); ?></button> + <input type="hidden" name="do" value="admin" /> + <input type="hidden" name="area" value="users" /> + <input type="hidden" name="project" value="<?php echo $proj->id; ?>" /> + </form> + </div> + </div> + <div id="groups_tab" class="tab"> +<div><a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'newgroup', $proj->id)); ?>"><i class="fa fa-group fa-lg fa-fw"></i><?php echo Filters::noXSS(L('newgroup')); ?></a></div> + +<?php +$perm_fields = array( +'group_open', +'is_admin', +'manage_project', +'view_tasks', +'view_groups_tasks', # TODO: What is the definition of "group's task" and how does it effect project views? +'view_own_tasks', # TODO: What is the definition of "own task" and how does it effect project views? +'open_new_tasks', +'add_multiple_tasks', +'modify_own_tasks', +'modify_all_tasks', +'create_attachments', +'delete_attachments', +'assign_to_self', +'assign_others_to_self', +'edit_assignments', +'close_own_tasks', +'close_other_tasks', +'view_roadmap', +'view_history', +'view_reports', +'add_votes', +'view_comments', +'add_comments', +'edit_comments', +'edit_own_comments', +'delete_comments', +'view_estimated_effort', +'view_current_effort_done', +'track_effort' +); + +$yesno = array( + '<td style="color:#ccc" title="'.eL('no').'">-</td>', + '<td title="'.eL('yes').'"><i class="good fa fa-check fa-lg"></i></td>' +); + +$perms=array(); +$gmembers=''; +$gnames=''; +$gdesc=''; +$cols=''; +foreach ($groups as $group){ + $cols.='<col class="group g'.$group['group_id'].($group['group_open']==0?' inactive':'').'"></col>'; + $gmembers.='<td>'.$group['users'].'</td>'; + $gnames .='<td><a class="button" title="'.eL('editgroup').'" href="'.( Filters::noXSS(CreateURL('editgroup', $group['group_id'], 'admin'))).'">' + .Filters::noXSS($group['group_name']) + .'<i class="fa fa-pencil fa-lg fa-fw"></i></a></td>'; + $gdesc .='<td>'.Filters::noXSS($group['group_desc']).'</td>'; + foreach ($group as $key => $val) { + if (!is_numeric($key) && in_array($key, $perm_fields)) { + $perms[$key][]=$val; + } + } +} +?> +<style> +.perms {border-collapse:collapse;} +.perms tbody tr:hover {background-color:#eee;} +.perms td, .perms th{border:1px solid #999;} +.perms thead th, .perms thead td {text-align:center;} +.perms tbody th{text-align:right;} +.perms tbody td{width:100px;text-align:center;} +.perms tbody span i:first-child {color: #090;} +</style> +<table class="perms"> +<colgroup> +<col></col> +<?php echo $cols; ?> +</colgroup> +<thead> +<tr> +<th><?php echo L('groupmembers'); ?></th> +<?php echo $gmembers; ?> +</tr> +<tr> +<th><?php echo L('group'); ?></th> +<?php echo $gnames; ?> +</tr> +<tr> +<th><?php echo L('description'); ?></th> +<?php echo $gdesc; ?> +</tr> +</thead> +<tbody> +<?php foreach ($perm_fields as $p): ?> +<tr> + <th><?php echo eL(str_replace('_', '', $p)); ?></th> +<?php +require_once('permicons.tpl'); +$i=0; +# TODO: make it visible that a granted 'view_tasks' overrules 'view_groups_tasks' and 'own_tasks'. (like is_admin) +foreach($perms[$p] as $val){ + if ($perms['is_admin'][$i]==1 && $val == 0){ + if(isset($permicons[$p])){ + echo '<td title="'.eL('yes').' - Permission granted because of is_admin">( '.$permicons[$p].' )</td>'; + }else{ + echo $yesno[1]; + } + } elseif($val==1 && isset($permicons[$p])){ + echo '<td>'.$permicons[$p].'</td>'; + } else{ + echo $yesno[$val]; + } + $i++; +} +?> +</tr> +<?php endforeach; ?> +</tbody> +</table> +</div> +</div> diff --git a/themes/CleanFS/templates/admin.menu.tpl b/themes/CleanFS/templates/admin.menu.tpl new file mode 100644 index 0000000..789a280 --- /dev/null +++ b/themes/CleanFS/templates/admin.menu.tpl @@ -0,0 +1,43 @@ +<?php $activeclass = ' class="active" '; ?> + +<div id="toolboxmenu"> + <a id="globprefslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'prefs') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'prefs')); ?>"><?php echo Filters::noXSS(L('preferences')); ?></a> + <a id="globuglink" + <?php if(isset($_GET['area']) and in_array($_GET['area'], array('groups','newuser', 'newuserbulk', 'newgroup','editgroup', 'users', 'editallusers'))) echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'groups')); ?>"><?php echo Filters::noXSS(L('usersandgroups')); ?></a> + <a id="globttlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'tasktype') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'tasktype')); ?>"><?php echo Filters::noXSS(L('tasktypes') ); ?></a> + <a id="globcatlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'cat') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'cat')); ?>"><?php echo Filters::noXSS(L('categories') ); ?></a> + <a id="globtglink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'tag') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'tag')); ?>"><i class="fa fa-tag"></i> <?php echo Filters::noXSS(L('tags') ); ?></a> + <a id="globstatuslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'status') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'status')); ?>"><?php echo Filters::noXSS(L('taskstatuses') ); ?></a> + <a id="globreslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'resolution') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'resolution')); ?>"><?php echo Filters::noXSS(L('resolutions') ); ?></a> + <a id="globverlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'version') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'version')); ?>"><?php echo Filters::noXSS(L('versions') ); ?></a> + <a id="globoslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'os') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'os')); ?>"><i class="fa fa-linux"></i><i class="fa fa-windows"></i><i class="fa fa-apple"></i> <?php echo Filters::noXSS(L('operatingsystems')); ?></a> + <a id="globnewprojlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'newproject') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'newproject')); ?>"><?php echo Filters::noXSS(L('newproject')); ?></a> + <a id="userrequestlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'userrequest') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'userrequest')); ?>"><?php echo Filters::noXSS(L('pendingnewuserrequest')); ?></a> + <a id="translationslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'translations') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'translations')); ?>"><?php echo Filters::noXSS(L('translations')); ?></a> + <a id="checkslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'checks') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('admin', 'checks')); ?>"><?php echo Filters::noXSS(L('adminchecks')); ?></a> +</div> diff --git a/themes/CleanFS/templates/admin.newgroup.tpl b/themes/CleanFS/templates/admin.newgroup.tpl new file mode 100644 index 0000000..af4a758 --- /dev/null +++ b/themes/CleanFS/templates/admin.newgroup.tpl @@ -0,0 +1,7 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('admintoolbox')); ?> :: <?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('createnewgroup')); ?></h3> + + <?php + $this->display('common.newgroup.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/admin.newproject.tpl b/themes/CleanFS/templates/admin.newproject.tpl new file mode 100644 index 0000000..db6c36f --- /dev/null +++ b/themes/CleanFS/templates/admin.newproject.tpl @@ -0,0 +1,58 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('createnewproject')); ?></h3> + <?php echo tpl_form(CreateURL('admin', 'newproject')); ?> + <div> + <input type="hidden" name="action" value="admin.newproject" /> + <input type="hidden" name="area" value="newproject" /> + </div> + <ul class="form_elements"> + <li> + <label for="projecttitle"><?php echo Filters::noXSS(L('projecttitle')); ?></label> + <input id="projecttitle" name="project_title" value="<?php echo Filters::noXSS(Req::val('project_title')); ?>" type="text" class="required text" size="40" maxlength="100" /> + </li> + <li> + <label for="themestyle"><?php echo Filters::noXSS(L('themestyle')); ?></label> + <select id="themestyle" name="theme_style"> + <?php echo tpl_options(Flyspray::listThemes(), Req::val('theme_style', $proj->prefs['theme_style']), true); ?> + + </select> + </li> + <li> + <label for="langcode"><?php echo Filters::noXSS(L('language')); ?></label> + <select id="langcode" name="lang_code"> + <?php echo tpl_options(Flyspray::listLangs(), Req::val('lang_code', $fs->prefs['lang_code']), true); ?> + </select> + </li> + <li> + <label for="intromesg"><?php echo Filters::noXSS(L('intromessage')); ?></label> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <?php endif; ?> + <?php echo TextFormatter::textarea('intro_message', 8, 70, array('accesskey' => 'r', 'tabindex' => 8, 'id' => 'intromesg'), Req::val('intro_message', $proj->prefs['intro_message'])); ?> + <br /> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <button tabindex="9" type="button" onclick="showPreview('intromesg', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + </li> + <li> + <label for="othersview"><?php echo Filters::noXSS(L('othersview')); ?></label> + <?php echo tpl_checkbox('others_view', Req::val('others_view', 0), 'othersview'); ?> + </li> + <li> + <label for="othersviewroadmap"><?php echo Filters::noXSS(L('othersviewroadmap')); ?></label> + <?php echo tpl_checkbox('others_viewroadmap', Req::val('others_viewroadmap', 0), 'othersviewroadmap'); ?> + </li> + <li> + <label for="anonopen"><?php echo Filters::noXSS(L('allowanonopentask')); ?></label> + <?php echo tpl_checkbox('anon_open', Req::val('anon_open'), 'anonopen'); ?> + </li> + <li> + <label for="disp_intro"><?php echo Filters::noXSS(L('dispintro')); ?></label> + <?php echo tpl_checkbox('disp_intro', Req::val('disp_intro', 0), 'disp_intro'); ?> + </li> + <li> + <td class="buttons" colspan="2"><button type="submit" class="positive"><?php echo Filters::noXSS(L('createthisproject')); ?></button></td> + </li> + </ul> + </form> +</div> diff --git a/themes/CleanFS/templates/admin.newuser.tpl b/themes/CleanFS/templates/admin.newuser.tpl new file mode 100644 index 0000000..825ab82 --- /dev/null +++ b/themes/CleanFS/templates/admin.newuser.tpl @@ -0,0 +1,7 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('admintoolbox')); ?> :: <?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('newuser')); ?></h3> + + <?php + $this->display('common.newuser.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/admin.newuserbulk.tpl b/themes/CleanFS/templates/admin.newuserbulk.tpl new file mode 100644 index 0000000..189e04f --- /dev/null +++ b/themes/CleanFS/templates/admin.newuserbulk.tpl @@ -0,0 +1,7 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('admintoolbox')); ?> :: <?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('newuserbulk')); ?></h3> + + <?php + $this->display('common.newuserbulk.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/admin.os.tpl b/themes/CleanFS/templates/admin.os.tpl new file mode 100644 index 0000000..4bbe0da --- /dev/null +++ b/themes/CleanFS/templates/admin.os.tpl @@ -0,0 +1,9 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('oslist')); ?></h3> + + <?php + $this->assign('list_type', 'os'); + $this->assign('rows', $proj->listOs(true)); + $this->display('common.list.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/admin.prefs.tpl b/themes/CleanFS/templates/admin.prefs.tpl new file mode 100644 index 0000000..97d7e6a --- /dev/null +++ b/themes/CleanFS/templates/admin.prefs.tpl @@ -0,0 +1,529 @@ +<script type="text/javascript"> +function ShowHidePassword(id) { + if(document.getElementById(id).type=="text") { + document.getElementById(id).type="password"; + } else { + document.getElementById(id).type="text"; + } +} +</script> +<script> + /* + * Second argument is always the parent calling to deactivate not needed childs + * Next args are all childsto be deactivated + */ + function check_change(inverted) + { + var i; + var parent = arguments[1]; + + if(document.getElementById(parent).checked) + { + for (i = 2; i < arguments.length; i++) + { + if (inverted) { + document.getElementById(arguments[i]).checked = false; + document.getElementById(arguments[i]).disabled = true; + } + else { + document.getElementById(arguments[i]).checked = true; + document.getElementById(arguments[i]).disabled = false; + } + } + } + else + { + for (i = 2; i < arguments.length; i++) + { + if (inverted) { + document.getElementById(arguments[i]).disabled = false; + } + else { + document.getElementById(arguments[i]).disabled = true; + } + } + } + } +</script> +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('admintoolboxlong')); ?> :: <?php echo Filters::noXSS(L('preferences')); ?></h3> + <?php echo tpl_form(CreateURL('admin', 'prefs')); ?> + <ul id="submenu"> + <li><a href="#general"><?php echo Filters::noXSS(L('general')); ?></a></li> + <li><a href="#lookandfeel"><?php echo Filters::noXSS(L('lookandfeel')); ?></a></li> + <li><a href="#userregistration"><?php echo Filters::noXSS(L('userregistration')); ?></a></li> + <li><a href="#notifications"><?php echo Filters::noXSS(L('notifications')); ?></a></li> + <li><a href="#antispam"><?php echo Filters::noXSS(L('antispam')); ?></a></li> + </ul> + + <div id="general" class="tab"> + <ul class="form_elements"> + <li> + <label for="pagetitle"><?php echo Filters::noXSS(L('pagetitle')); ?></label> + <input id="pagetitle" name="page_title" type="text" class="text" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['page_title']); ?>" /> + </li> + + <li> + <label for="defaultproject"><?php echo Filters::noXSS(L('defaultproject')); ?></label> + <select id="defaultproject" name="default_project"> + <?php echo tpl_options(array_merge(array(0 => L('allprojects')), Flyspray::listProjects()), $fs->prefs['default_project']); ?> + </select> + </li> + + <li> + <label for="langcode"><?php echo Filters::noXSS(L('language')); ?></label> + <select id="langcode" name="lang_code"> + <?php echo tpl_options(Flyspray::listLangs(), $fs->prefs['lang_code'], true); ?> + </select> + </li> + + <li> + <label for="urlrewriting"><?php echo Filters::noXSS(L('urlrewriting')); ?></label> + <select id="urlrewriting" name="url_rewriting"> + <?php echo tpl_options(array('1' => L('on'), '0' => L('off')), $fs->prefs['url_rewriting'], false); ?> + </select> + </li> + + <li> + <label for="emailNoHTML"><?php echo Filters::noXSS(L('emailNoHTML')); ?></label> + <?php echo tpl_checkbox('emailNoHTML', $fs->prefs['emailNoHTML'], 'emailNoHTML'); ?> + </li> + + <li> + <?php + // TODO WTF?? Isn't that an old temp fix? + if (!array_key_exists('logo', $fs->prefs)) { + $fs->prefs['logo'] = ''; + } + ?> + + <label for="logo"><?php echo Filters::noXSS(L('showlogo')); ?></label> + <?php if ($fs->prefs['logo']):?> + <img src="<?php echo Filters::noXSS($baseurl.'/'.$fs->prefs['logo']); ?>"> + <?php endif ?> + </li> + + <li> + <label for="logo_input"> </label> + <input id="logo_input" name="logo" type="file" accept="image/*" value="<?php echo Filters::noXSS($fs->prefs['logo']); ?>" /> + </li> + <li> + <label for="massops"><?php echo Filters::noXSS(L('massopsenable')); ?></label> + <?php echo tpl_checkbox('massops', $fs->prefs['massops'], 'massops'); ?> + </li> + <li> + <label for="enable_avatars"><?php echo Filters::noXSS(L('enableavatars')); ?></label> + <?php echo tpl_checkbox('enable_avatars', $fs->prefs['enable_avatars'], 'enable_avatars', 1, array('onclick'=>'check_change(false, "enable_avatars", "gravatars", "max_avatar_size")')); ?> + </li> + + <li> + <label for="gravatars"><?php echo Filters::noXSS(L('showgravatars')); ?></label> + <?php echo tpl_checkbox('gravatars', $fs->prefs['gravatars'], 'gravatars'); ?> + </li> + + <li> + <label for="max_avatar_size"><?php echo Filters::noXSS(L('maxavatarsize')); ?></label> + <input id="max_avatar_size" name="max_avatar_size" type="text" class="text" size="3" maxlength="3" value="<?php echo Filters::noXSS($fs->prefs['max_avatar_size']); ?>" /> + </li> + + <li> + <label for="hide_emails"><?php echo Filters::noXSS(L('hideemails')); ?></label> + <?php echo tpl_checkbox('hide_emails', $fs->prefs['hide_emails'], 'hide_emails'); ?> + </li> + + <li> + <label for="dateformat"><?php echo Filters::noXSS(L('dateformat')); ?></label> + <select id="dateformat" name="dateformat"> + <?php echo tpl_date_formats($fs->prefs['dateformat']); ?> + </select> + </li> + + <li> + <label for="dateformat_extended"><?php echo Filters::noXSS(L('dateformat_extended')); ?></label> + <select id="dateformat_extended" name="dateformat_extended"> + <?php echo tpl_date_formats($fs->prefs['dateformat_extended'], true); ?> + </select> + </li> + + <li> + <label for="cache_feeds"><?php echo Filters::noXSS(L('cache_feeds')); ?></label> + <select id="cache_feeds" name="cache_feeds"> + <?php echo tpl_options(array('0' => L('no_cache'), '1' => L('cache_disk'), '2' => L('cache_db')), $fs->prefs['cache_feeds']); ?> + </select> + </li> + + <li> + <label for="disable_lostpw"><?php echo Filters::noXSS(L('disable_lostpw')); ?></label> + <?php echo tpl_checkbox('disable_lostpw', $fs->prefs['disable_lostpw'], 'disable_lostpw'); ?> + + </li> + + <li> + <label for="disablechangepw"><?php echo Filters::noXSS(L('disable_changepw')); ?></label> + <?php echo tpl_checkbox('disable_changepw', $fs->prefs['disable_changepw'], 'disablechangepw'); ?> + </li> + + <li> + <label for="days_before_alert"><?php echo Filters::noXSS(L('daysbeforealert')); ?></label> + <input id="days_before_alert" name="days_before_alert" type="text" class="text" size="3" maxlength="3" value="<?php echo Filters::noXSS($fs->prefs['days_before_alert']); ?>" /> + </li> + + <li> + <label for="max_vote_per_day"><?php echo Filters::noXSS(L('maxvoteperday')); ?></label> + <input id="max_vote_per_day" name="max_vote_per_day" type="text" class="text" size="3" maxlength="3" value="<?php echo Filters::noXSS($fs->prefs['max_vote_per_day']); ?>" /> + </li> + + <li> + <label for="votes_per_project"><?php echo Filters::noXSS(L('votesperproject')); ?></label> + <input id="votes_per_project" name="votes_per_project" type="text" class="text" size="3" maxlength="3" value="<?php echo Filters::noXSS($fs->prefs['votes_per_project']); ?>" /> + </li> + + <li> + <label class="labeltextarea"><?php echo Filters::noXSS(L('pageswelcomemsg')); ?></label> + <?php + $pages = array( + 'index' => L('tasklist'), + 'toplevel' => L('toplevel'), + 'reports' => L('reports')); + $selectedPages = explode(' ', $fs->prefs['pages_welcome_msg']); + echo tpl_double_select('pages_welcome_msg', $pages, $selectedPages, false, false); + ?> + </li> + + <li> + <label class="labeltextarea" for="intromesg"><?php echo Filters::noXSS(L('mainmessage')); ?></label> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <button tabindex="9" type="button" onclick="showPreview('intromesg', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('intro_message', 8, 70, array('accesskey' => 'r', 'tabindex' => 8, 'id' => 'intromesg'), Post::val('intro_message', $fs->prefs['intro_message'])); ?> + </li> + </ul> + </div> + + <div id="userregistration" class="tab"> + <ul class="form_elements"> + <li> + <label for="allowusersignups"><?php echo Filters::noXSS(L('anonreg')); ?></label> + <?php echo tpl_checkbox('anon_reg', $fs->prefs['anon_reg'], 'allowusersignups'); ?> + </li> + + <li> + <label for="onlyoauthreg"><?php echo Filters::noXSS(L('onlyoauthreg')); ?></label> + <?php echo tpl_checkbox('only_oauth_reg', $fs->prefs['only_oauth_reg'], 'onlyoauthreg', 1, array('onclick'=>'check_change(true, "onlyoauthreg", "needapproval", "spamproof")')); ?> + </li> + + <li> + <label for="needapproval"><?php echo Filters::noXSS(L('regapprovedbyadmin')); ?></label> + <?php echo tpl_checkbox('need_approval', $fs->prefs['need_approval'], 'needapproval', 1, ($fs->prefs['only_oauth_reg']) ? array('disabled' => 'disabled', 'onclick' => 'check_change(true, "needapproval", "spamproof")') : array('onclick' => 'check_change("needapproval", "spamproof")')); ?> + </li> + + <li><?php /* TODO rename misleading 'spamproof' pref to something like email_verify */ ?> + <label for="spamproof"><?php echo Filters::noXSS(L('spamproof')); ?></label> + <?php echo tpl_checkbox('spam_proof', $fs->prefs['spam_proof'], 'spamproof', 1, ($fs->prefs['need_approval'] || $fs->prefs['only_oauth_reg'] ) ? array('disabled' => 'true') : ''); ?> + </li> + + <li> + <label for="repeat_password"><?php echo Filters::noXSS(L('repeatpassword')); ?></label> + <?php echo tpl_checkbox('repeat_password', $fs->prefs['repeat_password'], 'repeat_password'); ?> + </li> + + <li> + <label for="repeat_emailaddress"><?php echo Filters::noXSS(L('repeatemailaddress')); ?></label> + <?php echo tpl_checkbox('repeat_emailaddress', $fs->prefs['repeat_emailaddress'], 'repeat_emailaddress'); ?> + </li> + + <li> + <label for="notify_registration"><?php echo Filters::noXSS(L('notify_registration')); ?></label> + <?php echo tpl_checkbox('notify_registration', $fs->prefs['notify_registration'], 'notify_registration'); ?> + </li> + + <li> + <label for="defaultglobalgroup"><?php echo Filters::noXSS(L('defaultglobalgroup')); ?></label> + <select id="defaultglobalgroup" name="anon_group"> + <?php echo tpl_options(Flyspray::listGroups(), $fs->prefs['anon_group']); ?> + </select> + </li> + + <li> + <label><?php echo Filters::noXSS(L('activeoauths')); ?></label> + <?php + $oauths = array('github', 'google', 'facebook', 'microsoft'/*, 'instagram', 'eventbrite', 'linkedin', 'vkontakte'*/); //TODO try the commented out for FS 1.1 + $selectedOauths = explode(' ', $fs->prefs['active_oauths']); + echo tpl_double_select('active_oauths', $oauths, $selectedOauths, true, false); + ?> + </li> + + </ul> + </div> + +<div id="antispam" class="tab"> + <h2><?php echo Filters::noXSS(L('antispam')); ?></h2> + <p><?php echo Filters::noXSS(L('antispamprefsinfo')); ?></p> + + <h3>Securimage</h3> + <p><?php echo Filters::noXSS(L('securimageprefsinfo')); ?></p> + <ul class="form_elements"> + <li> + <label for="captcha_securimage"><?php echo Filters::noXSS(L('securimageenable')); ?></label> + <?php echo tpl_checkbox('captcha_securimage', isset($fs->prefs['captcha_securimage'])?$fs->prefs['captcha_securimage']:false, 'captcha_securimage'); ?> + </li> + </ul> + + <h3>Google reCaptcha</h3> + <p><?php echo Filters::noXSS(L('recaptchaprefsinfo')); ?></p> + <ul class="form_elements"> + <li> + <label for="captcha_recaptcha"><?php echo Filters::noXSS(L('recaptchaenable')); ?></label> + <?php echo tpl_checkbox('captcha_recaptcha', isset($fs->prefs['captcha_recaptcha'])?$fs->prefs['captcha_recaptcha']:false, 'captcha_recaptcha'); ?> + </li> + <li class="recaptchaconf"> + <label for="captcha_recaptcha_sitekey">sitekey</label> + <input id="captcha_recaptcha_sitekey" class="text" type="text" name="captcha_recaptcha_sitekey" value="<?php echo Filters::noXSS(isset($fs->prefs['captcha_recaptcha_sitekey']) ? $fs->prefs['captcha_recaptcha_sitekey']:''); ?>" /> + </li> + <li class="recaptchaconf"> + <label for="captcha_recaptcha_secret">secret</label> + <input id="captcha_recaptcha_secret" class="text" type="text" name="captcha_recaptcha_secret" value="<?php echo Filters::noXSS(isset($fs->prefs['captcha_recaptcha_secret']) ? $fs->prefs['captcha_recaptcha_secret']:''); ?>" /> + </li> + </ul> +</div> + + <div id="notifications" class="tab"> + <ul class="form_elements"> + <li> + <label for="usernotify"><?php echo Filters::noXSS(L('forcenotify')); ?></label> + <select id="usernotify" name="user_notify"> + <?php echo tpl_options(array(L('neversend'), L('userchoose'), L('email'), L('jabber')), $fs->prefs['user_notify']); ?> + </select> + </li> + </ul> + + <fieldset><legend><?php echo Filters::noXSS(L('emailnotify')); ?></legend> + <ul class="form_elements"> + <li> + <label for="adminemail"><?php echo Filters::noXSS(L('fromaddress')); ?></label> + <input id="adminemail" name="admin_email" class="text" type="text" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['admin_email']); ?>" /> + </li> + + <li> + <label for="smtpserv"><?php echo Filters::noXSS(L('smtpserver')); ?></label> + <input id="smtpserv" name="smtp_server" class="text" type="text" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['smtp_server']); ?>" /> + <?php if (extension_loaded('openssl')) : ?> + <?php echo tpl_checkbox('email_ssl', $fs->prefs['email_ssl'], 'email_ssl'); ?> <label class="inline" for="email_ssl"><?php echo Filters::noXSS(L('ssl')); ?></label> + <?php echo tpl_checkbox('email_tls', $fs->prefs['email_tls'], 'email_tls'); ?> <label class="inline" for="email_tls"><?php echo Filters::noXSS(L('tls')); ?></label> + <?php endif; ?> + </li> + + <li> + <label for="smtpuser"><?php echo Filters::noXSS(L('smtpuser')); ?></label> + <input id="smtpuser" name="smtp_user" class="text" type="text" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['smtp_user']); ?>" /> + </li> + + <li> + <label for="smtppass"><?php echo Filters::noXSS(L('smtppass')); ?></label> + <input id="smtppass" name="smtp_pass" class="text" type="password" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['smtp_pass']); ?>" /> + </li> + <li> + <label for="showsmtppass"><?php echo Filters::noXSS(L('showpass')); ?></label> + <input id="showsmtppass" name="show_smtp_pass" class="text" type="checkbox" onclick="ShowHidePassword('smtppass')"/> + </li> + </ul> + <?php echo Filters::noXSS(L('testmailsettings')); ?>: <button onclick="testEmail();return false;"><?php echo Filters::noXSS(L('test')); ?></button><div id="emailresult" style="display:inline-block;"></div> <?php echo Filters::noXSS(L('testmailsettingsnotice')); ?>. +<script> +function testEmail(){ + var xmlHttp = new XMLHttpRequest(); + + xmlHttp.onreadystatechange = function(){ + if(xmlHttp.readyState == 4){ + var target = document.getElementById('emailresult'); + if(xmlHttp.status == 200){ + if(xmlHttp.responseText=='ok'){ + target.style["background-color"]='#66ff00'; + target.innerHTML = '<i class="fa fa-check fa-2x"></i> '+xmlHttp.responseText; + } else{ + target.innerHTML = '<i class="fa fa-warning fa-2x" style="color:#ff0"></i>' + xmlHttp.responseText; + target.style["background-color"]='#ff6600'; + } + } else{ + target.innerHTML = '<i class="fa fa-warning fa-2x" style="color:#ff0"></i>' + xmlHttp.responseText; + target.style["background-color"]='#ff6600'; + } + } + } + xmlHttp.open("POST", "<?php echo Filters::noXSS($baseurl); ?>js/callbacks/testemail.php", true); + xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); + xmlHttp.send("name=email&csrftoken=<?php echo $_SESSION['csrftoken'] ?>"); +} +</script> + </fieldset> + + <fieldset><legend><?php echo Filters::noXSS(L('jabbernotify')); ?></legend> + <ul class="form_elements"> + <li> + <label for="jabberserver"><?php echo Filters::noXSS(L('jabberserver')); ?></label> + <input id="jabberserver" class="text" type="text" name="jabber_server" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['jabber_server']); ?>" /> + <?php if(extension_loaded('openssl')) : ?> + <select id="jabber_ssl" name="jabber_ssl"> + <?php echo tpl_options(array('0' => L('none'), '1' => L('ssl'), '2' => L('tls')), $fs->prefs['jabber_ssl']); ?> + </select> + <label class="inline" for="jabber_ssl"><?php echo Filters::noXSS(L('ssl')); ?> / <?php echo Filters::noXSS(L('tls')); ?></label> + <?php endif; ?> + </li> + + <li> + <label for="jabberport"><?php echo Filters::noXSS(L('jabberport')); ?></label> + <input id="jabberport" class="text" type="text" name="jabber_port" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['jabber_port']); ?>" /> + </li> + + <li> + <label for="jabberusername"><?php echo Filters::noXSS(L('jabberuser')); ?></label> + <input id="jabberusername" class="text" type="text" name="jabber_username" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['jabber_username']); ?>" /> + </li> + + <li> + <label for="jabberpassword"><?php echo Filters::noXSS(L('jabberpass')); ?></label> + <input id="jabberpassword" name="jabber_password" class="text" type="password" maxlength="100" value="<?php echo Filters::noXSS($fs->prefs['jabber_password']); ?>" /> + </li> + + <li> + <label for="showjabberpass"><?php echo Filters::noXSS(L('showpass')); ?></label> + <input id="showjabberpass" name="show_jabber_pass" class="text" type="checkbox" onclick="ShowHidePassword('jabberpassword')"/> + </li> + + </ul> + </fieldset> + </div> + +<div id="lookandfeel" class="tab"> + <ul class="form_elements"> + <li> + <label for="globaltheme"><?php echo Filters::noXSS(L('globaltheme')); ?></label> + <select id="globaltheme" name="global_theme"> + <?php echo tpl_options(Flyspray::listThemes(), $fs->prefs['global_theme'], true); ?> + </select> + <label for="customstyle" style="width:auto"><?php echo Filters::noXSS(L('customstyle')); ?></label> + <select id="customstyle" name="custom_style"> + <?php + $customs[]=array('', L('no')); + $customstyles=glob_compat(BASEDIR ."/themes/".($proj->prefs['theme_style'])."/custom_*.css"); + foreach ($customstyles as $cs){ + $customs[]=array($cs,$cs); + } + echo tpl_options($customs, $proj->prefs['custom_style']); + ?> + </select> + </li> + <li> + <label for="default_entry"><?php echo Filters::noXSS(L('defaultentry')); ?></label> + <select id="default_entry" name="default_entry"> + <?php echo tpl_options(array('index' => L('tasklist'),'toplevel' => L('toplevel')), Post::val('default_entry', $proj->prefs['default_entry'])); ?> + </select> + </li> + + <?php // Set the selectable column names + // Do NOT use real database column name here and in the next list, + // but a term from translation table entries instead, because it's + // also used elsewhere to draw a localized version of the name. + // Look also at the end of function + // tpl_draw_cell in scripts/index.php for further explanation. + $columnnames = array( + 'id' => L('id'), + 'project' => L('project'), + 'parent' => L('parent'), + 'tasktype' => L('tasktype'), + 'category' => L('category'), + 'severity' => L('severity'), + 'priority' => L('priority'), + 'summary' => L('summary'), + 'dateopened' => L('dateopened'), + 'status' => L('status'), + 'openedby' => L('openedby'), + 'private' => L('private'), + 'assignedto' => L('assignedto'), + 'lastedit' => L('lastedit'), + 'editedby' => L('editedby'), + 'reportedin' => L('reportedin'), + 'dueversion' => L('dueversion'), + 'duedate' => L('duedate'), + 'comments' => L('comments'), + 'attachments' => L('attachments'), + 'progress' => L('progress'), + 'dateclosed' => L('dateclosed'), + 'closedby' => L('closedby'), + 'os' => L('os'), + 'votes' => L('votes'), + 'estimatedeffort' => L('estimatedeffort'), + 'effort' => L('effort')); + $selectedcolumns = explode(' ', Post::val('visible_columns', $fs->prefs['visible_columns'])); + ?> + + <li> + <label for="default_order_by"><?php echo Filters::noXSS(L('defaultorderby')); ?></label> + <select id="default_order_by" name="default_order_by"> + <?php echo tpl_options($columnnames, $proj->prefs['sorting'][0]['field'], false); ?> + </select> + <select id="default_order_by_dir" name="default_order_by_dir"> + <?php echo tpl_options(array('asc' => L('ascending'), 'desc' => L('descending')), $proj->prefs['sorting'][0]['dir'], false); ?> + </select> + </li> + <li> + <label for="default_order_by2"><?php echo Filters::noXSS(L('defaultorderby2')); ?></label> + <select id="default_order_by2" name="default_order_by2"> + <?php echo tpl_options($columnnames, $proj->prefs['sorting'][1]['field'], false); ?> + </select> + <select id="default_order_by_dir2" name="default_order_by_dir2"> + <?php echo tpl_options(array('asc' => L('ascending'), 'desc' => L('descending')), $proj->prefs['sorting'][1]['dir'], false); ?> + </select> + </li> + + <li> + <label class="labeltextarea"><?php echo Filters::noXSS(L('visiblecolumns')); ?></label> + <?php echo tpl_double_select('visible_columns', $columnnames, $selectedcolumns, false); ?> + </li> + + <li> + <label class="labeltextarea"><?php echo Filters::noXSS(L('visiblefields')); ?></label> + <?php // Set the selectable field names + $fieldnames = array( + 'parent' => L('parent'), + 'tasktype' => L('tasktype'), + 'category' => L('category'), + 'severity' => L('severity'), + 'priority' => L('priority'), + 'status' => L('status'), + 'private' => L('private'), + 'assignedto' => L('assignedto'), + 'reportedin' => L('reportedin'), + 'dueversion' => L('dueversion'), + 'duedate' => L('duedate'), + 'progress' => L('progress'), + 'os' => L('os'), + 'votes' => L('votes')); + $selectedfields = explode(' ', Post::val('visible_fields', $fs->prefs['visible_fields'])); + echo tpl_double_select('visible_fields', $fieldnames, $selectedfields, false); + ?> + </li> + + <?php if(isset($fs->prefs['general_integration'])): ?> + <li> + <label class="labeltextarea"><?php echo Filters::noXSS(L('generalintegration')); ?></label> + <?php echo TextFormatter::textarea('general_integration', 8, 70, array('id'=>'general_integration'), Post::val('general_integration', $fs->prefs['general_integration'])); ?> + </li> + <?php endif; ?> + + <?php if(isset($fs->prefs['footer_integration'])): ?> + <li> + <label class="labeltextarea"><?php echo Filters::noXSS(L('footerintegration')); ?></label> + <?php echo TextFormatter::textarea('footer_integration', 8, 70, array('id'=>'footer_integration'), Post::val('footer_integration', $fs->prefs['footer_integration'])); ?> + </li> + <?php endif; ?> + + </ul> + </div> + <div class="tbuttons"> + <input type="hidden" name="action" value="globaloptions" /> + <button type="submit" class="positive"><?php echo Filters::noXSS(L('saveoptions')); ?></button> + <button type="reset"><?php echo Filters::noXSS(L('resetoptions')); ?></button> + </div> + </form> +</div> diff --git a/themes/CleanFS/templates/admin.resolution.tpl b/themes/CleanFS/templates/admin.resolution.tpl new file mode 100644 index 0000000..e8b78dc --- /dev/null +++ b/themes/CleanFS/templates/admin.resolution.tpl @@ -0,0 +1,8 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('resolutionlist')); ?></h3> + <?php + $this->assign('list_type', 'resolution'); + $this->assign('rows', $proj->listResolutions(true)); + $this->display('common.list.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/admin.status.tpl b/themes/CleanFS/templates/admin.status.tpl new file mode 100644 index 0000000..c38e6a9 --- /dev/null +++ b/themes/CleanFS/templates/admin.status.tpl @@ -0,0 +1,9 @@ +<div id="toolbox">
+ <h3><?php echo Filters::noXSS(L('taskstatuses')); ?></h3>
+
+ <?php
+ $this->assign('list_type', 'status');
+ $this->assign('rows', $proj->listTaskStatuses(true));
+ $this->display('common.list.tpl');
+ ?>
+</div>
diff --git a/themes/CleanFS/templates/admin.tag.tpl b/themes/CleanFS/templates/admin.tag.tpl new file mode 100644 index 0000000..2b5afd1 --- /dev/null +++ b/themes/CleanFS/templates/admin.tag.tpl @@ -0,0 +1,10 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('tags')); ?></h3> + <p>Tag management is in development.</p> + <p>Please see <a href="https://bugs.flyspray.org/2012" target="_blank">bugs.flyspray.org/2012</a> for status of <b>Tags</b> feature.</p> +<?php + $this->assign('list_type', 'tag'); + $this->assign('rows', $proj->listTags(true)); + $this->display('common.list.tpl'); +?> +</div> diff --git a/themes/CleanFS/templates/admin.tasktype.tpl b/themes/CleanFS/templates/admin.tasktype.tpl new file mode 100644 index 0000000..0ceff33 --- /dev/null +++ b/themes/CleanFS/templates/admin.tasktype.tpl @@ -0,0 +1,8 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('tasktypes')); ?></h3> + <?php + $this->assign('list_type', 'tasktype'); + $this->assign('rows', $proj->listTaskTypes(true)); + $this->display('common.list.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/admin.translation.tpl b/themes/CleanFS/templates/admin.translation.tpl new file mode 100644 index 0000000..f0b575c --- /dev/null +++ b/themes/CleanFS/templates/admin.translation.tpl @@ -0,0 +1 @@ +<?php echo $content; ?> diff --git a/themes/CleanFS/templates/admin.userrequest.tpl b/themes/CleanFS/templates/admin.userrequest.tpl new file mode 100644 index 0000000..badc98b --- /dev/null +++ b/themes/CleanFS/templates/admin.userrequest.tpl @@ -0,0 +1,50 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('pendingrequests')); ?></h3> + + <?php if (!count($pendings)): ?> + <?php echo Filters::noXSS(L('nopendingreq')); ?> + + <?php else: ?> + <table class="requests"> + <tr> + <th><?php echo Filters::noXSS(L('eventdesc')); ?></th> + <th><?php echo Filters::noXSS(L('requestedby')); ?></th> + <th><?php echo Filters::noXSS(L('daterequested')); ?></th> + <th><?php echo Filters::noXSS(L('emailaddress')); ?></th> + <th class="pm-buttons"> </th> + </tr> + <?php foreach ($pendings as $req): ?> + <tr> + <td> + New User Request + </td> + <td><?php echo tpl_userlink($req['submitted_by']); ?></td> + <td><?php echo Filters::noXSS(formatDate($req['time_submitted'], true)); ?></td> + <td><?php echo Filters::noXSS($req['reason_given']); ?></td> + <td> + <?php echo tpl_form(Filters::noXSS(CreateUrl('edituser', $req['submitted_by'])), null, null, null, 'style="display:inline"'); ?> + <input type="submit" value="<?php echo Filters::noXSS(L('accept')); ?>"> + <input type="hidden" name="action" value="approve.user"/> + <input type="hidden" name="user_id" value="<?php echo $req['submitted_by']; ?>"/> + <input type="hidden" name="account_enabled" value="1"/> + </form> + + <button class="submit" onclick="showhidestuff('denyform<?php echo Filters::noXSS($req['request_id']); ?>');"><?php echo Filters::noXSS(L('deny')); ?></button> + <div id="denyform<?php echo Filters::noXSS($req['request_id']); ?>" class="denyform"> + <?php echo tpl_form(Filters::noXSS(CreateUrl('admin','userrequest'))); ?> + <div> + <input type="hidden" name="action" value="denyuserreq" /> + <input type="hidden" name="req_id" value="<?php echo Filters::noXSS($req['request_id']); ?>" /> + <label for="deny_reason<?php echo Filters::noXSS($req['request_id']); ?>" class="inline"><?php echo Filters::noXSS(L('reasonfordeinal')); ?></label><br /> + <textarea cols="40" rows="5" name="deny_reason" id="deny_reason<?php echo Filters::noXSS($req['request_id']); ?>"></textarea> + <br /> + <button type="submit"><?php echo Filters::noXSS(L('deny')); ?></button> + </div> + </form> + </div> + </td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> +</div> diff --git a/themes/CleanFS/templates/admin.users.tpl b/themes/CleanFS/templates/admin.users.tpl new file mode 100644 index 0000000..25e89ad --- /dev/null +++ b/themes/CleanFS/templates/admin.users.tpl @@ -0,0 +1,6 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('admintoolboxlong')); ?> :: <?php echo Filters::noXSS(L('edituser')); ?> : <?php echo Filters::noXSS($theuser->infos['user_name']); ?></h3> + <fieldset><legend><?php echo Filters::noXSS(L('edituser')); ?></legend> + <?php $this->display('common.profile.tpl'); ?> + </fieldset> +</div> diff --git a/themes/CleanFS/templates/admin.version.tpl b/themes/CleanFS/templates/admin.version.tpl new file mode 100644 index 0000000..196fac9 --- /dev/null +++ b/themes/CleanFS/templates/admin.version.tpl @@ -0,0 +1,8 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('versionlist')); ?></h3> + <?php + $this->assign('list_type', 'version'); + $this->assign('rows', $proj->listVersions(true)); + $this->display('common.list.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/common.attachments.tpl b/themes/CleanFS/templates/common.attachments.tpl new file mode 100644 index 0000000..ee0898b --- /dev/null +++ b/themes/CleanFS/templates/common.attachments.tpl @@ -0,0 +1,50 @@ + <?php + if ($attachments && $user->can_view_task($task_details)): ?> + <div class="attachments"> + <?php foreach ($attachments as $attachment): ?> + <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?> + <a title="<?php echo Filters::noXSS($attachment['orig_name']); ?>" href="?getfile=<?php echo Filters::noXSS($attachment['attachment_id']); ?>" <?php if (substr($attachment['file_type'], 0, 5) == 'image'): ?>rel="lightbox[bug]"<?php endif; ?>> + <?php else: ?> + <del> + <?php endif; ?> + <?php + // Strip the mimetype to get the icon image name + list($main) = explode('/', $attachment['file_type']); + $imgdir = BASEDIR . "/themes/".Filters::noXSS($proj->prefs['theme_style'])."/mime/"; + $imgpath = Filters::noXSS($baseurl)."themes/".Filters::noXSS($proj->prefs['theme_style'])."/mime/"; + if (file_exists($imgdir.$attachment['file_type'] . '.png')): + ?> + <img src="<?php echo Filters::noXSS($imgpath); ?><?php echo Filters::noXSS($attachment['file_type']); ?>.png" alt="(<?php echo Filters::noXSS($attachment['file_type']); ?>)" title="<?php echo Filters::noXSS($attachment['file_type']); ?>" /> + <?php else: ?> + <img src="<?php echo Filters::noXSS($imgpath); ?><?php echo Filters::noXSS($main); ?>.png" alt="" title="<?php echo Filters::noXSS($attachment['file_type']); ?>" /> + <?php endif; ?> + + <?php if (utf8_strlen($attachment['orig_name']) > 30): ?> + <?php echo Filters::noXSS(utf8_substr($attachment['orig_name'], 0, 29)); ?>... + <?php else: ?> + <?php echo Filters::noXSS($attachment['orig_name']); ?> + + <?php endif; ?> + <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?> + </a> + <?php else: ?> + </del> + <?php endif; ?> + <?php if ($attachment['file_size'] < 1000000): ?> + (<?php echo Filters::noXSS(round($attachment['file_size']/1024,1)); ?> <?php echo Filters::noXSS(L('KiB')); ?>) + <?php else: ?> + (<?php echo Filters::noXSS(round($attachment['file_size']/1024/1024,2)); ?> <?php echo Filters::noXSS(L('MiB')); ?>) + <?php endif; ?> + <?php + # showing additional download links for images is a temporary fix, because the lightbox plugin used in <=FS1.0 (a lightbox version from 2008!) catches also right mouse clicks :-(. + # So you cannot just choose 'Save as..' context menu option. + # When the javascript based features of Flyspray (a big task, planned ~FS1.1) moved complete to (probably) jquery (used also by dokuwiki so prefered) and a jquery based lightbox/fancybox is used, this can be removed. + if(file_exists(BASEDIR . '/attachments/' . $attachment['file_name']) && substr($attachment['file_type'], 0, 5) == 'image' ): ?> + <a class="fa fa-download" title="Download <?php echo Filters::noXSS($attachment['orig_name']); ?>" href="?getfile=<?php echo Filters::noXSS($attachment['attachment_id']); ?>&dl"></a> + <?php endif; ?> + <br /> + <?php endforeach; ?> + </div> + <?php elseif (count($attachments)): ?> + <div class="attachments"><?php echo Filters::noXSS(L('attachnoperms')); ?></div> + <?php endif; ?> diff --git a/themes/CleanFS/templates/common.cat.tpl b/themes/CleanFS/templates/common.cat.tpl new file mode 100644 index 0000000..fb0e613 --- /dev/null +++ b/themes/CleanFS/templates/common.cat.tpl @@ -0,0 +1,157 @@ +<p><?php echo Filters::noXSS(L('listnote')); ?></p> +<?php if ($do=='pm'): ?> +<h3><?php echo Filters::noXSS(L('categoriesglobal')); ?></h3> +<table class="list" id="idtablesys"> +<colgroup> + <col class="cname" /> + <col class="cowner" /> + <col class="cshow" /> + <col class="cdelete" /> + <col class="cusage" /> +</colgroup> +<thead> +<tr> + <th><?php echo Filters::noXSS(L('name')); ?></th> + <th><?php echo Filters::noXSS(L('owner')); ?></th> + <th><?php echo Filters::noXSS(L('show')); ?></th> + <th> </th> + <th><?php echo Filters::noXSS(L('usedintasks')); ?></th> +</tr> +</thead> +<tbody> +<?php if (isset($sysrows) && count($sysrows)): ?> +<?php +$syscountlines=-1; +foreach ($sysrows as $row): +$syscountlines++; +?> +<tr> + <td class="first"><span class="depthmark"><?php echo str_repeat('→', $row['depth']); ?></span><?php echo Filters::noXSS($row['category_name']); ?></td> + <td><?php echo ($row['category_owner']==0)? '': Filters::noXSS($row['category_owner']); ?></td> + <td title="<?php echo Filters::noXSS(L('showtip')); ?>"><?php echo $row['show_in_list']; ?></td> + <td> </td> + <td><?php echo $row['used_in_tasks'] >0 ? $row['used_in_tasks']:''; ?></td> +</tr> +<?php endforeach; ?> +<?php else: ?> +<tr><td colspan="5"><?php echo Filters::noXSS(L('novalues')); ?></td></tr> +<?php endif; ?> +</tbody> +</table> +<?php endif; ?> +<h3><?php echo $do=='pm' ? Filters::noXSS(L('categoriesproject')) : Filters::noXSS(L('categoriesglobal')); ?></h3> +<?php +$countlines = -1; +$categories = $proj->listCategories($proj->id, false, false, false); +if ( count($categories) ){ + $root = $categories[0]; + unset($categories[0]); +} else{ + $root=array(); +} + +if (count($categories)) : ?> +<div id="controlBox"> + <div class="grip"></div> + <div class="inner"> + <a style="display:block;text-align:center;" href="#" onclick="TableControl.up('catTable'); return false;"><img src="<?php echo Filters::noXSS($this->themeUrl()); ?>/up.png" alt="Up" /></a> + <a href="#" onclick="TableControl.shallower('catTable'); return false;"><img src="<?php echo Filters::noXSS($this->themeUrl()); ?>/left.png" alt="Left" /></a> + <a href="#" onclick="TableControl.deeper('catTable'); return false;"><img src="<?php echo Filters::noXSS($this->themeUrl()); ?>/right.png" alt="Right" /></a> + <a style="display:block;text-align:center;" href="#" onclick="TableControl.down('catTable'); return false;"><img src="<?php echo Filters::noXSS($this->themeUrl()); ?>/down.png" alt="Down" /></a> +</div> +</div> +<?php endif; ?> +<?php echo tpl_form(Filters::noXSS(CreateURL($do, 'cat', $proj->id))); ?> + <table class="list" id="catTable"> + <thead> + <tr> + <th><?php echo Filters::noXSS(L('name')); ?></th> + <th><?php echo Filters::noXSS(L('owner')); ?></th> + <th><?php echo Filters::noXSS(L('show')); ?></th> + <th><?php echo Filters::noXSS(L('delete')); ?></th> + <th><?php echo Filters::noXSS(L('usedintasks')); ?></th> + </tr> + </thead> + <tbody> + <?php + foreach ($categories as $row): + $countlines++; + ?> + <tr class="depth<?php echo Filters::noXSS($row['depth']); ?>"> + <td class="first"> + <input type="hidden" name="lft[<?php echo Filters::noXSS($row['category_id']); ?>]" value="<?php echo Filters::noXSS($row['lft']); ?>" /> + <input type="hidden" name="rgt[<?php echo Filters::noXSS($row['category_id']); ?>]" value="<?php echo Filters::noXSS($row['rgt']); ?>" /> + <span class="depthmark"><?php echo str_repeat('→', intval($row['depth'])); ?></span> + <input id="categoryname<?php echo Filters::noXSS($countlines); ?>" class="text" type="text" maxlength="40" name="list_name[<?php echo Filters::noXSS($row['category_id']); ?>]" value="<?php echo Filters::noXSS($row['category_name']); ?>" /> + </td> + <td title="<?php echo Filters::noXSS(L('categoryownertip')); ?>"> + <?php echo tpl_userselect('category_owner[' . $row['category_id'] . ']' . $countlines, $row['category_owner'], 'categoryowner' . $countlines); ?> + + </td> + <td title="<?php echo Filters::noXSS(L('listshowtip')); ?>"> + <?php echo tpl_checkbox('show_in_list[' . $row['category_id'] . ']', $row['show_in_list'], 'showinlist'.$countlines); ?> + + </td> + <td title="<?php echo Filters::noXSS(L('listdeletetip')); ?>"> + <input id="delete<?php echo Filters::noXSS($row['category_id']); ?>" type="checkbox" + <?php if ($row['used_in_tasks']): ?>disabled="disabled"<?php endif; ?> + name="delete[<?php echo Filters::noXSS($row['category_id']); ?>]" value="1" /> + </td> + <td><?php echo $row['used_in_tasks'] >0 ? $row['used_in_tasks']:''; ?></td> + </tr> + <?php endforeach; ?> + </tbody> + <?php if($countlines > -1): ?> + <tr> + <td colspan="4"></td> + <td class="buttons"> + <input type="hidden" name="action" value="update_category" /> + <input type="hidden" name="list_type" value="category" /> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('update')); ?></button> + </td> + </tr> + <?php endif; ?> + </table> + <?php if (count($categories)): ?> + <script type="text/javascript"> + <?php + echo 'TableControl.create("catTable",{ + controlBox: "controlBox", + tree: true, + spreadActiveClass: true + });'; + echo 'new Draggable("controlBox",{ + handle: "grip" + });'; + ?> + </script> + <?php endif; ?> +</form> +<hr /> +<?php echo tpl_form(Filters::noXSS(CreateURL($do, 'cat', $proj->id))); ?> + <table class="list"> + <tr> + <td> + <input id="listnamenew" class="text" type="text" maxlength="40" name="list_name" autofocus /> + </td> + <td title="<?php echo Filters::noXSS(L('categoryownertip')); ?>"> + <?php echo tpl_userselect('category_owner', Req::val('category_owner'), 'categoryownernew'); ?> + + </td> + <td title="<?php echo Filters::noXSS(L('categoryparenttip')); ?>"> + <label for="parent_id"><?php echo Filters::noXSS(L('parent')); ?></label> + <select id="parent_id" name="parent_id"> + <option value="<?php echo Filters::noXSS($root['category_id']); ?>"><?php echo Filters::noXSS(L('notsubcategory')); ?></option> + <?php echo tpl_options($proj->listCategories($proj->id, false), Req::val('parent_id')); ?> + </select> + </td> + <td class="buttons"> + <input type="hidden" name="action" value="<?php echo Filters::noXSS($do); ?>.add_category" /> + <input type="hidden" name="area" value="<?php echo Filters::noXSS(Req::val('area')); ?>" /> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('addnew')); ?></button> + </td> + </tr> + </table> +</form> diff --git a/themes/CleanFS/templates/common.datepicker.tpl b/themes/CleanFS/templates/common.datepicker.tpl new file mode 100644 index 0000000..48a11e0 --- /dev/null +++ b/themes/CleanFS/templates/common.datepicker.tpl @@ -0,0 +1,9 @@ +<?php if ($label): ?> +<label for="<?php echo Filters::noXSS($name); ?>"><?php echo Filters::noXSS($label); ?></label> +<?php endif; ?> +<input id="<?php echo Filters::noXSS($name); ?>" type="text" class="text" size="10" name="<?php echo Filters::noXSS($name); ?>" placeholder=" " value="<?php echo Filters::noXSS($date); ?>" /> + +<a class="datelink" href="#" id="<?php echo Filters::noXSS($name); ?>dateview"> + <!--<img src="<?php echo Filters::noXSS($this->get_image('x-office-calendar')); ?>" alt="<?php echo Filters::noXSS(L('selectdate')); ?>" />--> +</a> +<script type="text/javascript">Calendar.setup({daFormat: '<?php echo Filters::noJsXSS($dateformat); ?>',inputField: "<?php echo Filters::noXSS($name); ?>", button: "<?php echo Filters::noXSS($name); ?>dateview"});</script> diff --git a/themes/CleanFS/templates/common.dualselect.tpl b/themes/CleanFS/templates/common.dualselect.tpl new file mode 100644 index 0000000..f207aa7 --- /dev/null +++ b/themes/CleanFS/templates/common.dualselect.tpl @@ -0,0 +1,15 @@ +<div class="double_select"> + <select class="dualselect_selectable" id="l<?php echo Filters::noXSS($id); ?>" multiple="multiple" + ondblclick="dualSelect(this, 'r', '<?php echo Filters::noJsXSS($id); ?>')">%s</select> + <div class="dualselect_buttons"> + <button type="button" onmouseup="dualSelect('l', 'r', '<?php echo Filters::noJsXSS($id); ?>')"><?php echo eL('add'); ?> ▶</button> + <button type="button" onmouseup="dualSelect('r', 'l', '<?php echo Filters::noJsXSS($id); ?>')">◀ <?php echo eL('remove'); ?></button> + </div> + <div class="dualselect_selected"> + <?php if($updown): ?><button type="button" onmouseup="selectMove('<?php echo Filters::noJsXSS($id); ?>', -1)">▲</button><br /><?php endif; ?> + <select id="r<?php echo Filters::noXSS($id); ?>" multiple="multiple" + ondblclick="dualSelect(this, 'l', '<?php echo Filters::noJsXSS($id); ?>')">%s</select> + <?php if($updown): ?><button type="button" onmouseup="selectMove('<?php echo Filters::noJsXSS($id); ?>', 1)">▼</button><?php endif; ?> + <input type="hidden" value="<?php echo Filters::noXSS(join(' ', $selected)); ?>" id="v<?php echo Filters::noXSS($id); ?>" name="<?php echo Filters::noXSS($name); ?>" /> + </div> +</div> diff --git a/themes/CleanFS/templates/common.editallusers.tpl b/themes/CleanFS/templates/common.editallusers.tpl new file mode 100644 index 0000000..4a49d81 --- /dev/null +++ b/themes/CleanFS/templates/common.editallusers.tpl @@ -0,0 +1,137 @@ +<script> +function toggleCheckbox(id) +{ + var el = document.getElementById(id); + if (el != null) { + if (el.checked) { + el.checked = false; + } else { + el.checked = true; + } + } +} +</script> +<?php + $showstats=(isset($_GET['showfields']) && in_array('stats',$_GET['showfields'])) ? 1 : 0; + $showltf= (isset($_GET['showfields']) && in_array('ltf', $_GET['showfields'])) ? 1 : 0; + ?> +<form action="<?php echo Filters::noXSS(createURL($do, 'editallusers'));?>" method="get"> +<input type="hidden" name="do" value="admin" /> +<input type="hidden" name="area" value="editallusers" /> +<div style="background-color:#ff9">Note: Choosing the "statistics" option here can result in a slow SQL query depending on your amount of existing tasks and users! The other options are fast.</div> +<select name="showfields[]" multiple="multiple" size="3"> +<option value="-">---basic---</option> +<option value="stats"<?php echo $showstats? ' selected="selected"':'';?>>statistics</option> +<option value="ltf"<?php echo $showltf? ' selected="selected"':'';?>>language, timezone, dateformat</option> +</select> +<button type="submit">Show selected fields</button> +</form> +<?php +if ($do == 'admin'): echo tpl_form(Filters::noXSS(createURL($do, 'editallusers')), null, null, null, 'id="editallusers"'); + else: echo tpl_form(Filters::noXSS($_SERVER['SCRIPT_NAME']), null, null, null, 'id="editallusers"'); +endif; +if ($do == 'admin'): ?> + <input type="hidden" name="action" value="admin.editallusers" /> + <input type="hidden" name="do" value="admin" /> + <input type="hidden" name="area" value="editallusers" /> +<?php endif; ?> +<style>.bulkedituser td.inactive{color:#999;}</style> +<table class="bulkedituser"> + <thead> + <tr class="account_header"> + <th></th> + <th><?= eL('realname') ?></th> + <th><?= eL('username') ?></th> + <th><?= eL('emailaddress') ?></th> + <th><?= eL('jabberid') ?></th> + <th><?= eL('regdate') ?></th> + <th><?= eL('lastlogin') ?></th> +<?php if($showstats): ?> + <th>opened_by</th> + <th>closed_by</th> + <th>last_edited_by</th> + <th>assigned</th> + <th>comments</th> + <th>votes</th> +<?php endif; ?> +<?php if($showltf): ?> + <th><?= eL('language') ?></th> + <th><?= eL('timezone') ?></th> + <th><?= eL('dateformat') ?></th> + <th><?= eL('dateformat_extended') ?></th> +<?php endif; ?> + </tr> + </thead> + <tbody> + <?php +$listopts=null; +if($showstats){ $listopts['stats']=1; } +foreach (Flyspray::listUsers($listopts) as $usr): ?> +<tr class="<?php echo ($usr['account_enabled']) ? 'account_enabled':'account_disabled'; ?>" onclick="toggleCheckbox('<?php echo $usr['user_id']; ?>')"> + <td><input id="<?php echo $usr['user_id'] ?>" onclick="event.stopPropagation()" type="checkbox" name="checkedUsers[]" value="<?php echo $usr['user_id']; ?>"></td> + <td><a href="<?php echo createURL('edituser', $usr['user_id'] ); ?>"><?php echo Filters::noXSS($usr['real_name']); ?></a></td> + <td><?php echo $usr['user_name']; ?></td> + <td<?= ($usr['notify_type']==0 || $usr['notify_type']==2) ? ' class="inactive"':''; ?>><?php echo Filters::noXSS($usr['email_address']); ?></td> + <td<?= ($usr['notify_type']==0 || $usr['notify_type']==1) ? ' class="inactive"':''; ?>><?php echo Filters::noXSS($usr['jabber_id']); ?></td> + <td><?php echo formatDate($usr['register_date']); ?></td> + <td><?php echo formatDate($usr['last_login']); ?></td> +<?php if($showstats): ?> + <td><?php echo $usr['countopen']>0 ? $usr['countopen']:''; ?></td> + <td><?php echo $usr['countclose']>0 ? $usr['countclose']:''; ?></td> + <td><?php echo $usr['countlastedit']>0 ? $usr['countlastedit']:''; ?></td> + <td><?php echo $usr['countassign']>0 ? $usr['countassign']:''; ?></td> + <td><?php echo $usr['countcomments']>0 ? $usr['countcomments']:''; ?></td> + <td><?php echo $usr['countvotes']>0 ? $usr['countvotes']:''; ?></td> +<?php endif; ?> +<?php if($showltf): ?> + <td><?php echo Filters::noXSS($usr['lang_code']); ?></td> + <td><?php echo Filters::noXSS($usr['time_zone']); ?></td> + <td><?php echo Filters::noXSS($usr['dateformat']); ?></td> + <td><?php echo Filters::noXSS($usr['dateformat_extended']); ?></td> +<?php endif; ?> + </tr> +<?php endforeach; ?> + </tbody> +</table> + +<button type="submit" id="buSubmit" name="enable"><?= eL('enableaccounts') ?></button> +<button type="submit" id="buSubmit" name="disable"><?= eL('disableaccounts') ?></button> +<button type="submit" id="buSubmit" name="delete"><?= eL('deleteaccounts') ?></button> + +<!-- TODO Should still add these to bulk edit, but hasn't been done yet +<ul class="form_elements"> +<li class="required"> + <label for="notify_type"><?= eL('notifications') ?></label> + <select id="notify_type" name="notify_type"> + <?php echo tpl_options($fs->getNotificationOptions(), Req::val('notify_type')); ?> + + </select> +</li> +<li> + <label for="time_zone"><?= eL('timezone') ?></label> + <select id="time_zone" name="time_zone"> + <?php + $times = array(); + for ($i = -12; $i <= 13; $i++) { + $times[$i] = L('GMT') . (($i == 0) ? ' ' : (($i > 0) ? '+' . $i : $i)); + } + ?> + <?php echo tpl_options($times, Req::val('time_zone', 0)); ?> + + </select> +</li> + + <?php if (isset($groups)): ?> + <li> + <label for="groupin"><?= eL('globalgroup') ?></label> + <select id="groupin" class="adminlist" name="group_in"> + <?php echo tpl_options($groups, Req::val('group_in')); ?> + + </select> + </li> + <?php endif; ?> + + </ul> + <p><button type="submit" id="buSubmit"><?= eL('updateaccounts') ?></button></p> +--> +</form> diff --git a/themes/CleanFS/templates/common.editattachments.tpl b/themes/CleanFS/templates/common.editattachments.tpl new file mode 100644 index 0000000..5cff7d2 --- /dev/null +++ b/themes/CleanFS/templates/common.editattachments.tpl @@ -0,0 +1,46 @@ + <?php if ($attachments): ?> + <table class="attachments"> + <thead><tr><th><?php echo Filters::noXSS(L('file')); ?></th><th<?php echo $user->perms('delete_attachments') ? '':' style="color:#999"'; ?>><?php echo Filters::noXSS(L('size')); ?></th><th><?php echo Filters::noXSS(L('delete')); ?></th></tr></thead> + <?php foreach ($attachments as $attachment): ?> + <tr> + <td> + <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?> + <a href="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?getfile=<?php echo Filters::noXSS($attachment['attachment_id']); ?>" title="<?php echo Filters::noXSS($attachment['file_type']); ?>"> + <?php else: ?> + <del> + <?php endif; ?> + <?php + // Strip the mimetype to get the icon image name + list($main) = explode('/', $attachment['file_type']); + $imgdir = BASEDIR . "/themes/".Filters::noXSS($proj->prefs['theme_style'])."/mime/"; + $imgpath = Filters::noXSS($baseurl)."themes/".Filters::noXSS($proj->prefs['theme_style'])."/mime/"; + if (file_exists($imgdir.$attachment['file_type'] . '.png')): + ?> + <img src="<?php echo Filters::noXSS($imgpath); ?><?php echo Filters::noXSS($attachment['file_type']); ?>.png" alt="(<?php echo Filters::noXSS($attachment['file_type']); ?>)" title="<?php echo Filters::noXSS($attachment['file_type']); ?>" /> + <?php else: ?> + <img src="<?php echo Filters::noXSS($imgpath); ?><?php echo Filters::noXSS($main); ?>.png" alt="" title="<?php echo Filters::noXSS($attachment['file_type']); ?>" /> + <?php endif; ?> + <?php echo Filters::noXSS($attachment['orig_name']); ?> + + <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?> + </a> + <?php else: ?> + </del> + <?php endif; ?> + </td> + <td> + <?php if ($attachment['file_size'] < 1000000): ?> + <?php echo Filters::noXSS(round($attachment['file_size']/1024,1)); ?> <?php echo Filters::noXSS(L('KiB')); ?> + + <?php else: ?> + <?php echo Filters::noXSS(round($attachment['file_size']/1024/1024,2)); ?> <?php echo Filters::noXSS(L('MiB')); ?> + + <?php endif; ?> + </td> + <td> + <input type="checkbox" <?php echo tpl_disableif(!$user->perms('delete_attachments')); ?> name="delete_att[]" value="<?php echo Filters::noXSS($attachment['attachment_id']); ?>" /> + </td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> diff --git a/themes/CleanFS/templates/common.editgroup.tpl b/themes/CleanFS/templates/common.editgroup.tpl new file mode 100644 index 0000000..28ef9f6 --- /dev/null +++ b/themes/CleanFS/templates/common.editgroup.tpl @@ -0,0 +1,233 @@ + <form action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get" id="groupselect"> + <div> + <label for="selectgroup"><?php echo Filters::noXSS(L('editgroup')); ?></label> + <select name="id" id="selectgroup"><?php echo tpl_options(Flyspray::ListGroups($proj->id), Req::num('id')); ?></select> + <button type="submit"><?php echo Filters::noXSS(L('edit')); ?></button> + <input type="hidden" name="do" value="<?php echo Filters::noXSS(Req::val('do')); ?>" /> + <input type="hidden" name="area" value="editgroup" /> + </div> + </form> + +<?php echo tpl_form(Filters::noXSS(CreateURL('editgroup', Req::num('id'), $do)), null, null, null, 'id="editgroup"'); ?> +<fieldset class="box"> <legend><?php echo Filters::noXSS(L('editgroup')); ?> <?php echo Filters::noXSS(Req::val('group_name', $group_details['group_name'])); ?></legend> +<table class="box"> + <tr> + <td> + <label for="groupname"><?php echo Filters::noXSS(L('groupname')); ?></label> + </td> + <td><input id="groupname" class="text" type="text" name="group_name" size="20" maxlength="20" value="<?php echo Filters::noXSS(Req::val('group_name', $group_details['group_name'])); ?>" /></td> + </tr> + <tr> + <td><label for="groupdesc"><?php echo Filters::noXSS(L('description')); ?></label></td> + <td><input id="groupdesc" class="text" type="text" name="group_desc" size="50" maxlength="100" value="<?php echo Filters::noXSS(Req::val('group_desc', $group_details['group_desc'])); ?>" /></td> + </tr> + <?php if ($group_details['group_id'] == 1): ?> + <tr> + <td colspan="2"><?php echo Filters::noXSS(L('notshownforadmin')); ?></td> + </tr> + <?php else: ?> + <tr> + <td><label for="projectmanager"><?php echo Filters::noXSS(L('projectmanager')); ?></label></td> + <td><?php echo tpl_checkbox('manage_project', Req::val('manage_project', !Req::val('action') && $group_details['manage_project']), 'projectmanager'); ?></td> + </tr> + <tr> + <td><label for="viewtasks"><?php echo Filters::noXSS(L('viewtasks')); ?></label></td> + <td><?php echo tpl_checkbox('view_tasks', Req::val('view_tasks', !Req::val('action') && $group_details['view_tasks']), 'viewtasks'); ?></td> + </tr> + <tr> + <td><label for="viewowntasks"><?php echo Filters::noXSS(L('viewowntasks')); ?></label></td> + <td><?php echo tpl_checkbox('view_own_tasks', Req::val('view_own_tasks', !Req::val('action') && $group_details['view_own_tasks']), 'viewowntasks'); ?></td> + </tr> + <tr> + <td><label for="viewgroupstasks"><?php echo Filters::noXSS(L('viewgroupstasks')); ?></label></td> + <td><?php echo tpl_checkbox('view_groups_tasks', Req::val('view_groups_tasks', !Req::val('action') && $group_details['view_groups_tasks']), 'viewgroupstasks'); ?></td> + </tr> + <tr> + <td><label for="canopenjobs"><?php echo Filters::noXSS(L('opennewtasks')); ?></label></td> + <td><?php echo tpl_checkbox('open_new_tasks', Req::val('open_new_tasks', !Req::val('action') && $group_details['open_new_tasks']), 'canopenjobs'); ?></td> + </tr> + <tr> + <td><label for="canopenmultipletasks"><?php echo Filters::noXSS(L('addmultipletasks')); ?></label></td> + <td><?php echo tpl_checkbox('add_multiple_tasks', Req::val('add_multiple_tasks', !Req::val('action') && $group_details['add_multiple_tasks']), 'canopenmultipletasks'); ?></td> + </tr> + <tr> + <td><label for="modifyowntasks"><?php echo Filters::noXSS(L('modifyowntasks')); ?></label></td> + <td><?php echo tpl_checkbox('modify_own_tasks', Req::val('modify_own_tasks', !Req::val('action') && $group_details['modify_own_tasks']), 'modifyowntasks'); ?></td> + </tr> + <tr> + <td><label for="modifyalltasks"><?php echo Filters::noXSS(L('modifyalltasks')); ?></label></td> + <td><?php echo tpl_checkbox('modify_all_tasks', Req::val('modify_all_tasks', !Req::val('action') && $group_details['modify_all_tasks']), 'modifyalltasks'); ?></td> + </tr> + <tr> + <td><label for="viewcomments"><?php echo Filters::noXSS(L('viewcomments')); ?></label></td> + <td><?php echo tpl_checkbox('view_comments', Req::val('view_comments', !Req::val('action') && $group_details['view_comments']), 'viewcomments'); ?></td> + </tr> + <tr> + <td><label for="canaddcomments"><?php echo Filters::noXSS(L('addcomments')); ?></label></td> + <td><?php echo tpl_checkbox('add_comments', Req::val('add_comments', !Req::val('action') && $group_details['add_comments']), 'canaddcomments'); ?></td> + </tr> + <tr> + <td><label for="editowncomments"><?php echo Filters::noXSS(L('editowncomments')); ?></label></td> + <td><?php echo tpl_checkbox('edit_own_comments', Req::val('edit_own_comments', !Req::val('action') && $group_details['edit_own_comments']), 'editowncomments'); ?></td> + </tr> + <tr> + <td><label for="editcomments"><?php echo Filters::noXSS(L('editcomments')); ?></label></td> + <td><?php echo tpl_checkbox('edit_comments', Req::val('edit_comments', !Req::val('action') && $group_details['edit_comments']), 'editcomments'); ?></td> + </tr> + <tr> + <td><label for="deletecomments"><?php echo Filters::noXSS(L('deletecomments')); ?></label></td> + <td><?php echo tpl_checkbox('delete_comments', Req::val('delete_comments', !Req::val('action') && $group_details['delete_comments']), 'deletecomments'); ?></td> + </tr> + <tr> + <td><label for="createattachments"><?php echo Filters::noXSS(L('createattachments')); ?></label></td> + <td><?php echo tpl_checkbox('create_attachments', Req::val('create_attachments', !Req::val('action') && $group_details['create_attachments']), 'createattachments'); ?></td> + </tr> + <tr> + <td><label for="deleteattachments"><?php echo Filters::noXSS(L('deleteattachments')); ?></label></td> + <td><?php echo tpl_checkbox('delete_attachments', Req::val('delete_attachments', !Req::val('action') && $group_details['delete_attachments']), 'deleteattachments'); ?></td> + </tr> + <tr> + <td><label for="viewhistory"><?php echo Filters::noXSS(L('viewhistory')); ?></label></td> + <td><?php echo tpl_checkbox('view_history', Req::val('view_history', !Req::val('action') && $group_details['view_history']), 'viewhistory'); ?></td> + </tr> + <tr> + <td><label for="canviewroadmap"><?php echo Filters::noXSS(L('canviewroadmap')); ?></label></td> + <td><?php echo tpl_checkbox('view_roadmap', Req::val('view_roadmap', !Req::val('action') && $group_details['view_roadmap']), 'canviewroadmap'); ?></td> + </tr> + <tr> + <td><label for="closeowntasks"><?php echo Filters::noXSS(L('closeowntasks')); ?></label></td> + <td><?php echo tpl_checkbox('close_own_tasks', Req::val('close_own_tasks', !Req::val('action') && $group_details['close_own_tasks']), 'closeowntasks'); ?></td> + </tr> + <tr> + <td><label for="closeothertasks"><?php echo Filters::noXSS(L('closeothertasks')); ?></label></td> + <td><?php echo tpl_checkbox('close_other_tasks', Req::val('close_other_tasks', !Req::val('action') && $group_details['close_other_tasks']), 'closeothertasks'); ?></td> + </tr> + <tr> + <td><label for="assigntoself"><?php echo Filters::noXSS(L('assigntoself')); ?></label></td> + <td><?php echo tpl_checkbox('assign_to_self', Req::val('assign_to_self', !Req::val('action') && $group_details['assign_to_self']), 'assigntoself'); ?></td> + </tr> + <tr> + <td><label for="assignotherstoself"><?php echo Filters::noXSS(L('assignotherstoself')); ?></label></td> + <td><?php echo tpl_checkbox('assign_others_to_self', Req::val('assign_others_to_self', !Req::val('action') && $group_details['assign_others_to_self']), 'assignotherstoself'); ?></td> + </tr> + <tr> + <td><label for="addtoassignees"><?php echo Filters::noXSS(L('addtoassignees')); ?></label></td> + <td><?php echo tpl_checkbox('add_to_assignees', Req::val('add_to_assignees', !Req::val('action') && $group_details['add_to_assignees']), 'addtoassignees'); ?></td> + </tr> + <tr> + <td><label for="viewreports"><?php echo Filters::noXSS(L('viewreports')); ?></label></td> + <td><?php echo tpl_checkbox('view_reports', Req::val('view_reports', !Req::val('action') && $group_details['view_reports']), 'viewreports'); ?></td> + </tr> + <tr> + <td><label for="canvote"><?php echo Filters::noXSS(L('canvote')); ?></label></td> + <td><?php echo tpl_checkbox('add_votes', Req::val('add_votes', !Req::val('action') && $group_details['add_votes']), 'canvote'); ?></td> + </tr> + <tr> + <td><label for="editassignments"><?php echo Filters::noXSS(L('editassignments')); ?></label></td> + <td><?php echo tpl_checkbox('edit_assignments', Req::val('edit_assignments', !Req::val('action') && $group_details['edit_assignments']), 'editassignments'); ?></td> + </tr> + <tr> + <td><label for="show_as_assignees"><?php echo Filters::noXSS(L('showasassignees')); ?></label></td> + <td><?php echo tpl_checkbox('show_as_assignees', Req::val('show_as_assignees', !Req::val('action') && $group_details['show_as_assignees']), 'show_as_assignees'); ?></td> + </tr> + <tr> + <td><label for="viewestimatedeffort"><?php echo Filters::noXSS(L('viewestimatedeffort')); ?></label></td> + <td><?php echo tpl_checkbox('view_estimated_effort', Req::val('view_estimated_effort', !Req::val('action') && $group_details['view_estimated_effort']), 'viewestimatedeffort'); ?></td> + </tr> + <tr> + <td><label for="viewcurrenteffortdone"><?php echo Filters::noXSS(L('viewcurrenteffortdone')); ?></label></td> + <td><?php echo tpl_checkbox('view_current_effort_done', Req::val('view_current_effort_done', !Req::val('action') && $group_details['view_current_effort_done']), 'viewactualeffort'); ?></td> + </tr> + <tr> + <td><label for="trackeffort"><?php echo Filters::noXSS(L('trackeffort')); ?></label></td> + <td><?php echo tpl_checkbox('track_effort', Req::val('track_effort', !Req::val('action') && $group_details['track_effort']), 'trackeffort'); ?></td> + </tr> + + <?php if (!$proj->id): ?> + <tr> + <td><label for="groupopen"><?php echo Filters::noXSS(L('groupenabled')); ?></label></td> + <td><?php echo tpl_checkbox('group_open', Req::val('group_open', !Req::val('action') && $group_details['group_open']), 'groupopen'); ?></td> + </tr> + <?php endif; ?> + <?php endif; ?> + <?php if ($group_details['group_id'] != '1'): ?> + <tr> + <td><label><input type="checkbox" name="delete_group" /> <?php echo Filters::noXSS(L('deletegroup')); ?></label></td> + <td><select name="move_to"> + <?php echo tpl_options( array_merge( ($proj->id) ? array(L('nogroup')) : array(), Flyspray::listGroups($proj->id)), null, false, null, $group_details['group_id']); ?> + </select> + </td> + </tr> + <?php endif; ?> + <tr> + <td><label for="add_user"><i class="fa fa-user"></i> <?php echo Filters::noXSS(L('addusergroup')); ?></label></td> + <td> + <?php echo tpl_userselect('uid', '', 'add_user'); ?> + </td> + </tr> + <tr> + <td colspan="2" class="buttons"> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <input type="hidden" name="action" value="<?php echo Filters::noXSS(Req::val('action', $do.'.editgroup')); ?>" /> + <input type="hidden" name="area" value="editgroup" /> + <input type="hidden" name="group_id" value="<?php echo Filters::noXSS($group_details['group_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('updatedetails')); ?></button> + </td> + </tr> + </table> +</fieldset> +</form> + +<?php echo tpl_form(Filters::noXSS(CreateURL('editgroup', Req::num('id'), $do)), null, null, null, 'id="userlist"'); ?> +<fieldset> + <h3><?php echo Filters::noXSS(L('groupmembers')); ?></h3> + <table id="manage_users_in_groups" class="userlist"> + <thead> + <tr> + <th> + <a href="javascript:ToggleSelected('manage_users_in_groups')"> + <img title="<?php echo Filters::noXSS(L('toggleselected')); ?>" alt="<?php echo Filters::noXSS(L('toggleselected')); ?>" src="<?php echo Filters::noXSS($this->get_image('kaboodleloop')); ?>" width="16" height="16" /> + </a> + </th> + <th><?php echo Filters::noXSS(L('username')); ?></th> + <th><?php echo Filters::noXSS(L('realname')); ?></th> + <th><?php echo Filters::noXSS(L('accountenabled')); ?></th> + </tr> + </thead> + <tbody> + <?php + foreach(Project::listUsersIn($group_details['group_id']) as $usr): ?> + <tr> + <td class="ttcolumn"><?php echo tpl_checkbox('users['.$usr['user_id'].']'); ?></td> + <td><a href="<?php echo Filters::noXSS(CreateURL('edituser', $usr['user_id'])); ?>"><?php echo Filters::noXSS($usr['user_name']); ?></a></td> + <td><?php echo Filters::noXSS($usr['real_name']); ?></td> + <?php if ($usr['account_enabled']) : ?> + <td class="imgcol"><i class="fa fa-check" style="color:#090" title="<?php echo L('yes'); ?>"></i></td> + <?php else: ?> + <td class="imgcol"><i class="fa fa-ban" style="color:#900" title="<?php echo L('no'); ?>"></i></td> + <?php endif; ?> + </tr> + <?php + $users_in[] = $usr['user_id']; + endforeach; + ?> + </tbody> + <tfoot> + <tr> + <td colspan="4"> + <button type="submit"><?php echo Filters::noXSS(L('moveuserstogroup')); ?></button> + <select class="adminlist" name="switch_to_group"> + <?php if ($proj->id): ?> + <option value="0"><?php echo Filters::noXSS(L('nogroup')); ?></option> + <?php endif; ?> + <?php echo tpl_options(Flyspray::listGroups($proj->id), null, false, null, $group_details['group_id']); ?> + </select> + </td> + </tr> + </tfoot> + </table> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <input type="hidden" name="action" value="movetogroup" /> + <input type="hidden" name="old_group" value="<?php echo Filters::noXSS($group_details['group_id']); ?>" /> + </fieldset> + </form> diff --git a/themes/CleanFS/templates/common.editlinks.tpl b/themes/CleanFS/templates/common.editlinks.tpl new file mode 100644 index 0000000..395d388 --- /dev/null +++ b/themes/CleanFS/templates/common.editlinks.tpl @@ -0,0 +1,15 @@ +<?php if($links): ?> +<table class="links"> +<thead> + <tr><th><?php echo Filters::noXSS(L('link')); ?></th><th<?php echo $user->perms('delete_attachments') ? '' : ' style="color:#999"'; ?>><?php echo Filters::noXSS(L('delete')); ?></th></tr> +</thead> +<tbody> +<?php foreach ($links as $link): ?> + <tr> + <td><a href="<?php echo Filters::noXSS($link['url']); ?>"><?php echo Filters::noXSS($link['url']); ?></a></td> + <td><input type="checkbox" <?php echo Filters::noXSS(tpl_disableif(!$user->perms('delete_attachments'))); ?> name="delete_link[]" value="<?php echo $link['link_id']; ?>" /></td> + </tr> +<?php endforeach; ?> +</tbody> +</table> +<?php endif; ?> diff --git a/themes/CleanFS/templates/common.links.tpl b/themes/CleanFS/templates/common.links.tpl new file mode 100644 index 0000000..146bf67 --- /dev/null +++ b/themes/CleanFS/templates/common.links.tpl @@ -0,0 +1,10 @@ +<?php if ($links && $user->can_view_task($task_details)): ?> + <div class="links"> + <?php echo Filters::noXSS(L('referencelinks')); ?><br> + <?php foreach ($links as $link): ?> + <a href="<?php echo Filters::noXSS($link['url']); ?>"><?php echo Filters::noXSS($link['url']); ?></a><br> + <?php endforeach; ?> + </div> +<?php elseif (count($links)): ?> + <div class="links"><?php echo Filters::noXSS(L('linknoperms')); ?></div> +<?php endif; ?> diff --git a/themes/CleanFS/templates/common.list.tpl b/themes/CleanFS/templates/common.list.tpl new file mode 100644 index 0000000..0ae9483 --- /dev/null +++ b/themes/CleanFS/templates/common.list.tpl @@ -0,0 +1,226 @@ +<p><?= eL('listnote') ?></p> +<?php +$tcols=5; +if($list_type == 'version') { + $tcols++; +} +if($list_type == 'tag') { + $tcols=$tcols+2; +} +?> +<?php if (count($rows)): ?> +<div id="controlBox"> + <div class="grip"></div> + <div class="inner"> + <a style="display:block;" href="#" onclick="TableControl.up('listTable'); return false;"><img src="<?php echo Filters::noXSS($this->themeUrl()); ?>/up.png" alt="Up" /></a> + <a style="display:block;" href="#" onclick="TableControl.down('listTable'); return false;"><img src="<?php echo Filters::noXSS($this->themeUrl()); ?>/down.png" alt="Down" /></a> + </div> +</div> +<?php endif; ?> +<?php echo tpl_form(Filters::noXSS(createURL($do, $list_type, $proj->id))); ?> +<table class="list" id="listTable"> +<colgroup> + <?php if ($list_type == 'tag'): ?><col class="ctag" /><?php endif; ?> + <col class="cname" /> + <?php if ($list_type == 'tag'): ?><col class="cclasses" /><?php endif; ?> + <col class="corder" /> + <col class="cshow" /> + <?php if ($list_type == 'version'): ?><col class="ctense" /><?php endif; ?> + <col class="cdelete" /> + <col class="cusage" /> +</colgroup> +<?php if ($do=='pm'): ?> +<thead> +<tr><th colspan="<?= $tcols ?>"><?= eL('systemvalues') ?></th></tr> +</thead> +<thead> +<tr> + <?php if ($list_type == 'tag'): ?><th>ID</th><?php endif; ?> + <th><?= eL('name') ?></th> + <?php if ($list_type == 'tag'): ?><th>CSS Classes</th><?php endif; ?> + <th><?= eL('order') ?></th> + <th><?= eL('show') ?></th> + <?php if ($list_type == 'version'): ?><th><?= eL('tense') ?></th><?php endif; ?> + <th> </th> + <th><?= eL('usedintasks') ?></th> +</tr> +</thead> +<thead id="globalentries"> +<?php if (isset($sysrows) && count($sysrows)): ?> +<?php +$syscountlines=-1; +foreach ($sysrows as $row): +$syscountlines++; +$classtype=''; $class=''; +switch ($list_type){ + case 'tag': + $classtype='tag'; + $class='t'; + break; + case 'tasktype': + $classtype='task_tasktype'; + $class='typ'.$row[$list_type.'_id']; + break; + case 'status': + $classtype='task_status'; + $class='sta'.$row[$list_type.'_id']; + break; + default: + $classtype='task_'.$list_type; + $class=substr($list_type, 0, 3).$row[$list_type.'_id']; +} +?> +<tr> + <?php if ($list_type == 'tag'): ?><td><?php echo tpl_tag($row['tag_id'], $row['tag_id'], $row['class']); ?></td><?php endif; ?> + <td<?= ($list_type!='tag') ? ' class="'.$classtype.' '.$class.'"':'' ?>><?= ($list_type=='tag') ? tpl_tag($row['tag_id']) : Filters::noXSS($row[$list_type.'_name']); ?></td> + <?php if ($list_type == 'tag'): ?><td><?php echo Filters::noXSS($row['class']); ?></td><?php endif; ?> + <td title="<?= eL('ordertip') ?>"><?php echo Filters::noXSS($row['list_position']); ?></td> + <td title="<?= eL('showtip') ?>"><?php echo $row['show_in_list']; ?></td> + <?php if ($list_type == 'version'): ?><td title="<?= eL('listtensetip') ?>"><?php echo $row[$list_type.'_tense']; ?></td><?php endif; ?> + <td> </td> + <td><?php echo $row['used_in_tasks'] >0 ? $row['used_in_tasks']:''; ?></td> +</tr> +<?php endforeach; ?> +<?php else: ?> +<tr><td colspan="<?= $tcols ?>"><?= eL('novalues') ?></td></tr> +<?php endif; ?> +</thead> +<?php endif; ?> +<thead> +<tr><th colspan="<?= $tcols ?>"><?= $do=='pm' ? eL('projectvalues') : eL('systemvalues') ?></th></tr> +</thead> +<thead> +<tr> + <?php if ($list_type == 'tag'): ?><th>ID</th><?php endif; ?> + <th><?= eL('name') ?></th> + <?php if ($list_type == 'tag'): ?><th title="CSS Classes or a #rgb or #rrggbb color. For instance #c00 for a red background">CSS Classes or #rgb</th><?php endif; ?> + <th><?= eL('order') ?></th> + <th><?= eL('show') ?></th> + <?php if ($list_type == 'version'): ?><th><?= eL('tense') ?></th><?php endif; ?> + <th><?= eL('delete') ?></th> + <th><?= eL('usedintasks') ?></th> +</tr> +</thead> +<tbody> +<?php + $countlines = -1; + foreach ($rows as $row): + $countlines++; +?> +<tr<?= ($list_type == 'resolution' && $row[$list_type.'_id'] == RESOLUTION_DUPLICATE ) ? ' class="nodelete" title="fixed duplicate resolution status"':'' ?>> + <?php if ($list_type == 'tag'): ?><td><?php echo tpl_tag($row['tag_id'], $row['tag_id'], $row['class']); ?></td><?php endif; ?> + <td> + <input id="listname<?php echo Filters::noXSS($countlines); ?>" class="text" type="text" maxlength="40" name="list_name[<?php echo Filters::noXSS($row[$list_type.'_id']); ?>]" + value="<?php echo Filters::noXSS($row[$list_type.'_name']); ?>" /> + </td> + <?php if ($list_type == 'tag'): ?> + <td> + <input id="listclass<?php echo Filters::noXSS($countlines); ?>" class="text" type="text" maxlength="40" name="list_class[<?php echo Filters::noXSS($row['tag_id']); ?>]" + value="<?php echo Filters::noXSS($row['class']); ?>" /> + </td> + <?php endif; ?> + <td title="<?= eL('ordertip') ?>"> + <input id="listposition<?php echo Filters::noXSS($countlines); ?>" class="text" type="text" maxlength="3" name="list_position[<?php echo Filters::noXSS($row[$list_type.'_id']); ?>]" value="<?php echo Filters::noXSS($row['list_position']); ?>" /> + </td> + <td title="<?= eL('showtip') ?>"> + <?php echo tpl_checkbox('show_in_list[' . $row[$list_type.'_id'] . ']', $row['show_in_list'], 'showinlist'.$countlines); ?> + + </td> + <?php if ($list_type == 'version'): ?> + <td title="<?= eL('listtensetip') ?>"> + <select id="tense<?php echo Filters::noXSS($countlines); ?>" name="<?php echo Filters::noXSS($list_type); ?>_tense[<?php echo Filters::noXSS($row[$list_type.'_id']); ?>]"> + <?php echo tpl_options(array(1=>L('past'), 2=>L('present'), 3=>L('future')), $row[$list_type.'_tense']); ?> + </select> + </td> + <?php endif; ?> + + <?php if ($row['used_in_tasks'] || ($list_type == 'status' && $row[$list_type.'_id'] < 7) || ($list_type == 'resolution' && $row[$list_type.'_id'] == RESOLUTION_DUPLICATE ) ): ?> + <td title="<?= eL('nodeletetip') ?>"></td> + <?php else: ?> + <td title="<?= eL('deletetip') ?>"><input id="delete<?php echo Filters::noXSS($row[$list_type.'_id']); ?>" type="checkbox" name="delete[<?php echo Filters::noXSS($row[$list_type.'_id']); ?>]" value="1" /></td> + <?php endif; ?> + + <td><?php echo $row['used_in_tasks'] >0 ? $row['used_in_tasks']:''; ?></td> + </tr> + <?php endforeach; ?> + </tbody> + <?php if(count($rows)): ?> + <tfoot> + <tr> + <td colspan="<?= ($tcols-2) ?>"></td> + <td colspan="2" class="buttons"> + <?php if ($list_type == 'version'): ?> + <input type="hidden" name="action" value="update_version_list" /> + <?php else: ?> + <input type="hidden" name="action" value="update_list" /> + <?php endif; ?> + <input type="hidden" name="list_type" value="<?php echo Filters::noXSS($list_type); ?>" /> + <input type="hidden" name="project" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <button type="submit"><?= eL('update') ?></button> + </td> + </tr> + </tfoot> + <?php endif; ?> + </table> + <?php if (count($rows)): ?> + <script type="text/javascript"> + <?php + echo 'TableControl.create("listTable",{ + controlBox: "controlBox", + tree: false + });'; + echo 'new Draggable("controlBox",{ + handle: "grip" + });'; + ?> + </script> + <?php endif; ?> +</form> +<hr /> +<?php echo tpl_form(Filters::noXSS(createURL($do, $list_type, $proj->id))); ?> +<table class="list"> +<colgroup> + <col class="cname" /> + <col class="corder" /> + <col class="cshow" /> + <?php if ($list_type == 'version'): ?><col class="ctense" /><?php endif; ?> + <col class="cdelete" /> +</colgroup> +<tbody> +<tr> + <td> + <?php if ($list_type == 'version'): ?> + <input type="hidden" name="action" value="<?php echo Filters::noXSS($do); ?>.add_to_version_list" /> + <?php else: ?> + <input type="hidden" name="action" value="<?php echo Filters::noXSS($do); ?>.add_to_list" /> + <?php endif; ?> + <input type="hidden" name="list_type" value="<?php echo Filters::noXSS($list_type); ?>" /> + <?php if ($proj->id): ?> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <?php endif; ?> + <input type="hidden" name="area" value="<?php echo Filters::noXSS(Req::val('area')); ?>" /> + <input type="hidden" name="do" value="<?php echo Filters::noXSS($do); ?>" /> + <input id="listnamenew" placeholder="<?= eL('name') ?>" class="text" type="text" maxlength="40" value="<?php echo Filters::noXSS(Req::val('list_name')); ?>" name="list_name" autofocus /> + </td> + <td> + <input id="listpositionnew" placeholder="<?= eL('order') ?>" class="text" type="text" maxlength="3" value="<?php echo Filters::noXSS(Req::val('list_position')); ?>" name="list_position" /> + </td> + <td> + <input id="showinlistnew" type="checkbox" name="show_in_list" checked="checked" disabled="disabled" /> + </td> + <?php if ($list_type == 'version'): ?> + <td title="<?php echo Filters::noXSS(L('listtensetip')); ?>"> + <select id="tensenew" name="<?php echo Filters::noXSS($list_type); ?>_tense"> + <?php echo tpl_options(array(1=>L('past'), 2=>L('present'), 3=>L('future')), 2); ?> + + </select> + </td> + <?php endif; ?> + <td class="buttons"> + <input type="hidden" name="project" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <button type="submit" class="positive"><?= eL('addnew') ?></button> + </td> + </tr> +</tbody> +</table> +</form> diff --git a/themes/CleanFS/templates/common.multiuserselect.tpl b/themes/CleanFS/templates/common.multiuserselect.tpl new file mode 100644 index 0000000..0692148 --- /dev/null +++ b/themes/CleanFS/templates/common.multiuserselect.tpl @@ -0,0 +1,49 @@ +<div class="userSelectWidget"> +<label for="find_user" class="inline"><?php echo Filters::noXSS(L('find')); ?>:</label> +<input placeholder="<?php echo Filters::noXSS(L('user')); ?>" type="text" class="text" value="<?php echo Filters::noXSS(Post::val('find_user')); ?>" name="find_user" id="find_user" onkeyup="return entercheck(event)" /> +<a class="button" href="javascript:unselectAll()"><?php echo Filters::noXSS(L('noone')); ?></a> +<br /> +<select size="8" name="rassigned_to[]" id="rassigned_to" multiple="multiple"> +<?php foreach ($userlist as $group => $users): ?> + <optgroup <?php echo ($users[0][2]==0 ? 'class="globalgroup" title="'.(Filters::noXSS(L('globalgroup'))).'" ':''); ?>label="<?php echo Filters::noXSS($users[0][3]); ?>"> + <?php foreach ($users as $info): ?> + <option value="<?php echo Filters::noXSS($info[0]); ?>" <?php if (in_array($info[0], $assignees)): ?>selected="selected"<?php endif; ?>><?php echo Filters::noXSS($info[1]); ?></option> + <?php endforeach; ?> + </optgroup> +<?php endforeach; ?> +</select> +</div> +<script type="text/javascript"> +resetOption = null; + +function entercheck(e){ + // Find user and select it + if ($('find_user').value.length < 1) { + if (resetOption != null) { + resetOption.selected = false; + } + } else { + var options = $('rassigned_to').options; + for (var i = 0; i < options.length; i++) { + if (options[i].text.toLowerCase().indexOf($('find_user').value.toLowerCase()) >= 0) { + if (resetOption != null) { + resetOption.selected = false; + } + if (options[i].selected == false) { + resetOption = options[i]; + } + options[i].selected=false; // focus + options[i].selected=true; + return true; + } + } + } +} + +function unselectAll(){ + var options = $('rassigned_to').options; + for (var i = 0; i < options.length; i++) { + options[i].selected=false; + } +} +</script> diff --git a/themes/CleanFS/templates/common.newgroup.tpl b/themes/CleanFS/templates/common.newgroup.tpl new file mode 100644 index 0000000..09cb737 --- /dev/null +++ b/themes/CleanFS/templates/common.newgroup.tpl @@ -0,0 +1,169 @@ +<?php echo tpl_form(Filters::noXSS(CreateUrl($do,'newgroup',$proj->id)),null,null,null,'id="newgroup"'); ?> + <ul class="form_elements"> + <li class="required"> + <label for="groupname"><?php echo Filters::noXSS(L('groupname')); ?> *</label> + <input id="groupname" class="required text" type="text" value="<?php echo Filters::noXSS(Req::val('group_name')); ?>" name="group_name" size="20" maxlength="20" /> + </li> + + <li> + <label for="groupdesc"><?php echo Filters::noXSS(L('description')); ?></label> + <input id="groupdesc" class="text" type="text" value="<?php echo Filters::noXSS(Req::val('group_desc')); ?>" name="group_desc" size="50" maxlength="100" /> + </li> + + <li> + <label for="manageproject"><?php echo Filters::noXSS(L('projectmanager')); ?></label> + <?php echo tpl_checkbox('manage_project', Req::val('manage_project'), 'manageproject'); ?> + </li> + + <li> + <label for="viewtasks"><?php echo Filters::noXSS(L('viewtasks')); ?></label> + <?php echo tpl_checkbox('view_tasks', Req::val('view_tasks'), 'viewtasks'); ?> + </li> + + <li> + <label for="viewowntasks"><?php echo Filters::noXSS(L('viewowntasks')); ?></label> + <?php echo tpl_checkbox('view_own_tasks', Req::val('view_own_tasks'), 'viewowntasks'); ?> + </li> + + <li> + <label for="viewgroupstasks"><?php echo Filters::noXSS(L('viewgroupstasks')); ?></label> + <?php echo tpl_checkbox('view_groups_tasks', Req::val('view_groups_tasks'), 'viewgroupstasks'); ?> + </li> + + <li> + <label for="opennewtasks"><?php echo Filters::noXSS(L('opennewtasks')); ?></label> + <?php echo tpl_checkbox('open_new_tasks', Req::val('open_new_tasks'), 'opennewtasks'); ?> + </li> + + <li> + <label for="canopenmultipletasks"><?php echo Filters::noXSS(L('addmultipletasks')); ?></label> + <?php echo tpl_checkbox('add_multiple_tasks', Req::val('add_multiple_tasks'), 'canopenmultipletasks'); ?> + </li> + + <li> + <label for="modifyowntasks"><?php echo Filters::noXSS(L('modifyowntasks')); ?></label> + <?php echo tpl_checkbox('modify_own_tasks', Req::val('modify_own_tasks'), 'modifyowntasks'); ?> + </li> + + <li> + <label for="modifyalltasks"><?php echo Filters::noXSS(L('modifyalltasks')); ?></label> + <?php echo tpl_checkbox('modify_all_tasks', Req::val('modify_all_tasks'), 'modifyalltasks'); ?> + </li> + + <li> + <label for="viewcomments"><?php echo Filters::noXSS(L('viewcomments')); ?></label> + <?php echo tpl_checkbox('view_comments', Req::val('view_comments'), 'viewcomments'); ?> + </li> + + <li> + <label for="addcomments"><?php echo Filters::noXSS(L('addcomments')); ?></label> + <?php echo tpl_checkbox('add_comments', Req::val('add_comments'), 'addcomments'); ?> + </li> + + <li> + <label for="editowncomments"><?php echo Filters::noXSS(L('editowncomments')); ?></label> + <?php echo tpl_checkbox('edit_own_comments', Req::val('edit_own_comments'), 'editowncomments'); ?> + </li> + + <li> + <label for="editcomments"><?php echo Filters::noXSS(L('editcomments')); ?></label> + <?php echo tpl_checkbox('edit_comments', Req::val('edit_comments'), 'editcomments'); ?> + </li> + + <li> + <label for="deletecomments"><?php echo Filters::noXSS(L('deletecomments')); ?></label> + <?php echo tpl_checkbox('delete_comments', Req::val('delete_comments'), 'deletecomments'); ?> + </li> + + <li> + <label for="createattachments"><?php echo Filters::noXSS(L('createattachments')); ?></label> + <?php echo tpl_checkbox('create_attachments', Req::val('create_attachments'), 'createattachments'); ?> + </li> + + <li> + <label for="deleteattachments"><?php echo Filters::noXSS(L('deleteattachments')); ?></label> + <?php echo tpl_checkbox('delete_attachments', Req::val('delete_attachments'), 'deleteattachments'); ?> + </li> + + <li> + <label for="viewhistory"><?php echo Filters::noXSS(L('viewhistory')); ?></label> + <?php echo tpl_checkbox('view_history', Req::val('view_history'), 'viewhistory'); ?> + </li> + + <li> + <label for="canviewroadmap"><?php echo Filters::noXSS(L('canviewroadmap')); ?></label> + <?php echo tpl_checkbox('view_roadmap', Req::val('view_roadmap', !Req::val('action')), 'canviewroadmap'); ?> + </li> + + <li> + <label for="closeowntasks"><?php echo Filters::noXSS(L('closeowntasks')); ?></label> + <?php echo tpl_checkbox('close_own_tasks', Req::val('close_own_tasks'), 'closeowntasks'); ?> + </li> + + <li> + <label for="closeothertasks"><?php echo Filters::noXSS(L('closeothertasks')); ?></label> + <?php echo tpl_checkbox('close_other_tasks', Req::val('close_other_tasks'), 'closeothertasks'); ?> + </li> + + <li> + <label for="assigntoself"><?php echo Filters::noXSS(L('assigntoself')); ?></label> + <?php echo tpl_checkbox('assign_to_self', Req::val('assign_to_self'), 'assigntoself'); ?> + </li> + + <li> + <label for="assignotherstoself"><?php echo Filters::noXSS(L('assignotherstoself')); ?></label> + <?php echo tpl_checkbox('assign_others_to_self', Req::val('assign_others_to_self'), 'assignotherstoself'); ?> + </li> + + <li> + <label for="addtoassignees"><?php echo Filters::noXSS(L('addtoassignees')); ?></label> + <?php echo tpl_checkbox('add_to_assignees', Req::val('add_to_assignees'), 'addtoassignees'); ?> + </li> + + <li> + <label for="viewreports"><?php echo Filters::noXSS(L('viewreports')); ?></label> + <?php echo tpl_checkbox('view_reports', Req::val('view_reports'), 'viewreports'); ?> + </li> + + <li> + <label for="canvote"><?php echo Filters::noXSS(L('canvote')); ?></label> + <?php echo tpl_checkbox('add_votes', Req::val('add_votes'), 'canvote'); ?> + </li> + + <li> + <label for="editassignments"><?php echo Filters::noXSS(L('editassignments')); ?></label> + <?php echo tpl_checkbox('edit_assignments', Req::val('edit_assignments'), 'editassignments'); ?> + </li> + + <li> + <label for="show_as_assignees"><?php echo Filters::noXSS(L('showasassignees')); ?></label> + <?php echo tpl_checkbox('show_as_assignees', Req::val('show_as_assignees'), 'show_as_assignees'); ?> + </li> + + <li> + <label for="viewestimatedeffort"><?php echo Filters::noXSS(L('viewestimatedeffort')); ?></label> + <?php echo tpl_checkbox('view_estimated_effort', Req::val('view_estimated_effort'), 'viewestimatedeffort'); ?> + </li> + + <li> + <label for="viewcurrenteffortdone"><?php echo Filters::noXSS(L('viewcurrenteffortdone')); ?></label> + <?php echo tpl_checkbox('view_current_effort_done', Req::val('view_current_effort_done'), 'viewcurrenteffortdone'); ?> + </li> + + <li> + <label for="trackeffort"><?php echo Filters::noXSS(L('trackeffort')); ?></label> + <?php echo tpl_checkbox('track_effort', Req::val('track_effort'), 'trackeffort'); ?> + </li> + + <?php if (!$proj->id): ?> + <li> + <label for="groupopen"><?php echo Filters::noXSS(L('groupenabled')); ?></label> + <?php echo tpl_checkbox('group_open', Req::val('group_open'), 'groupopen'); ?> + </li> + <?php endif; ?> + </ul> + + <input type="hidden" name="action" value="<?php if ($proj->id): ?>pm<?php else: ?>admin<?php endif; ?>.newgroup" /> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS(Req::val('project')); ?>" /> + <button type="submit" class="positive"><?php echo Filters::noXSS(L('addthisgroup')); ?></button> +</form> diff --git a/themes/CleanFS/templates/common.newuser.tpl b/themes/CleanFS/templates/common.newuser.tpl new file mode 100644 index 0000000..539e307 --- /dev/null +++ b/themes/CleanFS/templates/common.newuser.tpl @@ -0,0 +1,120 @@ +<?php +/* Note: This template file is currently in dual use for one of two guest register configurations +and also in admin area for admins. +May change in future because this sharing adds more complexity compared to little gain. +*/ +if ($do === 'admin'): echo tpl_form(Filters::noXSS(createURL($do, 'newuser')),null,null,null,'id="registernewuser"'); + else: echo tpl_form(Filters::noXSS(createURL($do, 'newuser')),null,null,null,'id="registernewuser"'); +endif; ?> +<ul class="form_elements"> + <li class="required"> + <?php if ($do === 'admin'): ?> + <input type="hidden" name="action" value="admin.newuser" /> + <input type="hidden" name="do" value="admin" /> + <input type="hidden" name="area" value="newuser" /> + <?php else: ?> + <input type="hidden" name="action" value="register.newuser" /> + <?php endif; ?> + <label for="username"><?= eL('username') ?></label> + <input id="username" name="user_name" value="<?php echo Filters::noXSS(Req::val('user_name')); ?>" required="required" type="text" size="20" maxlength="32" onblur="checkname(this.value);" /> + <br /><span id="errormessage"></span> + </li> + + <?php if (!$fs->prefs['disable_changepw']): ?> + <li> + <label for="userpass"><?= eL('password') ?></label> + <input id="userpass" class="password" name="user_pass" value="<?php echo Filters::noXSS(Req::val('user_pass')); ?>" type="password" size="20" maxlength="100" /> <em><?php echo Filters::noXSS(L('minpwsize')); ?></em> + <span class="note"><?= eL('leaveemptyauto') ?></span> + </li> + <?php if( $do==='register' && $fs->prefs['repeat_password'] ): ?> + <li> + <label for="userpass2"><?= eL('confirmpass') ?></label> + <input id="userpass2" class="password" name="user_pass2" value="<?php echo Filters::noXSS(Req::val('user_pass2')); ?>" type="password" size="20" maxlength="100" /><br /> + </li> + <?php endif; ?> + <?php endif; ?> + + <li class="required"> + <label for="realname"><?= eL('realname') ?></label> + <input id="realname" name="real_name" required="required" value="<?php echo Filters::noXSS(Req::val('real_name')); ?>" type="text" size="20" maxlength="100" /> + </li> + + <li class="required"> + <label for="emailaddress"><?= eL('emailaddress') ?></label> + <input id="emailaddress" name="email_address" required="required" value="<?php echo Filters::noXSS(Req::val('email_address')); ?>" type="text" size="20" maxlength="100" /> + <!-- <em><?= eL('validemail') ?></em> --> + </li> + + <?php if( $do==='register' && $fs->prefs['repeat_emailaddress'] ): ?> + <li> + <label for="verifyemailaddress"><?= eL('verifyemailaddress') ?></label> + <input id="verifyemailaddress" value="<?php echo Filters::noXSS(Req::val('verify_email_address')); ?>" name="verify_email_address" required="required" type="text" size="20" maxlength="100" /> + </li> + <?php endif; ?> + + <?php if (!empty($fs->prefs['jabber_server'])): ?> + <li> + <label for="jabberid"><?= eL('jabberid') ?></label> + <input id="jabberid" name="jabber_id" type="text" value="<?php echo Filters::noXSS(Req::val('jabber_id')); ?>" size="20" maxlength="100" /> + </li> + <?php endif ?> + + <?php if ($fs->prefs['enable_avatars']): ?> + <li> + <label for="profileimage"><?= eL('profileimage') ?></label> + <input id="profileimage" name="profile_image" type="file" value="<?php echo Filters::noXSS(Req::val('profile_image')); ?>"/> + </li> + <?php endif ?> + + <li> + <label for="notify_type"><?= eL('notifications') ?></label> + <select id="notify_type" name="notify_type"> + <?php echo tpl_options($fs->getNotificationOptions(), Req::val('notify_type')); ?> + </select> + </li> + + <li> + <label for="time_zone"><?= eL('timezone') ?></label> + <select id="time_zone" name="time_zone"> + <?php + $times = array(); + for ($i = -12; $i <= 13; $i++) { + $times[$i] = L('GMT') . (($i == 0) ? ' ' : (($i > 0) ? '+' . $i : $i)); + } + ?> + <?php echo tpl_options($times, Req::val('time_zone', 0)); ?> + </select> + </li> + + <?php if (isset($groups)): ?> + <li> + <label for="groupin"><?= eL('globalgroup') ?></label> + <select id="groupin" class="adminlist" name="group_in"> + <?php echo tpl_options($groups, Req::val('group_in', $fs->prefs['anon_group'])); ?> + </select> + </li> + <?php endif; ?> + + <?php if($do==='register' && $fs->prefs['captcha_securimage']) : ?> + <li class="captchali"> + <style> + #captcha_code{width:100px;} + .captchali .securimage label{width:auto;} + .captchali .securimage {display:inline-block; width:300px;} + </style> + <label for="captcha_code"><?= eL('registercaptcha') ?></label> + <div class="securimage"><?php echo $captcha_securimage_html; ?></div> + </li> + <?php endif; ?> + </ul> + <?php + /* only guests need captcha, not admins that currently this template file to add a user too. */ + if( $do==='register' + && isset($fs->prefs['captcha_recaptcha']) && $fs->prefs['captcha_recaptcha'] + && isset($fs->prefs['captcha_recaptcha_sitekey']) && $fs->prefs['captcha_recaptcha_sitekey'] + && isset($fs->prefs['captcha_recaptcha_secret']) && $fs->prefs['captcha_recaptcha_secret']): ?> + <div class="g-recaptcha" data-sitekey="<?php echo Filters::noXSS($fs->prefs['captcha_recaptcha_sitekey']); ?>"></div> + <noscript>Javascript is required for this Google reCAPTCHA.</noscript> + <?php endif; ?> + <p><button type="submit" id="buSubmit"><?= eL('registeraccount') ?></button></p> +</form> diff --git a/themes/CleanFS/templates/common.newuserbulk.tpl b/themes/CleanFS/templates/common.newuserbulk.tpl new file mode 100644 index 0000000..f9724b6 --- /dev/null +++ b/themes/CleanFS/templates/common.newuserbulk.tpl @@ -0,0 +1,78 @@ +<?php if ($do == 'admin'): echo tpl_form(Filters::noXSS(CreateURL($do, 'newuserbulk')),null,null,null,'id="registernewuser"'); + else: echo tpl_form(Filters::noXSS($_SERVER['SCRIPT_NAME']), null,null,null,'id="registernewuser"'); +endif; ?> + <ul class="form_elements"> + <li class="required"> + <?php if ($do == 'admin'): ?> + <input type="hidden" name="action" value="admin.newuserbulk" /> + <input type="hidden" name="do" value="admin" /> + <input type="hidden" name="area" value="newuserbulk" /> + <?php else: ?> + <input type="hidden" name="action" value="register.newuserbulk" /> + <?php endif; ?> + </li> + + <!-- Header --> + <li> + <b><?php echo Filters::noXSS(L('bulkuserstoadd')); ?>:</b> + </li> + <table class="bulkuser"> + <tr> + <td><label for="realname"><?php echo Filters::noXSS(L('realname')); ?></label></td> + <td><label for="username"><?php echo Filters::noXSS(L('username')); ?></label></td> + <td><label for="emailaddress"><?php echo Filters::noXSS(L('emailaddress')); ?></label></td> + </tr> + <br /> + + +<?php for ($i = 0 ; $i < 10 ; $i++) { ?> + <!-- User <?php echo Filters::noXSS($i); ?> --> + <tr> + <td><input id="realname" name="real_name<?php echo Filters::noXSS($i); ?>" class="text" value="<?php echo Filters::noXSS(Req::val('real_name')); ?>" type="text" size="20" maxlength="100" onblur="this.form.elements['user_name<?php echo Filters::noXSS($i); ?>'].value = this.form.elements['real_name<?php echo Filters::noXSS($i); ?>'].value.replace(/ /g,'');"/></td> + <td><input id="username" name="user_name<?php echo Filters::noXSS($i); ?>" value="<?php echo Filters::noXSS(Req::val('user_name')); ?>" class="text" type="text" size="20" maxlength="32" onblur="checkname(this.value); "/></td> + <td><input id="emailaddress" name="email_address<?php echo Filters::noXSS($i); ?>" class="text" value="<?php echo Filters::noXSS(Req::val('email_address')); ?>" type="text" size="20" maxlength="100" /></td> + <tr> + <tr></tr> +<?php } ?> + </table> + + + <br /> + + <li> + <b><?php echo Filters::noXSS(L('optionsforallusers')); ?>:</b> + </li> + <li> + <label for="notify_type"><?php echo Filters::noXSS(L('notifications')); ?></label> + <select id="notify_type" name="notify_type"> + <?php echo tpl_options($fs->GetNotificationOptions(), Req::val('notify_type')); ?> + + </select> + </li> + + <li> + <label for="time_zone"><?php echo Filters::noXSS(L('timezone')); ?></label> + <select id="time_zone" name="time_zone"> + <?php + $times = array(); + for ($i = -12; $i <= 13; $i++) { + $times[$i] = L('GMT') . (($i == 0) ? ' ' : (($i > 0) ? '+' . $i : $i)); + } + ?> + <?php echo tpl_options($times, Req::val('time_zone', 0)); ?> + + </select> + </li> + + <?php if (isset($groups)): ?> + <li> + <label for="groupin"><?php echo Filters::noXSS(L('globalgroup')); ?></label> + <select id="groupin" class="adminlist" name="group_in"> + <?php echo tpl_options($groups, Req::val('group_in', $fs->prefs['anon_group'])); ?> + </select> + </li> + <?php endif; ?> + + </ul> + <p><button type="submit" id="buSubmit"><?php echo Filters::noXSS(L('registerbulkaccount')); ?></button></p> +</form> diff --git a/themes/CleanFS/templates/common.profile.tpl b/themes/CleanFS/templates/common.profile.tpl new file mode 100644 index 0000000..97920f4 --- /dev/null +++ b/themes/CleanFS/templates/common.profile.tpl @@ -0,0 +1,152 @@ +<?php echo tpl_form( $do=='myprofile' ? Filters::noXSS(createUrl('myprofile')) : Filters::noXSS(createUrl('edituser', $theuser->id))); ?> + <ul class="form_elements"> + <li> + <label for="realname"><?= eL('realname') ?></label> + <input id="realname" type="text" name="real_name" maxlength="100" + value="<?php echo Filters::noXSS(Req::val('real_name', $theuser->infos['real_name'])); ?>" /> + </li> + <li> + <label for="emailaddress"><?= eL('emailaddress') ?></label> + <input id="emailaddress" type="text" name="email_address" maxlength="100" + value="<?php echo Filters::noXSS(Req::val('email_address', $theuser->infos['email_address'])); ?>" /> + </li> + <li> + <label for="hide_my_email"><?= eL('hidemyemail') ?></label> + <?php echo tpl_checkbox('hide_my_email', Req::val('hide_my_email', !Post::val('action') && $theuser->infos['hide_my_email']), 'hide_my_email', 1, ($fs->prefs['hide_emails'] ) ? array('checked' => 'true', 'disabled' => 'true') : ''); ?> + </li> + <?php if (!empty($fs->prefs['jabber_server'])):?> + <li> + <label for="jabberid"><?= eL('jabberid') ?></label> + <input id="jabberid" type="text" name="jabber_id" maxlength="100" + value="<?php echo Filters::noXSS(Req::val('jabber_id', $theuser->infos['jabber_id'])); ?>" /> + <input type="hidden" name="old_jabber_id" value="<?php echo Filters::noXSS($theuser->infos['jabber_id']); ?>" /> + </li> + <?php endif ?> + <?php if ($fs->prefs['enable_avatars']): ?> + <li> + <label for="profileimage"><?= eL('profileimage') ?></label> + <?php echo tpl_userlinkavatar($theuser->id, $fs->prefs['max_avatar_size'], 'av_comment'); ?> + </li> + <li> + <label for="profileimage_input"> </label> + <input id="profileimage_input" name="profile_image" type="file" value="<?php echo Filters::noXSS(Req::val('profile_image')); ?>"/> + </li> + <?php endif ?> + <li> + <label for="notifytype"><?= eL('notifytype') ?></label> + <select id="notifytype" name="notify_type"> + <?php echo tpl_options($fs->getNotificationOptions(), Req::val('notify_type', $theuser->infos['notify_type'])); ?> + </select> + </li> + <li> + <label for="notify_own"><?= eL('notifyown') ?></label> + <?php echo tpl_checkbox('notify_own', Req::val('notify_own', !Post::val('action') && $theuser->infos['notify_own']), 'notify_own'); ?> + </li> + <!--<li> + <label for="notify_online"><?= eL('notifyonline') ?></label> + <?php echo tpl_checkbox('notify_online', Req::val('notify_online', !Post::val('action') && $theuser->infos['notify_online']), 'notify_online'); ?> + </li>--> + <li> + <label for="dateformat"><?= eL('dateformat') ?></label> + <select id="dateformat" name="dateformat"> + <?php echo tpl_date_formats($theuser->infos['dateformat']); ?> + </select> + </li> + <li> + <label for="dateformat_extended"><?= eL('dateformat_extended') ?></label> + <select id="dateformat_extended" name="dateformat_extended"> + <?php echo tpl_date_formats($theuser->infos['dateformat_extended'], true); ?> + </select> + </li> + <li> + <label for="tasks_perpage"><?= eL('tasksperpage') ?></label> + <select name="tasks_perpage" id="tasks_perpage"> + <?php echo tpl_options(array(10, 25, 50, 100, 250), Req::val('tasks_perpage', $theuser->infos['tasks_perpage']), true); ?> + </select> + </li> + <li> + <label for="time_zone"><?= eL('timezone') ?></label> + <select id="time_zone" name="time_zone"> + <?php + $times = array(); + for ($i = -12; $i <= 13; $i++) { + $times[$i] = L('GMT') . (($i == 0) ? ' ' : (($i > 0) ? '+' . $i : $i)); + } + ?> + <?php echo tpl_options($times, Req::val('time_zone', $theuser->infos['time_zone'])); ?> + </select> + </li> + <li> + <label for="langcode"><?= eL('language') ?></label> + <select id="langcode" name="lang_code"> + <?php + #echo tpl_options(array_merge(array('browser', 'project'), Flyspray::listLangs()), Req::val('lang_code', $theuser->infos['lang_code']), true); + echo tpl_options( Flyspray::listLangs(), Req::val('lang_code', $theuser->infos['lang_code']), true); + ?> + </select> + </li> + <li> + <hr /> + </li> + <?php if ($user->perms('is_admin')): ?> + <li> + <label for="accountenabled"><?= eL('accountenabled') ?></label> + <?php echo tpl_checkbox('account_enabled', Req::val('account_enabled', !Post::val('action') && $theuser->infos['account_enabled']), 'accountenabled'); ?> + </li> + <li> + <label for="delete_user"><?= eL('deleteuser') ?></label> + <?php echo tpl_checkbox('delete_user', false, 'delete_user'); ?> + </li> + <?php endif; ?> + <li> + <label for="groupin"><?= eL('globalgroup') ?></label> + <select id="groupin" class="adminlist" name="group_in" <?php echo tpl_disableif(!$user->perms('is_admin')); ?>> + <?php echo tpl_options($groups, Req::val('group_in', $theuser->infos['global_group'])); ?> + </select> + <input type="hidden" name="old_global_id" value="<?php echo Filters::noXSS($theuser->infos['global_group']); ?>" /> + </li> + + <?php if ($proj->id): ?> + <li> + <label for="projectgroupin"><?= eL('projectgroup') ?></label> + <select id="projectgroupin" class="adminlist" name="project_group_in" <?php echo tpl_disableif(!$user->perms('manage_project')); ?>> + <?php echo tpl_options(array_merge($project_groups, array(0 => array('group_name' => L('none'), 0 => 0, 'group_id' => 0, 1 => L('none')))), Req::val('project_group_in', $theuser->perms('project_group'))); ?> + </select> + <input type="hidden" name="old_group_id" value="<?php echo Filters::noXSS($theuser->perms('project_group')); ?>" /> + <input type="hidden" name="project_id" value="<?php echo $proj->id; ?>" /> + </li> + <?php endif; ?> + <li> + <hr /> + </li> + + <?php if (!$theuser->infos['oauth_uid']): ?> + <?php if ($user->perms('is_admin') || $user->id == $theuser->id): ?> + <?php if (!$fs->prefs['disable_changepw']): ?> + <?php if (!$user->perms('is_admin')): ?> + <li> + <label for="oldpass"><?= eL('oldpass') ?></label> + <input id="oldpass" type="password" name="oldpass" value="<?php echo Filters::noXSS(Req::val('oldpass')); ?>" maxlength="100" /> + </li> + <?php endif; ?> + <li> + <label for="changepass"><?= eL('changepass') ?></label> + <input id="changepass" type="password" name="changepass" value="<?php echo Filters::noXSS(Req::val('changepass')); ?>" maxlength="100" /> + </li> + <?php if ($fs->prefs['repeat_password']): ?> + <li> + <label for="confirmpass"><?= eL('confirmpass') ?></label> + <input id="confirmpass" type="password" name="confirmpass" value="<?php echo Filters::noXSS(Req::val('confirmpass')); ?>" maxlength="100" /> + </li> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> + <?php endif; ?> + <li> + <input type="hidden" name="action" value="<?php echo Filters::noXSS(Req::val('action', $do . '.edituser')); ?>" /> + <?php if (Req::val('area') || $do == 'admin'): ?><input type="hidden" name="area" value="users" /><?php endif; ?> + <input type="hidden" name="user_id" value="<?php echo Filters::noXSS($theuser->id); ?>" /> + <button type="submit"><?= eL('updatedetails') ?></button> + </li> + </ul> + </form> diff --git a/themes/CleanFS/templates/common.userselect.tpl b/themes/CleanFS/templates/common.userselect.tpl new file mode 100644 index 0000000..dd58eab --- /dev/null +++ b/themes/CleanFS/templates/common.userselect.tpl @@ -0,0 +1,6 @@ +<input class="users text" <?php echo join_attrs($attrs); ?> type="text" name="<?php echo Filters::noXSS($name); ?>" <?php if ($id): ?>id="<?php echo Filters::noXSS($id); ?>"<?php endif; ?> value="<?php echo Filters::noXSS($value); ?>" /> +<span class="autocomplete" id="<?php echo Filters::noXSS($name); ?>_complete"></span> +<script type="text/javascript"> + showstuff('<?php echo Filters::noJsXSS($name); ?>_complete'); + new Ajax.Autocompleter('<?php echo Filters::noJsXSS($id); ?>', '<?php echo Filters::noJsXSS($name); ?>_complete', '<?php echo Filters::noXSS($baseurl); ?>js/callbacks/usersearch.php', {}) +</script> diff --git a/themes/CleanFS/templates/depends.tpl b/themes/CleanFS/templates/depends.tpl new file mode 100644 index 0000000..64b2047 --- /dev/null +++ b/themes/CleanFS/templates/depends.tpl @@ -0,0 +1,107 @@ +<div style="text-align:center;" class="box"> + <p><b><?php echo Filters::noXSS(L('pruninglevel')); ?>: </b><?php echo implode(" | \n", $strlist); ?></p> + <h2><a href="<?php echo Filters::noXSS(CreateUrl('details', $task_id)); ?>">FS#<?php echo $task_id; ?></a>: <?php echo Filters::noXSS(L('dependencygraph')); ?></h2> + +<div id="infovis" style="width:90%;height:50em"></div> + +<script type="text/javascript"> + // init data + var json = <?php echo $jasonData; ?>; + + // init ForceDirected + var fd = new $jit.ForceDirected({ + //id of the visualization container + injectInto: 'infovis', + //Enable zooming and panning + //by scrolling and DnD + Navigation: { + enable: true, + //Enable panning events only if we're dragging the empty + //canvas (and not a node). + zooming: 50 //zoom speed. higher is more sensible + }, + // Change node and edge styles such as + // color and width. + // These properties are also set per node + // with dollar prefixed data-properties in the + // JSON structure. + Node: { + overridable: true, + }, + Edge: { + overridable: false, + color: '#555555', + type: 'arrow', + dim: 25, + lineWidth: 1 + }, + //Native canvas text styling + Label: { + type: 'HTML', //Native or HTML + size: 10, + style: 'bold', + }, + //Add Tips + Tips: { + enable: true, + onShow: function(tip, node) { + // Count connections + var count = 0; + node.eachAdjacency(function(adj) { + count++; + }); + + // Display node info in tooltip + tip.innerHTML = "<div class=\"popup\" style=\"width:200px\">" + node.name + + "<div><b><?php echo Filters::noXSS(L('connectedtasks')); ?></b> " + count + "</div></div>"; + } + }, + // Add node events + Events: { + enable: true, + type: 'Native' + }, + //Number of iterations for the FD algorithm + iterations: 50, + //Edge length + levelDistance: 130, + // Add text to the labels. This method is only triggered + // on label creation and only for DOM labels (not native canvas ones). + onCreateLabel: function(domElement, node){ + domElement.innerHTML = node.name; + var style = domElement.style; + style.fontSize = "1em"; + style.color = "#ddd"; + }, + // Change node styles when DOM labels are placed + // or moved. + onPlaceLabel: function(domElement, node){ + var style = domElement.style; + var left = parseInt(style.left); + var top = parseInt(style.top); + var w = domElement.offsetWidth; + style.left = (left - w / 2) + 'px'; + style.top = top + 'px'; + style.padding = 25 + 'px'; + style.display = ''; + } + }); + // load JSON data. + fd.loadJSON(json); + // compute positions incrementally and animate. + fd.computeIncremental({ + iter: 40, + property: 'end', + onComplete: function(){ + fd.animate({ + modes: ['linear'], + transition: $jit.Trans.Elastic.easeOut, + duration: 1500 + }); + } + }); + // end + +</script> + +</div>
\ No newline at end of file diff --git a/themes/CleanFS/templates/details.edit.tpl b/themes/CleanFS/templates/details.edit.tpl new file mode 100644 index 0000000..d56bd56 --- /dev/null +++ b/themes/CleanFS/templates/details.edit.tpl @@ -0,0 +1,255 @@ +<?php echo tpl_form(Filters::noXSS(createUrl('details', $task_details['task_id'])),null,null,null,'id="taskeditform"'); ?> +<!-- Grab fields wanted for this project so we can only show those we want --> +<?php $fields = explode( ' ', $proj->prefs['visible_fields'] ); +# FIXME The template should respect the ordering of 'visible_fields', aren't they? +# Maybe define a 'put visible_fields in default ordering'-button in project settings to let them make consistent with other projects and a no-brainer. +# But let also project managers have the choice to sort to the order they want it. + +# FIXME If user wants a task to be moved to other project and a hidden list value (not in visible_fields) would be not legal in the target project: +# Should we show that dropdown-list even if the field is not in the $fields-array to give the user the chance to resolve the issue? +# The field list dropdown is not a secret for webtech-people, it is just not visible by css display:none; +?> +<style> +/* can be moved to default theme.css later, when the multiple errors/messages-feature is matured. currently used only here. */ +.errorinput{color:#c00 !important;} +li.errorinput{background-color:#fc9;} +.errorinput::before{display:block;content: attr(title);} +</style> +<div id="taskdetails"> + <input type="hidden" name="action" value="details.update" /> + <input type="hidden" name="edit" value="1" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="edit_start_time" value="<?php echo Filters::noXSS(Req::val('edit_start_time', time())); ?>" /> + <div id="taskfields"> + <ul class="form_elements slim"> + <!-- Status --> + <li<?php + # show the tasktype if invalid when moving tasks - even if not in the visible list. + echo isset($_SESSION['ERRORS']['invalidstatus']) ? ' class="errorinput"' : (in_array('status', $fields) ? '' : ' style="display:none"'); ?>> + <?php echo isset($_SESSION['ERRORS']['invalidstatus']) ? '<span class="errorinput" style="display:block;">'.eL('invalidstatus').'</span>' : ''; ?> + <label for="status"><?= eL('status') ?></label> + <?php echo tpl_select($statusselect); ?> + </li> + <!-- Progress --> + <li<?php echo in_array('progress', $fields) ? '' : ' style="display:none"'; ?>> + <label for="percent"<?php echo isset($_SESSION['ERRORS']['invalidprogress']) ? ' class="errorinput" title="'.eL('invalidprogress').'"':''; ?>><?php echo Filters::noXSS(L('percentcomplete')); ?></label> + <select id="percent" name="percent_complete" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')) ?>> + <?php $arr = array(); for ($i = 0; $i<=100; $i+=10) $arr[$i] = $i.'%'; ?> + <?php echo tpl_options($arr, Req::val('percent_complete', $task_details['percent_complete'])); ?> + </select> + </li> + <!-- Task Type --> + <li<?php + # show the tasktype if invalid when moving tasks - even if not in the visible list. + echo isset($_SESSION['ERRORS']['invalidtasktype']) ? ' class="errorinput"' : (in_array('tasktype', $fields) ? '' : ' style="display:none"'); ?>> + <?php echo isset($_SESSION['ERRORS']['invalidtasktype']) ? '<span class="errorinput" style="display:block;">'.eL('invalidtasktype').'</span>' : ''; ?> + <label for="tasktype"><?= eL('tasktype') ?></label> + <?php echo tpl_select($tasktypeselect); ?> + </li> + <!-- Category --> + <li<?php + # show the category if invalid when moving tasks - even if not in the visible list. + echo isset($_SESSION['ERRORS']['invalidcategory']) ? ' class="errorinput"' : (in_array('category', $fields) ? '' : ' style="display:none"'); ?>> + <?php echo isset($_SESSION['ERRORS']['invalidcategory']) ? '<span class="errorinput" style="display:block;">'.eL('invalidcategory').'</span>' : ''; ?> + <label for="category"><?= eL('category') ?></label> + <?php echo tpl_select($catselect); ?> + </li> + <!-- Assigned To --> + <li<?php echo in_array('assignedto', $fields) ? '' : ' style="display:none"'; ?>> + <label><?= eL('assignedto') ?></label> + <?php if ($user->perms('edit_assignments')): ?> + <input type="hidden" name="old_assigned" value="<?php echo Filters::noXSS($old_assigned); ?>" /> + <?php $this->display('common.multiuserselect.tpl'); ?> + <?php else: ?> + <?php if (empty($assigned_users)): ?> + <?= eL('noone') ?> + <?php else: + foreach ($assigned_users as $userid): ?> + <?php echo tpl_userlink($userid); ?><br /> + <?php endforeach; + endif; + endif; ?> + </li> + <!-- OS --> + <li<?php + # show the os if invalid when moving tasks - even if not in the visible list. + echo isset($_SESSION['ERRORS']['invalidos']) ? ' class="errorinput"' : (in_array('os', $fields) ? '' : ' style="display:none"'); ?>> + <?php echo isset($_SESSION['ERRORS']['invalidos']) ? '<span class="errorinput" style="display:block;">'.eL('invalidos').'</span>' : ''; ?> + <label for="os"><?= eL('operatingsystem') ?></label> + <?php echo tpl_select($osselect); ?> + </li> + <!-- Severity --> + <li<?php echo in_array('severity', $fields) ? '' : ' style="display:none"'; ?>> + <label for="severity"<?php echo isset($_SESSION['ERRORS']['invalidseverity']) ? ' class="errorinput" title="'.eL('invalidseverity').'"':''; ?>><?php echo Filters::noXSS(L('severity')); ?></label> + <select id="severity" name="task_severity"> + <?php echo tpl_options($fs->severities, Req::val('task_severity', $task_details['task_severity'])); ?> + </select> + </li> + <!-- Priority --> + <li<?php echo in_array('priority', $fields) ? '' : ' style="display:none"'; ?>> + <label for="priority"<?php echo isset($_SESSION['ERRORS']['invalidpriority']) ? ' class="errorinput" title="'.eL('invalidpriority').'"':''; ?>><?php echo Filters::noXSS(L('priority')); ?></label> + <select id="priority" name="task_priority" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')) ?>> + <?php echo tpl_options($fs->priorities, Req::val('task_priority', $task_details['task_priority'])); ?> + </select> + </li> + <!-- Reported In --> + <li<?php + # show the reportedversion if invalid when moving tasks - even if not in the visible list. + echo isset($_SESSION['ERRORS']['invalidreportedversion']) ? ' class="errorinput"' : (in_array('reportedin', $fields) ? '' : ' style="display:none"'); ?>> + <?php echo isset($_SESSION['ERRORS']['invalidreportedversion']) ? '<span class="errorinput" style="display:block;">'.eL('invalidreportedversion').'</span>' : ''; ?> + <label for="reportedver"><?= eL('reportedversion') ?></label> + <?php echo tpl_select($reportedversionselect); ?> + </li> + <!-- Due Version --> + <li<?php + # show the dueversion if invalid when moving tasks - even if not in the visible list. + echo isset($_SESSION['ERRORS']['invaliddueversion']) ? ' class="errorinput"' : (in_array('dueversion', $fields) ? '' : ' style="display:none"'); ?>> + <?php echo isset($_SESSION['ERRORS']['invaliddueversion']) ? '<span class="errorinput" style="display:block;">'.eL('invaliddueversion').'</span>' : ''; ?> + <label for="dueversion"><?= eL('dueinversion') ?></label> + <?php echo tpl_select($dueversionselect); ?> + </li> + <!-- Due Date --> + <li<?php echo (in_array('duedate', $fields) && $user->perms('modify_all_tasks')) ? '' : ' style="display:none"'; ?>> + <label for="due_date"><?= eL('duedate') ?></label> + <?php echo tpl_datepicker('due_date', '', Req::val('due_date', $task_details['due_date'])); ?> + </li> + <!-- Private --> + <?php if ($user->can_change_private($task_details)): ?> + <li<?php echo in_array('private', $fields) ? '' : ' style="display:none"'; ?>> + <label for="private"><?= eL('private') ?></label> + <?php echo tpl_checkbox('mark_private', Req::val('mark_private', $task_details['mark_private']), 'private'); ?> + </li> + <?php endif; ?> + + <?php if ($proj->prefs['use_effort_tracking'] && $user->perms('view_estimated_effort')): ?> + <li> + <label for="estimated_effort"><?= eL('estimatedeffort') ?></label> + <input id="estimated_effort" name="estimated_effort" class="text" type="text" size="5" maxlength="10" value="<?php echo Filters::noXSS(effort::secondsToEditString($task_details['estimated_effort'], $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format'])); ?>" /> + <?= eL('hours') ?> + </li> + <?php endif; ?> + + <!-- If no currently selected project is not there, push it on there so don't have to change things --> + <?php + $id = Req::val('project_id', $proj->id); + $selected = false; + foreach ($fs->projects as $value => $label) { + if ($label[0] == $id) { + $selected = true; + break; + } + } + + if (! $selected) { + $title = '---'; + $foo = array( $id, $title, 'project_id' => $id, 'project_title' => $title); + array_unshift( $fs->projects, $foo); + } + + ?> + + <!-- If there is only one choice of projects, then don't bother showing it --> + <li<?php + # show the targetproject selector if invalid when moving tasks + echo isset($_SESSION['ERRORS']['invalidtargetproject']) ? ' class="errorinput"' : ''; ?>> + <?php echo isset($_SESSION['ERRORS']['invalidtargetproject']) ? '<span class="errorinput" style="display:block;">'.eL('invalidtargetproject').'</span>' : ''; ?> + <label for="project_id"><?= eL('attachedtoproject') ?></label> + <select name="project_id" id="project_id"> + <?php echo tpl_options($fs->projects, Req::val('project_id', $proj->id)); ?> + </select> + </li> + </ul> + <div id="fineprint"> + <?= eL('openedby') ?> <?php echo tpl_userlink($task_details['opened_by']); ?> + - <span title="<?php echo formatDate($task_details['date_opened'], true); ?>"><?php echo formatDate($task_details['date_opened'], false); ?></span> + <?php if ($task_details['last_edited_by']): ?> + <br /> + <?= eL('editedby') ?> <?php echo tpl_userlink($task_details['last_edited_by']); ?> + - <span title="<?php echo Filters::noXSS(formatDate($task_details['last_edited_time'], true)); ?>"><?php echo Filters::noXSS(formatDate($task_details['last_edited_time'], false)); ?></span> + <?php endif; ?> + </div> +</div> +<div id="taskdetailsfull"> + <label for="itemsummary"<?php echo isset($_SESSION['ERRORS']['summaryrequired']) ? ' class="summary errorinput" title="'.eL('summaryrequired').'"':' class="summary"'; ?>>FS#<?php echo Filters::noXSS($task_details['task_id']); ?> <?php echo Filters::noXSS(L('summary')); ?>: + <input placeholder="<?= eL('summary') ?>" type="text" name="item_summary" id="itemsummary" maxlength="100" value="<?php echo Filters::noXSS(Req::val('item_summary', $task_details['item_summary'])); ?>" /> + </label> + <?php + foreach($tags as $tag): $tagnames[]= Filters::noXSS($tag['tag']); endforeach; + isset($tagnames) ? $tagstring=implode(';',$tagnames) : $tagstring=''; + ?> + <label style="display:block;" for="tags" title="<?= eL('tagsinfo') ?>"><?= eL('tags') ?>: + <input title="<?= eL('tagsinfo') ?>" placeholder="<?= eL('tags') ?>" type="text" name="tags" id="tags" maxlength="100" value="<?php echo Filters::noXSS(Req::val('tags', $tagstring)); ?>" /> + </label> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <button tabindex="9" type="button" onclick="showPreview('details', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('detailed_desc', 15, 70, array('id' => 'details'), Req::val('detailed_desc', $task_details['detailed_desc'])); ?> + <br /> + <button type="reset"><?php echo Filters::noXSS(L('reset')); ?></button> + <br /> + + <div id="addlinkbox"> + <?php + $links = $proj->listTaskLinks($task_details['task_id']); + $this->display('common.editlinks.tpl', 'links', $links); ?> + <?php if ($user->perms('create_attachments')): ?> + <input id="link1" tabindex="8" class="text" type="text" maxlength="100" name="userlink[]" /> + <script> + // hide the fallback input field if javascript is enabled + document.getElementById("link1").style.display='none'; + </script> + <button id="addlinkbox_addalink" tabindex="10" type="button" onclick="addLinkField('addlinkbox')"><?php echo Filters::noXSS(L('addalink')); ?></button> + <button id="addlinkbox_addanotherlink" tabindex="10" style="display: none" type="button" onclick="addLinkField('addlinkbox')"><?php echo Filters::noXSS(L('addalink')); ?></button> + <br /> + <span style="display: none"><?php /* this span is shown/copied by javascript when adding links */ ?> + <input tabindex="8" class="text" type="text" maxlength="100" name="userlink[]" /> + <a href="javascript://" tabindex="9" class="button fa fa-remove fa-lg" title="<?= eL('remove') ?>" onclick="removeLinkField(this, 'addlinkbox');"></a><br /> + </span> + <?php endif; ?> + </div> + <div id="uploadfilebox"> + <?php + $attachments = $proj->listTaskAttachments($task_details['task_id']); + $this->display('common.editattachments.tpl', 'attachments', $attachments); + if ($user->perms('create_attachments')): ?> + <input id="file1" tabindex="5" class="file" type="file" size="55" name="usertaskfile[]" /> + <script> + // hide the fallback input field if javascript is enabled + document.getElementById("file1").style.display='none'; + </script> + <button id="uploadfilebox_attachafile" tabindex="7" type="button" onclick="addUploadFields()"> + <?= eL('uploadafile') ?> (<?= eL('max') ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?= eL('MiB') ?>) + </button> + <button id="uploadfilebox_attachanotherfile" tabindex="7" style="display: none" type="button" onclick="addUploadFields()"> + <?= eL('attachanotherfile') ?> (<?= eL('max') ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?= eL('MiB') ?>) + </button> + <br /> + <span style="display: none"><?php /* this span is shown/copied by javascript when adding files */ ?> + <input tabindex="5" class="file" type="file" size="55" name="usertaskfile[]" /> + <a href="javascript://" tabindex="6" class="button fa fa-remove fa-lg" title="<?= eL('remove') ?>" onclick="removeUploadField(this);"></a><br /> + </span> + <?php endif; ?> + </div> + <div class="buttons"> + <?php if ($user->perms('add_comments') && (!$task_details['is_closed'] || $proj->prefs['comment_closed'])): ?> + <input type="checkbox" id="s_addcomment" /> + <label for="s_addcomment" title="<?= eL('addcomment') ?>"> + <span class="fa-stack"> + <i class="fa fa-comment-o fa-stack-2x"></i> + <i class="fa fa-plus fa-stack-1x"></i> + </span> + </label> + <div id="edit_add_comment"> + <label for="comment_text"><?php echo Filters::noXSS(L('comment')); ?></label> + <textarea accesskey="r" tabindex="8" id="comment_text" name="comment_text" cols="50" rows="2"></textarea> + </div> + <br /> + <?php endif; ?> + <button type="submit" class="positive" accesskey="s" onclick="return checkok('<?php echo Filters::noJsXSS($baseurl); ?>js/callbacks/checksave.php?time=<?php echo Filters::noXSS(time()); ?>&task_id=<?php echo Filters::noXSS($task_details['task_id']); ?>', '<?php echo Filters::noJsXSS(L('alreadyedited')); ?>', 'taskeditform')"><?php echo Filters::noXSS(L('savedetails')); ?></button> + <a class="button" href="<?php echo Filters::noXSS(createUrl('details', $task_details['task_id'])); ?>"><?= eL('canceledit') ?></a> + </div> +</div> +<div class="clear"></div> +</div> +</form> diff --git a/themes/CleanFS/templates/details.tabs.comment.tpl b/themes/CleanFS/templates/details.tabs.comment.tpl new file mode 100644 index 0000000..a2ded4f --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.comment.tpl @@ -0,0 +1,118 @@ +<?php /* preset 'active' class, so browsers with disabled javascript see the comments tab content. */ ?> +<div id="comments" class="tab active"> + <?php foreach($comments as $comment): ?> + <div class="comment_container" id="<?php echo 'comment' . $comment['comment_id']; ?>"> + <div class="comment_avatar"><?php echo tpl_userlinkavatar($comment['user_id'], $fs->prefs['max_avatar_size'], 'av_comment'); ?></div> + <div class="comment"> + <div class="comment_header"> + <div class="comment_header_actions"> + <?php echo tpl_form(CreateUrl('details', $task_details['task_id'])); ?> + <?php + $theuser = new User($comment['user_id']); + if (!$theuser->isAnon()) { + if ($theuser->perms('is_admin')) { + $rank = 'Admin'; + } + else if ($theuser->perms('manage_project')) { + $rank = 'Project Manager'; + } + else { + $rank = ''; + } + + if (!empty($rank)) { + echo '<span class="comment_header_usertype">'.Filters::noXSS($rank).'</span>'; + } + } + ?> + <?php if ($user->perms('edit_comments') || ($user->perms('edit_own_comments') && $comment['user_id'] == $user->id)): ?> + <a href="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?do=editcomment&task_id=<?php echo Filters::noXSS($task_details['task_id']); ?>&id=<?php echo Filters::noXSS($comment['comment_id']); ?>" title="<?php echo Filters::noXSS(L('edit')); ?>"><span class="fa fa-pencil fa-lg" style="margin-right: 10px;"></span></a> + <?php endif; ?> + <?php if ($user->perms('delete_comments')): ?> + <input type="hidden" name="action" value="details.deletecomment"/> + <input type="hidden" name="comment_id" value="<?php echo $comment['comment_id']; ?>"/> + <?php $confirm = (isset($comment_attachments[$comment['comment_id']])) ? sprintf(L('confirmdeletecomment'), L('attachementswilldeleted')) : sprintf(L('confirmdeletecomment'), '') ?> + <button type="submit" class="fakelinkbutton" onclick="return confirm('<?php echo Filters::noJsXSS($confirm); ?>');" title="<?php echo Filters::noXSS(L('delete')); ?>"><span class="fa fa-remove fa-lg"></span></button> + <?php endif; ?> + </form> + </div> + <div class="comment_header_infos"><?php echo tpl_userlink($comment['user_id']); ?> <?php echo Filters::noXSS(L('commentedon')); ?> <?php echo Filters::noXSS(formatDate($comment['date_added'], true)); ?></div> + </div> + <div class="commenttext"> + <?php echo TextFormatter::render($comment['comment_text'], 'comm', $comment['comment_id'], $comment['content']); ?> + <?php if (isset($comment_links[$comment['comment_id']])) { + $this->display('common.links.tpl', 'links', $comment_links[$comment['comment_id']]); + }?> + <?php if (isset($comment_attachments[$comment['comment_id']])) { + $this->display('common.attachments.tpl', 'attachments', $comment_attachments[$comment['comment_id']]); + }?> + </div> + </div> + </div> + <?php endforeach; ?> + <?php if ($user->perms('add_comments') && (!$task_details['is_closed'] || $proj->prefs['comment_closed'])): ?> + <div class="comment_container"> + <div class="comment_avatar"><?php echo tpl_userlinkavatar($user->id, $fs->prefs['max_avatar_size'], 'av_comment'); ?></div> + <div class="comment"> + <div class="comment_header"> + <?php echo Filters::noXSS(L('addcomment')); ?> + </div> + <div class="commenttext"> + <?php echo tpl_form(CreateUrl('details', $task_details['task_id']), 'comment', 'post', 'multipart/form-data'); ?> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <?php endif; ?> + <input type="hidden" name="action" value="details.addcomment" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS(Req::val('task_id', $task_details['task_id'])); ?>" /> + <?php if (!$watched): ?> + <?php echo tpl_checkbox('notifyme', Req::val('notifyme', !(Req::val('action') == 'details.addcomment')), 'notifyme'); ?> <label class="left" for="notifyme"><?php echo Filters::noXSS(L('notifyme')); ?></label> + <?php endif; ?> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <button tabindex="9" type="button" onclick="showPreview('comment_text', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('comment_text', 10, 72, array('accesskey' => 'r', 'tabindex' => 8, 'id' => 'comment_text')); ?> + <div id="addlinkbox"> + <button id="addlinkbox_addalink" tabindex="10" type="button" onclick="addLinkField('addlinkbox')"> + <?php echo Filters::noXSS(L('addalink')); ?> + </button> + <button id="addlinkbox_addanotherlink" tabindex="10" style="display: none" type="button" onclick="addLinkField('addlinkbox')"> + <?php echo Filters::noXSS(L('addanotherlink')); ?> + </button> + <span style="display: none"> + <input tabindex="8" class="text" type="text" size="28" maxlength="100" name="userlink[]" /> + <a href="javascript://" tabindex="9" onclick="removeLinkField(this, 'addlinkbox');"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + <noscript> + <span> + <input tabindex="8" class="text" type="text" size="28" maxlength="100" name="userlink[]" /> + <a href="javascript://" tabindex="9" onclick="removeLinkField(this, 'addlinkbox');"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + </noscript> + </div> + <?php if ($user->perms('create_attachments')): ?> + <div id="uploadfilebox"> + <button id="uploadfilebox_attachafile" tabindex="7" type="button" onclick="addUploadFields()"> + <?php echo Filters::noXSS(L('uploadafile')); ?> (<?php echo Filters::noXSS(L('max')); ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?php echo Filters::noXSS(L('MiB')); ?>) + </button> + <button id="uploadfilebox_attachanotherfile" tabindex="7" style="display: none" type="button" onclick="addUploadFields()"> + <?php echo Filters::noXSS(L('attachanotherfile')); ?> (<?php echo Filters::noXSS(L('max')); ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?php echo Filters::noXSS(L('MiB')); ?>) + </button> + <span style="display: none;"><!-- this span is shown/copied in javascript when adding files --> + <input tabindex="5" class="file" type="file" size="55" name="userfile[]" /> + <a href="javascript://" tabindex="6" onclick="removeUploadField(this);"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + <noscript> + <span> + <input tabindex="5" class="file" type="file" size="55" name="userfile[]" /> + <a href="javascript://" tabindex="6" onclick="removeUploadField(this);"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + </noscript> + </div> + <?php endif; ?> + <button class="button positive" accesskey="s" tabindex="9" type="submit"><?php echo Filters::noXSS(L('addcomment')); ?></button> + </form> + </div> + </div> + </div> + <?php endif; ?> +</div> diff --git a/themes/CleanFS/templates/details.tabs.efforttracking.tpl b/themes/CleanFS/templates/details.tabs.efforttracking.tpl new file mode 100644 index 0000000..7cd6a9b --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.efforttracking.tpl @@ -0,0 +1,52 @@ +<div id="effort" class="tab"> + <?php echo tpl_form(Filters::noXSS(CreateUrl('details', $task_details['task_id'])).'#effort'); ?> + <?php if ($user->perms('track_effort')) { ?> + <input type="hidden" name="action" value="details.efforttracking"/> + <button type="submit" name="start_tracking" value="true"><?php echo Filters::noXSS(L('starteffort')); ?></button> + <br /> + <label for="effort_to_add"><?php echo Filters::noXSS(L('manualeffort')); ?></label> + <input id="effort_to_add" name="effort_to_add" class="text" type="text" size="5" maxlength="100" value='00:00'/> + <button type="submit" name="manual_effort" value="true"><?php echo Filters::noXSS(L('addeffort')); ?></button> + <?php } ?> + <table class="userlist history"> + <thead> + <tr> + <th><?php echo Filters::noXSS(L('date')); ?></th> + <th><?php echo Filters::noXSS(L('user')); ?></th> + <th><?php echo Filters::noXSS(L('effort')); ?> (H:M)</th> + <th></th> + </tr> + </thead> + <tbody> + <?php + foreach($effort->details as $details){ + ?> + <tr> + <td><?php echo Filters::noXSS(formatDate($details['date_added'], true)); ?></td> + <td><?php echo tpl_userlink($details['user_id']); ?></td> + <td><?php + if($details['effort'] == 0 && $details['end_timestamp']==false) + { ?> + <?php echo Filters::noXSS(L('trackinginprogress')); ?> (<?php + + echo effort::SecondsToString(time()-$details['start_timestamp'], $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); + + ?>) + <?php } + else + { + echo effort::SecondsToString($details['effort'], $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); + } ?> + </td> + <td> + <?php if($user->id == $details['user_id'] & is_null($details['end_timestamp'])){ ?> + <button type="submit" name="stop_tracking" value="true"><?php echo Filters::noXSS(L('endeffort')); ?></button> + <button type="submit" name="cancel_tracking" value="true"><?php echo Filters::noXSS(L('cleareffort')); ?></button> + <?php } ?> + </td> + </tr> + <?php } ?> + </tbody> + </table> + </form> +</div> diff --git a/themes/CleanFS/templates/details.tabs.history.callback.tpl b/themes/CleanFS/templates/details.tabs.history.callback.tpl new file mode 100644 index 0000000..07eefd5 --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.history.callback.tpl @@ -0,0 +1,32 @@ +<?php if ($details && count($histories)): ?> +<table class="userlist history"> + <tr> + <th><?php echo Filters::noXSS(L('previousvalue')); ?></th> + <th><?php echo Filters::noXSS(L('newvalue')); ?></th> + </tr> + <tr> + <td><?php echo $details_previous; ?></td> + <td><?php echo $details_new; ?></td> + </tr> +</table> +<?php else: ?> +<table class="userlist history"> + <tr> + <th><?php echo Filters::noXSS(L('eventdate')); ?></th> + <th><?php echo Filters::noXSS(L('user')); ?></th> + <th><?php echo Filters::noXSS(L('event')); ?></th> + </tr> + + <?php foreach($histories as $history): ?> + <tr> + <td><?php echo Filters::noXSS(formatDate($history['event_date'], false)); ?></td> + <?php if($fs->prefs['enable_avatars'] == 1) { ?> + <td><?php echo tpl_userlinkavatar($history['user_id'], $fs->prefs['max_avatar_size'] / 2, 'left', '0px 5px 0px 0px'); ?> <?php echo tpl_userlink($history['user_id']); ?></td> + <?php } else { ?> + <td><?php echo tpl_userlink($history['user_id']); ?></td> + <?php } ?> + <td><?php echo event_description($history); ?></td> + </tr> + <?php endforeach; ?> +</table> +<?php endif; ?> diff --git a/themes/CleanFS/templates/details.tabs.history.tpl b/themes/CleanFS/templates/details.tabs.history.tpl new file mode 100644 index 0000000..69d7d79 --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.history.tpl @@ -0,0 +1,3 @@ +<div id="history" class="tab"> + <h3><?php echo Filters::noXSS(L('loading')); ?></h3> +</div> diff --git a/themes/CleanFS/templates/details.tabs.notifs.tpl b/themes/CleanFS/templates/details.tabs.notifs.tpl new file mode 100644 index 0000000..cebad39 --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.notifs.tpl @@ -0,0 +1,30 @@ +<div id="notify" class="tab"> + <p><em><?php echo Filters::noXSS(L('theseusersnotify')); ?></em></p> + <?php foreach ($notifications as $row): ?> + <div> + <?php echo tpl_form(Filters::noXSS(CreateUrl('details', $task_details['task_id'])).'#notify',null,null,null,'style="display:inline"'); ?> + <input type="hidden" name="action" value="remove_notification" /> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="user_id" value="<?php echo Filters::noXSS($row['user_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('remove')); ?></button> + <?php echo tpl_userlink($row['user_id']); ?> + </form> + <!-- + <a href="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?do=details&action=remove_notification&task_id=<?php echo Filters::noXSS($task_details['task_id']); ?>&ids=<?php echo Filters::noXSS($task_details['task_id']); ?>&user_id=<?php echo Filters::noXSS($row['user_id']); ?>#notify"><?php echo Filters::noXSS(L('remove')); ?></a> + --> + </div> + <?php endforeach; ?> + + <?php if ($user->perms('manage_project')): ?> + <?php echo tpl_form(Filters::noXSS(CreateUrl('details', $task_details['task_id'])).'#notify'); ?> + <div> + <label class="default multisel" for="notif_user_id"><?php echo Filters::noXSS(L('addusertolist')); ?>: </label> + <?php echo tpl_userselect('user_name', Req::val('user_name'), 'notif_user_id'); ?> + <button type="submit"><?php echo Filters::noXSS(L('add')); ?></button> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS(Req::num('ids', $task_details['task_id'])); ?>" /> + <input type="hidden" name="action" value="details.add_notification" /> + </div> + </form> + <?php endif; ?> +</div> + diff --git a/themes/CleanFS/templates/details.tabs.related.tpl b/themes/CleanFS/templates/details.tabs.related.tpl new file mode 100644 index 0000000..543f7d2 --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.related.tpl @@ -0,0 +1,65 @@ +<div id="related" class="tab"> + + <div class="related"> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])).'#related');?> + <table id="tasks_related" class="userlist"> + <thead> + <tr> + <th> + <a class="toggle_selected" href="javascript:ToggleSelected('tasks_related')"> + <!--<img title="<?php echo Filters::noXSS(L('toggleselected')); ?>" alt="<?php echo Filters::noXSS(L('toggleselected')); ?>" src="<?php echo Filters::noXSS($this->get_image('kaboodleloop')); ?>" width="16" height="16" />--> + </a> + </th> + <th><?php echo Filters::noXSS(L('tasksrelated')); ?> (<?php echo Filters::noXSS(count($related)); ?>)</th> + </tr> + </thead> + <tbody> + <?php + foreach ($related as $row): + ?> + <tr> + <td class="ttcolumn"> + <input type="checkbox" name="related_id[]" <?php echo tpl_disableif(!$user->can_edit_task($task_details)); ?> value="<?php echo Filters::noXSS($row['related_id']); ?>" /></td> + <td><?php echo tpl_tasklink($row); ?></td> + </tr> + <?php endforeach; ?> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <input type="hidden" name="action" value="remove_related" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('remove')); ?></button> + </td> + </tr> + </tfoot> + </table> + </form> + </div> + + <div class="related"> + <table id="duplicate_tasks" class="userlist"> + <thead> + <tr> + <th><?php echo Filters::noXSS(L('duplicatetasks')); ?> (<?php echo Filters::noXSS(count($duplicates)); ?>)</th> + </tr> + </thead> + <tbody> + <?php foreach ($duplicates as $row): ?> + <tr><td><?php echo tpl_tasklink($row); ?></td></tr> + <?php endforeach; ?> + </tbody> + </table> + </div> + + <?php if ($user->can_edit_task($task_details) && !$task_details['is_closed']): ?> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])).'#related',null,null,null,'class="clear" id="formaddrelatedtask"'); ?> + <div> + <input type="hidden" name="action" value="details.add_related" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <label><?php echo Filters::noXSS(L('addnewrelated')); ?> FS#<input name="related_task" id="related_task_input" type="text" class="text" size="10" maxlength="10" /></label> + <button type="submit" onclick="return checkok('<?php echo Filters::noJsXSS($baseurl); ?>js/callbacks/checkrelated.php?related_task=' + $('related_task_input').value + '&project=<?php echo Filters::noXSS($proj->id); ?>', '<?php echo Filters::noJsXSS(L('relatedproject')); ?>', 'formaddrelatedtask')"><?php echo Filters::noXSS(L('add')); ?></button> + </div> + </form> + <?php endif; ?> +</div> diff --git a/themes/CleanFS/templates/details.tabs.remind.tpl b/themes/CleanFS/templates/details.tabs.remind.tpl new file mode 100644 index 0000000..3332304 --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.remind.tpl @@ -0,0 +1,76 @@ +<?php if (!$task_details['is_closed']): ?> + <div id="remind" class="tab"> + <?php echo tpl_form(Filters::noXSS(CreateUrl('details', $task_details['task_id'])).'#remind'); ?> + <?php if (count($reminders)): ?> + <table id="reminders" class="userlist"> + <thead> + <tr> + <th> + <a class="toggle_selected" title="<?php echo Filters::noXSS(L('toggleselected')); ?>" + href="javascript:ToggleSelected('reminders')"></a> + </th> + <th><?php echo Filters::noXSS(L('user')); ?></th> + <th><?php echo Filters::noXSS(L('startat')); ?></th> + <th><?php echo Filters::noXSS(L('frequency')); ?></th> + <th><?php echo Filters::noXSS(L('message')); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($reminders as $row): ?> + <tr> + <td class="ttcolumn"> + <input type="checkbox" name="reminder_id[]" <?php echo tpl_disableif(!$user->can_edit_task($task_details)); ?> value="<?php echo Filters::noXSS($row['reminder_id']); ?>" /> + </td> + <td><?php echo tpl_userlink($row['user_id']); ?></td> + <td><?php echo Filters::noXSS(formatDate($row['start_time'])); ?></td> + <?php + // Work out the unit of time to display + if ($row['how_often'] < 86400) { + $how_often = $row['how_often'] / 3600 . ' ' . L('hours'); + } elseif ($row['how_often'] < 604800) { + $how_often = $row['how_often'] / 86400 . ' ' . L('days'); + } else { + $how_often = $row['how_often'] / 604800 . ' ' . L('weeks'); + } + ?> + <td><?php echo Filters::noXSS($how_often); ?></td> + <td><?php echo TextFormatter::render($row['reminder_message']); ?></td> + </tr> + <?php endforeach; ?> + </tbody> + <tfoot> + <tr><td colspan="5"> + <input type="hidden" name="action" value="deletereminder" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('remove')); ?></button></td> + </tr> + </tfoot> + </table> + <?php endif; ?> + </form> + + <fieldset><legend><?php echo Filters::noXSS(L('addreminder')); ?></legend> + <?php echo tpl_form(Filters::noXSS(CreateUrl('details', $task_details['task_id'])).'#remind',null,null,null,'id="formaddreminder"'); ?> + <div> + <input type="hidden" name="action" value="details.addreminder" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <label class="default multisel" for="to_user_id"><?php echo Filters::noXSS(L('remindthisuser')); ?></label> + <?php echo tpl_userselect('to_user_id', Req::val('to_user_id'), 'to_user_id'); ?> + <br /> + <label for="timeamount1"><?php echo Filters::noXSS(L('thisoften')); ?></label> + <input class="text" type="text" value="<?php echo Filters::noXSS(Req::val('timeamount1')); ?>" id="timeamount1" name="timeamount1" size="3" maxlength="3" /> + <select class="adminlist" name="timetype1"> + <?php echo tpl_options(array(3600 => L('hours'), 86400 => L('days'), 604800 => L('weeks')), Req::val('timetype1')); ?> + </select> + <br /> + <?php echo tpl_datepicker('timeamount2', L('startat'), Req::val('timeamount2', formatDate(time()))); ?> + <br /> + <textarea class="text" name="reminder_message" + rows="10" cols="72"><?php echo Filters::noXSS(Req::val('reminder_message', L('defaultreminder') . "\n\n" . CreateURL('details', $task_details['task_id']))); ?></textarea> + <br /> + <button type="submit"><?php echo Filters::noXSS(L('addreminder')); ?></button> + </div> + </form> + </fieldset> +</div> +<?php endif; ?> diff --git a/themes/CleanFS/templates/details.tabs.tpl b/themes/CleanFS/templates/details.tabs.tpl new file mode 100644 index 0000000..b1aad8b --- /dev/null +++ b/themes/CleanFS/templates/details.tabs.tpl @@ -0,0 +1,39 @@ +<ul id="submenu"> + <?php if ($user->perms('view_comments') || $proj->prefs['others_view'] || ($user->isAnon() && $task_details['task_token'] && Get::val('task_token') == $task_details['task_token'])): ?> + <li id="commentstab"> + <a href="#comments"><?php echo Filters::noXSS(L('comments')); ?> (<?php echo count($comments); ?>)</a> + </li> + <?php endif; ?> + + <li id="relatedtab"> + <a href="#related"><?php echo Filters::noXSS(L('relatedtasks')); ?> (<?php echo count($related); ?>/<?php echo count($duplicates); ?>)</a> + </li> + + <?php if ($user->perms('manage_project')): ?> + <li id="notifytab"> + <a href="#notify"><?php echo Filters::noXSS(L('notifications')); ?> (<?php echo count($notifications); ?>)</a> + </li> + <?php if (!$task_details['is_closed']): ?> + <li id="remindtab"> + <a href="#remind"><?php echo Filters::noXSS(L('reminders')); ?> (<?php echo count($reminders); ?>)</a> + </li> + <?php endif; ?> + <?php endif; ?> + + <?php if ($user->perms('view_history')): ?> + <li id="historytab"> + <a id="historytaba" onmousedown="getHistory('<?php echo Filters::noXSS($task_details['task_id']); ?>', '<?php echo Filters::noJsXSS($baseurl); ?>', 'history', '<?php echo Filters::noXSS(Get::num('details')); ?>');" + href="<?php echo Filters::noXSS(CreateURL('details', $task_details['task_id'], null)); ?>#history"><?php echo Filters::noXSS(L('history')); ?></a> + </li> + <?php endif; ?> + + <?php if ($proj->prefs['use_effort_tracking']){ ?> + <?php if ($user->perms('view_current_effort_done')){ ?> + <li id="efforttab"> + <a href="#effort"><?php echo Filters::noXSS(L('efforttracking')); ?></a> + </li> + + <?php + } + } ?> +</ul> diff --git a/themes/CleanFS/templates/details.view.tpl b/themes/CleanFS/templates/details.view.tpl new file mode 100644 index 0000000..abbcfc1 --- /dev/null +++ b/themes/CleanFS/templates/details.view.tpl @@ -0,0 +1,882 @@ +<div id="actionbar"> +<?php if ($task_details['is_closed']): //if task is closed ?> + <?php if ($user->can_close_task($task_details)): + echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="reopen" /> + <button><?php echo L('reopenthistask'); ?></button> + </form> + <?php elseif (!$user->isAnon() && !Flyspray::adminRequestCheck(2, $task_details['task_id'])): ?> + +<button class="submit main" onclick="showhidestuff('requestreopen');"><?php echo Filters::noXSS(L('reopenrequest')); ?></button> +<div id="requestreopen" class="popup hide"> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),'form3',null,null,'id="formclosetask"'); ?> + <input type="hidden" name="action" value="requestreopen" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <label for="reason"><?php echo Filters::noXSS(L('reasonforreq')); ?></label> + <textarea id="reason" name="reason_given"></textarea><br/> + <button type="submit"><?php echo Filters::noXSS(L('submitreq')); ?></button> + </form> + </div> + <?php endif; ?> +<?php else: //if task is open ?> + <?php if ($user->can_close_task($task_details) && !$d_open): ?> + <a href="<?php echo Filters::noXSS(createURL('details', $task_details['task_id'], null, array('showclose' => !Req::val('showclose')))); ?>" + id="closetask" class="button main" accesskey="y" + onclick="showhidestuff('closeform');return false;"> <?php echo Filters::noXSS(L('closetask')); ?></a> + + <div id="closeform" class="<?php if (Req::val('action') != 'details.close' && !Req::val('showclose')): ?>hide <?php endif; ?>popup"> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'id="formclosetask"'); ?> + <input type="hidden" name="action" value="details.close"/> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>"/> + <select class="adminlist" name="resolution_reason" onmouseup="event.stopPropagation();"> + <option value="0"><?php echo Filters::noXSS(L('selectareason')); ?></option> + <?php echo tpl_options($proj->listResolutions(), Req::val('resolution_reason')); ?> + </select> + <button type="submit"><?php echo Filters::noXSS(L('closetask')); ?></button> + <br/> + <label class="default text" for="closure_comment"><?php echo Filters::noXSS(L('closurecomment')); ?></label> + <textarea class="text" id="closure_comment" name="closure_comment" rows="3" cols="25"><?php echo Filters::noXSS(Req::val('closure_comment')); ?></textarea> + <?php if($task_details['percent_complete'] != '100'): ?> + <label><?php echo tpl_checkbox('mark100', Req::val('mark100', !(Req::val('action') == 'details.close'))); ?> <?php echo Filters::noXSS(L('mark100')); ?></label> + <?php endif; ?> + </form> + </div> + + <?php elseif (!$d_open && !$user->isAnon() && !Flyspray::AdminRequestCheck(1, $task_details['task_id'])): ?> + <a href="#close" id="reqclose" class="button main" onclick="showhidestuff('closeform');"><?php echo Filters::noXSS(L('requestclose')); ?></a> + <div id="closeform" class="popup hide"> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),'form3',null,null,'id="formclosetask"'); ?> + <input type="hidden" name="action" value="requestclose"/> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>"/> + <label for="reason"><?php echo Filters::noXSS(L('reasonforreq')); ?></label> + <textarea id="reason" name="reason_given"></textarea><br/> + <button type="submit"><?php echo Filters::noXSS(L('submitreq')); ?></button> + </form> + </div> + + <?php elseif(!$user->isAnon()): ?> + <a href="#closedisabled" id="reqclose" class="tooltip button disabled main"><?php echo Filters::noXSS(L('closetask')); ?> + + <span class="custom info"> + <em><?php echo Filters::noXSS(L('information')); ?></em> + <br> + <?php echo Filters::noXSS(L('taskclosedisabled')); ?> + <br> + <?php + foreach ($deps as $dependency){ + echo "FS#".$dependency['task_id']." : ".$dependency['item_summary']."</br>"; + } + ?> + </span> + </a> + <?php endif; ?> + + <?php if ($user->can_edit_task($task_details)): ?> + <a id="edittask" class="button" accesskey="e" + href="<?php echo Filters::noXSS(createURL('edittask', $task_details['task_id'])); ?>"> <?php echo Filters::noXSS(L('edittask')); ?></a> + <?php endif; ?> + + <?php if ($user->can_take_ownership($task_details)): ?> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'style="display:inline"'); ?> + <input type="hidden" name="action" value="takeownership" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit" id="own"><?php echo Filters::noXSS(L('assigntome')); ?></button> + </form> + <?php endif; ?> + + <?php if ($user->can_add_to_assignees($task_details) && !empty($task_details['assigned_to'])): ?> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'style="display:inline"'); ?> + <input type="hidden" name="action" value="addtoassignees" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit" id="own_add"><?php echo Filters::noXSS(L('addmetoassignees')); ?></button> + </form> + <?php endif; ?> + <input type="checkbox" id="s_quickactions" /> + <label class="button main" id="actions" for="s_quickactions"><?php echo Filters::noXSS(L('quickaction')); ?></label> + <div id="actionsform"> + <ul> + <?php if ($user->can_edit_task($task_details)): ?> + <li> + <a accesskey="e" href="<?php echo Filters::noXSS(createURL('edittask', $task_details['task_id'])); ?>"> <?php echo Filters::noXSS(L('edittask')); ?></a> + </li> + <?php endif; ?> + + <?php if ($user->can_set_task_parent($task_details)): ?> + <li><input type="checkbox" id="s_parent" /><label for="s_parent"><?php echo Filters::noXSS(L('setparent')); ?></label> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'id="setparentform"'); ?> + <?php echo Filters::noXSS(L('parenttaskid')); ?> + <input type="hidden" name="action" value="details.setparent" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input class="text" type="text" value="" id="supertask_id" name="supertask_id" size="5" maxlength="10" /> + <button type="submit" name="submit"><?php echo Filters::noXSS(L('set')); ?></button> + </form> + </li> + <?php endif; ?> + <?php if ($user->can_associate_task($task_details)): ?> + <li><input type="checkbox" id="s_associate"/><label for="s_associate"><?php echo Filters::noXSS(L('associatesubtask')); ?></label> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'id="associateform"'); ?> + <?php echo Filters::noXSS(L('associatetaskid')); ?> + <input type="hidden" name="action" value="details.associatesubtask"/> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>"/> + <input class="text" type="text" value="" id="associate_subtask_id" name="associate_subtask_id" size="5" maxlength="10"/> + <button type="submit" name="submit"><?php echo Filters::noXSS(L('set')); ?></button> + </form> + </li> + <?php endif; ?> + <li> + <a href="<?php echo Filters::noXSS(createURL('depends', $task_details['task_id'])); ?>"><?php echo Filters::noXSS(L('depgraph')); ?></a> + </li> + <?php if ($user->can_add_task_dependency($task_details)): ?> + <li><input type="checkbox" id="s_adddependent"/><label for="s_adddependent"><?php echo Filters::noXSS(L('adddependenttask')); ?></label> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'id="adddepform"'); ?> + <input type="hidden" name="action" value="details.newdep" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <label for="dep_task_id"><?php echo Filters::noXSS(L('newdependency')); ?></label> + FS# <input class="text" type="text" value="<?php echo Filters::noXSS(Req::val('dep_task_id')); ?>" id="dep_task_id" name="dep_task_id" size="5" maxlength="10" /> + <button type="submit" name="submit"><?php echo Filters::noXSS(L('add')); ?></button> + </form> + </li> + <?php endif; ?> + + <?php if ($proj->id && $user->perms('open_new_tasks')): ?> + <li> + <a href="<?php echo Filters::noXSS(createURL('newtask', $proj->id, $task_details['task_id'])); ?>"><?php echo Filters::noXSS(L('addnewsubtask')); ?></a> + </li> + <?php endif; ?> + + <?php if ($user->can_take_ownership($task_details)): ?> + <li><?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="takeownership" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('assigntome')); ?></button> + </form> + </li> + <?php endif; ?> + + <?php if ($user->can_add_to_assignees($task_details) && !empty($task_details['assigned_to'])): ?> + <li> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="addtoassignees" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('addmetoassignees')); ?></button> + </form> + </li> + <?php endif; ?> + + <?php if ($user->can_vote($task_details) > 0): ?> + <li> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="details.addvote" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('voteforthistask')); ?></button> + </form> + </li> + <?php endif; ?> + + <?php if (!$user->isAnon() && !$watched): ?> + <li> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="details.add_notification" /> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="user_id" value="<?php echo Filters::noXSS($user->id); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('watchthistask')); ?></button> + </form> + </li> + <?php endif; ?> + + <?php if ($user->can_change_private($task_details)): ?> + <li> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <?php if ($task_details['mark_private']): ?> + <input type="hidden" name="action" value="makepublic"/> + <button><?php echo eL('makepublic'); ?></button> + <?php elseif (!$task_details['mark_private']): ?> + <input type="hidden" name="action" value="makeprivate"/> + <button><?php echo eL('privatethistask'); ?></button> + <?php endif; ?> + </form> + </li> + <?php endif; ?> + </ul> + </div> +<?php endif; ?> +</div> + +<script type="text/javascript"> +function show_hide(elem, flag) +{ + elem.style.display = "none"; + if(flag) + elem.nextElementSibling.style.display = "block"; + else + elem.previousElementSibling.style.display = "block"; +} +function quick_edit(elem, id) +{ + var e = document.getElementById(id); + var name = e.name; + var value = e.value; + var text; + if(e.selectedIndex != null) + text = e.options[e.selectedIndex].text; + else + text = document.getElementById(id).value; // for due date and estimated effort + var xmlHttp = new XMLHttpRequest(); + + xmlHttp.onreadystatechange = function(){ + if(xmlHttp.readyState == 4){ + var target = elem.previousElementSibling; + if(xmlHttp.status == 200){ + if(target.getElementsByTagName("span").length > 0)//for progress + { + target.getElementsByTagName("span")[0].innerHTML = text; + target.getElementsByClassName("progress_bar")[0].style.width = text; + }else{ + target.innerHTML = text; + } + target.className='fa fa-check'; + elem.className='fa fa-check'; + show_hide(elem, false); + }else{ + // TODO show error message returned from the server and let quickedit form open + target.className='fa fa-warning'; + elem.className='fa fa-warning'; + } + } + } + xmlHttp.open("POST", "<?php echo Filters::noXSS($baseurl); ?>js/callbacks/quickedit.php", true); + xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); + xmlHttp.send("name=" + name + "&value=" + value + "&task_id=<?php echo Filters::noXSS($task_details['task_id']); ?>&csrftoken=<?php echo $_SESSION['csrftoken'] ?>"); +} +</script> + +<!-- Grab fields wanted for this project so we can only show those we want --> +<?php $fields = explode( ' ', $proj->prefs['visible_fields'] ); ?> + +<div id="taskdetails"> + <span id="navigation"> <?php if ($prev_id): ?> + <?php echo tpl_tasklink($prev_id, L('previoustask'), false, array('id'=>'prev', 'accesskey' => 'p')); ?> + + <?php endif; ?> + <?php if ($prev_id): ?> | <?php endif; ?> + <?php + if(isset($_COOKIE['tasklist_type']) && $_COOKIE['tasklist_type'] == 'project'): + $params = $_GET; unset($params['do'], $params['action'], $params['task_id'], $params['switch'], $params['project']); + ?> + <a href="<?php echo Filters::noXSS(createURL('project', $proj->id, null, array('do' => 'index') + $params)); ?>"><?php echo Filters::noXSS(L('tasklist')); ?></a> + <?php endif; + if ($next_id): ?> + <?php echo tpl_tasklink($next_id, L('nexttask'), false, array('id'=>'next', 'accesskey' => 'n')); ?> + + <?php endif; ?> + </span> + + <div id="taskfields"> +<?php if($user->can_edit_task($task_details)) : ?><div id="intromessage" align="center"><?php echo Filters::noXSS(L('clicktoedit')); ?></div><?php endif; ?> + <ul class="fieldslist"> + <!-- Status --> + <?php if (in_array('status', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('status')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"> + <?php if ($task_details['is_closed']): ?> + <?php echo Filters::noXSS(L('closed')); ?> + + <?php else: ?> + <?php echo Filters::noXSS($task_details['status_name']); ?> + + <?php if ($reopened): ?> + <strong class="reopened"><?php echo Filters::noXSS(L('reopened')); ?></strong> + <?php endif; ?> + <?php endif; ?> + </span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="status" name="item_status"> + <?php echo tpl_options($proj->listTaskStatuses(), Req::val('item_status', $task_details['item_status'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'status')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a onclick="show_hide(this.parentNode.parentNode, false)" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + + </li> + <?php endif; ?> + + <!-- Progress --> + <?php if (in_array('progress', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('percentcomplete')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"> + <div class="progress_bar_container" style="width: 90px"> + <span><?php echo Filters::noXSS($task_details['percent_complete']); ?>%</span> + + <div class="progress_bar" style="width:<?php echo Filters::noXSS($task_details['percent_complete']); ?>%"></div> + </div> + </span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="percent" name="percent_complete"> + <?php $arr = array(); for ($i = 0; $i<=100; $i+=10) $arr[$i] = $i.'%'; ?> + <?php echo tpl_options($arr, Req::val('percent_complete', $task_details['percent_complete'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'percent')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + + </li> + <?php endif; ?> + <!-- Task Type--> + <?php if (in_array('tasktype', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('tasktype')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"><?php echo Filters::noXSS($task_details['tasktype_name']); ?></span> + <?php if ($user->can_edit_task($task_details)):?> + <span style="display:none;"> + <div style="float:right"> + <select id="tasktype" name="task_type"> + <?php echo tpl_options($proj->listTaskTypes(), Req::val('task_type', $task_details['task_type'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'tasktype')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a></span> + </div> + </span> + <?php endif; ?></li> + <?php endif; ?> + + <!-- Category --> + <?php if (in_array('category', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('category')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"> + <?php foreach ($parent as $cat): ?> + <?php echo Filters::noXSS($cat['category_name']); ?> → + <?php endforeach; ?> + <?php echo Filters::noXSS($task_details['category_name']); ?> + + </span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="category" name="product_category"> + <?php echo tpl_options($proj->listCategories(), Req::val('product_category', $task_details['product_category'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'category')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + </li> + <?php endif; ?> + + <!-- Assigned To--> + <?php if (in_array('assignedto', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('assignedto')); ?></span> + <span class="value assignedto"> + <?php if (empty($assigned_users)): ?> + <?php echo Filters::noXSS(L('noone')); ?> + + <?php else: ?> + <table class="assignedto"> + <?php + foreach ($assigned_users as $userid): + ?> + <?php if($fs->prefs['enable_avatars'] == 1) { ?> + <tr><td><?php echo tpl_userlinkavatar($userid, $fs->prefs['max_avatar_size'] / 2); ?></td><td><?php echo tpl_userlink($userid); ?></td></tr> + <?php } else { ?> + <tr> + <td class="assignedto_name"><?php echo tpl_userlink($userid); ?></td> + </tr> + <?php } ?> + <?php endforeach; + ?> + </table> + <?php + endif; ?> + </span> + </li> + <?php endif; ?> + + <!-- OS --> + <?php if (in_array('os', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('operatingsystem')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"><?php echo Filters::noXSS($task_details['os_name']); ?></span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="os" name="operating_system"> + <?php echo tpl_options($proj->listOs(), Req::val('operating_system', $task_details['operating_system'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'os')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + </li> + <?php endif; ?> + + <!-- Severity --> + <?php if (in_array('severity', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('severity')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"><?php echo Filters::noXSS($task_details['severity_name']); ?></span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="severity" name="task_severity"> + <?php echo tpl_options($fs->severities, Req::val('task_severity', $task_details['task_severity'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'severity')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a></div> + </span> + <?php endif; ?> + </li> + <?php endif; ?> + + <!-- Priority --> + <?php if (in_array('priority', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('priority')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"><?php echo Filters::noXSS($task_details['priority_name']); ?></span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="priority" name="task_priority"> + <?php echo tpl_options($fs->priorities, Req::val('task_priority', $task_details['task_priority'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'priority')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + </li> + <?php endif; ?> + + <!-- Reported In --> + <?php if (in_array('reportedin', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('reportedversion')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"><?php echo Filters::noXSS($task_details['reported_version_name']); ?></span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="reportedver" name="product_version"> + <?php echo tpl_options($proj->listVersions(false, 2, $task_details['product_version']), Req::val('reportedver', $task_details['product_version'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'reportedver')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + </li> + <?php endif; ?> + + <!-- Due --> + <?php if (in_array('dueversion', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('dueinversion')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"><?php if ($task_details['due_in_version_name']): ?> + <?php echo Filters::noXSS($task_details['due_in_version_name']); ?> + + <?php else: ?> + <?php echo Filters::noXSS(L('undecided')); ?> + + <?php endif; ?> + </span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <select id="dueversion" name="closedby_version"> + <option value="0"><?php echo Filters::noXSS(L('undecided')); ?></option> + <?php echo tpl_options($proj->listVersions(false, 3), Req::val('closedby_version', $task_details['closedby_version'])); ?> + </select> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'dueversion')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + + </li> + <?php endif; ?> + + <!-- Due Date --> + <?php if (in_array('duedate', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('duedate')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"> + <?php echo Filters::noXSS(formatDate($task_details['due_date'], false, L('undecided'))); ?><br><?php + $days = floor((strtotime(date('c', $task_details['due_date'])) - strtotime(date("Y-m-d"))) / (60 * 60 * 24)); + if($task_details['due_date'] > 0) + { + if($days <$fs->prefs['days_before_alert'] && $days > 0) + { + echo "<font style='color: red; font-weight: bold'>".$days." ".L('daysleft')."</font>"; + } + elseif($days < 0) + { + echo "<font style='color: red; font-weight: bold'>".str_replace('-', '', $days)." + ".L('dayoverdue')."</font>"; + } + elseif($days == 0) + { + echo "<font style='color: red; font-weight: bold'>".L('duetoday')."</font>"; + } + else + { + echo $days." ".L('daysleft'); + } + } + ?> + </span> + + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <?php echo tpl_datepicker('due_date', '', Req::val('due_date', $task_details['due_date'])); ?> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'due_date')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a><a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + + </li> + <?php endif; ?> + <?php if($proj->prefs['use_effort_tracking']) { + if ($user->perms('view_estimated_effort')) { + ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('estimatedeffort')); ?></span> + <span <?php if ($user->can_edit_task($task_details)): ?>onclick="show_hide(this, true)"<?php endif;?> class="value"> + <?php + $displayedeffort = effort::secondsToString($task_details['estimated_effort'], $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']); + if (empty($displayedeffort)) { + $displayedeffort = Filters::noXSS(L('undecided')); + } + echo $displayedeffort; + ?> + </span> + <?php if ($user->can_edit_task($task_details)): ?> + <span style="display:none"> + <div style="float:right"> + <input type="text" size="15" id="estimatedeffort" name="estimated_effort" value="<?php echo effort::SecondsToEditString($task_details['estimated_effort'], $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']); ?>"/> + <br/><a onclick="quick_edit(this.parentNode.parentNode, 'estimatedeffort')" href="javascript:void(0)" class="button"><?php echo Filters::noXSS(L('confirmedit')); ?></a> <a href="javascript:void(0)" onclick="show_hide(this.parentNode.parentNode, false)" class="button"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </div> + </span> + <?php endif; ?> + </li> + <?php } + if ($user->perms('view_current_effort_done')) { + ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('currenteffortdone')); ?></span> + <?php + $total_effort = 0; + foreach($effort->details as $details){ + $total_effort += $details['effort']; + } + ?> + <span class="value"><?php echo effort::secondsToString($total_effort, $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); ?> </span> + </li> + <?php } + } ?> + <!-- Votes--> + <?php if (in_array('votes', $fields)): ?> + <li class="votes"> + <span class="label"><?php echo Filters::noXSS(L('votes')); ?></span> + <span class="value"> + <?php if (count($votes)): ?> + <a href="javascript:showhidestuff('showvotes')"><?php echo Filters::noXSS(count($votes)); ?> </a> + <div id="showvotes" class="hide"> + <ul class="reports"> + <?php foreach ($votes as $vote): ?> + <li><?php echo tpl_userlink($vote); ?> (<?php echo Filters::noXSS(formatDate($vote['date_time'])); ?>)</li> + <?php endforeach; ?> + </ul> + </div> + <?php endif; ?> + <?php if ($user->can_vote($task_details) > 0): ?> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id'])),null,null,null,'style="display:inline"'); ?> + <input type="hidden" name="action" value="details.addvote" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <button class="fakelinkbutton" type="submit" title="<?php echo Filters::noXSS(L('addvote')); ?>">+1</button> + </form> + <?php elseif ($user->can_vote($task_details) == -2): ?> (<?php echo Filters::noXSS(L('alreadyvotedthistask')); ?>) + <?php elseif ($user->can_vote($task_details) == -3): ?> (<?php echo Filters::noXSS(L('alreadyvotedthisday')); ?>) + <?php elseif ($user->can_vote($task_details) == -4): ?> (<?php echo Filters::noXSS(L('votelimitreached')); ?>) + <?php endif; ?> + </span> + </li> + <?php endif; ?> + + <!-- Private --> + <?php if (in_array('private', $fields)): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('private')); ?></span> + <span class="value"> + <?php if ($user->can_change_private($task_details) && $task_details['mark_private']): ?> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="makepublic"/> + <button type="submit" class="fakelinkbutton"><?php echo ucfirst(eL('makepublic')); ?></button> + </form> + <?php elseif ($user->can_change_private($task_details) && !$task_details['mark_private']): ?> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="action" value="makeprivate"/> + <button type="submit" class="fakelinkbutton"><?php echo ucfirst(eL('makeprivate')); ?></button> + </form> + <?php endif; ?> + </span> + </li> + <?php endif; ?> + + <!-- Watching --> + <?php if (!$user->isAnon()): ?> + <li> + <span class="label"><?php echo Filters::noXSS(L('watching')); ?></span> + <span class="value"> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="ids" value="<?php echo Filters::noXSS($task_details['task_id']); ?>"/> + <input type="hidden" name="user_id" value="<?php echo Filters::noXSS($user->id); ?>"/> + <?php if (!$watched): ?> + <input type="hidden" name="action" value="details.add_notification"/> + <button type="submit" accesskey="w" class="fakelinkbutton"><?php echo ucfirst(eL('watchtask')); ?></button> + <?php else: ?> + <input type="hidden" name="action" value="remove_notification"/> + <button type="submit" accesskey="w" class="fakelinkbutton"><?php echo ucfirst(eL('stopwatching')); ?></button> + <?php endif; ?> + </form> + </span> + </li> + <?php endif; ?> + </ul> + + <div id="fineprint"> + <?php echo Filters::noXSS(L('attachedtoproject')); ?>: <a + href="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?project=<?php echo Filters::noXSS($task_details['project_id']); ?>"><?php echo Filters::noXSS($task_details['project_title']); ?></a> + <br/> + <?php echo Filters::noXSS(L('openedby')); ?> <?php echo tpl_userlink($task_details['opened_by']); ?> + + <?php if ($task_details['anon_email'] && $user->perms('view_tasks')): ?> + (<?php echo Filters::noXSS($task_details['anon_email']); ?>) + <?php endif; ?> + - + <span title="<?php echo Filters::noXSS(formatDate($task_details['date_opened'], true)); ?>"><?php echo Filters::noXSS(formatDate($task_details['date_opened'], false)); ?></span> + <?php if ($task_details['last_edited_by']): ?> + <br/> + <?php echo Filters::noXSS(L('editedby')); ?> <?php echo tpl_userlink($task_details['last_edited_by']); ?> + + - + <span title="<?php echo Filters::noXSS(formatDate($task_details['last_edited_time'], true)); ?>"><?php echo Filters::noXSS(formatDate($task_details['last_edited_time'], false)); ?></span> + <?php endif; ?> + </div> + + </div> + + +<div id="taskdetailsfull"> + <h2 class="summary severity<?php echo Filters::noXSS($task_details['task_severity']); ?>"> + FS#<?php echo Filters::noXSS($task_details['task_id']); ?> - <?php echo Filters::noXSS($task_details['item_summary']); ?> + </h2> + <span class="tags"><?php + foreach($tags as $tag): + echo tpl_tag($tag['tag_id']); + endforeach; ?></span> + <div id="taskdetailstext"><?php echo $task_text; ?></div> + + <?php $attachments = $proj->listTaskAttachments($task_details['task_id']); + $this->display('common.attachments.tpl', 'attachments', $attachments); ?> + + <?php $links = $proj->listTaskLinks($task_details['task_id']); + $this->display('common.links.tpl', 'links', $links); ?> +</div> + +<div id="taskinfo"> + <?php if(!count($deps)==0): ?> + <table id="dependency_table" class="table" width="100%"> + <caption><?php echo (count($deps)==1) ? eL('taskdependsontask') : eL('taskdependsontasks'); ?></caption> + <thead> + <tr> + <th><?php echo Filters::noXSS(L('id')); ?></th> + <th><?php echo Filters::noXSS(L('project')); ?></th> + <th><?php echo Filters::noXSS(L('summary')); ?></th> + <th><?php echo Filters::noXSS(L('priority')); ?></th> + <th><?php echo Filters::noXSS(L('severity')); ?></th> + <th><?php echo Filters::noXSS(L('assignedto')); ?></th> + <th><?php echo Filters::noXSS(L('progress')); ?></th> + <th></th> + </tr> + </thead> + <tbody> + <?php foreach ($deps as $dependency): ?> + <tr> + <td><?php echo $dependency['task_id'] ?></td> + <td><?php echo $dependency['project_title'] ?></td> + <td><?php echo tpl_tasklink($dependency['task_id']); ?></td> + <td><?php echo $fs->priorities[$dependency['task_priority']] ?></td> + <td class="severity<?php echo Filters::noXSS($dependency['task_severity']); ?>"><?php echo $fs-> + severities[$dependency['task_severity']] ?> + </td> + <td> <?php for ($i=0;$i<count($dependency['assigned_to']);$i++){ if ($i>0) echo ", "; echo $dependency['assigned_to'][$i];} ?></td> + <td class="task_progress"> + <div class="progress_bar_container"> + <span><?php echo Filters::noXSS($dependency['percent_complete']); ?>%</span> + <div class="progress_bar" style="width:<?php echo Filters::noXSS($dependency['percent_complete']); ?>%"></div> + </div> + </td> + <td> + <?php echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); ?> + <input type="hidden" name="depend_id" value="<?php echo Filters::noXSS($dependency['depend_id']); ?>" /> + <input type="hidden" name="return_task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="action" value="removedep" /> + <button type="submit" title="<?php echo Filters::noXSS(L('remove')); ?>" class="fa fa-unlink fa-lg"></button> + </form> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> + + <!-- This task blocks the following tasks: --> + <?php if(!count($blocks)==0): ?> + <table id="blocking_table" class="table" width="100%"> + <caption><?php echo (count($blocks)==1) ? eL('taskblock') : eL('taskblocks'); ?></caption> + <thead> + <tr> + <th><?php echo Filters::noXSS(L('id')); ?></th> + <th><?php echo Filters::noXSS(L('project')); ?></th> + <th><?php echo Filters::noXSS(L('summary')); ?></th> + <th><?php echo Filters::noXSS(L('priority')); ?></th> + <th><?php echo Filters::noXSS(L('severity')); ?></th> + <th><?php echo Filters::noXSS(L('assignedto')); ?></th> + <th><?php echo Filters::noXSS(L('progress')); ?></th> + <th></th> + </tr> + </thead> + <tbody> + <?php foreach ($blocks as $dependency): ?> + <tr> + <td><?php echo $dependency['task_id'] ?></td> + <td><?php echo $dependency['project_title'] ?></td> + <td><?php echo tpl_tasklink($dependency['task_id']); ?></td> + <td><?php echo $fs->priorities[$dependency['task_priority']] ?></td> + <td class="severity<?php echo Filters::noXSS($dependency['task_severity']); ?>"><?php echo $fs-> + severities[$dependency['task_severity']] ?> + </td> + <td> <?php for ($i=0;$i<count($dependency['assigned_to']);$i++){ if ($i>0) echo ", "; echo $dependency['assigned_to'][$i];} ?></td> + <td class="task_progress"> + <div class="progress_bar_container"> + <span><?php echo Filters::noXSS($dependency['percent_complete']); ?>%</span> + <div class="progress_bar" style="width:<?php echo Filters::noXSS($dependency['percent_complete']); ?>%"></div> + </div> + </td> + <td> + <?php echo tpl_form(Filters::noXSS(createURL('details', $dependency['task_id']))); ?> + <input type="hidden" name="depend_id" value="<?php echo Filters::noXSS($dependency['depend_id']); ?>" /> + <input type="hidden" name="return_task_id" value="<?php echo Filters::noXSS($task_details['task_id']); ?>" /> + <input type="hidden" name="action" value="removedep" /> + <button type="submit" title="<?php echo Filters::noXSS(L('remove')); ?>" class="fa fa-unlink fa-lg"></button> + </form> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> + + <?php + if (!$task_details['supertask_id'] == 0) { + $supertask = Flyspray::getTaskDetails($task_details['supertask_id'], true); + if ($user->can_view_task($supertask)) { + echo eL('taskissubtaskof').' '.tpl_tasklink($supertask); + } + } + ?> + <?php if(!count($subtasks)==0): ?> + <table id="subtask_table" class="table" width="100%"> + <caption><?php echo (count($subtasks)==1) ? eL('taskhassubtask') : eL('taskhassubtasks'); ?></caption> + <thead> + <tr> + <th><?php echo Filters::noXSS(L('id')); ?></th> + <th><?php echo Filters::noXSS(L('project')); ?></th> + <th><?php echo Filters::noXSS(L('summary')); ?></th> + <th><?php echo Filters::noXSS(L('priority')); ?></th> + <th><?php echo Filters::noXSS(L('severity')); ?></th> + <th><?php echo Filters::noXSS(L('assignedto')); ?></th> + <th><?php echo Filters::noXSS(L('progress')); ?></th> + <th></th> + </tr> + </thead> + <tbody> + <?php foreach ($subtasks as $subtaskOrgin): ?> + <?php $subtask = $fs->getTaskDetails($subtaskOrgin['task_id']); ?> + <tr id="task<?php echo $subtask['task_id']; ?>" class="severity<?php echo Filters::noXSS($subtask['task_severity']); ?>"> + <td><?php echo $subtask['task_id'] ?></td> + <td><?php echo $subtask['project_title'] ?></td> + <td><?php echo tpl_tasklink($subtask['task_id']); ?></td> + <td><?php echo $fs->priorities[$subtask['task_priority']] ?></td> + <td class="severity<?php echo Filters::noXSS($subtask['task_severity']); ?>"><?php echo $fs->severities[$subtask['task_severity']] + ?> + </td> + <td> <?php for ($i=0;$i<count($subtaskOrgin['assigned_to']);$i++){ if ($i>0) echo ", "; echo $subtaskOrgin['assigned_to'][$i];} ?></td> + <td class="task_progress"> + <div class="progress_bar_container"> + <span><?php echo Filters::noXSS($subtask['percent_complete']); ?>%</span> + + <div class="progress_bar" style="width:<?php echo Filters::noXSS($subtask['percent_complete']); ?>%"></div> + </div> + </td> + <td> + <?php + echo tpl_form(Filters::noXSS(createURL('details', $task_details['task_id']))); + ?> + <input type="hidden" name="subtaskid" value="<?php echo Filters::noXSS($subtask['task_id']); ?>" /> + <input type="hidden" name="action" value="removesubtask" /> + <button type="submit" title="<?php echo Filters::noXSS(L('remove')); ?>" class="fa fa-unlink fa-lg"></button> + </form> + </td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endif; ?> + </div> +</div> + +<?php if ($task_details['is_closed']): ?> +<div id="taskclosed"> + <?php echo Filters::noXSS(L('closedby')); ?> <?php echo tpl_userlink($task_details['closed_by']); ?><br/> + <?php echo Filters::noXSS(formatDate($task_details['date_closed'], true)); ?><br/> + <strong><?php echo Filters::noXSS(L('reasonforclosing')); ?></strong> <?php echo Filters::noXSS($task_details['resolution_name']); ?><br/> + <?php if ($task_details['closure_comment']): ?> + <strong><?php echo Filters::noXSS(L('closurecomment')); ?></strong> + <?php echo wordwrap(TextFormatter::render($task_details['closure_comment']), 40, "\n", true); ?> + + <?php endif; ?> +</div> +<?php endif; ?> + +<div id="actionbuttons"> + + <?php if (count($penreqs)): ?> + <div class="pendingreq"><strong><?php echo Filters::noXSS(formatDate($penreqs[0]['time_submitted'])); ?> + + : <?php echo Filters::noXSS(L('request'.$penreqs[0]['request_type'])); ?></strong> + <?php if ($penreqs[0]['reason_given']): ?> + <?php echo Filters::noXSS(L('reasonforreq')); ?>: <?php echo Filters::noXSS($penreqs[0]['reason_given']); ?> + + <?php endif; ?> + </div> + <?php endif; ?> +</div> + +<div class="clear"></div> +</div> diff --git a/themes/CleanFS/templates/editcomment.tpl b/themes/CleanFS/templates/editcomment.tpl new file mode 100644 index 0000000..e27c6eb --- /dev/null +++ b/themes/CleanFS/templates/editcomment.tpl @@ -0,0 +1,83 @@ +<div class="box"> + <div class="comment_container"> + <div class="comment_avatar"><?php echo tpl_userlinkavatar($user->id, $fs->prefs['max_avatar_size'], 'av_comment'); ?></div> + <div class="comment"> + <div class="comment_header"> + <div class="comment_header_actions"> + <?php + $theuser = new User($comment['user_id']); + if (!$theuser->isAnon()) { + if ($theuser->perms('is_admin')) { + $rank = 'Admin'; + } + else if ($theuser->perms('manage_project')) { + $rank = 'Project Manager'; + } + else { + $rank = ''; + } + + if (!empty($rank)) { + echo '<span class="comment_header_usertype">'.Filters::noXSS($rank).'</span>'; + } + } + ?> + </div> + <div class="comment_header_infos"><?php echo tpl_userlink($comment['user_id']); ?> <?php echo Filters::noXSS(L('commentedon')); ?> <?php echo Filters::noXSS(formatDate($comment['date_added'], true)); ?></div> + </div> + <div class="commenttext"> + <?php echo tpl_form(CreateUrl('details', $comment['task_id'], 'multipart/form-data')); ?> + <input type="hidden" name="action" value="editcomment" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($comment['task_id']); ?>" /> + <input type="hidden" name="comment_id" value="<?php echo Filters::noXSS($comment['comment_id']); ?>" /> + <input type="hidden" name="previous_text" value="<?php echo Filters::noXSS($comment['comment_text']); ?>" /> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <button tabindex="9" type="button" onclick="showPreview('comment_text', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('comment_text', 10, 72, array('id' => 'comment_text'), $comment['comment_text']); ?> + <div id="addlinkbox"> + <?php $links = $proj->listLinks($comment['comment_id'], $comment['task_id']); + $this->display('common.editlinks.tpl', 'links', $links); ?> + <?php if ($user->perms('create_attachments')): ?> + <button id="addlinkbox_addalink" tabindex="10" type="button" onclick="addLinkField('addlinkbox')"> + <?php echo Filters::noXSS(L('addalink')); ?> + </button> + <button id="addlinkbox_addanotherlink" tabindex="10" style="display: none" type="button" onclick="addLinkField('addlinkbox')"> + <?php echo Filters::noXSS(L('addanotherlink')); ?> + </button> + <span style="display: none"> + <input tabindex="8" class="text" type="text" size="28" maxlength="100" name="userlink[]" /> + <a href="javascript://" tabindex="9" onclick="removeLinkField(this, 'addlinkbox');"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + <noscript> + <input tabindex="8" class="text" type="text" size="28" maxlength="100" name="userlink[]" /> + </noscript> + <?php endif; ?> + </div> + <div id="uploadfilebox"> + <?php $attachments = $proj->listAttachments($comment['comment_id'], $comment['task_id']); + $this->display('common.editattachments.tpl', 'attachments', $attachments); ?> + <?php if ($user->perms('create_attachments')): ?> + <button id="uploadfilebox_attachafile" tabindex="7" type="button" onclick="addUploadFields()"> + <?php echo Filters::noXSS(L('uploadafile')); ?> (<?php echo Filters::noXSS(L('max')); ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?php echo Filters::noXSS(L('MiB')); ?>) + </button> + <button id="uploadfilebox_attachanotherfile" tabindex="7" style="display: none" type="button" onclick="addUploadFields()"> + <?php echo Filters::noXSS(L('attachanotherfile')); ?> (<?php echo Filters::noXSS(L('max')); ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?php echo Filters::noXSS(L('MiB')); ?>) + </button> + <span style="display: none;"><!-- this span is shown/copied in javascript when adding files --> + <input tabindex="5" class="file" type="file" size="55" name="userfile[]" /> + <a href="javascript://" tabindex="6" onclick="removeUploadField(this);"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + <noscript> + <input tabindex="5" class="file" type="file" size="55" name="userfile[]" /> + </noscript> + <?php endif; ?> + </div> + <button accesskey="s" tabindex="9" type="submit" class="positive"><?php echo Filters::noXSS(L('saveeditedcomment')); ?></button> + <a class="button" href="<?php echo Filters::noXSS(CreateUrl('details', $comment['task_id'])); ?>"><?php echo Filters::noXSS(L('canceledit')); ?></a> + </form> + </div> + </div> + </div> +</div> diff --git a/themes/CleanFS/templates/feed.atom.tpl b/themes/CleanFS/templates/feed.atom.tpl new file mode 100644 index 0000000..e63eb4a --- /dev/null +++ b/themes/CleanFS/templates/feed.atom.tpl @@ -0,0 +1,73 @@ +<?php echo '<?xml version="1.0" ?>'; ?> + +<feed xmlns="http://www.w3.org/2005/Atom"> + <title type="text"><?php echo Filters::noXSS($fs->prefs['page_title']); ?></title> + <subtitle type="text"> + <?php echo Filters::noXSS($feed_description); ?> + + </subtitle> + <id><?php echo Filters::noXSS($baseurl); ?></id> + <?php if($feed_image): ?> + <icon><?php echo Filters::noXSS($feed_image); ?></icon> + <?php endif; ?> + <updated><?php echo Filters::noXSS(date('Y-m-d\TH:i:s\Z',$most_recent)); ?></updated> + <link rel="self" type="text/xml" href="feed.php?feed_type=atom"/> + <link rel="alternate" type="text/html" hreflang="en" href="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>"/> + <?php foreach ($task_details as $row): ?> + <entry> + <title>FS#<?php echo Filters::noXSS($row['task_id']); ?>: <?php echo Filters::noXSS($row['item_summary']); ?></title> + <link href="<?php echo Filters::noXSS(CreateURL('details', $row['task_id'])); ?>" /> + <updated><?php echo Filters::noXSS(date('Y-m-d\TH:i:s\Z',intval($row['last_edited_time']))); ?></updated> + <published><?php echo Filters::noXSS(date('Y-m-d\TH:i:s\Z',intval($row['date_opened']))); ?></published> + <content type="xhtml" xml:lang="en" xml:base="http://diveintomark.org/"> + <div xmlns="http://www.w3.org/1999/xhtml"> <?php + $data = $row['detailed_desc']; + + if ($conf['general']['syntax_plugin'] == 'dokuwiki') { + $data = TextFormatter::render($data); + // Convert most common html- but not xml-entities. + $data = preg_replace('/‘/', '‘', $data); + $data = preg_replace('/’/', '’', $data); + $data = preg_replace('/“/', '“', $data); + $data = preg_replace('/”/', '”', $data); + echo $data; + } + else { + if (preg_match('/^</', $data) === 0) { + // Assume an old entry. Just can't rely on any tags to be valid. + $data = strip_tags($data); + $data = preg_replace('/&/', '&', $data); + $data = preg_replace('/</', '<', $data); + $data = preg_replace('/>/', '>', $data); + $data = preg_replace('/"/', '"', $data); + $data = '<p>' . nl2br($data) . '</p>'; + } + else { + // Assume a new entry. Problem cases when an old entry started with + // < are just not handled well. Must draw the line somewhere, even if the + // browser will not show it or has an error. Those cases should be quite few. + } + + // Chrome complained loudly about this one. Firefox just didn't show anything... + // Any more html entities produced by ckeditor that should be turned into + // a numeric character reference? Add when found. Or check if we already have + // somewhere an existing function to do that. + $data = preg_replace('/ /', ' ', $data); + + // Single case. Old entry that started with <. Can contain &'s too. + // Convert to entity, without touching already existing entities. + $data = preg_replace('/&(?!([a-z]+|#[0-9]+);)/', '&', $data); + + // Still double quotes there? Convert any not appearing inside tags. + // Not sure if ckeditor makes that kind of entries. + $data = preg_replace('/"(?=[^>]*(<|$))/', '"', $data); + + // Best alternative, although will strip some odd custom data from old entries. + echo TextFormatter::render($data); + } ?></div> + </content> + <author><name><?php echo Filters::noXSS($row['real_name']); ?></name></author> + <id><?php echo Filters::noXSS($baseurl); ?>:<?php echo Filters::noXSS($row['task_id']); ?></id> + </entry> + <?php endforeach; ?> +</feed> diff --git a/themes/CleanFS/templates/feed.rss1.tpl b/themes/CleanFS/templates/feed.rss1.tpl new file mode 100644 index 0000000..4b37832 --- /dev/null +++ b/themes/CleanFS/templates/feed.rss1.tpl @@ -0,0 +1,70 @@ +<?php echo '<?xml version="1.0" ?>'; ?> + +<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns="http://purl.org/rss/1.0/" + xmlns:content="http://purl.org/rss/1.0/modules/content/"> + <channel rdf:about="<?php echo Filters::noXSS($baseurl); ?>"> + <title><?php echo Filters::noXSS($fs->prefs['page_title']); ?></title> + <link><?php echo Filters::noXSS($baseurl); ?></link> + <description><?php echo Filters::noXSS($feed_description); ?></description> + <dc:date><?php echo Filters::noXSS(date('Y-m-d\TH:i:s\Z',$most_recent)); ?></dc:date> + <items> + <rdf:Seq> + <?php foreach($task_details as $row): ?> + <rdf:li rdf:resource="<?php echo Filters::noXSS(CreateURL('details', $row['task_id'])); ?>" /> + <?php endforeach; ?> + </rdf:Seq> + </items> + <?php if($feed_image): ?> + <image rdf:resource="<?php echo Filters::noXSS($feed_image); ?>" /> + <?php endif; ?> + </channel> + <?php foreach($task_details as $row): ?> + <item rdf:about="<?php echo Filters::noXSS(CreateURL('details', $row['task_id'])); ?>"> + <title>FS#<?php echo Filters::noXSS($row['task_id']); ?>: <?php echo Filters::noXSS($row['item_summary']); ?></title> + <link><?php echo Filters::noXSS(CreateURL('details', $row['task_id'])); ?></link> + <dc:date><?php echo Filters::noXSS(date('Y-m-d\TH:i:s\Z',intval($row['last_edited_time']))); ?></dc:date> + <dc:creator><?php echo Filters::noXSS($row['real_name']); ?></dc:creator> + <?php + $data = $row['detailed_desc']; + + if ($conf['general']['syntax_plugin'] == 'dokuwiki') { + $data = TextFormatter::render($data); + // Convert most common html- but not xml-entities. + $data = preg_replace('/‘/', '‘', $data); + $data = preg_replace('/’/', '’', $data); + $data = preg_replace('/“/', '“', $data); + $data = preg_replace('/”/', '”', $data); + } + else { + if (preg_match('/^</', $data) === 0) { + // Assume an old entry. Just can't rely on any tags to be valid. + $data = strip_tags($data); + $data = preg_replace('/&/', '&', $data); + $data = preg_replace('/</', '<', $data); + $data = preg_replace('/>/', '>', $data); + $data = preg_replace('/"/', '"', $data); + $data = nl2br($data); + } + else { + // Assume a new entry. Problem cases when old entry started with + // < are just not handled. Must draw the line somewhere, even if the + // browser will not show it or has an error. Those cases should be quite few. + } + + // Single case. Old entry that started with <. Can contain &'s too. + // Convert to entity, without touching already existing entities. + $data = preg_replace('/&(?!([a-z]+|#[0-9]+);)/', '&', $data); + + // Still double quotes there? Convert any not appearing inside tags. + // Not sure if ckeditor makes that kind of entries. + $data = preg_replace('/"(?=[^>]*(<|$))/', '"', $data); + $data = TextFormatter::render($data); + } + ?> + <description><?php echo Filters::noXSS(strip_tags($data)); ?></description> + <content:encoded><![CDATA[<?php echo $data; ?>]]></content:encoded> + </item> + <?php endforeach; ?> +</rdf:RDF> diff --git a/themes/CleanFS/templates/feed.rss2.tpl b/themes/CleanFS/templates/feed.rss2.tpl new file mode 100644 index 0000000..e4e653c --- /dev/null +++ b/themes/CleanFS/templates/feed.rss2.tpl @@ -0,0 +1,65 @@ +<?php echo '<?xml version="1.0" ?>'; ?> + +<rss version="2.0"> + <channel> + <title><?php echo Filters::noXSS($fs->prefs['page_title']); ?></title> + <lastBuildDate><?php echo Filters::noXSS(date('r',$most_recent)); ?></lastBuildDate> + <description><?php echo Filters::noXSS($feed_description); ?></description> + <link><?php echo Filters::noXSS($baseurl); ?></link> + <?php if($feed_image): ?> + <image> + <url><?php echo Filters::noXSS($feed_image); ?></url> + <link><?php echo Filters::noXSS($baseurl); ?></link> + <title>[Logo]</title> + </image> + <?php endif; + foreach($task_details as $row):?> + <item> + <title>FS#<?php echo Filters::noXSS($row['task_id']); ?>: <?php echo Filters::noXSS($row['item_summary']); ?></title> + <author><?php echo Filters::noXSS($row['real_name']); ?></author> + <pubDate><?php echo Filters::noXSS(date('r',intval($row['date_opened']))); ?></pubDate> + <description><![CDATA[<?php + $data = $row['detailed_desc']; + + if ($conf['general']['syntax_plugin'] == 'dokuwiki') { + $data = TextFormatter::render($data); + // Convert most common html- but not xml-entities. + $data = preg_replace('/‘/', '‘', $data); + $data = preg_replace('/’/', '’', $data); + $data = preg_replace('/“/', '“', $data); + $data = preg_replace('/”/', '”', $data); + echo $data; + } + else { + if (preg_match('/^</', $data) === 0) { + // Assume an old entry. Just can't rely on any tags to be valid. + $data = strip_tags($data); + $data = preg_replace('/&/', '&', $data); + $data = preg_replace('/</', '<', $data); + $data = preg_replace('/>/', '>', $data); + $data = preg_replace('/"/', '"', $data); + $data = nl2br($data); + } + else { + // Assume a new entry. Problem cases when old entry started with + // < are just not handled. Must draw the line somewhere, even if the + // browser will not show it or has an error. Those cases should be quite few. + } + + // Single case. Old entry that started with <. Can contain &'s too. + // Convert to entity, without touching already existing entities. + $data = preg_replace('/&(?!([a-z]+|#[0-9]+);)/', '&', $data); + + // Still double quotes there? Convert any not appearing inside tags. + // Not sure if ckeditor makes that kind of entries. + $data = preg_replace('/"(?=[^>]*(<|$))/', '"', $data); + // Best alternative, although will strip some odd custom data from old entries. + echo TextFormatter::render($data); + } + ?>]]></description> + <link><?php echo Filters::noXSS(CreateURL('details', $row['task_id'])); ?></link> + <guid><?php echo Filters::noXSS(CreateURL('details', $row['task_id'])); ?></guid> + </item> + <?php endforeach; ?> + </channel> +</rss> diff --git a/themes/CleanFS/templates/footer.tpl b/themes/CleanFS/templates/footer.tpl new file mode 100644 index 0000000..3c2a17c --- /dev/null +++ b/themes/CleanFS/templates/footer.tpl @@ -0,0 +1,10 @@ +<?php $this->display('shortcuts.tpl'); ?> +</div> +<?php if(isset($general_integration)): echo $general_integration; endif; ?> +<div id="footer"> + <?php if(isset($footer_integration)): echo $footer_integration; endif; ?> + <!-- Please don't remove this line - it helps promote Flyspray --> + <a href="http://flyspray.org/" class="offsite"><?php echo Filters::noXSS(L('poweredby')); ?><?php if ($user->perms('is_admin')): ?> <?php echo Filters::noXSS($fs->version); ?> <?php endif; ?></a> +</div> +</body> +</html> diff --git a/themes/CleanFS/templates/header.tpl b/themes/CleanFS/templates/header.tpl new file mode 100644 index 0000000..ac360b4 --- /dev/null +++ b/themes/CleanFS/templates/header.tpl @@ -0,0 +1,131 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="<?= eL('locale') ?>" xml:lang="<?= eL('locale') ?>"> +<head> +<title><?php echo Filters::noXSS($this->_title); ?></title> +<meta name="description" content="Flyspray, a Bug Tracking System written in PHP." /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta http-equiv="Content-Script-Type" content="text/javascript" /> +<meta http-equiv="Content-Style-Type" content="text/css" /> +<meta name="viewport" content="width=device-width, initial-scale=1.0" /> +<?php if ($fs->prefs['url_rewriting']): ?> +<base href="<?php echo Filters::noXSS($baseurl); ?>" /> +<?php endif; ?> +<?php if(trim($this->get_image('favicon'))): ?> +<link rel="icon" type="image/png" href="<?php echo Filters::noXSS($this->get_image('favicon')); ?>" /> +<?php endif; ?> +<link rel="index" id="indexlink" type="text/html" href="<?php echo Filters::noXSS($baseurl); ?>" /> +<?php foreach ($fs->projects as $project): ?> +<link rel="section" type="text/html" href="<?php echo Filters::noXSS($baseurl); ?>?project=<?php echo Filters::noXSS($project[0]); ?>" /> +<?php endforeach; ?> +<link media="screen" href="<?php echo (is_readable(BASEDIR . '/themes/'.$this->_theme.'theme.css')) ? Filters::noXSS($this->themeUrl()) : Filters::noXSS($baseurl).'themes/CleanFS/' ; ?>theme.css" rel="stylesheet" type="text/css" /> +<?php +# css hack to fix css3only state switches with ~ in older android browser <4.3 TODO: find webkit version when that issue was fixed. +if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match( '/Android [23]\.\d|Android 4\.[012]/' , $_SERVER['HTTP_USER_AGENT'])):?> +<link rel="stylesheet" type="text/css" media="screen" href="<?php echo Filters::noXSS($this->themeUrl()); ?>oldwebkitsiblingfix.css'; ?>" /> +<?php endif; ?> +<link media="print" href="<?php echo Filters::noXSS($this->themeUrl()); ?>theme_print.css" rel="stylesheet" type="text/css" /> +<link href="<?php echo Filters::noXSS($this->themeUrl()); ?>font-awesome.min.css" rel="stylesheet" type="text/css" /> +<?php +# include an optional, customized css file for tag styling (all projects, loads even for guests) +if(is_readable(BASEDIR.'/themes/'.$this->_theme.'tags.css')): ?> +<link href="<?php echo Filters::noXSS($this->themeUrl()); ?>tags.css" rel="stylesheet" type="text/css" /> +<?php endif; ?> +<?php if($proj->prefs['custom_style'] !=''): ?> +<link media="screen" href="<?php echo Filters::noXSS($this->themeUrl()).$proj->prefs['custom_style']; ?>" rel="stylesheet" type="text/css" /> +<?php endif; ?> +<link rel="alternate" type="application/rss+xml" title="Flyspray RSS 1.0 Feed" + href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&project=<?php echo Filters::noXSS($proj->id); ?>" /> +<link rel="alternate" type="application/rss+xml" title="Flyspray RSS 2.0 Feed" + href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&project=<?php echo Filters::noXSS($proj->id); ?>" /> +<link rel="alternate" type="application/atom+xml" title="Flyspray Atom 0.3 Feed" + href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&project=<?php echo Filters::noXSS($proj->id); ?>" /> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/prototype/prototype.js"></script> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/script.aculo.us/scriptaculous.js"></script> +<?php if ('index' == $do): ?> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/index.js"></script> +<?php endif; ?> +<?php if ('details' == $do && $user->can_view_project($proj->id)): ?> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/details.js"></script> +<?php endif; ?> +<?php if ( $do == 'pm' || $do == 'admin'): ?> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/tablecontrol.js"></script> +<?php endif; ?> +<?php if ( $do == 'depends'): ?> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/jit/jit.js"></script> +<?php endif; ?> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/tabs.js"></script> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/functions.js"></script> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/jscalendar/calendar_stripped.js"></script> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/jscalendar/calendar-setup_stripped.js"> </script> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/jscalendar/lang/calendar-<?php echo Filters::noXSS(substr(L('locale'), 0, 2)); ?>.js"></script> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/lightbox/js/lightbox.js"></script> +<?php if(isset($conf['general']['syntax_plugin']) && $conf['general']['syntax_plugin'] !='dokuwiki'): ?><script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>js/ckeditor/ckeditor.js"></script><?php endif; ?> +<link rel="stylesheet" href="<?php echo Filters::noXSS($baseurl); ?>js/lightbox/css/lightbox.css" type="text/css" media="screen" /> +<?php foreach(TextFormatter::get_javascript() as $file): ?> +<script type="text/javascript" src="<?php echo Filters::noXSS($baseurl); ?>plugins/<?php echo Filters::noXSS($file); ?>"></script> +<?php endforeach; ?> +<?php if(isset($fs->prefs['captcha_recaptcha']) && $fs->prefs['captcha_recaptcha'] + && isset($fs->prefs['captcha_recaptcha_sitekey']) && $fs->prefs['captcha_recaptcha_sitekey']!='' + && isset($fs->prefs['captcha_recaptcha_secret']) && $fs->prefs['captcha_recaptcha_secret']!='' +): ?> + <?php + if ( + ($do=='register') + || ($do=='newtask' && $user->isAnon()) + ): ?> + <script src='https://www.google.com/recaptcha/api.js'></script> + <?php endif; ?> +<?php endif; ?> +</head> +<body onload="<?php + if (isset($_SESSION['SUCCESS']) || isset($_SESSION['ERROR']) || isset($_SESSION['ERRORS'])): + ?>/* window.setTimeout('Effect.Fade(\'successanderrors\', {duration:.3})', 10000); */ + <?php endif ?>" class="<?php echo (isset($do) ? Filters::noXSS($do) : 'index').' p'.$proj->id; ?>"> + +<div id="archnavbar" class="anb-forum"> + <a href="https://www.archlinux32.org"> + <div id="archnavbarlogo"> + <?php if($fs->prefs['logo']) { ?><img src="<?php echo Filters::noXSS($baseurl.'/'.$fs->prefs['logo']); ?>" /><?php } ?> + </div> + </a> + <div id="archnavbarmenu"> + <ul id="archnavbarlist"> + <li id="anb-home"><a href="http://archlinux32.org/">Home</a></li> + <li id="anb-packages"><a href="https://packages.archlinux32.org/">Packages</a></li> + <li id="anb-forums"><a href="https://bbs.archlinux32.org/">Forums</a></li> + <li id="anb-bugs"><a href="https://bugs.archlinux32.org/">Bugs</a></li> + <li id="anb-mailing list"><a href="https://lists.archlinux.org/listinfo/arch-ports">Mailing List</a></li> + <li id="anb-download"><a href="https://archlinux32.org/download/">Download</a></li> + <li id="anb-arch linux official"><a href="https://www.archlinux.org/">Arch Linux Official</a></li> + </ul> + </div> +</div> + <?php $this->display('links.tpl'); ?> + + <?php if (isset($_SESSION['SUCCESS']) || isset($_SESSION['ERROR']) || isset($_SESSION['ERRORS'])): ?> + <div id="successanderrors" onclick="this.style.display='none'"> + <?php endif; ?> + <?php if(isset($_SESSION['SUCCESS'])): ?><div class="success"><i class="fa fa-check" aria-hidden="true"></i> <?php echo Filters::noXSS($_SESSION['SUCCESS']); ?></div><?php endif; ?> + <?php if(isset($_SESSION['ERROR'])): ?><div class="error"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <?php echo Filters::noXSS($_SESSION['ERROR']); ?></div><?php endif; ?> + <?php if(isset($_SESSION['ERRORS'])): ?> + <?php + foreach(array_keys($_SESSION['ERRORS']) as $e){ + echo '<div class="error"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> '.eL($e).'</div>'; + } + ?> + <?php endif; ?> + <?php if(isset($_SESSION['SUCCESS']) || isset($_SESSION['ERROR']) || isset($_SESSION['ERRORS'])): ?> + </div> + <?php endif;?> + +<div id="content"> + <div class="clear"></div> + <?php $show_message = explode(' ', $fs->prefs['pages_welcome_msg']); + if ($fs->prefs['intro_message'] && ($proj->id == 0 || $proj->prefs['disp_intro']) && (in_array($do, $show_message)) ):?> + <div id="intromessage"><?php echo TextFormatter::render($fs->prefs['intro_message'], 'msg', $proj->id); ?></div> + <?php endif; ?> + <?php if ($proj->id > 0): + $show_message = explode(' ', $proj->prefs['pages_intro_msg']); + if ($proj->prefs['intro_message'] && (in_array($do, $show_message))): ?> + <div id="intromessage"><?php echo TextFormatter::render($proj->prefs['intro_message'], 'msg', $proj->id, ($proj->prefs['last_updated'] < $proj->prefs['cache_update']) ? $proj->prefs['pm_instructions'] : ''); ?></div> + <?php endif; endif; ?> diff --git a/themes/CleanFS/templates/index.tpl b/themes/CleanFS/templates/index.tpl new file mode 100644 index 0000000..a918b78 --- /dev/null +++ b/themes/CleanFS/templates/index.tpl @@ -0,0 +1,623 @@ +<script type="text/javascript"> + //Used for dynamically displaying the bulk edit pane, when Checkboxes are >1 + function BulkEditCheck() + { + var form = document.getElementById('massops'); + var count = 0; + for(var n=0;n < form.length;n++){ + if(form[n].name == 'ids[]' && form[n].checked){ + count++; + } + } + + if(count == 0) + { + Effect.Fade('bulk_edit_selectedItems',{ duration: 0.2 }); + } + if(count == 1) + { + Effect.Appear('bulk_edit_selectedItems',{ duration: 0.2 }); + } + } + + function massSelectBulkEditCheck() + { + var form = document.getElementById('massops'); + var check_count = 0, uncheck_count; + for(var n=0;n < form.length;n++){ + if(form[n].name == 'ids[]'){ + if(form[n].checked) + check_count++; + else + uncheck_count++; + } + } + + if(check_count == 0) + { + Effect.Appear('bulk_edit_selectedItems',{ duration: 0.2 }); + } + + if(uncheck_count == 0) + { + Effect.Fade('bulk_edit_selectedItems',{ duration: 0.2 }); + } + } + + function ClearAssignments() + { + document.getElementById('bulk_assignment').options.length = 0; + } +</script> + +<?php if(isset($update_error)): ?> +<div id="updatemsg"> + <span class="bad"> <?= eL('updatewrong') ?></span> + <a href="?hideupdatemsg=yep"><?= eL('hidemessage') ?></a> +</div> +<?php endif; ?> + +<?php if(isset($updatemsg)): ?> +<div id="updatemsg"> + <a href="http://flyspray.org/"><?= eL('updatefs') ?></a> <?= eL('currentversion') ?> + + <span class="bad"><?php echo Filters::noXSS($fs->version); ?></span> <?= eL('latestversion') ?> <span class="good"><?php echo Filters::noXSS($_SESSION['latest_version']); ?></span>. + <a href="?hideupdatemsg=yep"><?= eL('hidemessage') ?></a> +</div> +<?php endif; ?> + +<?php if (!($user->isAnon() && (count($fs->projects) == 0 || ($proj->id >0 && !$user->can_view_project($proj->id)))) ): ?> +<?php $filter = false; if($proj->id > 0) { $filter = true; $fields = explode( ' ', $proj->prefs['visible_fields'] );} ?> +<form id="search" action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> + <button id="searchthisproject" type="submit"><?= eL('searchthisproject') ?></button> + <input class="text" id="searchtext" name="string" type="text" size="20" placeholder=" " + maxlength="100" value="<?php echo Filters::noXSS(Get::val('string')); ?>" accesskey="q"/> + <input type="hidden" name="project" value="<?php echo Filters::noXSS(Get::num('project', $proj->id)); ?>"/> + <input type="hidden" name="do" value="index"/> + <button type="submit" name="export_list" value="1" id="exporttasklist" title="<?= eL('exporttasklist') ?>"><i class="fa fa-download"></i></button> +<style> +#sc2,#s_searchstate{display:none;} +#searchstateactions{color:#999;display:block;cursor:pointer;} +#s_searchstate:checked ~ #sc2 {display:block;} +#s_searchstate ~ label::before { content: "\25bc";} +#s_searchstate:checked ~ label::before { content: "\25b2";} +</style> +<input id="s_searchstate" type="checkbox" name="advancedsearch"<?php if(Req::val('advancedsearch')): ?> checked="checked"<?php endif; ?>/> +<label id="searchstateactions" for="s_searchstate"><?= eL('advanced') ?></label> +<div id="sc2" class="switchcontent"> +<?php if (!$user->isAnon()): ?> +<fieldset> + <div class="save_search"><label for="save_search" id="lblsaveas"><?= eL('saveas') ?></label> + <input class="text" type="text" value="<?php echo Filters::noXSS(Get::val('search_name')); ?>" id="save_search" name="search_name" size="15"/> <button onclick="savesearch('<?php echo Filters::escapeqs($_SERVER['QUERY_STRING']); ?>', '<?php echo Filters::noJsXSS($baseurl); ?>', '<?= eL('saving') ?>', '<?php echo Filters::noJsXSS($_SESSION['csrftoken']); ?>')" type="button"><?= eL('OK') ?></button> + </div> +</fieldset> +<?php endif; ?> +<fieldset class="advsearch_misc"> + <legend><?= eL('miscellaneous') ?></legend> + <?php echo tpl_checkbox('search_in_comments', Get::has('search_in_comments'), 'sic'); ?> + <label class="left" for="sic"><?= eL('searchcomments') ?></label> + + <?php echo tpl_checkbox('search_in_details', Get::has('search_in_details'), 'search_in_details'); ?> + <label class="left" for="search_in_details"><?= eL('searchindetails') ?></label> + + <?php echo tpl_checkbox('search_for_all', Get::has('search_for_all'), 'sfa'); ?> + <label class="left" for="sfa"><?= eL('searchforall') ?></label> + + <?php echo tpl_checkbox('only_watched', Get::has('only_watched'), 'only_watched'); ?> + <label class="left" for="only_watched"><?= eL('taskswatched') ?></label> + + <?php echo tpl_checkbox('only_primary', Get::has('only_primary'), 'only_primary'); ?> + <label class="left" for="only_primary"><?= eL('onlyprimary') ?></label> + + <?php echo tpl_checkbox('only_blocker', Get::has('only_blocker'), 'only_blocker'); ?> + <label class="left" for="only_blocker" id="blockerlabel"><?= eL('onlyblocker') ?></label> + <span id="blockerornoblocker"><?= eL('blockerornoblocker') ?></span> + <style> + #blockerornoblocker {display:none;color:#c00;} + #only_primary:checked ~ #only_blocker:checked ~ #blockerornoblocker {display:inline;} + </style> + + <?php echo tpl_checkbox('has_attachment', Get::has('has_attachment'), 'has_attachment'); ?> + <label class="left" for="has_attachment"><?= eL('hasattachment') ?></label> + + <?php echo tpl_checkbox('hide_subtasks', Get::has('hide_subtasks'), 'hide_subtasks'); ?> + <label class="left" for="hide_subtasks"><?= eL('hidesubtasks') ?></label> + </fieldset> + + <fieldset class="advsearch_task"> + <legend><?= eL('taskproperties') ?></legend> + <!-- Task Type --> + <?php if (!$filter || in_array('tasktype', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="type"><?= eL('tasktype') ?></label> + <select name="type[]" id="type" multiple="multiple" size="8"> + <?php echo tpl_options(array('' => L('alltasktypes')) + $proj->listTaskTypes(), Get::val('type', '')); ?> + </select> + </div> + + <!-- Severity --> + <?php if (!$filter || in_array('severity', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="sev"><?= eL('severity') ?></label> + <select name="sev[]" id="sev" multiple="multiple" size="8"> + <?php echo tpl_options(array('' => L('allseverities')) + $fs->severities, Get::val('sev', '')); ?> + </select> + </div> + + <!-- Priority --> + <?php if (!$filter || in_array('priority', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="pri"><?= eL('priority') ?></label> + <select name="pri[]" id="pri" multiple="multiple" size="8"> + <?php echo tpl_options(array('' => L('allpriorities')) + $fs->priorities, Get::val('pri', '')); ?> + </select> + </div> + + <!-- Due Version --> + <?php if (!$filter || in_array('dueversion', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="due"><?= eL('dueversion') ?></label> + <select name="due[]" id="due" multiple="multiple" size="8"> + <?php echo tpl_options(array_merge(array('' => L('dueanyversion'), 0 => L('unassigned')), $proj->listVersions(false)), Get::val('due', '')); ?> + </select> + </div> + + <!-- Reportedin --> + <?php if (!$filter || in_array('reportedin', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="reported"><?= eL('reportedversion') ?></label> + <select name="reported[]" id="reported" multiple="multiple" size="8"> + <?php echo tpl_options(array('' => L('anyversion')) + $proj->listVersions(false), Get::val('reported', '')); ?> + </select> + </div> + + <!-- Category --> + <?php if (!$filter || in_array('category', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="cat"><?= eL('category') ?></label> + <select name="cat[]" id="cat" multiple="multiple" size="8"> + <?php echo tpl_options(array('' => L('allcategories')) + $proj->listCategories(), Get::val('cat', '')); ?> + </select> + </div> + + <!-- Status --> + <?php if (!$filter || in_array('status', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="status"><?= eL('status') ?></label> + <select name="status[]" id="status" multiple="multiple" size="8"> + <?php echo tpl_options(array('' => L('allstatuses')) + + array('open' => L('allopentasks')) + + array('closed' => L('allclosedtasks')) + + $proj->listTaskStatuses(), Get::val('status', 'open')); ?> + </select> + </div> + + <!-- Progress --> + <?php if (!$filter || in_array('progress', $fields)) { ?> + <div class="search_select"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <label class="default multisel" for="percent"><?= eL('percentcomplete') ?></label> + <!-- legacy: tpl_options() + <select name="percent[]" id="percent" multiple="multiple" size="12"> + <?php $percentages = array(); for ($i = 0; $i <= 100; $i += 10) $percentages[$i] = $i; ?> + <?php echo tpl_options(array('' => L('anyprogress')) + $percentages, Get::val('percent', '')); ?> + </select> + --> +<?php +# new: use of tpl_select() which provides much more control +# maybe move some of the php code from here to scripts/index.php ... +$selected=Get::val('percent', ''); +$selected = is_array($selected) ? $selected : (array) $selected; +$percentages = array(); +$percentages[]=array('value'=>'', 'label'=>L('anyprogress') ); +if(in_array('', $selected, true)){ + $percentages[0]['attr']['selected']='selected'; +} +for($i = 0; $i <= 100; $i += 10){ + $opt = array(); + $opt['value'] = $i; + $opt['label'] = $i; + # goes to theme.css .. + # styling of html select options probably works only in a few browsers (at least firefox), but where it works it can be an added value. + $opt['attr']=array('style'=>'background:linear-gradient(90deg,#0c0 0%,#0c0 '.$i.'%, #fff '.$i.'%, #fff 100%)'); + $opt['attr']=array('class'=>'percent'.$i); + if(in_array("$i", $selected)){ + $opt['attr']['selected']='selected'; + } + $percentages[]=$opt; +} +echo tpl_select( + array( + 'name'=>'percent[]', + 'attr'=>array( + 'id'=>'percent', + 'multiple'=>'multiple', + 'size'=>12 + ), + 'options'=>$percentages + ) +); +?> + </div> + <div class="clear"></div> + </fieldset> + + <fieldset class="advsearch_users"> + <legend><?= eL('users') ?></legend> + <label class="default multisel" for="opened"><?= eL('openedby') ?></label> + <?php echo tpl_userselect('opened', Get::val('opened'), 'opened', array('placeholder'=>' ')); ?> + + <?php if (!$filter || in_array('assignedto', $fields)) { ?> + <label class="default multisel" for="dev"><?= eL('assignedto') ?></label> + <?php echo tpl_userselect('dev', Get::val('dev'), 'dev', array('placeholder'=>' ')); } ?> + <label class="default multisel" for="closed"><?= eL('closedby') ?></label> + <?php echo tpl_userselect('closed', Get::val('closed'), 'closed', array('placeholder'=>' ')); ?> + </fieldset> + + <fieldset class="advsearch_dates"> + <legend><?= eL('dates') ?></legend> + <!-- Due Date --> + <?php if (!$filter || in_array('duedate', $fields)) { ?> + <div class="dateselect"> + <?php } else { ?> + <div style="display:none"> + <?php } ?> + <?php echo tpl_datepicker('duedatefrom', L('selectduedatefrom')); ?> + <?php echo tpl_datepicker('duedateto', L('selectduedateto')); ?> + </div> + <div class="dateselect"> + <?php echo tpl_datepicker('changedfrom', L('selectsincedatefrom')); ?> + <?php echo tpl_datepicker('changedto', L('selectsincedateto')); ?> + </div> + <div class="dateselect"> + <?php echo tpl_datepicker('openedfrom', L('selectopenedfrom')); ?> + <?php echo tpl_datepicker('openedto', L('selectopenedto')); ?> + </div> + <div class="dateselect"> + <?php echo tpl_datepicker('closedfrom', L('selectclosedfrom')); ?> + <?php echo tpl_datepicker('closedto', L('selectclosedto')); ?> + </div> + </fieldset> + </div> +</form> +<?php endif; ?> +<?php if (isset($_GET['string']) || $total): ?> +<div id="tasklist"> +<?php echo tpl_form(Filters::noXSS(createURL('project', $proj->id, null, $_GET)),'massops',null,null,'id="massops"'); ?> +<div> +<script type="text/javascript"> + var cX = 0; var cY = 0; var rX = 0; var rY = 0; + function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;} + function UpdateCursorPositionDocAll(e){ cX = e.clientX; cY = e.clientY;} + if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; } + else { document.onmousemove = UpdateCursorPosition; } + function AssignPosition(d) { + if (self.pageYOffset) { + rX = self.pageXOffset; + rY = self.pageYOffset; + } else if(document.documentElement && document.documentElement.scrollTop) { + rX = document.documentElement.scrollLeft; + rY = document.documentElement.scrollTop; + } else if(document.body) { + rX = document.body.scrollLeft; + rY = document.body.scrollTop; + } + if (document.all) { + cX += rX; + cY += rY; + } + d.style.left = (cX+10) + "px"; + d.style.top = (cY+10) + "px"; + } + function Show(elem, id) { + if(cY == 0) return; + var div = document.getElementById("desc_"+id); + AssignPosition(div); + div.style.display = "block"; + } + function Hide(elem, id) { + document.getElementById("desc_"+id).style.display = "none"; + } +</script> +<table id="tasklist_table"> +<colgroup> + <col class="caret" /> + <?php if (!$user->isAnon() && $proj->id !=0 && $total): ?><col class="toggle" /><?php endif; ?> + <?php foreach ($visible as $col): ?> + <col class="<?php echo $col; ?>" /> + <?php endforeach; ?> +</colgroup> +<thead> +<tr> + <th class="caret"></th> + <?php if (!$user->isAnon() && $proj->id !=0 && $total): ?> + <th class="ttcolumn"><a title="<?= eL('toggleselected') ?>" href="javascript:ToggleSelected('massops')" onclick="massSelectBulkEditCheck();"></a></th> + <?php + endif; + foreach ($visible as $col): + echo tpl_list_heading($col, "<th%s>%s</th>"); + endforeach; + ?> +</tr> +</thead> +<tbody> +<?php foreach ($tasks as $task):?> +<tr id="task<?php echo $task['task_id']; ?>" class="severity<?php echo $task['task_severity']; echo $task['is_closed'] ==1 ? ' closed': '';?>"> + <td class="caret"></td> + <?php if (!$user->isAnon() && $proj->id !=0): ?> + <td class="ttcolumn"><input class="ticktask" type="checkbox" name="ids[]" onclick="BulkEditCheck()" value="<?php echo $task['task_id']; ?>"/></td> + <?php + endif; + foreach ($visible as $col): + if($col == 'progress'):?> + <td class="task_progress"><div class="progress_bar_container"><span><?php echo $task['percent_complete']; ?>%</span><div class="progress_bar" style="width:<?php echo $task['percent_complete']; ?>%"></div></div></td> + <?php elseif ($col == 'summary'): + echo tpl_draw_cell($task, $col, "<td class='%s' onmouseover=\"Show(this," . $task['task_id'] . ")\" onmouseout=\"Hide(this, " . $task['task_id'] . ")\">%s</td>"); + else: + echo tpl_draw_cell($task, $col); + endif; + endforeach; + ?> + <td id="desc_<?php echo $task['task_id']; ?>" class="descbox box"> + <b><?php echo L('taskdescription'); ?></b> + <?php echo $task['detailed_desc'] ? TextFormatter::render($task['detailed_desc'], 'task', $task['task_id'], $task['desccache']) : '<p>'.L('notaskdescription').'</p>'; ?> + </td> +</tr> +<?php endforeach; ?> +</tbody> +</table> +<table id="pagenumbers"> +<tr> +<?php if ($total): ?> + <td id="taskrange"><?php echo sprintf(L('taskrange'), $offset + 1, ($offset + $perpage > $total ? $total : $offset + $perpage), $total); ?></td> + <td id="numbers"><?php echo pagenums($pagenum, $perpage, $total); ?></td> +<?php else: ?> + <td id="taskrange"><strong><?= eL('noresults') ?></strong></td> +<?php endif; ?> +</tr> +</table> + +<!-- Bulk editing Tasks --> +<?php if (!$user->isAnon() && $proj->id !=0 && $total): ?> +<!-- Grab fields wanted for this project so we only show those specified in the settings --> +<div id="bulk_edit_selectedItems" style="display:none"> + <fieldset> + <legend><b><?= eL('updateselectedtasks') ?></b></legend> + <ul class="form_elements slim"> + <input type="hidden" name="action" value="task.bulkupdate" /> + <input type="hidden" name="user_id" value="<?php echo Filters::noXSS($user->id); ?>"/> + <!-- Quick Actions --> + <li> + <label for="bulk_quick_action"><?= eL('quickaction') ?></label> + <select name="bulk_quick_action" id="bulk_quick_action"> + <option value="0"><?= eL('notspecified') ?></option> + <option value="bulk_start_watching"><?= eL('watchtasks') ?></option> + <option value="bulk_stop_watching"><?= eL('stopwatchingtasks') ?></option> + <option value="bulk_take_ownership"><?= eL('assigntaskstome') ?></option> + </select> + </li> + <!-- Status --> + <?php if (in_array('status', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + + <label for="bulk_status"><?= eL('status') ?></label> + <select id="bulk_status" name="bulk_status"> + <?php $statusList = $proj->listTaskStatuses(); ?> + <?php array_unshift($statusList,L('notspecified')); ?> + <?php echo tpl_options($statusList); ?> + + </select> + </li> + + <!-- Progress --> + <?php if (in_array('progress', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="bulk_percent"><?= eL('percentcomplete') ?></label> + <select id="bulk_percent" name="bulk_percent_complete"> + <?php $percentCompleteList = array();$percentCompleteList[0]=L('notspecified'); for ($i = 1; $i<=101; $i+=10) $percentCompleteList[$i-1] =''.($i-1).'%'; ?> + <?php echo tpl_options($percentCompleteList); ?> + + </select> + </li> + + <!-- Task Type--> + <?php if (in_array('tasktype', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $taskTypeList = $proj->listTaskTypes(); ?> + <?php array_unshift($taskTypeList,L('notspecified')); ?> + <label for="bulk_tasktype"><?= eL('tasktype') ?></label> + <select id="bulk_tasktype" name="bulk_task_type"> + <?php echo tpl_options($taskTypeList); ?> + </select> + + </li> + + <!-- Category --> + <?php if (in_array('category', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $categoryTypeList = $proj->listCategories(); ?> + <?php array_unshift($categoryTypeList,L('notspecified')); ?> + <label for="bulk_category"><?php echo Filters::noXSS(L('category')); ?></label> + <select id="bulk_category" name="bulk_category"> + <?php echo tpl_options($categoryTypeList); ?> + </select> + + </li> + + <!-- Assigned To--> + <li> + <?php if ($user->perms('edit_assignments')): ?> + <label for="bulk_assignment"><?= eL('assignedto') ?></label> + <?php + //insert a noone into the list in order to bulk de-assign tasks + $noone[0]=array(0,L('noone')); + array_unshift($userlist, $noone); + ?> + <select size="8" style="height: 200px;" name="bulk_assignment[]" id="bulk_assignment" multiple> + <?php foreach ($userlist as $group => $users): ?> + <optgroup <?php if($group == '0'){ ?> label='<?= eL('pleaseselect') ?> ... ' <?php } else { ?> label='<?php echo Filters::noXSS($group); ?>' <?php } ?> > + <?php foreach ($users as $info): ?> + <option value="<?php echo Filters::noXSS($info[0]); ?>"><?php echo Filters::noXSS($info[1]); ?></option> + <?php endforeach; ?> + </optgroup> + <?php endforeach; ?> + </select> + <?php endif; ?> + </li> + + <!-- OS --> + <?php if (in_array('os', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $osTypeList = $proj->listOs(); ?> + <?php array_unshift($osTypeList,L('notspecified')); ?> + <label for="bulk_os"><?= eL('operatingsystem') ?></label> + <select id="bulk_os" name="bulk_os"> + <?php echo tpl_options($osTypeList); ?> + </select> + </li> + + <!-- Severity --> + <?php if (in_array('severity', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $severityTypeList = array_reverse($fs->severities); ?> + <?php array_unshift($severityTypeList,L('notspecified')); ?> + <label for="bulk_severity"><?= eL('severity') ?></label> + <select id="bulk_severity" name="bulk_severity"> + <?php echo tpl_options($severityTypeList); ?> + </select> + </li> + + <!-- Priority --> + <?php if (in_array('priority', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + + <?php $priorityTypeList = array_reverse($fs->priorities); ?> + <?php array_unshift($priorityTypeList,L('notspecified')); ?> + <label for="bulk_priority"><?= eL('priority') ?></label> + <select id="bulk_priority" name="bulk_priority"> + <?php echo tpl_options($priorityTypeList); ?> + </select> + </li> + + <!-- Reported In --> + <?php if (in_array('reportedin', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $reportedVerList = $proj->listVersions(); ?> + <?php array_unshift($reportedVerList,L('notspecified')); ?> + <label for="bulk_reportedver"><?= eL('reportedversion') ?></label> + <select id="bulk_reportedver" name="bulk_reportedver"> + <?php echo tpl_options($reportedVerList); ?> + </select> + </li> + + <!-- Due --> + <?php if (in_array('dueversion', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $dueInVerList = $proj->listVersions(); ?> + <?php array_unshift($dueInVerList,L('undecided')); ?> + <?php array_unshift($dueInVerList,L('notspecified')); ?> + <label for="bulk_dueversion"><?= eL('dueinversion') ?></label> + <select id="bulk_dueversion" name="bulk_due_version"> + <?php echo tpl_options($dueInVerList); ?> + </select> + </li> + + <!-- Due Date --> + <?php if (in_array('duedate', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="bulk_due_date"><?= eL('duedate') ?></label> + <?php echo tpl_datepicker('bulk_due_date'); ?> + </li> + + <!-- Projects --> + <!-- If there is only one choice of project, then don't bother showing it --> + <?php if (count($fs->projects) > 1) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <?php $projectsList = $fs->listProjects(); ?> + <?php array_unshift($projectsList,L('notspecified')); ?> + <label for="bulk_projects"><?= eL('attachedtoproject') ?></label> + <select id="bulk_projects" name="bulk_projects"> + <?php echo tpl_options($projectsList); ?> + </select> + </li> + </ul> + <button type="submit" name="updateselectedtasks" value="true"><?= eL('updateselectedtasks') ?></button> + </fieldset> + <fieldset> + <legend><b><?php echo L('closeselectedtasks'); ?></b></legend> + <div> + <select class="adminlist" name="resolution_reason" onmouseup="event.stopPropagation();"> + <option value="0"><?= eL('selectareason') ?></option> + <?php echo tpl_options($proj->listResolutions(), Req::val('resolution_reason')); ?> + </select> + <button type="submit" name="updateselectedtasks" value="false"><?php echo L('closetasks'); ?></button> + <br/> + <label class="default text" for="closure_comment"><?= eL('closurecomment') ?></label> + <textarea class="text" id="closure_comment" name="closure_comment" rows="3" + cols="25"><?php echo Filters::noXSS(Req::val('closure_comment')); ?></textarea> + <label><?php echo tpl_checkbox('mark100', Req::val('mark100', !(Req::val('action') == 'details.close'))); ?> <?php echo Filters::noXSS(L('mark100')); ?></label> + </div> + </fieldset> + +</div> +<?php endif; /* !$user->isAnon() && $proj-> !=0 && $total */ ?> +</div> +</form> +</div> +<?php endif; /* isset($_GET['string'] || $total */ ?> diff --git a/themes/CleanFS/templates/links.searches.tpl b/themes/CleanFS/templates/links.searches.tpl new file mode 100644 index 0000000..9347cd4 --- /dev/null +++ b/themes/CleanFS/templates/links.searches.tpl @@ -0,0 +1,15 @@ + <strong id="nosearches" <?php if(count($user->searches)): ?>class="hide"<?php endif; ?>><?php echo Filters::noXSS(L('nosearches')); ?></strong> + <?php if(count($user->searches)): ?> + <input type="hidden" name="csrftoken" id="deletesearchtoken" value="<?php echo $_SESSION['csrftoken']; ?>"> + <table id="mysearchestable"> + <?php foreach ($user->searches as $search): ?> + <tr id="rs<?php echo Filters::noXSS($search['id']); ?>" <?php if($search == end($user->searches)): ?>class="last"<?php endif; ?>> + <td><a href="<?php echo Filters::noXSS($baseurl); ?>?do=index&<?php echo http_build_query(unserialize($search['search_string']), '', '&'); ?>"><?php echo Filters::noXSS($search['name']); ?></a></td> + <td class="searches_delete"> + <a href="javascript:deletesearch('<?php echo Filters::noXSS($search['id']); ?>','<?php echo Filters::noJsXSS($baseurl); ?>')"> + <i title="<?php echo Filters::noXSS(L('delete')); ?>" class="fa fa-trash fa-lg"></i></a> + </td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> diff --git a/themes/CleanFS/templates/links.tpl b/themes/CleanFS/templates/links.tpl new file mode 100644 index 0000000..f793a2b --- /dev/null +++ b/themes/CleanFS/templates/links.tpl @@ -0,0 +1,148 @@ +<input id="menu1" type="checkbox"> +<label id="labelmenu1" for="menu1"></label> +<div id="menu"><ul id="menu-list"><?php +if ($user->isAnon()): + # 20150211 peterdd: pure css toggle using checked status, no js needed + ?><li class="first"> + <input type="checkbox" id="s_loginbox" /> + <label for="s_loginbox" id="show_loginbox" accesskey="l"><?php echo Filters::noXSS(L('login')); ?></label> + <div id="loginbox" class="popup"><?php $this->display('loginbox.tpl'); ?></div> + </li><?php +else: ?><li> + <a id="profilelink" <?php if($do == 'myprofile'): ?> class="active"<?php endif; ?> href="<?php echo Filters::noXSS(CreateURL('myprofile')); ?>" title="<?php echo Filters::noXSS(L('editmydetails')); ?> <?php echo Filters::noXSS($user->infos['real_name']); ?> (<?php echo Filters::noXSS($user->infos['user_name']); ?>)"><i class="fa fa-user fa-lg"></i></a> + </li><li> + <a id="lastsearchlink" href="#" accesskey="m" onclick="showhidestuff('mysearches');return false;" class="inactive"><?php echo Filters::noXSS(L('mysearch')); ?></a> + <div id="mysearches"><?php $this->display('links.searches.tpl'); ?></div> + </li><?php + if ($user->perms('is_admin')): + ?><li> + <a id="optionslink"<?php if ($do=='admin'): ?> class="active"<?php endif; ?> href="<?php echo Filters::noXSS(CreateURL('admin', 'prefs')); ?>" title="<?php echo Filters::noXSS(L('admintoolbox')); ?>"><i class="fa fa-gears fa-lg"></i></a> + </li><?php + endif; + ?><li> + <a id="logoutlink" href="<?php echo Filters::noXSS(CreateURL('logout', null)); ?>" + accesskey="l" title="<?php echo Filters::noXSS(L('logout')); ?>"><i class="fa fa-power-off fa-lg"></i></a> + </li><?php + if (isset($_SESSION['was_locked'])): + ?><li> + <span id="locked"><?php echo Filters::noXSS(L('accountwaslocked')); ?></span> + </li><?php + elseif (isset($_SESSION['login_attempts']) && $_SESSION['login_attempts'] > 0): + ?><li> + <span id="locked"><?php echo Filters::noXSS(sprintf(L('failedattempts'), $_SESSION['login_attempts'])); ?></span> + </li><?php + endif; + unset($_SESSION['login_attempts'], $_SESSION['was_locked']); + +endif; ?> +</ul> +</div><div id="pm-menu"> + <input id="pmmenu" type="checkbox"> + <label id="labelpmmenu" for="pmmenu"></label> + <ul id="pm-menu-list"><?php + if ( count($fs->projects) && $user->can_select_project($proj->id) ) { + ?><li class="first"> + <a id="toplevellink" + <?php if($do == 'toplevel'): ?> class="active" <?php endif; ?> + href="<?php echo Filters::noXSS(CreateURL('toplevel', $proj->id)); ?>"><?php echo Filters::noXSS(L('overview')); ?></a> + </li><?php + } + if( (!$user->isAnon() && $user->perms('view_tasks')) || ($user->isAnon() && $proj->id >0 && $proj->prefs['others_view'])): + ?><li> + <a id="homelink" + <?php if($do == 'index' && !(isset($_GET['dev']) && !$user->isAnon() && $_GET['dev'] == $user->id)): ?> class="active" <?php endif; ?> + href="<?php echo Filters::noXSS(CreateURL('tasklist', $proj->id)); ?>"><?php echo Filters::noXSS(L('tasklist')); ?></a> + </li><?php + endif; + if($proj->id && $user->perms('open_new_tasks')): + ?><li> + <a id="newtasklink" href="<?php echo Filters::noXSS(CreateURL('newtask', $proj->id)); ?>" + <?php if($do == 'newtask'): ?> class="active" <?php endif; ?> + accesskey="a"><?php echo Filters::noXSS(L('addnewtask')); ?></a> + </li><?php + if($proj->id && $user->perms('add_multiple_tasks')) : + ?><li> + <a id="newmultitaskslink" href="<?php echo Filters::noXSS(CreateURL('newmultitasks', $proj->id)); ?>" + <?php if($do == 'newmultitasks'): ?> class="active"<?php endif; ?>><?php echo Filters::noXSS(L('addmultipletasks')); ?></a> + </li><?php + endif; + elseif ($proj->id && $user->isAnon() && $proj->prefs['anon_open'] && $proj->prefs['project_is_active']): ?><li> + <a id="anonopen" + <?php if($do == 'newtask'): ?> class="active" <?php endif; ?> + href="?do=newtask&project=<?php echo Filters::noXSS($proj->id); ?>"><?php echo Filters::noXSS(L('opentaskanon')); ?></a> + </li><?php + endif; + if(!$user->isAnon()): ?><li> + <a id="mytaskslink" + <?php if($do == 'index' && isset($_GET['dev']) && $_GET['dev'] == $user->id): ?> class="active" <?php endif; ?> + href="<?php echo Filters::noXSS(CreateURL('mytasks', $proj->id, $user->id, null)); ?>"><?php echo Filters::noXSS(L('myassignedtasks')); ?></a> + </li><?php + endif; + if($user->perms('view_reports')): ?><li> + <a id="reportslink" + <?php if( $do == 'reports'): ?> class="active" <?php endif; ?> + href="<?php echo Filters::noXSS(CreateURL('reports', $proj->id)); ?>"><?php echo Filters::noXSS(L('reports')); ?></a> + </li><?php + endif; + if($proj->id && ($user->perms('view_roadmap') || ($user->isAnon() && $proj->prefs['others_viewroadmap'])) ): ?><li> + <a id="roadmaplink" + <?php if($do == 'roadmap'): ?> class="active" <?php endif; ?> + href="<?php echo Filters::noXSS(CreateURL('roadmap', $proj->id)); ?>"><?php echo Filters::noXSS(L('roadmap')); ?></a> + </li><?php + endif; + if(file_exists(BASEDIR . '/scripts/gantt.php') && $proj->id && $user->perms('view_roadmap')): ?><li> + <a id="gantt" + <?php if($do == 'gantt'): ?> class="active" <?php endif; ?> + href="<?php echo Filters::noXSS(CreateURL('gantt', $proj->id)); ?>" title="Gantt chart"><i class="fa fa-tasks fa-lg"></i></a> + </li><?php + endif; + if ($proj->id && $user->perms('manage_project')): ?><li> + <a id="projectslink"<?php if($do=='pm'): ?> class="active"<?php endif; ?> href="<?php echo Filters::noXSS(CreateURL('pm', 'prefs', $proj->id)); ?>"><?php echo Filters::noXSS(L('manageproject')); ?></a> + </li><?php + endif; + if ($proj->id && isset($pm_pendingreq_num) && $pm_pendingreq_num): + ?><li> + <a class="pendingreq attention" + href="<?php echo Filters::noXSS(CreateURL('pm', 'pendingreq', $proj->id)); ?>"><?php echo Filters::noXSS($pm_pendingreq_num); ?> <?php echo Filters::noXSS(L('pendingreq')); ?></a> + </li><?php + endif; + if ($user->perms('is_admin') && isset($admin_pendingreq_num) && $admin_pendingreq_num): + ?><li> + <a class="pendingreq attention" + href="<?php echo Filters::noXSS(CreateURL('admin', 'userrequest')); ?>"><?php echo Filters::noXSS($admin_pendingreq_num); ?> <?php echo Filters::noXSS(L('adminrequestswaiting')); ?></a> + </li><?php + endif; ?> + </ul> + <div id="pmcontrol"> + <div id="projectselector"><?php + # $fs->projects is filtered with can_select_project() for the current user/guest in index.php + if(count($fs->projects)>0): ?> + <form id="projectselectorform" action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> + <select name="project" onchange="document.getElementById('projectselectorform').submit()"> + <?php echo tpl_options(array_merge(array(0 => L('allprojects')), $fs->projects), $proj->id); ?> + </select> + <noscript><button type="submit"><?php echo Filters::noXSS(L('switch')); ?></button></noscript> + <input type="hidden" name="do" value="<?php echo Filters::noXSS($do); ?>" /> + <input type="hidden" value="1" name="switch" /> + <?php $check = array('area', 'id'); + if ($do == 'reports') { + $check = array_merge($check, array('open', 'close', 'edit', 'assign', 'repdate', 'comments', 'attachments', + 'related', 'notifications', 'reminders', 'within', 'duein', 'fromdate', 'todate')); + } + foreach ($check as $key): + if (Get::has($key)): ?> + <input type="hidden" name="<?php echo Filters::noXSS($key); ?>" value="<?php echo Filters::noXSS(Get::val($key)); ?>" /> + <?php endif; + endforeach; ?> + </form> + <?php endif; ?></div> + <div id="showtask"><?php + # $fs->projects is filtered with can_select_project() for the current user/guest in index.php + if(count($fs->projects)>0): ?> + <form action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> + <noscript><button type="submit"><?php echo Filters::noXSS(L('showtask')); ?> #</button></noscript> + <input id="task_id" name="show_task" class="text" type="text" size="10" accesskey="t" placeholder="<?php echo Filters::noXSS(L('showtask')); ?> #" /> + </form> + <?php endif; ?></div> + </div> +</div> diff --git a/themes/CleanFS/templates/loginbox.tpl b/themes/CleanFS/templates/loginbox.tpl new file mode 100644 index 0000000..e6df4fb --- /dev/null +++ b/themes/CleanFS/templates/loginbox.tpl @@ -0,0 +1,45 @@ +<form id="login" action="<?php echo Filters::noXSS($baseurl); ?>index.php?do=authenticate" method="post"> +<div id="login_input"> + <input placeholder="<?php echo Filters::noXSS(L('username')); ?>" class="text" type="text" id="lbl_user_name" name="user_name" size="17" maxlength="32" /> + <input placeholder="<?php echo Filters::noXSS(L('password')); ?>" class="password" type="password" id="lbl_password" name="password" size="17" maxlength="100" /> + <label for="lbl_remember"><?php echo Filters::noXSS(L('rememberme')); ?></label> + <input type="checkbox" id="lbl_remember" name="remember_login" /> + <input type="hidden" name="return_to" value="<?php echo Filters::noXSS($_SERVER['REQUEST_URI']); ?>" /> + <input type="submit" value="<?php echo Filters::noXSS(L('login')); ?>" name="login" id="login_button" /> +</div> +<div id="login_links"> + <?php $activeclass = ' class="active" '; ?> + <?php if ($user->isAnon() && $fs->prefs['anon_reg'] && !$fs->prefs['only_oauth_reg']): ?> + <a id="registerlink" + <?php if(isset($_GET['do']) and $_GET['do'] == 'register') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('register','')); ?>"><?php echo Filters::noXSS(L('register')); ?></a> + <?php endif; ?> + <?php if ($user->isAnon() && !$fs->prefs['disable_lostpw']): ?> + <?php if ($user->isAnon() && $fs->prefs['user_notify']): ?> + <a id="forgotlink" + <?php if(isset($_GET['do']) and $_GET['do'] == 'lostpw') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('lostpw','')); ?>"><?php echo Filters::noXSS(L('lostpassword')); ?></a> + <?php else: ?> + <a id="forgotlink" href="mailto:<?php echo Filters::noXSS(implode(',', $admin_emails)); ?>?subject=<?php echo Filters::noXSS(rawurlencode(L('lostpwforfs'))); ?>&body=<?php echo Filters::noXSS(rawurlencode(L('lostpwmsg1'))); ?><?php echo Filters::noXSS($baseurl); ?><?php echo Filters::noXSS(rawurlencode(L('lostpwmsg2'))); ?><?php + if(isset($_SESSION['failed_login'])): + ?><?php echo Filters::noXSS(rawurlencode($_SESSION['failed_login'])); ?><?php + else: + ?><<?php echo Filters::noXSS(rawurlencode(L('yourusername'))); ?>><?php + endif; + ?><?php echo Filters::noXSS(rawurlencode(L('regards'))); ?>"><?php echo Filters::noXSS(L('lostpassword')); ?></a> + <script type="text/javascript">var link = document.getElementById('forgotlink');link.href=link.href.replace(/#/g,"@");</script> + <?php endif; ?> + <?php endif; ?> +</div> +<?php $return = '&return_to=' . base64_encode($_SERVER['REQUEST_URI']);?> +<div id="login_oauth"> + <?php + if ($fs->prefs['active_oauths']): + $providers = explode(' ', $fs->prefs['active_oauths']); + foreach($providers as $provider): ?> + <a class="btn-<?php echo $provider; ?>" href="index.php?do=oauth&provider=<?php echo $provider . $return; ?>"> + <i class="fa fa-<?php echo $provider; ?>"></i> <?php echo Filters::noXSS(sprintf(L('signinwith'), ucfirst($provider))); ?> + </a> + <?php endforeach; endif;?> +</div> +</form> diff --git a/themes/CleanFS/templates/lostpw.step1.tpl b/themes/CleanFS/templates/lostpw.step1.tpl new file mode 100644 index 0000000..cbc35a2 --- /dev/null +++ b/themes/CleanFS/templates/lostpw.step1.tpl @@ -0,0 +1,11 @@ +<h3><?php echo Filters::noXSS(L('lostpw')); ?></h3> +<div class="box"> + <p><?php echo Filters::noXSS(L('lostpwexplain')); ?></p> + <?php echo tpl_form(Filters::noXSS(createUrl('lostpw'))); ?> + <p><b><?php echo Filters::noXSS(L('username')); ?></b> + <input type="hidden" name="action" value="lostpw.sendmagic" /> + <input class="text" type="text" value="<?php echo Filters::noXSS(Req::val('user_name')); ?>" name="user_name" size="20" maxlength="32" /> + <button type="submit"><?php echo Filters::noXSS(L('sendlink')); ?></button> + </p> + </form> +</div> diff --git a/themes/CleanFS/templates/lostpw.step2.tpl b/themes/CleanFS/templates/lostpw.step2.tpl new file mode 100644 index 0000000..2495747 --- /dev/null +++ b/themes/CleanFS/templates/lostpw.step2.tpl @@ -0,0 +1,23 @@ +<h3><?php echo Filters::noXSS(L('changepass')); ?></h3> +<div class="box"> + <?php echo tpl_form(Filters::noXSS(CreateUrl('lostpw'))); ?> + <ul class="form_elements wide"> + <li> + <label for="pass1"><?php echo Filters::noXSS(L('changepass')); ?></label> + <input class="password" id="pass1" type="password" value="<?php echo Filters::noXSS(Req::val('pass1')); ?>" name="pass1" size="20" /> + </li> +<?php if($fs->prefs['repeat_password']): ?> + <li> + <label for="pass2"><?php echo Filters::noXSS(L('confirmpass')); ?></label> + <input class="password" id="pass2" type="password" value="<?php echo Filters::noXSS(Req::val('pass2')); ?>" name="pass2" size="20" /> + </li> + </ul> +<?php endif;?> + <div> + <input type="hidden" name="action" value="lostpw.chpass" /> + <input type="hidden" name="magic_url" value="<?php echo Filters::noXSS(Req::val('magic_url')); ?>" /> + <button type="submit"><?php echo Filters::noXSS(L('savenewpass')); ?></button> + </div> + </form> +</div> + diff --git a/themes/CleanFS/templates/myprofile.tpl b/themes/CleanFS/templates/myprofile.tpl new file mode 100644 index 0000000..5118dcb --- /dev/null +++ b/themes/CleanFS/templates/myprofile.tpl @@ -0,0 +1,40 @@ +<div class="box"><h3><?= eL('editmydetails') ?></h3> +<ul class="form_elements"> +<li title="<?= eL('usernamenotchangeable') ?>"> +<label><?= eL('username') ?></label> +<input type="text" style="border:none;background:none;width:auto;" disabled="disabled" value="<?= $user->infos['user_name'] ?>" /> +</li> +</ul> +<?php $this->display('common.profile.tpl'); ?> +</div> +<div class="box"><h3><?= L('myvotes') ?></h3> +<?php if(count($votes)>0): ?> +<table id="myvotes"> +<thead> +<tr> +<th><?= eL('project') ?></th> +<th><?= eL('task') ?></th> +<th><?= eL('removevote') ?></th> +</tr> +</thead> +<tbody> +<?php foreach($votes as $vote): ?> +<tr<?php echo $vote['is_closed'] ? ' class="closed"':''; ?>> +<td><?php echo $vote['project_title']; ?></td> +<td><?php echo tpl_tasklink($vote); ?></td> +<td><?php echo tpl_form(Filters::noXSS(createURL('myprofile', $vote['task_id'])));?> +<input type="hidden" name="action" value="removevote" /> +<input type="hidden" name="task_id" value="<?php echo $vote['task_id']?>" /> +<button type="submit" title="<?php echo eL('removevote'); ?>"><span class="fa fa-trash"></span></button> +</form></td> +<td></td> +</tr> +<?php endforeach; ?> +</tbody> +</table> +<?php else: + echo eL('novotes'); +endif; ?> +</div> +<div class="box"><h3><?php echo eL('permissionsforproject').' '.$proj->prefs['project_title']; ?></h3><?php echo tpl_draw_perms($user->perms); ?></div> +<div class="clear"></div> diff --git a/themes/CleanFS/templates/newmultitasks.tpl b/themes/CleanFS/templates/newmultitasks.tpl new file mode 100644 index 0000000..d8126f5 --- /dev/null +++ b/themes/CleanFS/templates/newmultitasks.tpl @@ -0,0 +1,261 @@ +<?php + if (!isset($supertask_id)) { + $supertask_id = 0; + } + $field_num = 3; +?> +<!-- Grab fields wanted for this project so we can only show those we want --> +<?php $fields = explode( ' ', $proj->prefs['visible_fields'] ); ?> + +<div id="intromessage"><?php echo L('hintforbulkimport'); ?></div> +<?php echo tpl_form(Filters::noXSS(CreateUrl('newmultitasks', $proj->id, $supertask_id))); ?> + <input type="hidden" name="supertask_id" value="<?php echo Filters::noXSS($supertask_id); ?>" /> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <input type="hidden" name="action" value="newmultitasks.newmultitasks" /> + <button class="button" accesskey="f" type="button" onClick="Apply()"><?php echo L('applyfirstline'); ?></button> + <table class="list"> + <thead> + <tr> + <th></th> + <?php if (in_array('tasktype', $fields)) { ?><th><?php echo Filters::noXSS(L('tasktype')); ?></th><?php $field_num++;} ?> + <?php if (in_array('category', $fields)) { ?><th><?php echo Filters::noXSS(L('category')); ?></th><?php $field_num++;} ?> + <?php if (in_array('status', $fields)) { ?><th><?php echo Filters::noXSS(L('status')); ?></th><?php $field_num++;} ?> + <?php if (in_array('os', $fields)) { ?><th><?php echo Filters::noXSS(L('operatingsystem')); ?></th><?php $field_num++;} ?> + <?php if (in_array('severity', $fields)) { ?><th><?php echo Filters::noXSS(L('severity')); ?></th><?php $field_num++;} ?> + <?php if (in_array('priority', $fields)) { ?><th><?php echo Filters::noXSS(L('priority')); ?></th><?php $field_num++;} ?> + <?php if (in_array('reportedin', $fields)) { ?><th><?php echo Filters::noXSS(L('reportedversion')); ?></th><?php $field_num++;} ?> + <?php if (in_array('dueversion', $fields)) { ?><th><?php echo Filters::noXSS(L('dueinversion')); ?></th><?php $field_num++;} ?> + <?php if ($user->perms('modify_all_tasks')): ?><?php if (in_array('assignedto', $fields)) { ?><th><?php echo Filters::noXSS(L('assignedto')); ?></th><?php $field_num++;} ?><?php endif; ?> + <th><?php echo Filters::noXSS(L('summary')); ?></th> + <th><?php echo Filters::noXSS(L('details')); ?></th> + </tr> + </thead> + <tbody id="table"> + <tr id="row"> + <td><button class="button img delete" accesskey="s" type="button" onClick="removeRow(this);return false;"></button></td> + <?php if (in_array('tasktype', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select name="task_type[]" id="tasktype"> + <?php echo tpl_options($proj->listTaskTypes(), Req::val('task_type')); ?> + + </select> + </td> + + <!-- Category--> + <?php if (in_array('category', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select class="adminlist" name="product_category[]" id="category"> + <?php echo tpl_options($proj->listCategories(), Req::val('product_category')); ?> + + </select> + </td> + + <!-- Status--> + <?php if (in_array('status', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select id="status" name="item_status[]" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')); ?>> + <?php echo tpl_options($proj->listTaskStatuses(), Req::val('item_status', ($user->perms('modify_all_tasks') ? STATUS_NEW : STATUS_UNCONFIRMED))); ?> + </select> + </td> + + <!-- OS--> + <?php if (in_array('os', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select id="os" name="operating_system[]"> + <?php echo tpl_options($proj->listOs(), Req::val('operating_system')); ?> + + </select> + </td> + + <!-- Severity--> + <?php if (in_array('severity', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select id="severity" class="adminlist" name="task_severity[]"> + <?php echo tpl_options($fs->severities, Req::val('task_severity', 2)); ?> + + </select> + </td> + + <!-- Priority--> + <?php if (in_array('priority', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select id="priority" name="task_priority[]" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')); ?>> + <?php echo tpl_options($fs->priorities, Req::val('task_priority', 4)); ?> + </select> + </td> + + <!-- Reported Version--> + <?php if (in_array('reportedin', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select class="adminlist" name="product_version[]" id="reportedver"> + <?php echo tpl_options($proj->listVersions(false, 2), Req::val('product_version')); ?> + + </select> + </td> + + <!-- Due Version --> + <?php if (in_array('dueversion', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } ?> + <select id="dueversion" name="closedby_version[]" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')); ?>> + <option value="0"><?php echo Filters::noXSS(L('undecided')); ?></option> + <?php echo tpl_options($proj->listVersions(false, 3),$proj->prefs['default_due_version'], false); ?> + </select> + </td> + + <!-- Assigned To --> + <?php if ($user->perms('modify_all_tasks')){ ?><?php if (in_array('assignedto', $fields)) { ?> + <td> + <?php } else { ?> + <td style="display:none"> + <?php } echo tpl_userselect('assigned_to[0]', Req::val('assigned_to[0]'), 'find_user_0'); ?> + </td> + <?php } ?> + <td> + <input type="text" class="text" size="30" id="summary" name="item_summary[]" onPaste="pasteMultiLines(this, event);return false"/> + </td> + <td> + <input type="text" class="text" size="20" id="details" name="detailed_desc[]" onkeydown="return TabandCreate(this, event);" onPaste="pasteMultiLines(this, event);return false"/> + </td> + </tr> + + <tr> + <td class="buttons" colspan="<?php echo $field_num; ?>"> + <button class="button" accesskey="a" type="button" onClick="createRow('','')"><?php echo L('addmorerows'); ?></button> + <button class="button positive" accesskey="s" type="submit"><?php echo L('addtasks'); ?></button> + </td> + </tr> + </tbody> + </table> + <script type="text/javascript"> + + var index = 0; + function createRow(summary, details) + { + index++; + var table = document.getElementById("table"); + var rows = table.getElementsByTagName("tr"); + var clone = rows[0].cloneNode(true); + + var tds = clone.getElementsByTagName("td"); + var length = tds.length; + tds[length-2].getElementsByTagName("input")[0].value = summary; + tds[length-1].getElementsByTagName("input")[0].value = details; + tds[length-3].getElementsByTagName("input")[0].value = ""; + tds[length-3].getElementsByTagName("script")[0].innerHTML = ""; + var res = tds[length-3].innerHTML.replace(/assigned_to\[0\]/g, "assigned_to[" + index + "]"); + res = res.replace(/find_user_0/g, "find_user_" + index); + tds[length-3].innerHTML = res; + table.insertBefore(clone, table.lastElementChild); + showstuff("assigned_to[" + index + "]_complete"); + new Ajax.Autocompleter(tds[length-3].getElementsByTagName("input")[0].id, tds[length-3].getElementsByTagName("span")[0].id, "<?php echo Filters::noXSS($baseurl); ?>js/callbacks/usersearch.php", null); + } + function removeRow(elem) + { + var table = document.getElementById("table"); + var rows = table.getElementsByTagName("tr"); + var length = rows.length; + if(length <= 2) + return false; + for(var i = 0; i < length -1; i++) + { + if(rows[i] == elem.parentNode.parentNode) { + table.deleteRow(i); + break; + } + } + } + function pasteMultiLines(elem, e) + { + + if(e && e.clipboardData && e.clipboardData.getData) { + var strs = e.clipboardData.getData("text/plain").split("\n"); + var table = document.getElementById("table"); + var rows = table.getElementsByTagName("tr"); + for(var i = 0; i < rows.length-1; i++) + { + if(rows[i] == elem.parentNode.parentNode) + break; + } + var index; + if(elem.id == "summary") + index = 2; + else + index = 1; + var k = 0; + for(var j = i; j < rows.length-1 && k < strs.length; j++, k++) + { + var tds = rows[j].getElementsByTagName("td"); + var length = tds.length; + tds[length-index].getElementsByTagName("input")[0].value = strs[k]; + } + for(; k < strs.length; k++) + { + if(index == 2) + createRow(strs[k], ""); + else + createRow("", strs[k]); + } + } + } + function Apply() + { + var table = document.getElementById("table"); + var rows = table.getElementsByTagName("tr"); + var fields = rows[0].getElementsByTagName("td"); + for(var i = 1; i < rows.length-1; i++) + { + var tds = rows[i].getElementsByTagName("td"); + for(var j = 1; j < tds.length; j++) + { + var input = tds[j].getElementsByTagName("input"); + var select = tds[j].getElementsByTagName("select"); + if(input != null && input.length > 0) + { + input[0].value = fields[j].getElementsByTagName("input")[0].value; + } + if(select != null && select.length > 0) + { + select[0].value = fields[j].getElementsByTagName("select")[0].value; + } + } + } + } + function TabandCreate(elem, e) + { + if(e.keyCode != 9) + return true; + var table = document.getElementById("table"); + var rows = table.getElementsByTagName("tr"); + var length = rows.length; + var parent = elem.parentNode.parentNode; + if(parent == rows[length-2]) + createRow('',''); + parent.nextElementSibling.getElementsByTagName("input")[1].focus(); + return false; + } + </script> +</form> diff --git a/themes/CleanFS/templates/newtask.tpl b/themes/CleanFS/templates/newtask.tpl new file mode 100644 index 0000000..a09e423 --- /dev/null +++ b/themes/CleanFS/templates/newtask.tpl @@ -0,0 +1,268 @@ +<!--<h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> :: <?= eL('newtask') ?></h3>--> +<?php + if (!isset($supertask_id)) { + $supertask_id = 0; + } +?> + <script type="text/javascript"> + function checkContent() + { + var instance; + for(instance in CKEDITOR.instances){ + CKEDITOR.instances[instance].updateElement(); + } + var summary = document.getElementById("itemsummary").value; + if(summary.trim().length == 0){ + return true; + } + var detail = document.getElementById("details").value; + var project_id = document.getElementsByName('project_id')[0].value; + + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open("POST", "<?php echo Filters::noXSS($baseurl); ?>js/callbacks/searchtask.php", false); + xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); + xmlHttp.send("summary=" + summary + "&detail=" + detail +"&project_id=" + project_id); + if(xmlHttp.status === 200) { + if(xmlHttp.responseText > 0) { + var res = confirm("There is already a similar task, do you still want to create?"); + return res; + } + return true; + } + return false; + } + </script> +<?php echo tpl_form(Filters::noXSS(createUrl('newtask', $proj->id, $supertask_id)), 'newtask', 'post', 'multipart/form-data', 'onsubmit="return checkContent()"'); ?> + <input type="hidden" name="supertask_id" value="<?php echo Filters::noXSS($supertask_id); ?>" /> + <div id="actionbar"><div class="clear"></div></div> + <?php + # Grab fields wanted for this project so we can only show those we want + $fields = explode( ' ', $proj->prefs['visible_fields'] ); + ?> + <div id="taskdetails"> + <div id="taskfields"> + <ul class="form_elements slim"> + <!-- Task Type --> + <?php if (in_array('tasktype', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="tasktype"><?= eL('tasktype') ?></label> + <select name="task_type" id="tasktype"> + <?php echo tpl_options($proj->listTaskTypes(), Req::val('task_type')); ?> + </select> + </li> + + <!-- Category --> + <?php if (in_array('category', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="category"><?= eL('category') ?></label> + <select class="adminlist" name="product_category" id="category"> + <?php echo tpl_options($proj->listCategories(), Req::val('product_category')); ?> + </select> + </li> + + <!-- Status --> + <?php if (in_array('status', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="status"><?= eL('status') ?></label> + <select id="status" name="item_status" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')); ?>> + <?php echo tpl_options($proj->listTaskStatuses(), Req::val('item_status', ($user->perms('modify_all_tasks') ? STATUS_NEW : STATUS_UNCONFIRMED))); ?> + </select> + </li> + + <?php if ($user->perms('modify_all_tasks')): ?> + <!-- Assigned To --> + <?php if (in_array('assignedto', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label><?= eL('assignedto') ?></label> + <?php if ($user->perms('modify_all_tasks')): ?> + <?php $this->display('common.multiuserselect.tpl'); ?> + <?php endif; ?> + </li> + <?php endif; ?> + + <!-- os --> + <?php if (in_array('os', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="os"><?= eL('operatingsystem') ?></label> + <select id="os" name="operating_system"> + <?php echo tpl_options($proj->listOs(), Req::val('operating_system')); ?> + </select> + </li> + + <!-- Severity --> + <?php if (in_array('severity', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="severity"><?= eL('severity') ?></label> + <select onchange="getElementById('edit_summary').className = 'summary severity' + this.value; + getElementById('itemsummary').className = 'text severity' + this.value;" + id="severity" class="adminlist" name="task_severity"> + <?php echo tpl_options($fs->severities, Req::val('task_severity', 2)); ?> + </select> + </li> + + <!-- Priority--> + <?php if (in_array('priority', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="priority"><?= eL('priority') ?></label> + <select id="priority" name="task_priority" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')); ?>> + <?php echo tpl_options($fs->priorities, Req::val('task_priority', 4)); ?> + </select> + </li> + + <!-- Reported Version--> + <?php if (in_array('reportedin', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="reportedver"><?= eL('reportedversion') ?></label> + <select class="adminlist" name="product_version" id="reportedver"> + <?php echo tpl_options($proj->listVersions(false, 2), Req::val('product_version')); ?> + </select> + </li> + + <!-- Due Version --> + <?php if (in_array('dueversion', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="dueversion"><?= eL('dueinversion') ?></label> + <select id="dueversion" name="closedby_version" <?php echo tpl_disableif(!$user->perms('modify_all_tasks')); ?>> + <option value="0"><?= eL('undecided') ?></option> + <?php echo tpl_options($proj->listVersions(false, 3),$proj->prefs['default_due_version'], false); ?> + </select> + </li> + + <?php if ($user->perms('modify_all_tasks')): ?> + <!-- Due Date --> + <?php if (in_array('duedate', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="due_date"><?= eL('duedate') ?></label> + <?php echo tpl_datepicker('due_date', '', Req::val('due_date')); ?> + </li> + <?php endif; ?> + + <?php if($proj->prefs['use_effort_tracking']) { + if ($user->perms('view_effort')) { + ?> + <li> + <label for="estimatedeffort"><?= eL('estimatedeffort') ?></label> + <input id="estimated_effort" name="estimated_effort" class="text" type="text" size="5" maxlength="100" value="0" /> + <?= eL('hours') ?> + </li> + <?php } + } ?> + + <?php if ($user->perms('manage_project')): ?> + <!-- Private --> + <?php if (in_array('private', $fields)) { ?> + <li> + <?php } else { ?> + <li style="display:none"> + <?php } ?> + <label for="private"><?= eL('private') ?></label> + <?php echo tpl_checkbox('mark_private', Req::val('mark_private', 0), 'private'); ?> + </li> + <?php endif; ?> + </ul> + </div> + + <div id="taskdetailsfull"> + <!--<h3 class="taskdesc"><?= eL('details') ?></h3>--> + <label class="severity<?php echo Filters::noXSS(Req::val('task_severity', 2)); ?> summary" id="edit_summary" for="itemsummary"><?php echo Filters::noXSS(L('summary')); ?></label> + <input id="itemsummary" required="required" placeholder="<?= eL('summary') ?>" title="<?= eL('tooltipshorttasktitle') ?>" type="text" value="<?php echo Filters::noXSS(Req::val('item_summary')); ?>" + name="item_summary" maxlength="100" /> + <div id="edit_tags"> + <label for="tags" title="<?= eL('tagsinfo') ?>"><?= eL('tags') ?>:</label> + <input id="tags" title="<?= eL('tagsinfo') ?>" class="text" type="text" + value="<?php echo Filters::noXSS(Req::val('tags')); ?>" name="tags" maxlength="100" /> + </div> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <button tabindex="9" type="button" onclick="showPreview('details', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('detailed_desc', 15, 70, array('id' => 'details'), Req::val('detailed_desc', $proj->prefs['default_task'])); ?> + + <p class="buttons"> + <?php if ($user->isAnon()): ?> + <label class="inline" for="anon_email"><?= eL('youremail') ?></label><input type="text" class="text" id="anon_email" name="anon_email" size="30" required="required" value="<?php echo Filters::noXSS(Req::val('anon_email')); ?>" /><br /> + <?php endif; ?> + <?php if (!$user->perms('modify_all_tasks')): ?> + <input type="hidden" name="item_status" value="1" /> + <input type="hidden" name="task_priority" value="2" /> + <?php endif; ?> + <input type="hidden" name="action" value="newtask.newtask" /> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <?php if (!$user->isAnon()): ?> + <input class="text" type="checkbox" id="notifyme" name="notifyme" + value="1" checked="checked" /> <label class="inline left" for="notifyme"><?= eL('notifyme') ?></label> + <?php endif; ?> + </p> + + <?php if ($user->perms('create_attachments')): ?> + <div id="uploadfilebox"> + <span style="display: none"><?php // this span is shown/copied in javascript when adding files ?> + <input tabindex="5" class="file" type="file" size="55" name="userfile[]" /> + <a href="javascript://" tabindex="6" onclick="removeUploadField(this, 'uploadfilebox');"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + <noscript> + <span> + <input tabindex="5" class="file" type="file" size="55" name="userfile[]" /> + <a href="javascript://" tabindex="6" onclick="removeUploadField(this, 'uploadfilebox');"><?php echo Filters::noXSS(L('remove')); ?></a><br /> + </span> + </noscript> + </div> + <button id="uploadfilebox_attachafile" tabindex="7" type="button" onclick="addUploadFields('uploadfilebox')"> + <?= eL('uploadafile') ?> (<?= eL('max') ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?= eL('MiB') ?>) + </button> + <button id="uploadfilebox_attachanotherfile" tabindex="7" style="display: none" type="button" onclick="addUploadFields('uploadfilebox')"> + <?= eL('attachanotherfile') ?> (<?= eL('max') ?> <?php echo Filters::noXSS($fs->max_file_size); ?> <?= eL('MiB') ?>) + </button> + + <div id="addlinkbox"> + <span style="display: none"> + <input tabindex="8" class="text" type="text" size="28" maxlength="100" name="userlink[]" /> + <a href="javascript://" tabindex="9" onclick="removeLinkField(this, 'addlinkbox');"><?= eL('remove') ?></a><br /> + </span> + <noscript> + <span> + <input tabindex="8" class="text" type="text" size="28" maxlength="100" name="userlink[]" /> + <a href="javascript://" tabindex="9" onclick="removeLinkField(this, 'addlinkbox');"><?= eL('remove') ?></a><br /> + </span> + </noscript> +</div> +<button id="addlinkbox_addalink" tabindex="10" type="button" onclick="addLinkField('addlinkbox')"><?= eL('addalink') ?></button> +<button id="addlinkbox_addanotherlink" tabindex="10" style="display:none" type="button" onclick="addLinkField('addlinkbox')"><?= eL('addanotherlink') ?></button> + <?php endif; ?> + +<button class="button positive" style="display:block;margin-top:20px" accesskey="s" type="submit"><?= eL('addthistask') ?></button> + </div> + + <div class="clear"></div> + </div> +</form> diff --git a/themes/CleanFS/templates/permicons.tpl b/themes/CleanFS/templates/permicons.tpl new file mode 100644 index 0000000..7e3d869 --- /dev/null +++ b/themes/CleanFS/templates/permicons.tpl @@ -0,0 +1,30 @@ +<?php +$permicons=array( +'view_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_groups_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_own_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_roadmap'=>'<span class="fa fa-stack"><i class="fa fa-road fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_history'=>'<span class="fa fa-stack"><i class="fa fa-history fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_reports'=>'<span class="fa fa-stack"><i class="fa fa-line-chart fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_estimated_effort'=>'<span class="fa fa-stack"><i class="fa fa-clock-o fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_current_effort_done'=>'<span class="fa fa-stack"><i class="fa fa-clock-o fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'track_effort'=>'<span class="fa fa-stack"><i class="fa fa-clock-o fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'open_new_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-plus fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'add_multiple_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-plus fa-stack" style="padding-top:8px;padding-top:8px;"></i></span>', +'modify_own_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-pencil fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'modify_all_tasks'=>'<span class="fa fa-stack"><i class="fa fa-tasks fa-stack-2x"></i><i class="fa fa-pencil fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'close_own_tasks'=>'<i class="fa fa-check fa-lg"></i>', +'close_other_tasks'=>'<i class="fa fa-check fa-lg"></i>', +'create_attachments'=>'<span class="fa fa-stack"><i class="fa fa-paperclip fa-flip-horizontal fa-stack-2x"></i><i class="fa fa-plus fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'delete_attachments'=>'<span class="fa fa-stack"><i class="fa fa-paperclip fa-flip-horizontal fa-stack-2x"></i><i class="fa fa-remove fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'assign_to_self'=>'<span class="fa fa-stack"><i class="fa fa-hand-o-right fa-stack-2x"></i></span>', +'assign_others_to_self'=>'<span class="fa fa-stack"><i class="fa fa-hand-o-right fa-stack-2x"></i></span>', +'edit_assignments'=>'<span class="fa fa-stack"><i class="fa fa-hand-o-right fa-stack-2x"></i><i class="fa fa-pencil fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'add_votes'=>'<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i><i class="fa fa-plus fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'view_comments'=>'<span class="fa fa-stack"><i class="fa fa-comments fa-stack-2x"></i><i class="fa fa-eye fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'add_comments'=>'<span class="fa fa-stack"><i class="fa fa-comments fa-stack-2x"></i><i class="fa fa-plus fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'edit_comments'=>'<span class="fa fa-stack"><i class="fa fa-comments fa-stack-2x"></i><i class="fa fa-pencil fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'edit_own_comments'=>'<span class="fa fa-stack"><i class="fa fa-comments fa-stack-2x"></i><i class="fa fa-pencil fa-stack" style="padding-top:8px;padding-left:12px"></i></span>', +'delete_comments'=>'<span class="fa fa-stack"><i class="fa fa-comments fa-stack-2x"></i><i class="fa fa-remove fa-stack" style="padding-top:8px;padding-left:12px"></i></span>' +); +?> diff --git a/themes/CleanFS/templates/pm.cat.tpl b/themes/CleanFS/templates/pm.cat.tpl new file mode 100644 index 0000000..f629cd4 --- /dev/null +++ b/themes/CleanFS/templates/pm.cat.tpl @@ -0,0 +1,5 @@ +<?php $this->assign('sysrows', $proj->listCategories(0, false, true, false)); ?> +<div id="toolbox"> + <h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('catlisted')); ?></h3> + <?php $this->display('common.cat.tpl'); ?> +</div> diff --git a/themes/CleanFS/templates/pm.editgroup.tpl b/themes/CleanFS/templates/pm.editgroup.tpl new file mode 100644 index 0000000..39b00af --- /dev/null +++ b/themes/CleanFS/templates/pm.editgroup.tpl @@ -0,0 +1,4 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('pmtoolbox')); ?> :: <?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('editgroup')); ?></h3> + <?php $this->display('common.editgroup.tpl'); ?> +</div> diff --git a/themes/CleanFS/templates/pm.groups.tpl b/themes/CleanFS/templates/pm.groups.tpl new file mode 100644 index 0000000..2b250ef --- /dev/null +++ b/themes/CleanFS/templates/pm.groups.tpl @@ -0,0 +1,138 @@ +<div id="toolbox"> +<h2><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('groupmanage')); ?></h2> +<?php if ($user->perms('is_admin')): ?><a class="button" href="<?php echo CreateURL('admin', 'newuser', $proj->id); ?>"><i class="fa fa-user-plus fa-lg fa-fw"></i> <?php echo Filters::noXSS(L('newuser')); ?></a><?php endif; ?> +<a class="button" href="<?php echo Filters::noXSS(CreateURL('pm', 'newgroup', $proj->id)); ?>"><i class="fa fa-group fa-lg fa-fw"></i><?php echo Filters::noXSS(L('newgroup')); ?></a> + +<form style="display:inline-block" action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> +<label for="edit_user"><?php echo Filters::noXSS(L('edituser')); ?></label> +<?php echo tpl_userselect('user_name', '', 'edit_user'); ?> +<button type="submit"><?php echo Filters::noXSS(L('edit')); ?></button> +<input type="hidden" name="do" value="user" /> +<input type="hidden" name="project" value="<?php echo $proj->id; ?>" /> +</form> +<?php +# 'group_open 'is not relevant for project groups, so lets not add it here. +$perm_fields = array( +'is_admin', +'manage_project', +'view_tasks', +'view_groups_tasks', # TODO: What is the definition of "group's task" and how does it effect project views? +'view_own_tasks', # TODO: What is the definition of "own task" and how does it effect project views? +'open_new_tasks', +'add_multiple_tasks', +'modify_own_tasks', +'modify_all_tasks', +'create_attachments', +'delete_attachments', +'assign_to_self', +'assign_others_to_self', +'edit_assignments', +'close_own_tasks', +'close_other_tasks', +'view_roadmap', +'view_history', +'view_reports', +'add_votes', +'view_comments', +'add_comments', +'edit_comments', +'edit_own_comments', +'delete_comments', +'view_estimated_effort', +'view_current_effort_done', +'track_effort' +); + +$yesno = array( + '<td style="color:#ccc" title="'.eL('no').'">-</td>', + '<td title="'.eL('yes').'"><i class="good fa fa-check fa-lg"></i></td>' +); + +$merge=array_merge($groups,$globalgroups); + +$perms=array(); +$gmembers=''; +$gnames=''; +$gdesc=''; +$cols=''; +foreach ($merge as $group){ + $cols.='<col class="group g'.$group['group_id'].($group['project_id']==0?' globalgroup':'').($group['project_id']==0 && $group['group_open']==0?' inactive':'').'"></col>'; + $gmembers.='<td>'.$group['users'].'</td>'; + if($group['project_id']!=0) { + $gnames.='<td><a class="button" title="'.eL('editgroup').'" href="'.(CreateURL('editgroup', $group['group_id'], 'pm')).'">' + .Filters::noXSS($group['group_name']) + .'<i class="fa fa-pencil fa-lg fa-fw"></i></a></td>'; + } else { + $gnames.='<th title="'.eL('globalgroup').'">'.Filters::noXSS($group['group_name']).'</th>'; + } + $gdesc.='<td>'.Filters::noXSS($group['group_desc']).'</td>'; + foreach ($group as $key => $val) { + if (!is_numeric($key) && in_array($key, $perm_fields)) { + $perms[$key][]=$val; + } + } +} +?> +<style> +.perms {border-collapse:collapse;margin-top:20px;display:block;} +.perms tbody tr:hover {background-color:#eee;} +.perms td, .perms th{border:1px solid #999;} +.perms thead th, .perms thead td {text-align:center;} +.perms tbody th{text-align:right;} +.perms tbody td{width:100px;text-align:center;} +.perms tbody span i:first-child {color: #090;} +.group.globalgroup {background-color:#ddd;} +.group.globalgroup.inactive {background-color:#ccc;} +</style> +<table class="perms"> +<colgroup> +<col></col> +<?php echo $cols; ?> +</colgroup> +<thead> +<tr> +<th><?php echo L('groupmembers'); ?></th> +<?php echo $gmembers; ?> +</tr> +<tr> +<th><?php echo L('group'); ?></th> +<?php echo $gnames; ?> +</tr> +<tr> +<th><?php echo L('description'); ?></th> +<?php echo $gdesc; ?> +</tr> +</thead> +<tbody> +<?php foreach ($perm_fields as $p): ?> +<tr<?php +# TODO view_own_tasks +echo ( ($p=='view_tasks' || $p=='view_groups_tasks' || $p=='view_own_tasks') && $proj->prefs['others_view']) ? ' class="everybody"':''; +echo ($p=='view_roadmap' && $proj->prefs['others_viewroadmap']) ?' class="everybody"':''; +echo ($p=='open_new_tasks' && $proj->prefs['anon_open']) ? ' class="everybody"':''; +?>> +<th<?php echo ($p=='modify_own_tasks') ? ' title="Fields allowed to change: '.implode(', ', $proj->prefs['basic_fields']).'"':''; ?>><?php echo eL(str_replace('_', '', $p)); ?></th> +<?php +require_once('permicons.tpl'); +$i=0; + +foreach($perms[$p] as $val){ + if ($perms['is_admin'][$i]==1 && $val == 0){ + if(isset($permicons[$p])){ + echo '<td title="'.eL('yes').' - Permission granted because of is_admin">( '.$permicons[$p].' )</td>'; + }else{ + echo $yesno[1]; + } + } elseif($val==1 && isset($permicons[$p])){ + echo '<td>'.$permicons[$p].'</td>'; + } else{ + echo $yesno[$val]; + } + $i++; +} +?> +</tr> +<?php endforeach; ?> +</tbody> +</table> +</div> diff --git a/themes/CleanFS/templates/pm.menu.tpl b/themes/CleanFS/templates/pm.menu.tpl new file mode 100644 index 0000000..f239e10 --- /dev/null +++ b/themes/CleanFS/templates/pm.menu.tpl @@ -0,0 +1,34 @@ +<?php $activeclass = ' class="active" '; ?> + +<div id="toolboxmenu"> + <a id="projprefslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'prefs') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'prefs', $proj->id)); ?>"><?php echo Filters::noXSS(L('preferences')); ?></a> + <a id="projuglink" + <?php if(isset($_GET['area']) and ($_GET['area'] == 'groups' || $_GET['area'] == 'newgroup' || $_GET['area'] == 'editgroup') ) echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'groups', $proj->id)); ?>"><?php echo Filters::noXSS(L('usergroups')); ?></a> + <a id="projcatlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'cat') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'cat', $proj->id)); ?>"><?php echo Filters::noXSS(L('categories')); ?></a> + <a id="projttlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'tasktype') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'tasktype', $proj->id)); ?>"><?php echo Filters::noXSS(L('tasktypes')); ?></a> + <a id="projtglink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'tag') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'tag', $proj->id)); ?>"><i class="fa fa-tag"></i> <?php echo Filters::noXSS(L('tags')); ?></a> + <a id="projstatuslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'status') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'status', $proj->id)); ?>"><?php echo Filters::noXSS(L('taskstatuses')); ?></a> + <a id="projreslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'resolution') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'resolution', $proj->id)); ?>"><?php echo Filters::noXSS(L('resolutions')); ?></a> + <a id="projverlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'version') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'version', $proj->id)); ?>"><?php echo Filters::noXSS(L('versions')); ?></a> + <a id="projoslink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'os') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'os', $proj->id)); ?>"><i class="fa fa-linux"></i><i class="fa fa-windows"></i><i class="fa fa-apple"></i> <?php echo Filters::noXSS(L('operatingsystems')); ?></a> + <a id="projreqlink" + <?php if(isset($_GET['area']) and $_GET['area'] == 'pendingreq') echo $activeclass; ?> + href="<?php echo Filters::noXSS(CreateURL('pm', 'pendingreq', $proj->id)); ?>"><?php echo Filters::noXSS(L('pendingrequests')); ?></a> +</div> diff --git a/themes/CleanFS/templates/pm.newgroup.tpl b/themes/CleanFS/templates/pm.newgroup.tpl new file mode 100644 index 0000000..dac1c9a --- /dev/null +++ b/themes/CleanFS/templates/pm.newgroup.tpl @@ -0,0 +1,7 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('pmtoolbox')); ?> :: <?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('createnewgroup')); ?></h3> + + <?php + $this->display('common.newgroup.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/pm.os.tpl b/themes/CleanFS/templates/pm.os.tpl new file mode 100644 index 0000000..a2f2dc4 --- /dev/null +++ b/themes/CleanFS/templates/pm.os.tpl @@ -0,0 +1,12 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('oslisted')); ?></h3> +<?php +$this->assign('list_type', 'os'); +$this->assign('rows', $proj->listOs(true)); + +$systemwide = new Project(0); +$this->assign('sysrows', $systemwide->listOs(true)); + +$this->display('common.list.tpl'); +?> +</div> diff --git a/themes/CleanFS/templates/pm.pendingreq.tpl b/themes/CleanFS/templates/pm.pendingreq.tpl new file mode 100644 index 0000000..353dc3b --- /dev/null +++ b/themes/CleanFS/templates/pm.pendingreq.tpl @@ -0,0 +1,79 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('pendingrequests')); ?></h3> + + <?php if (!count($pendings)): ?> + <?php echo Filters::noXSS(L('nopendingreq')); ?> + + <?php else: ?> + <table class="requests"> + <tr> + <th><?php echo Filters::noXSS(L('eventdesc')); ?></th> + <th><?php echo Filters::noXSS(L('requestedby')); ?></th> + <th><?php echo Filters::noXSS(L('daterequested')); ?></th> + <th><?php echo Filters::noXSS(L('reasongiven')); ?></th> + <th class="pm-buttons"> </th> + </tr> + <?php foreach ($pendings as $req): ?> + <tr> + <td> + <?php if ($req['request_type'] == 1) : ?> + <?php echo Filters::noXSS(L('closetask')); ?> - + <a href="<?php echo Filters::noXSS(CreateURL('details', $req['task_id'])); ?>">FS#<?php echo Filters::noXSS($req['task_id']); ?> : + <?php echo Filters::noXSS($req['item_summary']); ?></a> + <?php elseif ($req['request_type'] == 2) : ?> + <?php echo Filters::noXSS(L('reopentask')); ?> - + <a href="<?php echo Filters::noXSS(CreateURL('details', $req['task_id'])); ?>">FS#<?php echo Filters::noXSS($req['task_id']); ?> : + <?php echo Filters::noXSS($req['item_summary']); ?></a> + <?php endif; ?> + </td> + <td><?php echo tpl_userlink($req['user_id']); ?></td> + <td><?php echo Filters::noXSS(formatDate($req['time_submitted'], true)); ?></td> + <td><?php echo Filters::noXSS($req['reason_given']); ?></td> + <td> + <?php if ($req['request_type'] == 1) : ?> + <a class="button" href="#" onclick="showhidestuff('closeform<?php echo Filters::noXSS($req['request_id']); ?>');"><?php echo Filters::noXSS(L('accept')); ?></a> + <div id="closeform<?php echo Filters::noXSS($req['request_id']); ?>" class="denyform"> + <?php echo tpl_form(Filters::noXSS(CreateURL('pm', 'pendingreq', $proj->id))); ?> + <div> + <input type="hidden" name="action" value="details.close"/> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($req['task_id']); ?>"/> + <select class="adminlist" name="resolution_reason" onmouseup="event.stopPropagation();"> + <option value="0"><?php echo Filters::noXSS(L('selectareason')); ?></option> + <?php echo tpl_options($proj->listResolutions(), Req::val('resolution_reason')); ?> + </select> + <button type="submit"><?php echo Filters::noXSS(L('closetask')); ?></button> + <br/> + <label class="default text" for="closure_comment"><?php echo Filters::noXSS(L('closurecomment')); ?></label> + <textarea class="text" id="closure_comment" name="closure_comment" rows="3" + cols="25"><?php echo Filters::noXSS(Req::val('closure_comment')); ?></textarea> + <label><?php echo tpl_checkbox('mark100', Req::val('mark100', !(Req::val('action') == 'details.close'))); ?> <?php echo Filters::noXSS(L('mark100')); ?></label> + </div> + </form> + </div> + <?php elseif ($req['request_type'] == 2) : ?> + <?php echo tpl_form(Filters::noXSS(CreateUrl('pm', 'pendingreq', $proj->id)), null, null, null, 'style="display:inline"'); ?> + <input type="hidden" name="action" value="reopen" /> + <input type="hidden" name="task_id" value="<?php echo Filters::noXSS($req['task_id']); ?>"> + <input type="submit" class="button" value="<?php echo Filters::noXSS(L('accept')); ?>"> + </form> + + <?php endif; ?> + <a href="#" class="button" onclick="showhidestuff('denyform<?php echo Filters::noXSS($req['request_id']); ?>');"><?php echo Filters::noXSS(L('deny')); ?></a> + <div id="denyform<?php echo Filters::noXSS($req['request_id']); ?>" class="denyform"> + <?php echo tpl_form(Filters::noXSS(CreateUrl('pm', 'pendingreq', $proj->id))); ?> + <div> + <input type="hidden" name="action" value="denypmreq" /> + <input type="hidden" name="req_id" value="<?php echo Filters::noXSS($req['request_id']); ?>" /> + <label for="deny_reason<?php echo Filters::noXSS($req['request_id']); ?>" class="inline"><?php echo Filters::noXSS(L('reasonfordeinal')); ?></label><br /> + <textarea cols="40" rows="5" name="deny_reason" id="deny_reason<?php echo Filters::noXSS($req['request_id']); ?>"></textarea> + <br /> + <button type="submit"><?php echo Filters::noXSS(L('deny')); ?></button> + </div> + </form> + </div> + </td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> +</div> diff --git a/themes/CleanFS/templates/pm.prefs.tpl b/themes/CleanFS/templates/pm.prefs.tpl new file mode 100644 index 0000000..6af32fa --- /dev/null +++ b/themes/CleanFS/templates/pm.prefs.tpl @@ -0,0 +1,370 @@ +<div id="toolbox"> +<h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('preferences')); ?></h3> +<?php echo tpl_form(CreateUrl('pm', 'prefs', $proj->id)); ?> + <ul id="submenu"> + <li><a href="#general"><?php echo Filters::noXSS(L('general')); ?></a></li> + <li><a href="#lookandfeel"><?php echo Filters::noXSS(L('lookandfeel')); ?></a></li> + <li><a href="#notifications"><?php echo Filters::noXSS(L('notifications')); ?></a></li> + <li><a href="#feeds"><?php echo Filters::noXSS(L('feeds')); ?></a></li> + <li><a href="#effort"><?php echo Filters::noXSS(L('efforttracking')); ?></a></li> + </ul> + + <div id="general" class="tab"> + <ul class="form_elements wide"> + <li> + <label for="projecttitle"><?php echo Filters::noXSS(L('projecttitle')); ?></label> + <input id="projecttitle" name="project_title" class="text" type="text" maxlength="100" + value="<?php echo Filters::noXSS(Post::val('project_title', $proj->prefs['project_title'])); ?>" /> + </li> + + <li> + <label for="defaultcatowner"><?php echo Filters::noXSS(L('defaultcatowner')); ?></label> + <?php echo tpl_userselect('default_cat_owner', Post::val('default_cat_owner', $proj->prefs['default_cat_owner']), 'defaultcatowner'); ?> + </li> + + <li> + <label for="langcode"><?php echo Filters::noXSS(L('language')); ?></label> + <select id="langcode" name="lang_code"> + <?php echo tpl_options(Flyspray::listLangs(), Post::val('lang_code', $proj->prefs['lang_code']), true); ?> + </select> + </li> + + <?php echo tpl_checkbox('disp_intro', Post::val('disp_intro', $proj->prefs['disp_intro']), 'disp_intro'); ?> + <label for="disp_intro"><?php echo Filters::noXSS(L('dispintro')); ?></label> + <li class="disp_introdep"> + <label class="labeltextarea" for="intromesg"><?php echo Filters::noXSS(L('intromessage')); ?></label> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview"></div> + <button tabindex="9" type="button" onclick="showPreview('intromesg', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('intro_message', 8, 70, array('accesskey' => 'r', 'tabindex' => 8, 'id' => 'intromesg'), Post::val('intro_message', $proj->prefs['intro_message'])); ?> + + <label class="labeltextarea"><?php echo Filters::noXSS(L('pagesintromsg')); ?></label> + <?php + $pages = array( + 'index' => L('tasklist'), + 'toplevel' => L('toplevel'), + 'newmultitasks' => L('addmultipletasks'), + 'details' => L('details'), + 'roadmap' => L('roadmap'), + 'newtask' => L('newtask'), + 'reports' => L('reports'), + 'depends' => L('dependencygraph'), + 'pm' => L('manageproject')); + $selectedPages = explode(' ', $proj->prefs['pages_intro_msg']); + echo tpl_double_select('pages_intro_msg', $pages, $selectedPages, false, false); + ?> + </li> + + <li> + <label class="labeltextarea" for="default_task"><?php echo Filters::noXSS(L('defaulttask')); ?></label> + <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?> + <div class="hide preview" id="preview_taskdesc"></div> + <button tabindex="9" type="button" onclick="showPreview('default_task', '<?php echo Filters::noJsXSS($baseurl); ?>', 'preview_taskdesc')"><?php echo Filters::noXSS(L('preview')); ?></button> + <?php endif; ?> + <?php echo TextFormatter::textarea('default_task', 8, 70, array('accesskey' => 'r', 'tabindex' => 8, 'id' => 'default_task'), Post::val('default_task', $proj->prefs['default_task'])); ?> + </li> + + <li> + <label for="isactive"><?php echo Filters::noXSS(L('isactive')); ?></label> + <?php echo tpl_checkbox('project_is_active', Post::val('project_is_active', $proj->prefs['project_is_active']), 'isactive'); ?> + </li> + + <li> + <label><?php echo tpl_checkbox('delete_project', null); ?> <?php echo Filters::noXSS(L('deleteproject')); ?></label> + <select name="move_to"><?php echo tpl_options(array_merge(array(0 => L('none')), Flyspray::listProjects()), null, false, null, (string) $proj->id); ?></select> + </li> + + <li> + <label for="othersviewroadmap"><?php echo Filters::noXSS(L('othersviewroadmap')); ?></label> + <?php + # note for FS1.0: This setting is currently also used as anon/public permission for: show project name, activity, stats, milestone progress + # but not listing tasks per milestone + echo tpl_checkbox('others_viewroadmap', Post::val('others_viewroadmap', $proj->prefs['others_viewroadmap']), 'othersviewroadmap'); ?> + </li> + + <li> + <label for="othersview"><?php echo Filters::noXSS(L('othersview')); ?></label> + <?php + # note for FS1.0: This setting is current anon/public task view permission for: listing tasks (toplevel, tasklist, roadmap, RSS feed, ..) + echo tpl_checkbox('others_view', Post::val('others_view', $proj->prefs['others_view']), 'othersview'); ?> + </li> + + <li> + <label for="anon_open"><?php echo Filters::noXSS(L('allowanonopentask')); ?></label> + <?php echo tpl_checkbox('anon_open', Post::val('anon_open', $proj->prefs['anon_open']), 'anon_open'); ?> + </li> + + <li> + <label for="comment_closed"><?php echo Filters::noXSS(L('allowclosedcomments')); ?></label> + <?php echo tpl_checkbox('comment_closed', Post::val('comment_closed', $proj->prefs['comment_closed']), 'comment_closed'); ?> + </li> + + <li> + <label for="auto_assign"><?php echo Filters::noXSS(L('autoassign')); ?></label> + <?php echo tpl_checkbox('auto_assign', Post::val('auto_assign', $proj->prefs['auto_assign']), 'auto_assign'); ?> + </li> + + <li> + <label for="defaultdueversion"><?php echo Filters::noXSS(L('defaultdueinversion')); ?></label> + <select id="defaultdueversion" name="default_due_version"> + <option value="0"><?php echo Filters::noXSS(L('undecided')); ?></option> + <?php echo tpl_options($proj->listVersions(false, 3), Post::val('default_due_version', $proj->prefs['default_due_version']), true); ?> + </select> + </li> + + <li> + <label for="freetagging"><?php echo Filters::noXSS(L('freetagging')); ?></label> + <?php echo tpl_checkbox('freetagging', Post::val('freetagging', $proj->prefs['freetagging']), 'freetagging'); ?> + </li> + </ul> + </div> + + <div id="lookandfeel" class="tab"> + <ul class="form_elements wide"> + <li> + <label for="themestyle"><?php echo Filters::noXSS(L('themestyle')); ?></label> + <select id="themestyle" name="theme_style"> + <?php echo tpl_options(Flyspray::listThemes(), Post::val('theme_style', $proj->prefs['theme_style']), true); ?> + </select> + <label for="customstyle" style="width:auto"><?php echo Filters::noXSS(L('customstyle')); ?></label> + <select id="customstyle" name="custom_style"> + <?php + $customs[]=array('', L('no')); + $customstyles=glob_compat(BASEDIR ."/themes/".($proj->prefs['theme_style'])."/custom_*.css"); + foreach ($customstyles as $cs){ + $customs[]=array($cs,$cs); + } + echo tpl_options($customs, $proj->prefs['custom_style']); + ?> + </select> + </li> + + <li> + <label for="default_entry"><?php echo Filters::noXSS(L('defaultentry')); ?></label> + <select id="default_entry" name="default_entry"> + <?php echo tpl_options(array('index' => L('tasklist'), 'toplevel' => L('toplevel'), 'roadmap' => L('roadmap')), Post::val('default_entry', $proj->prefs['default_entry'])); ?> + </select> + </li> + + <?php // Set the selectable column names + // Do NOT use real database column name here and in the next list, + // but a term from translation table entries instead, because it's + // also used elsewhere to draw a localized version of the name. + // Look also at the end of function + // tpl_draw_cell in scripts/index.php for further explanation. + $columnnames = array( + 'id' => L('id'), + 'project' => L('project'), + 'parent' => L('parent'), + 'tasktype' => L('tasktype'), + 'category' => L('category'), + 'severity' => L('severity'), + 'priority' => L('priority'), + 'summary' => L('summary'), + 'dateopened' => L('dateopened'), + 'status' => L('status'), + 'openedby' => L('openedby'), + 'private' => L('private'), + 'assignedto' => L('assignedto'), + 'lastedit' => L('lastedit'), + 'editedby' => L('editedby'), + 'reportedin' => L('reportedin'), + 'dueversion' => L('dueversion'), + 'duedate' => L('duedate'), + 'comments' => L('comments'), + 'attachments' => L('attachments'), + 'progress' => L('progress'), + 'dateclosed' => L('dateclosed'), + 'closedby' => L('closedby'), + 'os' => L('os'), + 'votes' => L('votes'), + 'estimatedeffort' => L('estimatedeffort'), + 'effort' => L('effort')); + $selectedcolumns = explode(' ', Post::val('visible_columns', $proj->prefs['visible_columns'])); + ?> + + <li> + <label for="default_order_by"><?php echo Filters::noXSS(L('defaultorderby')); ?></label> + <select id="default_order_by" name="default_order_by"> + <?php echo tpl_options($columnnames, $proj->prefs['sorting'][0]['field'], false); ?> + </select> + <!-- <label><?php echo Filters::noXSS(L('defaultorderbydirection')); ?></label> --> + <select id="default_order_by_dir" name="default_order_by_dir"> + <?php echo tpl_options(array('asc' => L('ascending'), 'desc' => L('descending')), $proj->prefs['sorting'][0]['dir'], false); ?> + </select> + </li> + + <li> + <label for="default_order_by2"><?php echo Filters::noXSS(L('defaultorderby2')); ?></label> + <select id="default_order_by2" name="default_order_by2"> + <?php echo tpl_options($columnnames, $proj->prefs['sorting'][1]['field'], false); ?> + </select> + <select id="default_order_by_dir2" name="default_order_by_dir2"> + <?php echo tpl_options(array('asc' => L('ascending'), 'desc' => L('descending')), $proj->prefs['sorting'][1]['dir'], false); ?> + </select> + </li> + + <li> + <label><?php echo Filters::noXSS(L('visiblecolumns')); ?></label> + <?php echo tpl_double_select('visible_columns', $columnnames, $selectedcolumns, false); ?> + </li> + + <li> + <label><?php echo Filters::noXSS(L('visiblefields')); ?></label> + <?php // Set the selectable field names + $fieldnames = array( + 'parent' => L('parent'), + 'tasktype' => L('tasktype'), + 'category' => L('category'), + 'severity' => L('severity'), + 'priority' => L('priority'), + 'status' => L('status'), + 'private' => L('private'), + 'assignedto' => L('assignedto'), + 'reportedin' => L('reportedin'), + 'dueversion' => L('dueversion'), + 'duedate' => L('duedate'), + 'progress' => L('progress'), + 'os' => L('os'), + 'votes' => L('votes')); + $selectedfields = explode(' ', Post::val('visible_fields', $proj->prefs['visible_fields'])); + ?> + <?php echo tpl_double_select('visible_fields', $fieldnames, $selectedfields, false); ?> + </li> + </ul> + </div> + + <div id="notifications" class="tab"> + <ul class="form_elements"> + <li> + <label for="notify_subject"><?php echo Filters::noXSS(L('notifysubject')); ?></label> + <input id="notify_subject" class="text" name="notify_subject" type="text" value="<?php echo Filters::noXSS(Post::val('notify_subject', $proj->prefs['notify_subject'])); ?>" /> + <br /><span class="note"><?php echo Filters::noXSS(L('notifysubjectinfo')); ?></span> + </li> + + <li> + <label for="emailaddress"><?php echo Filters::noXSS(L('emailaddress')); ?></label> + <input id="emailaddress" name="notify_email" class="text" type="text" value="<?php echo Filters::noXSS(Post::val('notify_email', $proj->prefs['notify_email'])); ?>" /> + </li> + + <?php if (!empty($fs->prefs['jabber_server'])): ?> + <li> + <label for="jabberid"><?php echo Filters::noXSS(L('jabberid')); ?></label> + <input id="jabberid" class="text" name="notify_jabber" type="text" value="<?php echo Filters::noXSS(Post::val('notify_jabber', $proj->prefs['notify_jabber'])); ?>" /> + </li> + <?php endif ?> + + <li> + <label for="notify_reply"><?php echo Filters::noXSS(L('replyto')); ?></label> + <input id="notify_reply" name="notify_reply" class="text" type="text" value="<?php echo Filters::noXSS(Post::val('notify_reply', $proj->prefs['notify_reply'])); ?>" /> + </li> + + <li> + <label for="notify_types"><?php echo Filters::noXSS(L('notifytypes')); ?></label> + <select id="notify_types" size="17" multiple="multiple" name="notify_types[]"> + <?php echo tpl_options(array(0 => L('none'), + NOTIFY_TASK_OPENED => L('taskopened'), + NOTIFY_TASK_CHANGED => L('pm.taskchanged'), + NOTIFY_TASK_CLOSED => L('taskclosed'), + NOTIFY_TASK_REOPENED => L('pm.taskreopened'), + NOTIFY_DEP_ADDED => L('pm.depadded'), + NOTIFY_DEP_REMOVED => L('pm.depremoved'), + NOTIFY_COMMENT_ADDED => L('commentadded'), + NOTIFY_ATT_ADDED => L('attachmentadded'), + NOTIFY_REL_ADDED => L('relatedadded'), + NOTIFY_OWNERSHIP => L('ownershiptaken'), + NOTIFY_PM_REQUEST => L('pmrequest'), + NOTIFY_PM_DENY_REQUEST => L('pmrequestdenied'), + NOTIFY_NEW_ASSIGNEE => L('newassignee'), + NOTIFY_REV_DEP => L('revdepadded'), + NOTIFY_REV_DEP_REMOVED => L('revdepaddedremoved'), + NOTIFY_ADDED_ASSIGNEES => L('assigneeadded')), + Post::val('notify_types', Flyspray::int_explode(' ', $proj->prefs['notify_types']))); ?> + </select> + </li> + </ul> + </div> + + <div id="feeds" class="tab"> + <ul class="form_elements"> + <li> + <label for="feed_description"><?php echo Filters::noXSS(L('feeddescription')); ?></label> + <input id="feed_description" class="text" name="feed_description" type="text" value="<?php echo Filters::noXSS(Post::val('feed_description', $proj->prefs['feed_description'])); ?>" /> + </li> + + <li> + <label for="feed_img_url"><?php echo Filters::noXSS(L('feedimgurl')); ?></label> + <input id="feed_img_url" class="text" name="feed_img_url" type="text" value="<?php echo Filters::noXSS(Post::val('feed_img_url', $proj->prefs['feed_img_url'])); ?>" /> + </li> + </ul> + </div> + + <div id="effort" class="tab"> + <ul class="form_elements"> + <li> + <label for="useeffort"><?php echo Filters::noXSS(L('useeffort')); ?></label> + <?php echo tpl_checkbox('use_effort_tracking', Post::val('use_effort_tracking', $proj->prefs['use_effort_tracking']), 'useeffort'); ?> + </li> + <li> + <label for="hours_per_manday"><?php echo Filters::noXSS(L('hourspermanday')); ?></label> + <input id="hours_per_manday" class="text" name="hours_per_manday" type="text" + value="<?php + $seconds = Post::val('hours_per_manday', $proj->prefs['hours_per_manday']); + // Post::val is in HH:mm format, $proj->prefs in seconds. + if (!preg_match('/^\d+$/', $seconds)) { + $seconds = effort::EditStringToSeconds($seconds, $proj->prefs['hours_per_manday'], effort::FORMAT_HOURS_COLON_MINUTES); + } + + echo Filters::noXSS(effort::SecondsToEditString($seconds,$proj->prefs['hours_per_manday'], effort::FORMAT_HOURS_COLON_MINUTES)); + ?>" /> + </li> + <li> + <label for="estimated_effort_format"><?php echo Filters::noXSS(L('estimatedeffortformat')); ?></label> + <select id="estimated_effort_format" name="estimated_effort_format"> + <?php echo tpl_options(array( + effort::FORMAT_HOURS_COLON_MINUTES => L('hourplural') . ':' . L('minuteplural'), + effort::FORMAT_HOURS_SPACE_MINUTES => L('hourplural') . ' ' . L('minuteplural'), + effort::FORMAT_HOURS_PLAIN => L('hourplural'), + effort::FORMAT_HOURS_ONE_DECIMAL => L('hourplural') . ' (' . L('onedecimal') . ')', + effort::FORMAT_MINUTES => L('minuteplural'), + effort::FORMAT_DAYS_PLAIN => L('mandays'), + effort::FORMAT_DAYS_ONE_DECIMAL => L('mandays') . ' (' . L('onedecimal') . ')', + effort::FORMAT_DAYS_PLAIN_HOURS_PLAIN => L('mandays') . ' ' . L('hourplural'), + effort::FORMAT_DAYS_PLAIN_HOURS_ONE_DECIMAL => L('mandays') . ' ' . L('hourplural') . ' (' . L('onedecimal') . ')', + effort::FORMAT_DAYS_PLAIN_HOURS_COLON_MINUTES => L('mandays') . ' ' . L('hourplural') . ":" . L('minuteplural'), + effort::FORMAT_DAYS_PLAIN_HOURS_SPACE_MINUTES => L('mandays') . ' ' . L('hourplural') . " " . L('minuteplural'), + ), + Post::val('estimated_effort_format', $proj->prefs['estimated_effort_format'])); ?> + </select> + </li> + <li> + <label for="current_effort_done_format"><?php echo Filters::noXSS(L('currenteffortdoneformat')); ?></label> + <select id="current_effort_done_format" name="current_effort_done_format"> + <?php echo tpl_options(array( + effort::FORMAT_HOURS_COLON_MINUTES => L('hourplural') . ':' . L('minuteplural'), + effort::FORMAT_HOURS_SPACE_MINUTES => L('hourplural') . ' ' . L('minuteplural'), + effort::FORMAT_HOURS_PLAIN => L('hourplural'), + effort::FORMAT_HOURS_ONE_DECIMAL => L('hourplural') . ' (' . L('onedecimal') . ')', + effort::FORMAT_MINUTES => L('minuteplural'), + effort::FORMAT_DAYS_PLAIN => L('mandays'), + effort::FORMAT_DAYS_ONE_DECIMAL => L('mandays') . ' (' . L('onedecimal') . ')', + effort::FORMAT_DAYS_PLAIN_HOURS_PLAIN => L('mandays') . ' ' . L('hourplural'), + effort::FORMAT_DAYS_PLAIN_HOURS_ONE_DECIMAL => L('mandays') . ' ' . L('hourplural') . ' (' . L('onedecimal') . ')', + effort::FORMAT_DAYS_PLAIN_HOURS_COLON_MINUTES => L('mandays') . ' ' . L('hourplural') . ":" . L('minuteplural'), + effort::FORMAT_DAYS_PLAIN_HOURS_SPACE_MINUTES => L('mandays') . ' ' . L('hourplural') . " " . L('minuteplural'), + ), + Post::val('current_effort_done_format', $proj->prefs['current_effort_done_format'])); ?> + </select> + </li> + </ul> + </div> + + <div class="tbuttons"> + <input type="hidden" name="action" value="pm.updateproject" /> + <input type="hidden" name="project_id" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <button type="submit" class="positive"><?php echo Filters::noXSS(L('saveoptions')); ?></button> + <button type="reset"><?php echo Filters::noXSS(L('resetoptions')); ?></button> + </div> +</form> +</div> diff --git a/themes/CleanFS/templates/pm.resolution.tpl b/themes/CleanFS/templates/pm.resolution.tpl new file mode 100644 index 0000000..451ef5a --- /dev/null +++ b/themes/CleanFS/templates/pm.resolution.tpl @@ -0,0 +1,12 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('resed')); ?></h3> +<?php +$this->assign('list_type', 'resolution'); +$this->assign('rows', $proj->listResolutions(true)); + +$systemwide = new Project(0); +$this->assign('sysrows', $systemwide->listResolutions(true)); + +$this->display('common.list.tpl'); +?> +</div> diff --git a/themes/CleanFS/templates/pm.status.tpl b/themes/CleanFS/templates/pm.status.tpl new file mode 100644 index 0000000..9c2263e --- /dev/null +++ b/themes/CleanFS/templates/pm.status.tpl @@ -0,0 +1,12 @@ +<div id="toolbox">
+ <h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('taskstatuses')); ?></h3>
+<?php
+$this->assign('list_type', 'status');
+$this->assign('rows', $proj->listTaskStatuses(true));
+
+$systemwide = new Project(0);
+$this->assign('sysrows', $systemwide->listTaskStatuses(true));
+
+$this->display('common.list.tpl');
+?>
+</div>
diff --git a/themes/CleanFS/templates/pm.tag.tpl b/themes/CleanFS/templates/pm.tag.tpl new file mode 100644 index 0000000..7ec3f2d --- /dev/null +++ b/themes/CleanFS/templates/pm.tag.tpl @@ -0,0 +1,14 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS(L('tags')); ?></h3> + <p>Tag management is in development.</p> + <p>Please see <a href="https://bugs.flyspray.org/2012" target="_blank">bugs.flyspray.org/2012</a> for status of <b>Tags</b> feature.</p> +<?php +$this->assign('list_type', 'tag'); +$this->assign('rows', $proj->listTags(true)); + +$systemwide = new Project(0); +$this->assign('sysrows', $systemwide->listTags(true)); + +$this->display('common.list.tpl'); +?> +</div> diff --git a/themes/CleanFS/templates/pm.tasktype.tpl b/themes/CleanFS/templates/pm.tasktype.tpl new file mode 100644 index 0000000..6dcd029 --- /dev/null +++ b/themes/CleanFS/templates/pm.tasktype.tpl @@ -0,0 +1,12 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('tasktypeed')); ?></h3> + <?php + $this->assign('list_type', 'tasktype'); + $this->assign('rows', $proj->listTaskTypes(true)); + + $systemwide = new Project(0); + $this->assign('sysrows', $systemwide->listTaskTypes(true)); + + $this->display('common.list.tpl'); + ?> +</div> diff --git a/themes/CleanFS/templates/pm.version.tpl b/themes/CleanFS/templates/pm.version.tpl new file mode 100644 index 0000000..0b56fe6 --- /dev/null +++ b/themes/CleanFS/templates/pm.version.tpl @@ -0,0 +1,12 @@ +<div id="toolbox"> + <h3><?php echo Filters::noXSS($proj->prefs['project_title']); ?> : <?php echo Filters::noXSS(L('verlisted')); ?></h3> +<?php +$this->assign('list_type', 'version'); +$this->assign('rows', $proj->listVersions(true)); + +$systemwide = new Project(0); +$this->assign('sysrows', $systemwide->listVersions(true)); + +$this->display('common.list.tpl'); +?> +</div> diff --git a/themes/CleanFS/templates/profile.tpl b/themes/CleanFS/templates/profile.tpl new file mode 100644 index 0000000..2c828ef --- /dev/null +++ b/themes/CleanFS/templates/profile.tpl @@ -0,0 +1,70 @@ +<fieldset class="box"><legend><?php echo Filters::noXSS(L('profile')); ?> <?php echo Filters::noXSS($theuser->infos['real_name']); ?> (<?php echo Filters::noXSS($theuser->infos['user_name']); ?>)</legend> +<table id="profile"> + <tr> + <th><?php echo Filters::noXSS(L('realname')); ?></th> + <td><?php echo Filters::noXSS($theuser->infos['real_name']); ?></td> + </tr> + <?php if ((!$user->isAnon() && !$fs->prefs['hide_emails'] && !$theuser->infos['hide_my_email']) || $user->perms('is_admin')): ?> + <tr> + <th><?php echo Filters::noXSS(L('emailaddress')); ?></th> + <td><a href="mailto:<?php echo Filters::noXSS($theuser->infos['email_address']); ?>"><?php echo Filters::noXSS($theuser->infos['email_address']); ?></a></td> + </tr> + <?php endif; ?> + <?php if (!empty($fs->prefs['jabber_server']) && (( !$user->isAnon() && !$fs->prefs['hide_emails'] && !$theuser->infos['hide_my_email']) || $user->perms('is_admin')) ): ?> + <tr> + <th><?php echo Filters::noXSS(L('jabberid')); ?></th> + <td><?php echo Filters::noXSS($theuser->infos['jabber_id']); ?></td> + </tr> + <?php endif; ?> + <tr> + <th><?php echo Filters::noXSS(L('globalgroup')); ?></th> + <td><?php echo Filters::noXSS($groups[Flyspray::array_find('group_id', $theuser->infos['global_group'], $groups)]['group_name']); ?></td> + </tr> + <?php if ($proj->id): ?> + <tr> + <th><?php echo Filters::noXSS(L('projectgroup')); ?></th> + <td> + <?php if ($user->perms('manage_project')): ?> + <?php echo tpl_form(Filters::noXSS($baseurl).'index.php?do=user&id='.Filters::noXSS($theuser->id)); ?> + <select id="projectgroupin" class="adminlist" name="project_group_in"> + <?php $sel = $theuser->perms('project_group') == '' ? 0 : $theuser->perms('project_group'); ?> + <?php echo tpl_options(array_merge($project_groups, array(0 => array('group_name' => L('none'), 0 => 0, 'group_id' => 0, 1 => L('none')))), $sel); ?> + </select> + <input type="hidden" name="old_group_id" value="<?php echo Filters::noXSS($theuser->perms('project_group')); ?>" /> + <input type="hidden" name="action" value="admin.edituser" /> + <input type="hidden" name="user_id" value="<?php echo Filters::noXSS($theuser->id); ?>" /> + <input type="hidden" name="project_id" value="<?php echo $proj->id; ?>" /> + <input type="hidden" name="onlypmgroup" value="1" /> + <button type="submit"><?php echo Filters::noXSS(L('update')); ?></button> + </form> + <?php else: ?> + <?php if ($theuser->perms('project_group')): ?> + <?php echo Filters::noXSS($project_groups[Flyspray::array_find('group_id', $theuser->perms('project_group'), $project_groups)]['group_name']); ?> + <?php else: ?> + <?php echo Filters::noXSS(L('none')); ?> + <?php endif; ?> + <?php endif; ?> + </td> + </tr> + <?php endif; ?> + <tr> + <th><a href="<?php echo CreateURL('tasklist', 0, null, array('opened'=>$theuser->id, 'status[]'=>'')); ?>"><?php echo Filters::noXSS(L('tasksopened')); ?></a></th> + <td><a href="<?php echo CreateURL('tasklist', 0, null, array('opened'=>$theuser->id, 'status[]'=>'')); ?>"><?php echo Filters::noXSS($tasks); ?></a></td> + </tr> + <tr> + <th><a href="<?php echo CreateURL('tasklist', 0, null, array('dev'=>$theuser->id)); ?>"><?php echo Filters::noXSS(L('assignedto')); ?></a></th> + <td><a href="<?php echo CreateURL('tasklist', 0, null, array('dev'=>$theuser->id)); ?>"><?php echo Filters::noXSS($assigned); ?></a></td> + </tr> + <tr> + <th><?php echo Filters::noXSS(L('comments')); ?></th> + <td><?php echo Filters::noXSS($comments); ?></td> + </tr> + <?php if ($theuser->infos['register_date']): ?> + <tr> + <th><?php echo Filters::noXSS(L('regdate')); ?></th> + <td><?php echo Filters::noXSS(formatDate($theuser->infos['register_date'])); ?></td> + </tr> + <?php endif; ?> +</table> +</fieldset> +<div><?php if($user->perms('is_admin')): ?><a href="<?php echo CreateURL('edituser', $theuser->id); ?>" class="button"><?php echo L('edituser'); ?></a><?php endif; ?></div> diff --git a/themes/CleanFS/templates/register.magic.tpl b/themes/CleanFS/templates/register.magic.tpl new file mode 100644 index 0000000..b93e743 --- /dev/null +++ b/themes/CleanFS/templates/register.magic.tpl @@ -0,0 +1,31 @@ +<h3><?php echo Filters::noXSS(L('registernewuser')); ?></h3> +<div class="box"> + <!-- +<?php echo tpl_form(Filters::noXSS($baseurl).'index.php','registernewuser',null,null,'id="registernewuser"'); ?> + --> +<?php echo tpl_form(Filters::noXSS(CreateUrl('registernewuser')),null,null,null,'id="registernewuser"'); ?> + <p><?php echo Filters::noXSS(L('entercode')); ?></p> + <ul class="form_elements wide"> + <li> + <label for="confirmation_code"><?php echo Filters::noXSS(L('confirmationcode')); ?></label> + <input id="confirmation_code" class="text" name="confirmation_code" value="<?php echo Filters::noXSS(Req::val('confirmation_code')); ?>" type="text" size="20" maxlength="20" /> + </li> + + <li> + <label for="user_pass"><?php echo Filters::noXSS(L('password')); ?></label> + <input id="user_pass" class="password" name="user_pass" value="<?php echo Filters::noXSS(Req::val('user_pass')); ?>" type="password" size="20" maxlength="100" /> <em><?php echo Filters::noXSS(L('minpwsize')); ?></em> + </li> + <?php if($fs->prefs['repeat_password']): ?> + <li> + <label for="user_pass2"><?php echo Filters::noXSS(L('confirmpass')); ?></label> + <input id="user_pass2" class="password" name="user_pass2" value="<?php echo Filters::noXSS(Req::val('user_pass2')); ?>" type="password" size="20" maxlength="100" /> + </li> + <?php endif;?> + </ul> + <div> + <input type="hidden" name="action" value="register.registeruser" /> + <input type="hidden" name="magic_url" value="<?php echo Filters::noXSS(Req::val('magic_url')); ?>" /> + <button type="submit" name="buSubmit"><?php echo Filters::noXSS(L('registeraccount')); ?></button> + </div> +</form> +</div> diff --git a/themes/CleanFS/templates/register.no-magic.tpl b/themes/CleanFS/templates/register.no-magic.tpl new file mode 100644 index 0000000..16fedd2 --- /dev/null +++ b/themes/CleanFS/templates/register.no-magic.tpl @@ -0,0 +1,78 @@ +<h3><?= eL('registernewuser') ?></h3> +<div class="box"> +<?php echo tpl_form(Filters::noXSS(createUrl('register')),null,null,null,'id="registernewuser"'); ?> + <ul class="form_elements wide"> + <li> + <label for="username"><?= eL('username') ?></label> + <input required="required" value="<?php echo Filters::noXSS(Req::val('user_name')); ?>" id="username" name="user_name" type="text" size="20" maxlength="32" onblur="checkname(this.value);" /> <?= eL('validusername') ?><br /><strong><span id="errormessage"></span></strong> + </li> + + <li> + <label for="realname"><?= eL('realname') ?></label> + <input required="required" value="<?php echo Filters::noXSS(Req::val('real_name')); ?>" id="realname" name="real_name" type="text" size="30" maxlength="100" /> + </li> + + <li> + <label for="emailaddress"><?= eL('emailaddress') ?></label> + <input id="emailaddress" value="<?php echo Filters::noXSS(Req::val('email_address')); ?>" name="email_address" required="required" type="text" size="20" maxlength="100" /> <?= eL('validemail') ?> + </li> + <?php if ($fs->prefs['repeat_emailaddress']): ?> + <li> + <label for="verifyemailaddress"><?= eL('verifyemailaddress') ?></label> + <input id="verifyemailaddress" value="<?php echo Filters::noXSS(Req::val('verify_email_address')); ?>" name="verify_email_address" required="required" type="text" size="20" maxlength="100" /> + </li> + <?php endif ?> + + <?php if (!empty($fs->prefs['jabber_server'])): ?> + <li> + <label for="jabberid"><?= eL('jabberid') ?></label> + <input id="jabberid" value="<?php echo Filters::noXSS(Req::val('jabber_id')); ?>" name="jabber_id" type="text" size="20" maxlength="100" /> + </li> + <?php endif ?> + + <li> + <label for="notify_type"><?= eL('notifications') ?></label> + <select id="notify_type" name="notify_type"> + <?php echo tpl_options($fs->getNotificationOptions(), Req::val('notify_type')); ?> + </select> + </li> + + <li> + <label for="time_zone"><?= eL('timezone') ?></label> + <select id="time_zone" name="time_zone"> + <?php + $times = array(); + for ($i = -12; $i <= 13; $i++) { + $times[$i] = L('GMT') . (($i == 0) ? ' ' : (($i > 0) ? '+' . $i : $i)); + } + ?> + <?php echo tpl_options($times, Req::val('time_zone', 0)); ?> + </select> + </li> + <?php if($fs->prefs['captcha_securimage']) : ?> + <li class="captchali"> + <style> + #captcha_code{width:100px;} + .captchali .securimage label{width:auto;} + .captchali .securimage {display:inline-block; width:300px;} + </style> + <label for="captcha_code"><?= eL('registercaptcha') ?></label> + <div class="securimage"><?php echo $captcha_securimage_html; ?></div> + </li> + <?php endif; ?> + </ul> + <div> + <input type="hidden" name="action" value="register.sendcode" /> + <?php if(isset($fs->prefs['captcha_recaptcha']) && $fs->prefs['captcha_recaptcha'] + && isset($fs->prefs['captcha_recaptcha_sitekey']) && $fs->prefs['captcha_recaptcha_sitekey'] + && isset($fs->prefs['captcha_recaptcha_secret']) && $fs->prefs['captcha_recaptcha_secret'] + ): ?> + <div class="g-recaptcha" data-sitekey="<?php echo Filters::noXSS($fs->prefs['captcha_recaptcha_sitekey']); ?>"></div> + <noscript>Javascript is required for this Google reCAPTCHA.</noscript> + <?php endif; ?> + <button type="submit" name="buSubmit" id="buSubmit"><?= eL('sendcode') ?></button> + </div> + <br /> + <p><?= L('note') ?></p> +</form> +</div> diff --git a/themes/CleanFS/templates/register.oauth.tpl b/themes/CleanFS/templates/register.oauth.tpl new file mode 100644 index 0000000..0e6ed38 --- /dev/null +++ b/themes/CleanFS/templates/register.oauth.tpl @@ -0,0 +1,15 @@ +<h3><?php echo Filters::noXSS(L('register')); ?></h3> +<div class="box"> + +<form action="index.php?do=oauth" method="post" id="registernewuser"> + <ul class="form_elements"> + <li> + <label for="username"><?php echo Filters::noXSS(L('username')); ?></label> + <input class="required text" value="<?php echo Filters::noXSS($username); ?>" id="user_name" name="username" type="text" size="20" maxlength="32" /> <?php echo Filters::noXSS(L('validusername')); echo '<span class="warning"> ' . Filters::noXSS(L('usernametaken')) . '</span>'; ?> + </li> + </ul> + <div> + <button type="submit" name="buSubmit" id="buSubmit"><?php echo Filters::noXSS(L('register')); ?></button> + </div> +</form> +</div> diff --git a/themes/CleanFS/templates/register.ok.tpl b/themes/CleanFS/templates/register.ok.tpl new file mode 100644 index 0000000..3bc05a8 --- /dev/null +++ b/themes/CleanFS/templates/register.ok.tpl @@ -0,0 +1,4 @@ +<div class="redirectmessage"> + <p><?= eL('loginbelow') ?></p> + <p><?= eL('newuserwarning') ?></p> +</div> diff --git a/themes/CleanFS/templates/reports.tpl b/themes/CleanFS/templates/reports.tpl new file mode 100644 index 0000000..f7b0cdf --- /dev/null +++ b/themes/CleanFS/templates/reports.tpl @@ -0,0 +1,120 @@ +<?php +if(isset($theuser->infos['eventtypes'])){ + $eventpref=$theuser->infos['eventtypes']; +}else{ + $eventpref=array_keys($events); + $usereventpref=array_keys($user_events); +} +?> +<h3><?php echo Filters::noXSS(L('eventlog')); ?></h3> +<div class="box"> + <form action="<?php echo Filters::noXSS(CreateURL('reports', $proj->id)); ?>" method="get"> + <table id="event1"> + <tr> + <td><label for="events[]"><?php echo Filters::noXSS(L('events')); ?></label></td> + <td> + <select name="events[]" class='eventlist<?php echo $histories ? ' hasresult':''; ?>' multiple="multiple" id="events[]" size="<?php echo Filters::noXSS(count($events)+count($user_events)+2); ?>"> + <optgroup label="<?php echo Filters::noXSS(L('Tasks')); ?>"> + <?php echo tpl_options($events, Req::val('events', $eventpref)); ?> + </optgroup> + <optgroup label="<?php echo Filters::noXSS(L('users')); ?>"> + <?php echo tpl_options($user_events, Req::val('events', $usereventpref)); ?> + </optgroup> + </select> + </td> + <td> + <div> + <label class="inline" for="fromdate"><?php echo Filters::noXSS(L('from')); ?></label> + <?php echo tpl_datepicker('fromdate'); ?> + <?php echo tpl_datepicker('todate', L('to')); ?> + </div> + <div> + <label for="event_number"><?php echo Filters::noXSS(L('show')); ?></label> + <select name="event_number" id="event_number"> + <?php + # set 20 to 25 like in tasks_per_page because we use same settings here too + echo tpl_options(array(-1 => L('all'), 10 => 10, 25 => 25, 50 => 50, 100 => 100, 200 => 200), + Req::val('event_number', isset($theuser->infos['tasks_perpage']) ? $theuser->infos['tasks_perpage'] : 50)); ?> + </select> + <?php echo Filters::noXSS(L('events')); ?> + </div> + </td> + </tr> + </table> + + <input type="hidden" name="project" value="<?php echo Filters::noXSS($proj->id); ?>" /> + <input type="hidden" name="do" value="reports" /> + <button type="submit" name="submit"><?php echo Filters::noXSS(L('show')); ?></button> + </form> + + <?php if ($histories): ?> + <div id="tasklist"> + <table id="eventlist_table"> + <thead> + <tr> + <th> + <a href="<?php echo Filters::noXSS(CreateURL('reports', $proj->id, null, array('sort' => (Req::val('order') == 'type' && $sort == 'DESC') ? 'asc' : 'desc', 'order' => 'type') + $_GET)); ?>"> + <?php echo Filters::noXSS(L('event')); ?> + + </a> + </th> + <th> + <a href="<?php echo Filters::noXSS(CreateURL('reports', $proj->id, null, array('sort' => (Req::val('order') == 'user' && $sort == 'DESC') ? 'asc' : 'desc', 'order' => 'user') + $_GET)); ?>"> + <?php echo Filters::noXSS(L('user')); ?> + + </a> + </th> + <th> + <a href="<?php echo Filters::noXSS(CreateURL('reports', $proj->id, null, array('sort' => (Req::val('order') == 'date' && $sort == 'DESC') ? 'asc' : 'desc', 'order' => 'date') + $_GET)); ?>"> + <?php echo Filters::noXSS(L('eventdate')); ?> + + </a> + </th> + <th><?php echo Filters::noXSS(L('summary')); ?></th> + </tr> + </thead> + <?php foreach ($histories as $history): ?> + <?php if (isset($events[$history['event_type']])): ?> + <tr class="severity1"><?php /* just for different colors */ ?> + <td><?php echo Filters::noXSS($events[$history['event_type']]); ?></td> + <?php else: ?> + <tr class="severity2"> + <td><?php echo Filters::noXSS($user_events[$history['event_type']]); ?></td> + <?php endif; ?> + <td><?php echo tpl_userlink($history['user_id']); ?></td> + <td><?php echo Filters::noXSS(formatDate($history['event_date'], true)); ?></td> + <?php if ($history['event_type'] == 30 || + $history['event_type'] == 31): + $user_data = unserialize($history['new_value']); ?> + <td> + <a href="javascript:showhidestuff('h<?php echo Filters::noXSS($history['history_id']); ?>')"><?php echo Filters::noXSS(L('detailedinfo')); ?></a> + <div class="hide popup" id="h<?php echo Filters::noXSS($history['history_id']); ?>"> + <table> + <tr> + <th><?php echo Filters::noXSS(L('username')); ?></th> + <td><?php echo Filters::noXSS($user_data['user_name']); ?></td> + </tr> + <tr> + <th><?php echo Filters::noXSS(L('realname')); ?></th> + <td><?php echo Filters::noXSS($user_data['real_name']); ?></td> + </tr> + <tr> + <th><?php echo Filters::noXSS(L('email')); ?></th> + <td><?php echo Filters::noXSS($user_data['email_address']); ?></td> + </tr> + <tr> + <th><?php echo Filters::noXSS(L('jabber')); ?></th> + <td><?php echo Filters::noXSS($user_data['jabber_id']); ?></td> + </tr> + </table> + </div> + </td> + <?php else: ?> + <td><?php echo tpl_tasklink($history); ?></td> + <?php endif; ?> + </tr> + <?php endforeach; ?> + </table> + </div> + <?php endif; ?> +</div> diff --git a/themes/CleanFS/templates/roadmap.text.tpl b/themes/CleanFS/templates/roadmap.text.tpl new file mode 100644 index 0000000..7d33199 --- /dev/null +++ b/themes/CleanFS/templates/roadmap.text.tpl @@ -0,0 +1,51 @@ +=== <?php echo Filters::noXSS($proj->prefs['project_title']); ?> === + +<?php foreach($data as $milestone): ?> +<?php echo Filters::noXSS(L('roadmapfor')); ?> <?php echo Filters::noXSS($milestone['name']); ?> + + +<?php echo Filters::noXSS($milestone['percent_complete']); ?><?php echo Filters::noXSS(L('of')); ?> <?php echo Filters::noXSS(count($milestone['all_tasks'])); ?> <?php echo Filters::noXSS(L('tasks')); ?> <?php echo Filters::noXSS(L('completed')); ?> <?php + if(count($milestone['open_tasks'])): + ?><?php echo Filters::noXSS(count($milestone['open_tasks'])); ?> <?php echo Filters::noXSS(L('opentasks')); ?>:<?php + endif; ?> +<?php + if ($proj->prefs['use_effort_tracking']) { + $total_estimated = 0; + $actual_effort = 0; + + foreach($milestone['open_tasks'] as $task) { + $total_estimated += $task['estimated_effort']; + $effort = new effort($task['task_id'],0); + $effort->populateDetails(); + + foreach($effort->details as $details) { + $actual_effort += $details['effort']; + } + $effort = null; + } + // } +?> + +<?php + if ($user->perms('view_estimated_effort')) { + echo Filters::noXSS(L('opentasks')); ?> - <?php echo Filters::noXSS(L('totalestimatedeffort')); ?>: <?php echo effort::SecondsToString($total_estimated, $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']); +} ?> + +<?php + if ($user->perms('view_current_effort_done')) { + echo Filters::noXSS(L('opentasks')); ?> - <?php echo Filters::noXSS(L('currenteffortdone')); ?>: <?php echo effort::SecondsToString($actual_effort, $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); +} ?> +<?php } ?> + +<?php if(count($milestone['open_tasks'])): ?> + +<?php foreach($milestone['open_tasks'] as $task): + if(!$user->can_view_task($task)) continue; ?> +FS#<?php echo Filters::noXSS($task['task_id']); ?> - <?php echo Filters::noXSS($task['item_summary']); ?> + + +<?php endforeach; ?> + +<?php endif; ?> + +<?php endforeach; ?> diff --git a/themes/CleanFS/templates/roadmap.tpl b/themes/CleanFS/templates/roadmap.tpl new file mode 100644 index 0000000..2ec8a48 --- /dev/null +++ b/themes/CleanFS/templates/roadmap.tpl @@ -0,0 +1,116 @@ +<script type="text/javascript"> + +function hideAll(allTasks) +{ + for (i = 0; i < allTasks.length; i++) { + if (!allTasks[i]) continue; + hidestuff('dd'+ allTasks[i]); + hidestuff('hide'+ allTasks[i]); + showstuff('expand'+ allTasks[i], 'inline'); + } +} + +function showAll(allTasks) +{ + for (i = 0; i < allTasks.length; i++) { + if (!allTasks[i]) continue; + showstuff('dd'+ allTasks[i]); + hidestuff('expand'+ allTasks[i]); + showstuff('hide'+ allTasks[i], 'inline'); + } +} +</script> + +<?php foreach($data as $milestone): ?> + +<script type="text/javascript"> +allTasks<?php echo Filters::noXSS($milestone['id']); ?> = [<?php foreach($milestone['open_tasks'] as $task): echo $task['task_id'] . ','; endforeach; ?>]; +</script> + +<div class="box roadmap"> +<h3><?php echo Filters::noXSS(L('roadmapfor')); ?> <?php echo Filters::noXSS($milestone['name']); ?> + + <?php if (count($milestone['open_tasks'])): ?> + <small class="DoNotPrint"> + <a href="javascript:showAll(allTasks<?php echo Filters::noXSS($milestone['id']); ?>)"><?php echo Filters::noXSS(L('expandall')); ?></a> | + <a href="javascript:hideAll(allTasks<?php echo Filters::noXSS($milestone['id']); ?>)"><?php echo Filters::noXSS(L('collapseall')); ?></a> + </small> + <?php endif; ?> +</h3> +<div class="progress_bar_container" style="width: 250px;"> + <span><?php echo Filters::noXSS($milestone['percent_complete']); ?>%</span> + <div class="progress_bar" style="width:<?php echo Filters::noXSS($milestone['percent_complete']); ?>%"></div> +</div> +<p style="margin-top: 5px;"><?php echo Filters::noXSS($milestone['percent_complete']); ?><?php echo Filters::noXSS(L('of')); ?> + + <a href="<?php echo Filters::noXSS($baseurl); ?>index.php?do=index&tasks=&project=<?php echo Filters::noXSS($proj->id); ?>&due=<?php echo Filters::noXSS($milestone['id']); ?>&status[]="> + <?php echo Filters::noXSS(count($milestone['all_tasks'])); ?> <?php echo Filters::noXSS(L('tasks')); ?> + + </a> <?php echo Filters::noXSS(L('completed')); ?> + + <?php if(count($milestone['open_tasks'])): ?> + <a href="<?php echo Filters::noXSS($baseurl); ?>index.php?do=index&tasks=&project=<?php echo Filters::noXSS($proj->id); ?>&due=<?php echo Filters::noXSS($milestone['id']); ?>"><?php echo Filters::noXSS(count($milestone['open_tasks'])); ?> <?php echo Filters::noXSS(L('opentasks')); ?>:</a> + <?php endif; ?> + <?php + if ($proj->prefs['use_effort_tracking']) { + $total_estimated = 0; + $actual_effort = 0; + + foreach($milestone['open_tasks'] as $task) { + $total_estimated += $task['estimated_effort']; + $effort = new effort($task['task_id'],0); + $effort->populateDetails(); + + foreach($effort->details as $details) { + $actual_effort += $details['effort']; + } + $effort = null; + } + // } + ?> + <br /> + <?php + if ($user->perms('view_estimated_effort')) { + echo Filters::noXSS(L('opentasks')); ?> - <?php echo Filters::noXSS(L('totalestimatedeffort')); ?>: <?php echo effort::SecondsToString($total_estimated, $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']); + } ?> + <br /> + <?php + if ($user->perms('view_current_effort_done')) { + echo Filters::noXSS(L('opentasks')); ?> - <?php echo Filters::noXSS(L('currenteffortdone')); ?>: <?php echo effort::SecondsToString($actual_effort, $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); + } ?> + <?php } + ?> +</p> + +<?php if(count($milestone['open_tasks'])): ?> +<dl class="roadmap"> + <?php foreach($milestone['open_tasks'] as $task): ?> + <dt class="severity<?php echo Filters::noXSS($task['task_severity']); ?>"> + <i class="fa typ<?php echo $task['task_type']; ?>"></i> + <?php echo tpl_tasklink($task['task_id']); ?> + + <small class="DoNotPrint"> + <a id="expand<?php echo Filters::noXSS($task['task_id']); ?>" href="javascript:showstuff('dd<?php echo Filters::noXSS($task['task_id']); ?>');hidestuff('expand<?php echo Filters::noXSS($task['task_id']); ?>');showstuff('hide<?php echo Filters::noXSS($task['task_id']); ?>', 'inline')"><?php echo Filters::noXSS(L('expand')); ?></a> + <a class="hide" id="hide<?php echo Filters::noXSS($task['task_id']); ?>" href="javascript:hidestuff('dd<?php echo Filters::noXSS($task['task_id']); ?>');hidestuff('hide<?php echo Filters::noXSS($task['task_id']); ?>');showstuff('expand<?php echo Filters::noXSS($task['task_id']); ?>', 'inline')"><?php echo Filters::noXSS(L('collapse')); ?></a> + </small> + </dt> + <dd id="dd<?php echo Filters::noXSS($task['task_id']); ?>" style="display: none;"> + <?php echo TextFormatter::render($task['detailed_desc'], 'rota', $task['task_id'], $task['content']); ?> + + <br style="position:absolute;" /> + </dd> + <?php endforeach; ?> +</dl> + +<?php endif; ?> +</div> +<?php endforeach; ?> + +<?php if (!count($data)): ?> +<div class="box roadmap"> +<p><em><?php echo Filters::noXSS(L('noroadmap')); ?></em></p> +</div> +<?php else: ?> +<p><a href="<?php echo Filters::noXSS(CreateURL('roadmap', $proj->id, null, array('txt' => 'true'))); ?>"> +<!--<img src="<?php echo Filters::noXSS($this->get_image('mime/text')); ?>" alt="" />--> <?php echo Filters::noXSS(L('textversion')); ?></a></p> +<?php endif; ?> diff --git a/themes/CleanFS/templates/shortcuts.tpl b/themes/CleanFS/templates/shortcuts.tpl new file mode 100644 index 0000000..b6905a4 --- /dev/null +++ b/themes/CleanFS/templates/shortcuts.tpl @@ -0,0 +1,31 @@ +<input type="checkbox" id="s_shortcuts" /> +<label for="s_shortcuts" id="shortcutlabel"><i class="fa fa-keyboard-o"></i> <?php echo Filters::noXSS(L('keyboardshortcuts')); ?></label> +<label for="s_shortcuts" id="shortcutsmodal"></label> +<div id="shortcuts"> +<label for="s_shortcuts" id="shortcutclose"><i class="fa fa-close fa-2x"></i></label> +<h3><?php echo Filters::noXSS(L('availablekeybshortcuts')); ?></h3> +<h4></h4> +<ul> +<li><kbd>SHIFT+ALT+l</kbd> <?php echo Filters::noXSS(L('logindialoglogout')); ?></li> +<li><kbd>SHIFT+ALT+a</kbd> <?php echo Filters::noXSS(L('addnewtask')); ?></li> +<li><kbd>SHIFT+ALT+m</kbd> <?php echo Filters::noXSS(L('mysearch')); ?></li> +<li><kbd>SHIFT+ALT+t</kbd> <?php echo Filters::noXSS(L('focustaskidsearch')); ?></li> +</ul> +<h4><?php echo Filters::noXSS(L('tasklist')); ?></h4> +<ul> +<li><kbd>o</kbd> <?php echo Filters::noXSS(L('openselectedtask')); ?></li> +<li><kbd>j</kbd> <?php echo Filters::noXSS(L('movecursordown')); ?></li> +<li><kbd>k</kbd> <?php echo Filters::noXSS(L('movecursorup')); ?></li> +</ul> +<h4><?php echo Filters::noXSS(L('taskdetails')); ?></h4> +<ul> +<li><kbd>n</kbd> <?php echo Filters::noXSS(L('nexttask')); ?></li> +<li><kbd>p</kbd> <?php echo Filters::noXSS(L('previoustask')); ?></li> +<li><kbd>SHIFT+ALT+e</kbd> <kbd>ENTER</kbd> <?php echo Filters::noXSS(L('edittask')); ?></li> +<li><kbd>SHIFT+ALT+y</kbd> <?php echo Filters::noXSS(L('closetask')); ?></li> +</ul> +<h4><?php echo Filters::noXSS(L('taskediting')); ?></h4> +<ul> +<li><kbd>SHIFT+ALT+s</kbd> <?php echo Filters::noXSS(L('savetask')); ?></li> +</ul> +</div> diff --git a/themes/CleanFS/templates/toplevel.tpl b/themes/CleanFS/templates/toplevel.tpl new file mode 100644 index 0000000..78766d6 --- /dev/null +++ b/themes/CleanFS/templates/toplevel.tpl @@ -0,0 +1,169 @@ +<?php $project_count = count($projects); + +/* If user has no projects, just redirect them to the index page of All Projects */ +if (!$project_count): ?> + <meta http-equiv="Refresh" content="0;url=/index.php?project=0&do=index" /> +<?php endif; ?> +<style type="text/css"> +.activity::after { +content: "\25B4"; +position: absolute; +right: -3px; +bottom:-5px; +text-align: right; +color:#c00; +} +.activity img{ +padding-right:1px; +background-color:#c00; +} +.activity { +display: block; +position: relative; +width: 160px; +} +#s_inactive {display:none;} +#s_inactive ~ .box {display: none;} +#s_inactive:checked ~ .box {display: inline-block;} +</style> +<?php +# $projects are now sorted active first, then inactive +$lastprojectactive=1; +foreach ($projects as $project): ?> + <?php if( count($projects)>1 && $lastprojectactive==1 && $project['project_is_active']==0) : ?> + <div style="clear:both;padding-top:20px;border-bottom:1px solid #999;"></div> + <input type="checkbox" id="s_inactive" /> + <label class="button" style="display:block;width:100px;" for="s_inactive"><?php echo Filters::noXSS(L('showinactive')); ?></label> + <?php endif; ?> + <?php $lastprojectactive=$project['project_is_active']; ?> + +<div class="box<?php if ($project_count == 1) echo ' single-project' ?>"> +<h2><a href="<?php echo Filters::noXSS(CreateUrl('project', $project['project_id'])); ?>"><?php echo Filters::noXSS($project['project_title']); ?></a></h2> + +<table class="toplevel"> +<?php if($user->can_view_project($project['project_id'])): ?> + <tr> + <th><?php echo Filters::noXSS(L('viewtasks')); ?></th> + <td> + <a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('status[]'=>'')); ?>"><?php echo Filters::noXSS(L('All')); ?></a> - + <a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('status[]'=>'open')); ?>"><?php echo Filters::noXSS(L('open')); ?></a> - + <a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('openedfrom'=>'-1 week')); ?>"><?php echo Filters::noXSS(L('recentlyopened')); ?></a> + <?php if (!$user->isAnon()): ?> + <br /> + <a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('dev'=>$user->id, 'devsm'=>'userid')); ?>"><?php echo Filters::noXSS(L('assignedtome')); ?></a> - + <a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('only_watched'=>1)); ?>"><?php echo Filters::noXSS(L('taskswatched')); ?></a> - + <a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('opened'=>$user->id, 'openedsm'=>'userid')); ?>"><?php echo Filters::noXSS(L('tasksireported')); ?></a> + <?php endif; ?> + </td> + + <?php if ($project_count == 1 and isset($most_wanted[$project['project_id']])): ?> + <td rowspan="4"> + <strong><?php echo Filters::noXSS(L('mostwanted')); ?></strong> + <ul> + <?php foreach($most_wanted[$project['project_id']] as $task): ?> + <li><?php echo tpl_tasklink($task['task_id']); ?>, <?php echo Filters::noXSS($task['num_votes']); ?> <?php echo ($task['num_votes']==1) ? Filters::noXSS(L('vote')) : Filters::noXSS(L('votes')); ?></li> + <?php endforeach; ?> + </ul> + </td> + <?php endif; ?> + <?php if ($project_count == 1 and isset($assigned_to_myself[$project['project_id']])): ?> + <td rowspan="4"> + <strong><?php echo Filters::noXSS(L('assignedtome')); ?></strong> + <ul> + <?php foreach($assigned_to_myself[$project['project_id']] as $task): ?> + <li><?php echo tpl_tasklink($task['task_id']); ?></li> + <?php endforeach; ?> + </ul> + </td> + <?php endif; ?> + </tr> +<?php endif; ?> +<?php +# lets say if someone can view normal tasks of a project, then activity graphs are allowed. +if($user->can_view_project($project['project_id']) ) : ?> + <tr> + <th><?php echo Filters::noXSS(L('activity')); ?></th> + <td><span class="activity" title="red line=today"><img width="160px" height="25px" src="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?line=0066CC&do=activity&project_id=<?php echo Filters::noXSS($project['project_id']); ?>&graph=project"/></span></td> + </tr> + <?php if (!$user->isAnon()): ?> + <tr> + <th><?php echo Filters::noXSS(L('myactivity')); ?></th> + <td><span class="activity" title="red line=today"><img width="160px" height="25px" src="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?line=0066CC&do=activity&user_id=<?php echo Filters::noXSS($user->id); ?>&project_id=<?php echo Filters::noXSS($project['project_id']); ?>&graph=user"/></span></td> + </tr> + <?php endif; ?> +<?php endif; ?> +<?php if($projprefs[$project['project_id']]['others_viewroadmap'] || ($user->perms('view_roadmap', $project['project_id'])) ) : ?> + <tr> + <th><?php echo Filters::noXSS(L('stats')); ?></th> + <td><?php echo Filters::noXSS($stats[$project['project_id']]['open']); ?> <?php echo Filters::noXSS(L('opentasks')); ?>, <?php echo Filters::noXSS($stats[$project['project_id']]['all']); ?> <?php echo Filters::noXSS(L('totaltasks')); ?>.</td> + </tr> + <tr> + <th><?php echo Filters::noXSS(L('progress')); ?></th> + <td> + <?php echo Filters::noXSS($stats[$project['project_id']]['average_done']); ?>% <?php echo Filters::noXSS(L('done')); ?> + + <?php $progressbar_value = $stats[$project['project_id']]['average_done']; ?> + + <div class="progress_bar_container"> + <span><?php echo Filters::noXSS($stats[$project['project_id']]['average_done']); ?>%</span> + <div class="progress_bar" style="width:<?php echo Filters::noXSS($stats[$project['project_id']]['average_done']); ?>%"></div> + </div> + </td> + </tr> +<?php endif; ?> +<?php + if($projprefs[$project['project_id']]['use_effort_tracking']) : + $total_estimated = 0; + $actual_effort = 0; + + if(isset($stats[$project['project_id']]['tasks'])) : + foreach($stats[$project['project_id']]['tasks'] as $task) { + $total_estimated += $task['estimated_effort']; + $effort = new effort($task['task_id'],0); + $effort->populateDetails(); + + foreach($effort->details as $details) { + $actual_effort += $details['effort']; + } + $effort = null; + } + endif; + + if ($user->perms('view_estimated_effort', $project['project_id'])) : ?> + <tr> + <th><?php echo Filters::noXSS(L('estimatedeffortopen')); ?></th> + <td><?php echo effort::SecondsToString($total_estimated, $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']); ?></td> + </tr> + <?php endif; ?> + <?php if ($user->perms('view_current_effort_done', $project['project_id'])) : ?> + <tr> + <th><?php echo Filters::noXSS(L('currenteffortdoneopen')); ?></th> + <td><?php echo effort::SecondsToString($actual_effort, $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); ?></td> + </tr> + <?php endif; ?> + <?php endif; ?> +<?php if($projprefs[$project['project_id']]['others_view']==1): ?> + <tr> + <th><?php echo Filters::noXSS(L('feeds')); ?></th> + <td> + <b><?php echo Filters::noXSS(L('rss')); ?> 1.0</b> <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('opened')); ?></a> - + <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&topic=edit&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('edited')); ?></a> - + <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&topic=clo&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('closed')); ?></a> + <br /> + <b><?php echo Filters::noXSS(L('rss')); ?> 2.0</b> <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('opened')); ?></a> - + <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&topic=edit&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('edited')); ?></a> - + <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&topic=clo&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('closed')); ?></a> + <br /> + <b><?php echo Filters::noXSS(L('atom')); ?></b> <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('opened')); ?></a> - + <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&topic=edit&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('edited')); ?></a> - + <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&topic=clo&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('closed')); ?></a> + </td> + </tr> +<?php endif; ?> +</table> +</div> +<?php +endforeach; +?> + +<div class="clear"></div> |