/**
  * Execute any application/business logic for this component.
  *
  * @param sfRequest $request The current sfRequest object
  *
  * @return mixed     A string containing the view name associated with this action
  */
 function execute($request)
 {
     //pas de jenkins => pas de form
     if (!$this->getJenkins()->isAvailable()) {
         $this->redirect('jenkins/index');
     }
     if (is_array($buildRequest = $request->getParameter('build'))) {
         $groupRunId = isset($buildRequest['group_run_id']) ? $buildRequest['group_run_id'] : null;
     } else {
         $groupRunId = $request->getParameter('group_run_id');
     }
     $this->forward404If($groupRunId === null, 'group_run_id parameter is required');
     $jenkinsGroupRun = JenkinsGroupRunPeer::retrieveByPK($groupRunId);
     $this->forward404Unless($jenkinsGroupRun instanceof JenkinsGroupRun, sprintf('Can\'t create JenkinsGroupRun with id %s', $groupRunId));
     $defaults = array();
     if ($request->hasParameter('auto_launch')) {
         $autoLaunch = $request->getParameter('auto_launch');
         if ('on' === $autoLaunch) {
             $defaults = array('auto_launch' => true);
         }
     } else {
         $defaults = array('auto_launch' => true);
     }
     $form = new BuildForm($defaults, array('jenkins' => $this->getJenkins(), 'group_run' => $jenkinsGroupRun));
     if (sfRequest::POST === $request->getMethod()) {
         $form->bind($buildRequest);
         if ($form->isValid()) {
             $jobName = $form->getValue('job');
             $autoLaunch = 'on' === $form->getValue('auto_launch');
             $extraParameters = $form->getValue('parameters');
             $jobParameters = array();
             if (isset($extraParameters[$jobName])) {
                 $jobParameters = $extraParameters[$jobName];
             }
             //créer les builds
             $run = new JenkinsRun();
             $run->setJenkinsGroupRun($jenkinsGroupRun);
             $run->setJobName($jobName);
             $run->encodeParameters($jobParameters);
             $run->setLaunched($autoLaunch);
             $run->save();
             //launcher les builds
             if ($autoLaunch) {
                 $run->launch($this->getJenkins(), $jobParameters);
                 $run->computeJobBuildNumber($this->getJenkins(), $this->getUser());
             }
             $this->getUser()->setFlash('info', sprintf('Build [%s] has been added to build branch [%s]', $run->getJobName(), $jenkinsGroupRun->getLabel()));
             if ($request->hasParameter('add_and_continue')) {
                 $urlRedirect = sprintf('jenkins/addBuild?auto_launch=%s&group_run_id=%s', $autoLaunch ? 'on' : 'off', $jenkinsGroupRun->getId());
             } else {
                 $urlRedirect = $this->generateUrl('branch_view', $jenkinsGroupRun);
             }
             $this->redirect($urlRedirect);
         }
     }
     $this->setVar('form', $form);
     $this->setVar('group_run', array('label' => $jenkinsGroupRun->getLabel(), 'git_branch' => $jenkinsGroupRun->getGitBranch(), 'git_branch_slug' => $jenkinsGroupRun->getGitBranchSlug(), 'result' => $jenkinsGroupRun->getResult($this->getJenkins()), 'url' => $this->generateUrl('branch_view', $jenkinsGroupRun)));
 }
Exemple #2
0
<?php

