switch externals to trunk.

Inform-merge: from the changeset:
r32477: Merge 2.0-inform from trunk previously
r32478: Merge 2.0-inform from trunk previously
r32481: merge 2.0infom with lastes chunk 
r32483: merge 2.0infom with lastes chunk 
r33526: Final styling of all forms and combined communication form add/alter javascript for height adjustment of First / Second block 
r33580: styling for combined form communication in myinfom pages 
r33706: styling of combined form (communication) in Email 
r33881: made compatible to $extraClass 
r33885: added defaultVal
r33887: fixed typo 
r34728: modified SmallFieldHolder?()
r34729: added "validationError"-class 
r34914: WIP3866: Factfinder: Hide "self emplyed" block 
r34964: Change current plan upto TraumaInsurance? 
r35038: disabled friggin field focus 
r35230: #1032 Fixed hash-link insertion 
r35887: conditionally setting parameters in sourceID() - to avoid empty overrides
r35892: Saving value in SQL-compatible format (YYYY-MM-DD instead of DD/MM/YYYY), with fallback for non-sql values (just passed through without conversion) 
r35928: Removed "create a" from PageType?-dropdown, sorting alphabetically, falling back to $singular_name
r35990: branched off for membertablefield
r35994: fix for membertablefield
r36024: added array-condition needed for DMYDateField 
r36083: fix bug for compositeField -> dropDatalessField
r36394: removed debug code 
r36826: change wrong indent format 
r36828: WIP 4262: Logging out of My Inform goes to blank page
r36858: Fixed error caused in r12472 while merging to Session-class
r37132: Merged partial changesets from branches/2.0-nzct, only adding childID to detailform when not in add-mode 
r40815: add an unsubscribe record when a member subscribe a newslettertype 
r41113: fix the bug described in http://support.silverstripe.com/info/ticket/31: CRM not showing search results
r43226: fixed search (partial merge from trunk) 
r43268: merged createNewPassword() from trunk, was referencing a non-existinent global function randomString()


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@45473 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2007-11-23 01:10:19 +00:00
parent d8709777c0
commit a3f9d9b6d3
10 changed files with 86 additions and 38 deletions

View File

@ -255,7 +255,6 @@ JS;
unset($classes[$mark]);
}
}
foreach($classes as $class) {
$instance = singleton($class);
if($instance instanceof HiddenClass) continue;
@ -271,7 +270,7 @@ JS;
$addAction = preg_replace('/^a /','',$addAction);
$addAction = ucfirst($addAction);
} else {
$addAction = $class;
$addAction = $instance->singular_name();
}
$result->push(new ArrayData(array(
@ -279,6 +278,8 @@ JS;
"AddAction" => $addAction,
)));
}
$result->sort('AddAction');
return $result;
}

View File

