Commit 2f468f87 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 9d0cde31
......@@ -29,6 +29,7 @@ require_once(PATH_t3lib.'class.t3lib_db.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_db.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_utils.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_process.php');
require_once(t3lib_extMgm::extPath('nG6').'/res/smarty/libs/Smarty.class.php');
/**
* Class 'tx_nG6_eid' for the 'nG6' extension.
......@@ -579,6 +580,31 @@ class tx_nG6_eid {
$encode_size_tab = json_encode($size_tab);
print $encode_size_tab;
} elseif($type == 'runs_table') {
$smarty = new Smarty();
$smarty->setTemplateDir(t3lib_extMgm::extPath('nG6').'/pi1');
$smarty->setCompileDir(t3lib_extMgm::extPath('nG6').'/res/smarty/templates_c');
$smarty->setCacheDir(t3lib_extMgm::extPath('nG6').'/res/smarty/cache');
$smarty->setConfigDir(t3lib_extMgm::extPath('nG6').'/res/smarty/configs');
$smarty->security = true;
$smarty->security_settings['MODIFIER_FUNCS'] = array('count');
$project_id = intVal(trim(t3lib_div::_GP('project_id')));
$user_id = intVal(trim(t3lib_div::_GP('user_id')));
$login_user = intVal(trim(t3lib_div::_GP('login_user')));
$page_id = intVal(trim(t3lib_div::_GP('page_id')));
$project_runs = tx_nG6_db::get_project_runs($project_id);
$is_at_least_admin_of_1_run = false;
foreach($project_runs as $run_id => $run_values) {
$is_admin = tx_nG6_db::is_administrator($user_id, 'run', $run_values['id']);
$project_runs[$run_id]['is_admin'] = $is_admin;
if ($is_admin) { $is_at_least_admin_of_1_run = true; }
$href = '<a href="index.php?id='.$page_id.'&tx_nG6_pi1[run_id]='.$run_values['id'].'&tx_nG6_pi1[project_id]='.$run_values['project_id'].'">'.$run_values['name'].'</a>';
$project_runs[$run_id]['href'] = $href;
}
$smarty->assign('runs', $project_runs);
$smarty->assign('is_at_least_admin_of_1_run', $is_at_least_admin_of_1_run);
$smarty->assign('login_user', $login_user);
print $smarty->fetch('run_table.tpl');
}
}
......@@ -737,8 +763,7 @@ class tx_nG6_eid {
}
}
return array($src_directories, $dest_directories);
}
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/class.tx_nG6_eid.php']) {
......
......@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="hidden" id="data_folder" value="{$data_folder}" />
<input type="hidden" id="view" value="project" />
<input type="hidden" id="ids" value="{$project_ids}" />
<input type="hidden" id="login_user" value="{$login_user}" />
{* If no project can be displayed *}
{if $projects|@count == 0 || ($projects|@count == 1 && $projects[key($projects)].hidden == 1 && !$projects[key($projects)].is_admin)}
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment