Ejemplo n.º 1
0
tutorHelper($dbConn, $isTutor);
$page->addBodyComponent(new Component(ob_get_clean()));
$page->addBodyComponent($nav);
$sql = "SELECT distinct apt.prj_id||':'||apt.milestone as value, \n" . "apt.afko||': '||apt.description||'('||apt.year::text||')'||' milestone '||apt.milestone as name\n" . ", apt.prj_id,apt.milestone,apt.afko, apt.year as namegrp,apt.year, apt.description,apt.grp_num \n" . "FROM all_prj_tutor apt join prj_grp pg using(prjtg_id) " . " join project_deliverables pd using(prjm_id)\n" . " where snummer={$snummer} order by year desc,afko";
$resultSet = $dbConn->Execute($sql);
if ($resultSet === false) {
    die('Error: ' . $dbConn->ErrorMsg() . ' with <pre>' . $sql . "</pre>\n");
}
extract($resultSet->fields);
$preload = array('0' => array('name' => '&nbsp;', 'value' => '1:1'));
$prjList = "<form name='prjmil' action='{$PHP_SELF}' method='get'>\n" . $prjSel->getSelector() . "</select>&nbsp;<input type='submit' value='Get'/>\n</form>";
$pp = array();
$pp['prjList'] = $prjList;
$sql = "SELECT roepnaam, voorvoegsel,achternaam,lang,prjtg_id FROM student \n" . "join prj_grp using(snummer) join prj_tutor pt using(prjtg_id) \n" . "WHERE snummer={$snummer} and pt.prjm_id={$prjm_id}";
$resultSet = $dbConn->Execute($sql);
if ($resultSet === false) {
    die('Error: ' . $dbConn->ErrorMsg() . ' with ' . $sql);
}
if (!$resultSet->EOF) {
    extract($resultSet->fields);
}
$isTutorBool = $isTutor ? 'true' : 'false';
$sqlfolders = "select ddd.*,doc_count from (select rtrim(afko) as afko,rtrim(description) as description,\n            dd.prj_id,dd.year,dd.milestone,\n            dd.prjtg_id as authorgrp,dd.grp_num as author_grp_num,long_name,title,rel_file_path,\n            to_char(uploadts,'YYYY-MM-DD HH24:MI')::text as uploadts,dd.due,rtrim(mime_type) as mime_type,\n            case when dd.uploadts::date > dd.due then 'late' else 'early' end as late_or_early,\n            vers,dd.doctype,dd.dtdescr,upload_id,\n            dd.snummer, roepnaam,voorvoegsel,achternaam,sclass,critique_count as crits,dd.rights,filesize,\n\t        (coalesce({$peer_id} = aud.reader,false) or {$isTutorBool}) as link, viewergrp\n             from document_data3 dd \n                left join (select upload_id,prjm_id,reader,reader_role,viewergrp \n\t    \t      \t      from document_audience where prjm_id={$prjm_id} and reader={$peer_id}) aud using(upload_id,prjm_id)\n                          \n\t\t   where dd.prjm_id={$prjm_id} ) ddd\n             join grp_upload_count2 guc on(ddd.authorgrp=guc.prjtg_id)\n\n    order by afko,milestone,authorgrp";
$pp['documentFolders'] = getDocumentFolders($dbConn, $sqlfolders);
if ($isTutor) {
    $pp['tutorText'] = "Tutors can always read all files without limitation.\n            The extra files visable to the tutor have <span style='font-weight: bold; color:#800;'>red</span> due dates.\n            The others are <span style='font-weight: bold; color:#080;'>green</span>\n            (And these last remarks are only visible because you appear to be a tutor. )";
} else {
    $pp['tutorText'] = '';
}
$page->addHtmlFragment('templates/uploadviewer.html', $pp);
$page->show();
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listNamedFilter');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listOpportunityCriteriaBasedSharingRule');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listOpportunityOwnerSharingRule');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listOpportunitySharingRules');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listRecordType');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listSharingReason');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listValidationRule');
echo shell_exec('ant -buildfile /home/dpeter/sf/build.xml listWebLink');
//========================================= END OPERATION 2
//========================================= OPERATION 3, get some folder names via the REST API so we can get some metadata components which rely on the folder names
//get a session ID via the REST API
$sessionId = getSession($USERNAME, $PASSWORD);
$arrReports = getReportFolders($sessionId);
$arrDashboards = getDashboardFolders($sessionId);
$arrEmailTemplates = getEmailTemplateFolders($sessionId);
$arrDocuments = getDocumentFolders($sessionId);
$bulkRetrieve = '';
$bulkRetrieve .= buildBulkRetrieve('Report', $arrReports);
$bulkRetrieve .= buildBulkRetrieve('Dashboard', $arrDashboards);
$bulkRetrieve .= buildBulkRetrieve('EmailTemplate', $arrEmailTemplates);
$bulkRetrieve .= buildBulkRetrieve('Document', $arrDocuments);
//open the build.xml file and populate the bulkRetrieve based on the folders names we got
searchReplaceBuildXmlFile('<!-- bulkRetrieveFolders populated by script -->', $bulkRetrieve);
//========================================= END OPERATION 3
//========================================= OPERATION 4.  get the standard and custom object names via the rest API, and there subcomponents via ant list
//get a list of standard and custom objects
$arrObjectList = getObjectLists($sessionId);
$arrStdObjects = $arrObjectList['standard'];
$arrCustomObjects = $arrObjectList['custom'];
//loop through the std and custom objects, building this kind of XML:
/*