Skip to content

Commit 1ed6204

Browse files
author
momo_102
committed
Last bugfixes. Should be now fully 2.5 compliant
1 parent 8946886 commit 1ed6204

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

com_clubmanagement/backend/classes/nokCMPerson.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function select_record() {
338338
$mainframe = JFactory::getApplication();
339339
$uri = JFactory::getURI();
340340
$option = $uri->getVar('option');
341-
$func = $uri->getVar('function');
341+
$function = JRequest::getCmd('function', 'jSelectRecord');
342342
$user =& JFactory::getUser();
343343
$limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
344344
$limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' );
@@ -405,7 +405,7 @@ function select_record() {
405405
echo "<td>";
406406
if ($rp == 0)
407407
{
408-
echo "<a style=\"cursor: pointer;\" onclick=\"window.parent.".$func."('".$id."', '".$name."', 'id');\">";
408+
echo "<a class=\"pointer\" onclick=\"if (window.parent) window.parent.".$function."('".$id."', '".$name."');\">";
409409
echo $this->_displayField($strColumn,$field,$i);
410410
echo "</a>";
411411
}

com_clubmanagement/backend/classes/nokTable.class.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,18 @@ function save($id=0, $cols=array()) {
947947
return $result;
948948
}
949949

950+
function get($id, $cols=array())
951+
{
952+
if (count($cols) < 1) $cols = $this->column_show;
953+
954+
//Query
955+
$strSQL = $this->_calcquery($cols, "`".$this->getSetting("Primary_Key")."`=".$id, "");
956+
$this->db->setQuery( $strSQL );
957+
$rows = $this->db->loadRowList();
958+
$row = $rows[0];
959+
return $row;
960+
}
961+
950962
function showdetail($id, $cols=array())
951963
{
952964
if (count($cols) < 1) $cols = $this->column_show;
@@ -962,10 +974,7 @@ function showdetail($id, $cols=array())
962974
echo "<table class=\"admintable\">\n";
963975

964976
//Query
965-
$strSQL = $this->_calcquery($cols, "`".$this->getSetting("Primary_Key")."`=".$id, "");
966-
$this->db->setQuery( $strSQL );
967-
$rows = $this->db->loadRowList();
968-
$row = $rows[0];
977+
$row = $this->get($id, $cols);
969978

970979
// Display
971980
reset($cols);

com_clubmanagement/backend/elements/cmpersonrecord.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,23 @@ protected function getInput() {
4040
$cmobject = new nokCMPerson('com_clubmanagement');
4141
$db =& JFactory::getDBO();
4242
$doc =& JFactory::getDocument();
43-
$title = JText::_('SELECT_PERSON');
4443

45-
$js = "
46-
function jSelectRecord(id, title, object) {
47-
document.getElementById(object + '_id').value = id;
48-
document.getElementById(object + '_name').value = title;
49-
SqueezeBox.close();
50-
}";
51-
$doc->addScriptDeclaration($js);
44+
$title = "";
45+
if ($this->value) {
46+
$row = $cmobject->get($this->value,$cmobject->column_list);
47+
$title = implode($row, " ");
48+
}
49+
50+
// Build the script.
51+
$script = array();
52+
$script[] = ' function jSelectRecord_'.$this->id.'(id, name) {';
53+
$script[] = ' document.id("'.$this->id.'_id").value = id;';
54+
$script[] = ' document.id("'.$this->id.'_name").value = name;';
55+
$script[] = ' SqueezeBox.close();';
56+
$script[] = ' }';
57+
58+
// Add the script to the document head.
59+
$doc->addScriptDeclaration(implode("\n", $script));
5260

5361
// Build the script.
5462
$script = array();
@@ -60,7 +68,7 @@ function jSelectRecord(id, title, object) {
6068
// Add the script to the document head.
6169
$doc->addScriptDeclaration(implode("\n", $script));
6270

63-
$link = 'index.php?option=com_clubmanagement&layout=modal&amp;task=select&amp;cmobj=person&amp;tmpl=component&amp;&amp;function=jSelectRecord';
71+
$link = 'index.php?option=com_clubmanagement&layout=modal&amp;task=select&amp;cmobj=person&amp;tmpl=component&amp;&amp;function=jSelectRecord_'.$this->id;
6472

6573
JHTML::_('behavior.modal', 'a.modal');
6674
$html = "\n".'<div style="float: left;"><input style="background: #ffffff;" type="text" id="'.$this->id.'_name" value="'.htmlspecialchars($title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" /></div>';

com_clubmanagement/backend/language/de-DE.com_clubmanagement.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
CLUB_MANAGEMENT="Vereinsverwaltung"
33
EXPORT="Esportieren"
44
IMPORT="Importieren"
5-
SELECT_PERSON="Person ausw&auml;hlen"
65
BOARD="Vorstand"
76
LINK="Link"
87
LINK_NR="Link %s"
@@ -13,6 +12,7 @@ GO="Los"
1312
DETAILS="Details"
1413
SAVE="Speichern"
1514
CANCEL="Abbrechen"
15+
SELECT="Ausw&auml;hlen"
1616

1717
;Submenu
1818
SUBMENU_CLUBMANAGEMENT_PERSON="Personen"

0 commit comments

Comments
 (0)