* @version $Id$
* @access public
* @license http://opensource.org/licenses/gpl-3.0.html
* 'Workshoprep' (as Workshop Report) module is used by 'Workshop' modules
*/
include_once(override('../workshoprep/'.SQL.'.inc.php'));
if(!function_exists('DisplayOneWorkshopRep')) {
function DisplayOneWorkshopRep($work_id) {
$data=$GLOBALS['sql_object'] -> DBSelect(SQL_getoneCompleteWorkshopRep($work_id, array('P', 'PA')));
$content = '';
if($data == 0) error_redirect();
if(count($data)!=1) exit;
else
{
// marker visible to members only to specify workshop is not visible to others
if($data[0]['workrep_visible'] == 0) {
$workrep_visible = ''._t('workshoprep', 'visible').' : '._t('divers', 'no').''.PHP_EOL;
} else {
$workrep_visible = '';
}
$link_workshop= array('rub'=> $GLOBALS['links'][U_L]['workgroup']['linkvalue'],'id'=>$data[0]['workrep_workshop_id'], 'name' =>$data[0]['workshop_denomination']);
$link_self= array('rub'=> $GLOBALS['links'][U_L]['report']['linkvalue'],'id' => $work_id);
$workrep_title=formatText($data[0]['workrep_title'], '2HTML');
$workrep_resume=formatText($data[0]['workrep_resume'], '2HTML');
$workshop_denomination=formatText($data[0]['workshop_denomination'], '2HTML');
$workrep_posted_on=formatText($data[0]['workrep_published_date_display'], '2HTML');
$workrep_posted_on_long = formatText($data[0]['workrep_published_date_display_long'], '2ATT');
$workrep_modify_on=formatText($data[0]['workrep_last_modify_display'], '2HTML');
$workrep_statut=$data[0]['workrep_statut'];
if(commentEnabled('report')) {
postCommentAction(array('module'=> 'report', 'module_id'=> $work_id));
$content .= '
'.PHP_EOL;
}
$content.=''.$workrep_title.'
'.PHP_EOL;
$content.=''.PHP_EOL;
$content.=''._t('statut','published_on') . ' '.$workrep_posted_on_long.' - ';
$content.=_t('workshoprep','workshop_product').' : '.$workshop_denomination.'';
if($workrep_statut=='PA') {
$content.=' ('._t('statut','archived_on').' '.$workrep_modify_on.')';
}
$content .= formatted_permalink($link_self);
$content.='
'.PHP_EOL;
$content.=$workrep_visible.PHP_EOL;
$content.=''.$workrep_resume.'
';
$content.='
';
}
echo $content;
}
}
if(!function_exists('DisplayWorkshopRepParts')) {
function DisplayWorkshopRepParts($work_id) {
$data=$GLOBALS['sql_object'] -> DBSelect(SQL_getWorkshopParts($work_id));
// no data, we don't display anything
if(!is_array($data)) return '';
$content = '' . PHP_EOL;
$content .= '
' . mb_ucfirst(_t('workshoprep', 'name2')) . '
' . PHP_EOL;
$content .= '
' . PHP_EOL;
for ($i = 0; $i < count($data); $i ++) {
$link_parts = array(
'rub' => $GLOBALS['links'][U_L]['report-part']['linkvalue'],
'id' => $data[$i]['workrepcon_id'],
'parentid' => $work_id,
'name' => $data[$i]['workrepcon_title']
);
$workrepcon_title = formatText($data[$i]['workrepcon_title'], '2HTML');
$content .= '- ' . PHP_EOL;
// $content.=''.($i+1).' - '.PHP_EOL;
$content .= '';
$content .= $workrepcon_title;
$content .= '';
$content .= '
' . PHP_EOL;
}
$content .= '
' . PHP_EOL;
$content .= '
' . PHP_EOL;
// $content.='
';
echo $content;
}
}
if(!function_exists('DisplayWorkshopRepLinks')) {
function DisplayWorkshopRepLinks($work_id) {
$data = SQL_GetResources($work_id, 'W', 'LINK', $GLOBALS['sql_object']);
// no data, we don't display anything
if (! is_array($data)) return '';
$content = '' . PHP_EOL;
$content .= '
' . mb_ucfirst(_t('workshoprep', 'link_res')) . '
' . PHP_EOL;
$content .= '
' . PHP_EOL;
for ($i = 0; $i < count($data); $i ++) {
$linkres_mask = formatText($data[$i]['linkres_mask'], '2HTML');
$linkres_text = $data[$i]['linkres_text'];
$content .= '- ' . PHP_EOL;
$content .= '';
$content .= $linkres_mask;
$content .= '';
$content .= '
' . PHP_EOL;
}
$content .= '
' . PHP_EOL;
$content .= '
' . PHP_EOL;
// $content.='
';
echo $content;
}
}
if(!function_exists('DisplayWorkshopRepBiblio')) {
function DisplayWorkshopRepBiblio($work_id) {
$data = SQL_GetResources($work_id, 'W', 'BIBLIO', $GLOBALS['sql_object']);
// no data, we don't display anything
if (! is_array($data)) return '';
$content = '' . PHP_EOL;
$content .= '
' . mb_ucfirst(_t('workshoprep', 'biblio_res')) . '
' . PHP_EOL;
$content .= '
' . PHP_EOL;
for ($i = 0; $i < count($data); $i ++) {
$bibliores_author = formatText($data[$i]['bibliores_author'], '2HTML');
$bibliores_title = formatText($data[$i]['bibliores_title'], '2HTML');
$bibliores_sub_title = empty($data[$i]['bibliores_sub_title']) ? '' : ', ' . formatText($data[$i]['bibliores_sub_title'], '2HTML');
$bibliores_editor = empty($data[$i]['bibliores_editor']) ? '' : ' - ' . formatText($data[$i]['bibliores_editor'], '2HTML');
$bibliores_date = empty($data[$i]['bibliores_date']) ? '' : ', ' . formatText($data[$i]['bibliores_date'], '2HTML');
$content .= '- ' . PHP_EOL;
$content .= $bibliores_author . ' - ' . $bibliores_title;
$content .= $bibliores_sub_title . '' . $bibliores_editor . $bibliores_date;
$content .= '
' . PHP_EOL;
}
$content .= '
' . PHP_EOL;
$content .= '
' . PHP_EOL;
// $content.='
';
echo $content;
}
}
?>