@ -439,7 +439,7 @@ HTML;
$fileData .= implode(",",$columnData);
$fileData .= "\n";
}
HTTP::sendFileToBrowser($fileData, $fileName);
} else {
user_error("No records found", E_USER_ERROR);

View File

@ -81,6 +81,8 @@ class MemberTableField extends ComplexTableField {
$fieldList["Password"] = "Password";
}
// $detailFormFields = singleton(Object::getCustomClass($this->stat("data_class")))->getCMSFields();
if(isset($_REQUEST['ctf']['childID']) && $memberID = $_REQUEST['ctf']['childID']) {
$SNG_member = DataObject::get_by_id($this->stat("data_class"),$_REQUEST['ctf']['childID']);
} else {
@ -98,7 +100,7 @@ class MemberTableField extends ComplexTableField {
$this->hidePassword = $hidePassword;
parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields);
parent::__construct($controller, $name, $sourceClass, $fieldList);
Requirements::javascript("cms/javascript/MemberTableField.js");
@ -128,7 +130,6 @@ class MemberTableField extends ComplexTableField {
}
$this->sourceJoin = " INNER JOIN `Group_Members` ON `MemberID`=`Member`.`ID`";
$this->setFieldListCsv( $csvFieldList );
}
@ -146,40 +147,80 @@ class MemberTableField extends ComplexTableField {
}
function DetailForm() {
// Get all the requests
$ID = Convert::raw2xml(isset($_REQUEST['ctf']['ID'])
? $_REQUEST['ctf']['ID']
: '');
$childID = isset($_REQUEST['ctf']['childID']) ? Convert::raw2xml($_REQUEST['ctf']['childID']) : 0;
$childClass = Convert::raw2xml($_REQUEST['fieldName']);
$methodName = isset($_REQUEST['methodName']) ? $_REQUEST['methodName'] : '';
$this->methodName = $_REQUEST['methodName'];
if($methodName == "add") {
$parentIdName = $this->getParentIdName($childClass,$this->getParentClass());
// used to discover fields if requested and for population of field
if(is_numeric($childID)) {
// we have to use the basedataclass, otherwise we might exclude other subclasses
$childData = DataObject::get_by_id(ClassInfo::baseDataClass($this->sourceClass), $childID);
}
$parentIdName = $this->getParentIdName($this->sourceClass,$this->getParentClass());
if(!$parentIdName) {
user_error("ComplexTableField::DetailForm() DataObject does not seem to have an 'has-one'-relationship", E_USER_WARNING);
return;
}
// If the fieldset is passed, use it, else use the formfields returned
// from the object via a string method call.
if(is_a($this->detailFormFields,"Fieldset")){
$detailFields = $this->detailFormFields;
} else if(is_string($this->detailFormFields)){
$functioncall = $this->detailFormFields;
if($childData->hasMethod($functioncall)){
$detailFields = $childData->$functioncall();
}
} elseif(!$childData || $this->methodName == 'add') {
$SNG_sourceClass = singleton($this->sourceClass);
if(is_numeric($ID) && $this->getParentClass()) {
// make sure the relation-link is existing, even if we just add the sourceClass
// and didn't save it
$parentIDName = $this->getParentIdName($this->sourceClass,$this->getParentClass());
$SNG_sourceClass->$parentIDName = $ID;
}
$detailFields = $SNG_sourceClass->getCMSFields();
} else {
$detailFields = $childData->getCMSFields();
}
if($this->getParentClass()) {
$parentIdName = $this->getParentIdName($this->sourceClass,$this->getParentClass());
if(!$parentIdName) {
user_error("ComplexTableField::DetailForm() Dataobject does not seem to have an 'has-one'-relationship", E_USER_WARNING);
user_error("ComplexTableField::DetailForm() Cannot automatically
determine 'has-one'-relationship to parent,
please use setParentClass() to set it manually",
E_USER_WARNING);
return;
}
$this->detailFormFields->push(new HiddenField('parentClass'," ",$this->getParentClass()));
}
// add relational fields
$detailFields->push(new HiddenField("ctf[parentClass]"," ",$this->getParentClass()));
$detailFields->push(new HiddenField("$parentIdName"," ",$ID));
}
// the ID field confuses the Controller-logic in finding the right view for ReferencedField
$this->detailFormFields->removeByName('ID');
$this->detailFormFields->push(new HiddenField("ctf[ID]"," ",$ID));
// add a namespaced ID instead thats "converted" by saveComplexTableField()
$this->detailFormFields->push(new HiddenField("ctf[childID]","",$childID));
$this->detailFormFields->push(new HiddenField("ClassName","",$this->sourceClass));
$detailFields->removeByName('ID');
$form = new MemberTableField_Popup($this, "DetailForm", $this->detailFormFields, $this->sourceClass, $methodName == "show", $this->detailFormValidator);
// add a namespaced ID instead thats "converted" by saveComplexTableField()
$detailFields->push(new HiddenField("ctf[childID]","",$childID));
$detailFields->push(new HiddenField("ctf[ClassName]","",$this->sourceClass));
$form = new MemberTableField_Popup($this, "DetailForm", $detailFields, $this->sourceClass, false, $this->detailFormValidator);
if (is_numeric($childID)) {
if ($methodName == "show" || $methodName == "edit") {
if ($this->methodName == "show" || $this->methodName == "edit") {
$childData = DataObject::get_by_id($this->sourceClass, $childID);
$form->loadDataFrom($childData);
}
}
if ($methodName == "show") {
if ($this->methodName == "show") {
$form->makeReadonly();
}

View File

@ -46,7 +46,7 @@ class BatchProcess extends Object {
$this->id = self::generateID();
if( !$this->objects || count( $this->objects ) === 0 )
return $this->complete();
return $this->complete();
return $this->next();
}

View File

@ -18,9 +18,9 @@ class SubscribeForm extends UserDefinedForm {
'Subject' => 'Varchar'
);
static $defaults = array(
"OnCompleteMessage" => "<p>Thanks, you have been added to our mailing list.</p>",
);
static $defaults = array(
"OnCompleteMessage" => "<p>Thanks, you have been added to our mailing list.</p>",
);
static $has_many = array(
'Newsletters' => 'NewsletterType'

View File

@ -223,8 +223,7 @@ class NewsletterAdmin extends LeftAndMain {
if(isset($mailType) && is_object($mailType) && $mailType->GroupID) {
$group = DataObject::get_one("Group", "ID = $mailType->GroupID");
}
if(isset($mailType)) {
if(isset($mailType)&&$mailType) {
$fields = new FieldSet(
new TabSet("Root",
new Tab("Newsletter Settings",

View File

@ -50,8 +50,16 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
new TableField(
"Permissions",
"Permission",
array("Code" => "Code", "Arg" => "Optional ID"),
array("Code" => "PermissionDropdownField", "Arg" => "TextField"),
array(
"Code" => "Code",
"Arg" => "Optional ID",
"Enabled" => "Enabled",
),
array(
"Code" => "PermissionDropdownField",
"Arg" => "TextField",
"Enabled" => "CheckboxField",
),
"GroupID", $id
)
)

View File

@ -8,18 +8,13 @@ RightContent.prototype = {
welcomeMessage: "<h1>SilverStripe CMS</h1><p>Welcome to SilverStripe CMS! Please choose click on one of the items on the left pane.</p>",
initialize : function() {
Behaviour.register({
'#Form_EditForm_action_delete' : {
onclick: this.remove.bind(this)
}
});
},
updateCMSContent: function(el, currentTab, link, customCallBack) {
if(!customCallBack) customCallBack = function(){};
if(el || link){
var reqLink = (el.href) ? el.href : link;
var reqLink = (el && el.href) ? el.href : link;
if(typeof(currentTab) != 'undefined')
$('Form_EditForm').openTab = currentTab;
@ -59,7 +54,7 @@ RightContent.prototype = {
remove: function(e) {
if(window.confirm('Are you sure you want to delete?')){
var el = Event.element(e);
Ajax.SubmitForm(el.ownerForm, el.name, {
Ajax.SubmitForm($('Form_EditForm'),, el.name, {
postBody : 'ajax=1',
onSuccess: Ajax.Evaluator,
onFailure: ajaxErrorHandler
@ -113,4 +108,8 @@ RightContent.prototype = {
titleHolder[0].innerHTML = title;
}
}
}
}
var action_delete_right = function(e) {
$('Form_EditForm').remove(e);
}

View File

@ -1 +1 @@
$URL$
$URL:svn://svn.silverstripe.com/silverstripe/modules/cms/branches/2.0.1-inform/silverstripe_version $

View File

@ -22,7 +22,7 @@
&nbsp;
</div>
<h2><% _t('SEARCHRESULTS','Search Results') %></h2>
<div id="ResultTable_holder" class="leftbottom" style="overflow:auto">
<div id="ResultTable_holder" class="leftbottom">
$Results
</div>
</div>