示例#1
0
    ?>
">
		<?php 
}
?>
		<?php 
include THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'themes' . DS . TBGSettings::getThemeName() . DS . 'theme.php';
?>
		<?php 
if (count(TBGContext::getModules())) {
    ?>
			<?php 
    foreach (TBGContext::getModules() as $module) {
        ?>
				<?php 
        if (file_exists(THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'themes' . DS . TBGSettings::getThemeName() . DS . "{$module->getName()}.css")) {
            ?>
					<?php 
            $tbg_response->addStylesheet("{$module->getName()}.css");
            ?>
				<?php 
        }
        ?>
				<?php 
        if (file_exists(THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'js' . DS . "{$module->getName()}.js")) {
            ?>
					<?php 
            $tbg_response->addJavascript("{$module->getName()}.js");
            ?>
				<?php 
        }
示例#2
0
			}
			/* next rows of buttons */
			.markItUpHeader ul ul {
				display:none;
				position:absolute;
				top:18px; left:0px;	
				background:#FFF;
				border:1px solid #000;
			}
			.markItUpHeader ul ul li {
				float:none;
				border-bottom:1px solid #000;
			}
			.markItUpHeader ul ul .markItUpDropMenu {
				background:#FFF url(<?php 
echo TBGSettings::getURLhost() . TBGContext::getStrippedTBGPath() . '/themes/' . TBGSettings::getThemeName() . '/markitup/';
?>
submenu.png) no-repeat 100% 50%;
			}
			.markItUpHeader ul .markItUpSeparator {
				margin:0 10px;
				width:1px;
				height:16px;
				overflow:hidden;
				background-color:#CCC;
			}
			.markItUpHeader ul ul .markItUpSeparator {
				width:auto; height:1px;
				margin:0px;
			}
			/* next rows of buttons */