$mod_name = "email";
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
$obj = new SysMenu();
$buildform = new BuildForm();
$table = "blast_lists";
$listtitle = "Blast Lists";
$listsql = "select id, name ,publish   from {$table}  ";
$orderby = " order by name asc  ";
$fieldsarray = array('List' => 'name', 'Publish' => 'publish', 'ID' => 'id');
$filename = "blast_lists.php";
ob_start();
// insert, update, delete
if ($_POST['MM_update'] && $_POST['MM_recordId'] or $_POST['MM_insert'] or $_POST['MM_delete'] && $_POST['MM_recordId']) {
    $MM_editTable = $table;
    $MM_recordId = $_POST['MM_recordId'];
    $MM_editRedirectUrl = $filename . "?action=list";
    $MM_editColumn = "id";
    $MM_fieldsStr = "name|value|description|value|publish|value";
    $MM_columnsStr = "name|',none,''|description|',none,''|publish|',none,''";
    //|$delim,$altVal,$emptyVal|  |',none,''|
    require "../Connections/insetstuff.php";
    require "../Connections/dataactions.php";
    ob_end_flush();
}
if (isset($_GET['id'])) {
    $R__MMColParam = $_GET['id'];
} else {
    $R__MMColParam = "8000000";
Exemple #3
0
<?php

$mod_name = "email";
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
require_once "AMP/Form/HTMLEditor.inc.php";
$obj = new SysMenu();
$buildform = new BuildForm();
if ($_GET['action'] == "list" && !$_GET['status']) {
    $show_sub = "all";
}
if ($_GET['status'] == "pending") {
    $show_sub = "pending";
}
//if (!$_GET) {$show_sub = "new"; }
//if ($_GET['status'] =='pending') {
//	$wherestatus = " and c.status != 'Complete' ";
$extra = array('Blast Report' => 'blast_report.php?blast_ID=');
//}
//else {
//$extra = array('Blast Report'=>'blast_report.php?blast_ID=');
//}
$table = "blast";
$listtitle = "Email Blast";
$listsql = "select distinct c.blast_ID as id, c.status, c.subject, l.name from {$table} c left join blast_lists l on c.list_ID = l.id  where c.blast_type='Email' {$wherestatus} ";
$orderby = " order by id desc  ";
$fieldsarray = array('Subject' => 'subject', 'List' => 'name', 'Status' => 'status');
$filename = "blast_email.php";
ob_start();
// insert, update, delete
if ($_POST['MM_update'] && $_POST['MM_recordId'] or $_POST['MM_insert'] or $_POST['MM_delete'] && $_POST['MM_recordId']) {
<?php

include_once "../lib/buildform.class.php";
/**
 * How to use the from class: implement it like this 
 */
try {
    $createform = new BuildForm("textform", filter_var($_SERVER["PHP_SELF"]), "post");
    echo $createform->formHtml("<p>Sign Up Form :)</p>");
    // $firstname= array("label"=>"*Firstname","type"=>"text","name"=>"firstname","value"=>"","required"=>true,"optionalattr"=>"class=\"formclass\" placeholder=\"Enter name here\"");
    // $lastname = array("label"=>"*Lastname","type"=>"text","name"=>"lastname","value"=>"","required"=>true,"optionalattr"=>"class=\"formclass\" placeholder=\"Enter name here\"");
    $email = array("label" => "*Email Address", "type" => "email", "name" => "email", "value" => "", "optionalattr" => "class=\"formclass\" placeholder=\"Enter your email here\"");
    //$password= array("label"=>"*Password","type"=>"password","name"=>"pass","value"=>"","required"=>true,"optionalattr"=>"class=\"formclass\"");
    $submit = array("type" => "submit", "name" => "submit", "value" => "Register Me", "optionalattr" => "class=\"formclass\"");
    $hidden = array("type" => "hidden", "name" => "submit", "value" => "Register Me", "optionalattr" => "class=\"formclass\"");
    $createform->createInputField(array("label" => "*Enter Firstname", "type" => "text", "name" => "firstname", "value" => "", "required" => true, "optionalattr" => "class=\"formclass\" placeholder=\"Enter name here\""));
    $createform->createInputField(array("label" => "*Enter Lastname", "type" => "text", "name" => "lastname", "value" => "", "required" => true, "optionalattr" => "class=\"formclass\" placeholder=\"Enter name here\""));
    $createform->createInputField($email);
    //$createform->createInputField($password);
    $createform->createTextField(array("label" => "*Type Your Message", "name" => "comments", "cols" => 40, "rows" => 10, "value" => "", "optionalattr" => "class=\"formclass\" placeholder=\"Type your message here\""));
    $gender = array("label" => "Select your Gender", "radiogroup" => array(array("radiolabel" => "male", "checked" => $createform->checkedRadioValue("gender", "male"), "name" => "gender", "value" => "male"), array("radiolabel" => "female", "checked" => $createform->checkedRadioValue("gender", "female"), "name" => "gender", "value" => "female")));
    $sex = array("label" => "Choose your sex", "name" => "sex", "options" => array("....", "male" => "Male", "female" => "Female"));
    $recipes = array("label" => "Choose your favourite foods", "checkboxes" => array(array("checklabel" => "Banku and Tilapia", "name" => "recipes[]", "value" => "Banku and Tilapia", "checked" => $createform->checkedBoxValue("recipes", 'Banku and Tilapia')), array("checklabel" => "Rice and Stew", "name" => "recipes[]", "value" => "Rice and Stew", "checked" => $createform->checkedBoxValue("recipes", 'Rice and Stew')), array("checklabel" => "Fried Rice and Chicken", "name" => "recipes[]", "value" => "Fried Rice and Chicken", "checked" => $createform->checkedBoxValue("recipes", "Fried Rice and Chicken")), array("checklabel" => "Gari Foto and Chicken", "name" => "recipes[]", "value" => "Gari Foto and Chicken", "checked" => $createform->checkedBoxValue("recipes", "Gari Foto and Chicken"))));
    $createform->createCheckBox($recipes);
    $createform->createSelectField($sex);
    $createform->createRadioButton($gender);
    $createform->createInputField($hidden);
    //$createform->createInputField($hidden);
    $createform->createInputField($submit);
    //shows entire form on screen
    echo $createform->displayForm("Top Labling");
Exemple #5
0
<?php

$modid = "";
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
$obj = new SysMenu();
$buildform = new BuildForm();
$table = "display";
$listtitle = "Dispaly Page";
$listsql = "select id, name  from {$table}  ";
$orderby = " order by name asc  ";
$fieldsarray = array('Name' => 'name', 'ID' => 'id');
$filename = "display.php";
ob_start();
// insert, update, delete
if ($_POST['MM_update'] && $_POST['MM_recordId'] or $_POST['MM_insert'] or $_POST['MM_delete'] && $_POST['MM_recordId']) {
    $MM_editTable = $table;
    $MM_recordId = $_POST['MM_recordId'];
    $MM_editRedirectUrl = $filename . "?action=list";
    $MM_editColumn = "id";
    $MM_fieldsStr = "name|value|mod_id|value|mod_intro_list_id|value|mod_intro_detail_id|value|sql|value|list_html|value|detail_html|value|display_fields|value|sort_field|value|sort_class|sort_field2|value|sort_class2|value|sql_order|value";
    $MM_columnsStr = "name|',none,''|mod_id|',none,''|mod_intro_list_id|',none,''|mod_intro_detail_id|',none,''|sql|',none,''|list_html|',none,''|detail_html|',none,''|display_fields|',none,''|sort_field|',none,''|sort_class|',none,''|sort_field2|',none,''|sort_class2|',none,''|sql_order|',none,''";
    //|$delim,$altVal,$emptyVal|  |',none,''|
    require "../Connections/insetstuff.php";
    require "../Connections/dataactions.php";
    ob_end_flush();
}
if (isset($_GET['id'])) {
    $R__MMColParam = $_GET['id'];
} else {
    $R__MMColParam = "8000000";
Exemple #6
0
<?php

$modid = "45";
$mod_name = "rss";
require "Connections/freedomrising.php";
$buildform = new BuildForm();
include_once "FeedOnFeeds/init.php";
$table = "px_feeds";
$listtitle = "Subscribed Feeds";
$listsql = "select * from {$table} WHERE(isNull(service) OR service='Content') ";
$orderby = " order by id desc ";
$fieldsarray = array('ID' => 'id', 'Title' => 'title', 'URL' => 'url');
$url = $_POST['rss_url'];
if (!$url) {
    $url = $_GET['rss_url'];
}
$opml = $_POST['opml_url'];
$file = $_POST['opml_file'];
$maxfilesize =& new Input('hidden', 'MAX_FILE_SIZE', '100000');
$html = $buildform->start_table('name');
$html .= $buildform->add_header('Add RSS Feed', 'banner');
$html .= $buildform->add_content($maxfilesize->fetch());
$html .= addfield('rss_url', 'RSS or Weblog URL:', 'text');
$html .= addfield('opml_url', 'OPML URL:', 'text');
$html .= $buildform->add_content($buildform->add_btn());
$html .= $buildform->end_table();
$form =& new Form();
$form->set_contents($html);
include "header.php";
echo $form->fetch();
if ($url) {
Exemple #7
0
<?php
$mod_name = "system";

require("Connections/freedomrising.php");
$buildform = new BuildForm;

function addsecart($name,$desc,$type) {
	global $dbcon;
	$sql = "insert into articles(title,test,type,class,publish) values ('$name','$desc','$type','8','1')";
	$insert=$dbcon->Execute($sql) or DIE($dbcon->ErrorMsg());
}

function addsec($name, $desc,$order) {
	global $dbcon;
	$name = addslashes($name);
	$desc = addslashes($desc);
	$sql = "insert into articletype (usenav,type,description,up,parent,listtype,header,textorder) values ('1','$name','$desc','20','1','1','1','$order')";
	$insert=$dbcon->Execute($sql) or DIE($dbcon->ErrorMsg());
	$getid=$dbcon->Execute("select id from articletype order by id desc limit 1") or DIE($dbcon->ErrorMsg());
	addsecart($name, $desc, $getid->Fields("id"));
	$nav = "<td> <a href=\"section.php?id=".$getid->Fields("id")."\" class=nav>".$name."</a></td>";
	return $nav;
}

if ($_POST['MM_insert']) {

	$stripit= substr(trim($basepath), -1); 
	if ($stripit != "/") { $basepath = $basepath."/";}
	$websitename = addslashes($websitename);
	$metadescription = addslashes($metadescription);
	$sql = "update sysvar set websitename= '$websitename' ,basepath = '$basepath', metadescription = '$metadescription', emfrom = '$emfrom', emfaq = '$emfaq' where id=1 ";
     array_push($required, "password");
     $process->errorinfo = array_merge($process->errorinfo, $validate->check_PasswordLength(array("password" => 6)));
     $process->errorinfo = array_merge($process->errorinfo, $validate->check_requiredFields($required));
     $process->errorinfo = array_merge($process->errorinfo, $validate->check_PasswordFields("password", "cpassword"));
     /** Insert Data into Database **/
     $process->message("You have successfully registered {$process->post("firstname")}");
     if ($process->successflag) {
         echo "<p style='background:white;text-align:center'>Hooray your form is ready to be inserted into the database :)</p>";
         //echo "Form_submitted - ".$process->post("firstname");
         //$rec::$tablefields = array('fieldname1'=>'?','fieldname2'=>'?',...);
         //array("firstname","lastname","gender","username","email","password","cpassword",); //$sql = $query->getTable("users");
         // $result = $query->tablefields = array('fieldname1'=>'?','fieldname2'=>'?');
         // return parent::setData($key,$result);
     }
 }
 $form = new BuildForm("signupform", filter_var($_SERVER["PHP_SELF"]), "post");
 $form->form_heading = $form->formHtml("<h2>User Sign Up Form </h2>");
 //First name
 $form->createInputField(array("label" => "*Firstname", "type" => "text", "name" => "firstname", "value" => "", "optionalattr" => "class=\"forminput\" placeholder=\"Enter Firstname\""), $validate->displayErrorField($process->errorinfo, "firstname"));
 //Last name
 $form->createInputField(array("label" => "*Lastname", "type" => "text", "name" => "lastname", "value" => "", "optionalattr" => "class=\"forminput\" placeholder=\"Enter Lastname\""), $validate->displayErrorField($process->errorinfo, "lastname"));
 //Gender
 $form->createSelectField(array("label" => "*Gender", "name" => "gender", "value" => "", "options" => array("--Select Your Gender--" => "--Select Your Gender--", "M" => "Male", "F" => "Female")), $validate->displayErrorField($process->errorinfo, "gender"));
 //Username
 $form->createInputField(array("label" => "*Username", "type" => "text", "name" => "username", "value" => "", "required" => true, "optionalattr" => "class=\"forminput\" placeholder=\"Enter Username \""), $validate->displayErrorField($process->errorinfo, "username"));
 //Email
 $form->createInputField(array("label" => "*Email", "type" => "email", "name" => "email", "value" => "", "optionalattr" => "class=\"forminput\" placeholder=\"Enter Email: someone@example.com\""), $validate->displayErrorField($process->errorinfo, "email"));
 //Password
 $form->createInputField(array("label" => "*Password", "type" => "password", "name" => "password", "value" => "", "optionalattr" => "class=\"forminput\" placeholder=\"Enter Password\""), $validate->displayErrorField($process->errorinfo, "password"));
 //Confirm Password
 $form->createInputField(array("label" => "*Confirm Password", "type" => "password", "name" => "cpassword", "value" => "", "optionalattr" => "class=\"forminput\" placeholder=\"Enter Your Password Again \""), $validate->displayErrorField($process->errorinfo, "cpassword"));
Exemple #9
0
<?php

$mod_name = "content";
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
require_once 'AMP/System/Upload.inc.php';
require_once 'AMP/Content/Image/Resize.inc.php';
require_once 'AMP/Content/Image/Display.inc.php';
$obj = new SysMenu();
$buildform = new BuildForm();
include "header.php";
#$getimgset=$dbcon->Execute("SELECT thumb, optw, optl FROM sysvar where id =1") or DIE($dbcon->ErrorMsg());
if ($_POST['MM_insert'] && isset($_FILES['file']['tmp_name']) && file_exists($_FILES['file']['tmp_name'])) {
    $upLoader =& new AMPSystem_Upload($_FILES['file']['name']);
    if (isset($_POST['newname']) && $_POST['newname']) {
        $upLoader->setTargetFileName($_POST['newname']);
    }
    $image_path = AMP_CONTENT_URL_IMAGES . AMP_IMAGE_CLASS_ORIGINAL;
    if ($upLoader->setFolder($image_path) && $upLoader->execute($_FILES['file']['tmp_name'])) {
        $new_file_name = basename($upLoader->getTargetPath());
        $reSizer =& new ContentImage_Resize();
        if (!($reSizer->setImageFile($upLoader->getTargetPath()) && $reSizer->execute())) {
            $result_message = "Resize failed:<BR>" . join("<BR>", $reSizer->getErrors()) . $result_message;
        } else {
            $imageDisplay =& new ContentImage_Display_allVersions($new_file_name);
            $result_message = $imageDisplay->execute();
        }
    } else {
        $result_message = "File Upload Failed<BR>\n" . join('<BR>', $upLoader->getErrors());
    }
    #$imnae2 = upload_image($_POST['newname'],$getimgset->Fields("optw"),$getimgset->Fields("optl"),$getimgset->Fields("thumb"));
Exemple #10
0
<?php

$mod_name = 'content';
require_once "Connections/freedomrising.php";
require_once "Connections/sysmenu.class.php";
require_once "AMP/Form/HTMLEditor.inc.php";
require_once "../includes/versionfunctions.php";
$buildform = new BuildForm();
$obj = new SysMenu();
/* 
 foreach ($_POST as $ps_key=>$ps_value) {
   print $ps_key.": ".$ps_value."<BR>";
 }
*/
if (!AMP_Authorized(AMP_PERMISSION_CONTENT_EDIT)) {
    ampredirect("index.php");
}
if (isset($_GET['preview'])) {
    ampredirect(AMP_URL_AddVars(AMP_CONTENT_URL_ARTICLE, array("id=" . $_GET['id'], "preview=1")));
}
ob_start();
if ($_GET['restore']) {
    articleversionrestore($_GET['restore']);
    $org_id = $_GET['id'];
    ampredirect("article_edit.php?id={$org_id}");
}
if ($_POST['MM_update'] && $_POST['MM_recordId'] or $_POST['MM_insert'] or $_POST['MM_delete'] && $_POST['MM_recordId']) {
    //set non POST passed varablies
    $userlookup = AMPSystem_Lookup::instance('users');
    $article = trim($_POST['article']);
    $_POST['updatedby'] = array_search($_SERVER['REMOTE_USER'], $userlookup);
Exemple #11
0
<?php
$mod_name="content";
require_once("Connections/freedomrising.php"); 
require_once("Connections/sysmenu.class.php");
require_once ('AMP/Content/Section/Contents/Manager.inc.php');
require_once('AMP/Content/Lookups.inc.php');
require_once ('AMP/Content/Labels.inc.php');

// create Menu
$buildform = new BuildForm;
$obj = new SysMenu;

  // *** Edit Operations: declare Tables
  $MM_editAction = $PHP_SELF;
  if ($_SERVER['QUERY_STRING']) {
    $MM_editAction = $MM_editAction . "?" . $_SERVER['QUERY_STRING'];
  }

  $MM_abortEdit = 0;
  $MM_editQuery = "";
  ob_start();


  // *** Update Record: set variables
  
if ( ((isset($_REQUEST['MM_update'])) && (isset($_REQUEST['MM_recordId'])) ) or (isset($_REQUEST['MM_insert'])) or ((isset($_REQUEST['MM_delete'])) && (isset($_REQUEST['MM_recordId']))) )  {

	$getimgset=$dbcon->Execute("SELECT thumb, optw, optl FROM sysvar where id =1") or DIE($dbcon->ErrorMsg());
	if ($_FILES['file']['name']) {
		$image2 = upload_image('',$getimgset->Fields("optw"),$getimgset->Fields("optl"),$getimgset->Fields("thumb"));
	}
Exemple #12
0
<?php
$modid = "payments";

require_once("Connections/freedomrising.php");
require_once("Connections/sysmenu.class.php");
$obj = new SysMenu; 
$buildform = new BuildForm;

$table = "payment";
$listtitle ="Payments";
$listsql ="select id, Name_On_Card, Amount  from $table  ";
$orderby =" order by  id desc  ";
$fieldsarray=array( 'Name On Card'=>'Name_On_Card','Amount'=>'Amount','ID'=>'id'
					);
$filename="payments.php";

ob_start();
// insert, update, delete
if ((($_POST['MM_update']) && ($_POST['MM_recordId'])) or ($_POST['MM_insert']) or (($_POST['MM_delete']) && ($_POST['MM_recordId']))) {

    $MM_editTable  = $table;
    $MM_recordId = $_POST['MM_recordId'];
    $MM_editRedirectUrl = $filename."?action=list";
	$MM_editColumn = "id";
	$MM_fieldsStr = "user_ID|value|payment_item_ID|value|payment_merchant_ID|value|Name_On_Card|value|Credit_Card_Type|value|Credit_Card_Number|value|Credit_Card_Secrity_Code|value|Credit_Card_Expiration|value|Amount|value|Status|value| Billing_Street|value|Billing_Street2|value|Billing_City|value|Billing_State|value|Billing_Zip|value|Billing_Email|value";
    $MM_columnsStr = "user_ID|',none,''|payment_item_ID|',none,''|payment_merchant_ID|',none,''|Name_On_Card|',none,''|Credit_Card_Type|',none,''|Credit_Card_Number|',none,''|Credit_Card_Secrity_Code|',none,''|Credit_Card_Expiration|',none,''|Amount|',none,''|Status|',none,''| Billing_Street|',none,''|Billing_Street2|',none,''|Billing_City|',none,''|Billing_State|',none,''|Billing_Zip|',none,''|Billing_Email|',none,''"; //|$delim,$altVal,$emptyVal|  |',none,''|

	require ("../Connections/insetstuff.php");
    require ("../Connections/dataactions.php");
    ob_end_flush();	
}