示例#3
0
 /**
  * Reverts an issue field back to the original value
  * 
  * @param TBGRequest $request
  */
 public function runIssueRevertField(TBGRequest $request)
 {
     if ($issue_id = $request['issue_id']) {
         try {
             $issue = TBGContext::factory()->TBGIssue($issue_id);
         } catch (Exception $e) {
             $this->getResponse()->setHttpStatus(400);
             return $this->renderText('fail');
         }
     } else {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderText('no issue');
     }
     $field = null;
     TBGContext::loadLibrary('common');
     switch ($request['field']) {
         case 'description':
             $issue->revertDescription();
             $issue->revertDescription_Syntax();
             $field = array('id' => (int) ($issue->getDescription() != ''), 'name' => $issue->getParsedDescription(array('issue' => $issue)), 'form_value' => $issue->getDescription());
             break;
         case 'reproduction_steps':
             $issue->revertReproduction_Steps();
             $issue->revertReproduction_Steps_Syntax();
             $field = array('id' => (int) ($issue->getReproductionSteps() != ''), 'name' => $issue->getParsedReproductionSteps(array('issue' => $issue)), 'form_value' => $issue->getReproductionSteps());
             break;
         case 'title':
             $issue->revertTitle();
             $field = array('id' => 1, 'name' => strip_tags($issue->getTitle()));
             break;
         case 'category':
             $issue->revertCategory();
             $field = $issue->getCategory() instanceof TBGCategory ? array('id' => $issue->getCategory()->getID(), 'name' => $issue->getCategory()->getName()) : array('id' => 0);
             break;
         case 'resolution':
             $issue->revertResolution();
             $field = $issue->getResolution() instanceof TBGResolution ? array('id' => $issue->getResolution()->getID(), 'name' => $issue->getResolution()->getName()) : array('id' => 0);
             break;
         case 'severity':
             $issue->revertSeverity();
             $field = $issue->getSeverity() instanceof TBGSeverity ? array('id' => $issue->getSeverity()->getID(), 'name' => $issue->getSeverity()->getName()) : array('id' => 0);
             break;
         case 'reproducability':
             $issue->revertReproducability();
             $field = $issue->getReproducability() instanceof TBGReproducability ? array('id' => $issue->getReproducability()->getID(), 'name' => $issue->getReproducability()->getName()) : array('id' => 0);
             break;
         case 'priority':
             $issue->revertPriority();
             $field = $issue->getPriority() instanceof TBGPriority ? array('id' => $issue->getPriority()->getID(), 'name' => $issue->getPriority()->getName()) : array('id' => 0);
             break;
         case 'percent_complete':
             $issue->revertPercentCompleted();
             $field = $issue->getPercentCompleted();
             break;
         case 'status':
             $issue->revertStatus();
             $field = $issue->getStatus() instanceof TBGStatus ? array('id' => $issue->getStatus()->getID(), 'name' => $issue->getStatus()->getName(), 'color' => $issue->getStatus()->getColor()) : array('id' => 0);
             break;
         case 'pain_bug_type':
             $issue->revertPainBugType();
             $field = $issue->hasPainBugType() ? array('id' => $issue->getPainBugType(), 'name' => $issue->getPainBugTypeLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
             break;
         case 'pain_likelihood':
             $issue->revertPainLikelihood();
             $field = $issue->hasPainLikelihood() ? array('id' => $issue->getPainLikelihood(), 'name' => $issue->getPainLikelihoodLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
             break;
         case 'pain_effect':
             $issue->revertPainEffect();
             $field = $issue->hasPainEffect() ? array('id' => $issue->getPainEffect(), 'name' => $issue->getPainEffectLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
             break;
         case 'issuetype':
             $issue->revertIssuetype();
             $field = $issue->getIssuetype() instanceof TBGIssuetype ? array('id' => $issue->getIssuetype()->getID(), 'name' => $issue->getIssuetype()->getName(), 'src' => htmlspecialchars(TBGContext::getTBGPath() . 'iconsets/' . TBGSettings::getThemeName() . '/' . $issue->getIssuetype()->getIcon() . '_small.png')) : array('id' => 0);
             $visible_fields = $issue->getIssuetype() instanceof TBGIssuetype ? $issue->getProject()->getVisibleFieldsArray($issue->getIssuetype()->getID()) : array();
             return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $field, 'visible_fields' => $visible_fields));
             break;
         case 'milestone':
             $issue->revertMilestone();
             $field = $issue->getMilestone() instanceof TBGMilestone ? array('id' => $issue->getMilestone()->getID(), 'name' => $issue->getMilestone()->getName()) : array('id' => 0);
             break;
         case 'estimated_time':
             $issue->revertEstimatedTime();
             return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasEstimatedTime() ? array('id' => 1, 'name' => TBGIssue::getFormattedTime($issue->getEstimatedTime())) : array('id' => 0), 'values' => $issue->getEstimatedTime()));
             break;
         case 'spent_time':
             $issue->revertSpentTime();
             return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasSpentTime() ? array('id' => 1, 'name' => TBGIssue::getFormattedTime($issue->getSpentTime())) : array('id' => 0), 'values' => $issue->getSpentTime()));
             break;
         case 'owned_by':
             $issue->revertOwner();
             return $this->renderJSON(array('changed' => $issue->isOwnerChanged(), 'field' => $issue->isOwned() ? array('id' => $issue->getOwner()->getID(), 'name' => $issue->getOwner() instanceof TBGUser ? $this->getComponentHTML('main/userdropdown', array('user' => $issue->getOwner())) : $this->getComponentHTML('main/teamdropdown', array('team' => $issue->getOwner()))) : array('id' => 0)));
             break;
         case 'assigned_to':
             $issue->revertAssignee();
             return $this->renderJSON(array('changed' => $issue->isAssigneeChanged(), 'field' => $issue->isAssigned() ? array('id' => $issue->getAssignee()->getID(), 'name' => $issue->getAssignee() instanceof TBGUser ? $this->getComponentHTML('main/userdropdown', array('user' => $issue->getAssignee())) : $this->getComponentHTML('main/teamdropdown', array('team' => $issue->getAssignee()))) : array('id' => 0)));
             break;
         case 'posted_by':
             $issue->revertPostedBy();
             return $this->renderJSON(array('changed' => $issue->isPostedByChanged(), 'field' => array('id' => $issue->getPostedByID(), 'name' => $this->getComponentHTML('main/userdropdown', array('user' => $issue->getPostedBy())))));
             break;
         default:
             if ($customdatatype = TBGCustomDatatype::getByKey($request['field'])) {
                 $key = $customdatatype->getKey();
                 $revert_methodname = "revertCustomfield{$key}";
                 $issue->{$revert_methodname}();
                 if ($customdatatype->hasCustomOptions()) {
                     $field = $issue->getCustomField($key) instanceof TBGCustomDatatypeOption ? array('value' => $issue->getCustomField($key)->getID(), 'name' => $issue->getCustomField($key)->getName()) : array('id' => 0);
                 } else {
                     switch ($customdatatype->getType()) {
                         case TBGCustomDatatype::INPUT_TEXTAREA_MAIN:
                         case TBGCustomDatatype::INPUT_TEXTAREA_SMALL:
                             $field = $issue->getCustomField($key) != '' ? array('value' => $key, 'name' => tbg_parse_text($issue->getCustomField($key))) : array('id' => 0);
                             break;
                         default:
                             $field = $issue->getCustomField($key) != '' ? array('value' => $key, 'name' => $issue->getCustomField($key)) : array('id' => 0);
                             break;
                     }
                 }
             }
             break;
     }
     if ($field !== null) {
         return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $field));
     } else {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => TBGContext::getI18n()->__('No valid field specified (%field)', array('%field' => $request['field']))));
     }
 }
示例#4
0
function tbg_get_stylesheets()
{
    $tbg_response = TBGContext::getResponse();
    $cssstrings = array();
    $sepcss = array();
    // Add stylesheets to minify and non-minify lists
    foreach ($tbg_response->getStylesheets() as $stylesheet => $minify) {
        if ($minify == true && file_exists(THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . TBGSettings::getThemeName() . DIRECTORY_SEPARATOR . $stylesheet)) {
            $cssstrings[] = 'themes/' . TBGSettings::getThemeName() . '/' . $stylesheet;
        } else {
            $sepcss[] = $stylesheet;
        }
    }
    $cssstrings = join(',', $cssstrings);
    return array($cssstrings, $sepcss);
}
示例#5
0
?>
" id="theme_name" style="width: 300px;"<?php 
if ($access_level != TBGSettings::ACCESS_FULL) {
    ?>
 disabled<?php 
}
?>
>
			<?php 
foreach ($themes as $aTheme) {
    ?>
				<option value="<?php 
    echo $aTheme;
    ?>
"<?php 
    if (TBGSettings::getThemeName() == $aTheme) {
        ?>
 selected<?php 
    }
    if ($access_level != TBGSettings::ACCESS_FULL) {
        ?>
 disabled<?php 
    }
    ?>
><?php 
    echo $aTheme;
    ?>
</option>
			<?php 
}
?>
?>
				</div>
			</form>
		</div>
		<div id="custom_types_list">
			<?php 
foreach ($custom_types as $type_key => $type) {
    ?>
				<?php 
    include_component('issuefields_customtype', array('type_key' => $type_key, 'type' => $type));
    ?>
			<?php 
}
?>
		</div>
	</div>
</td>
</tr>
</table>
<script>
	var picker = new ColorPicker({iconPath: '<?php 
echo TBGSettings::getURLhost() . TBGContext::getTBGPath() . 'themes/' . TBGSettings::getThemeName() . '/cpicker/';
?>
'});
	
	picker.setCallback(function (color) {
		picker.selector.style.backgroundColor = color;
		picker.selector.value = color;
		picker.hide();
	});
</script>
示例#7
0
/**
 * Returns an <input type="image"> tag
 * 
 * @param string $image image source
 * @param array $params[optional] html parameters
 * @param bool $notheme[optional] whether this is a themed image or a top level path
 * 
 * @return string
 */
function image_submit_tag($image, $params = array(), $notheme = false)
{
    $params['src'] = !$notheme ? TBGContext::getTBGPath() . 'themes/' . TBGSettings::getThemeName() . '/' . $image : $image;
    return '<input type="image" ' . parseHTMLoptions($params) . ' />';
}
 /**
  * Generate captcha picture
  * 
  * @param TBGRequest $request The request object
  * @global array $_SESSION['activation_number'] The session captcha activation number
  */
 public function runCaptcha(TBGRequest $request)
 {
     TBGContext::loadLibrary('ui');
     if (!function_exists('imagecreatetruecolor')) {
         return $this->return404();
     }
     $this->getResponse()->setContentType('image/png');
     $this->getResponse()->setDecoration(TBGResponse::DECORATE_NONE);
     $chain = str_split($_SESSION['activation_number'], 1);
     $size = getimagesize(THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'themes' . DS . TBGSettings::getThemeName() . DS . 'numbers/0.png');
     $captcha = imagecreatetruecolor($size[0] * sizeof($chain), $size[1]);
     foreach ($chain as $n => $number) {
         $pic = imagecreatefrompng(THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'themes' . DS . TBGSettings::getThemeName() . DS . 'numbers/' . $number . '.png');
         imagecopymerge($captcha, $pic, $size[0] * $n, 0, 0, 0, imagesx($pic), imagesy($pic), 100);
         imagedestroy($pic);
     }
     imagepng($captcha);
     imagedestroy($captcha);
     return true;
 }
示例#9
0
    public function getEmailTemplates($template, $parameters = array())
    {
        if (!array_key_exists('module', $parameters)) {
            $parameters['module'] = $this;
        }
        $message_plain = TBGAction::returnTemplateHTML("mailing/{$template}.text", $parameters);
        $html = TBGAction::returnTemplateHTML("mailing/{$template}.html", $parameters);
        $styles = file_get_contents(THEBUGGENIE_MODULES_PATH . 'mailing' . DS . 'fixtures' . DS . TBGSettings::getThemeName() . '.css');
        $message_html = <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
\t<html>
\t\t<head>
\t\t\t<meta http-equiv=Content-Type content="text/html; charset=utf-8">
\t\t\t<style type="text/css">
\t\t\t\t{$styles}
\t\t\t</style>
\t\t</head>
\t\t<body>
\t\t\t{$html}
\t\t</body>
\t</html>
EOT;
        return array($message_plain, $message_html);
    }