Index: typo3/sysext/sys_action/class.tx_sysaction.php =================================================================== --- typo3/sysext/sys_action/class.tx_sysaction.php (revision 7997) +++ typo3/sysext/sys_action/class.tx_sysaction.php (working copy) @@ -1,413 +0,0 @@ - - */ - -class tx_sysaction extends mod_user_task { - var $todoTypesCache = array(); - var $insCounter=0; - var $xCol; - - /** - * TCEforms instance - * - * @var t3lib_TCEforms - */ - var $t3lib_TCEforms; - - function overview_main() { - $mC = $this->renderActionList(); - if ($mC) { - $icon = ''; - return $this->mkMenuConfig($icon.$this->headLink("tx_sysaction",1),'',$mC); - } - } - function main() { - global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS; - - return $this->renderActions(); - } - function JScode() { - $this->t3lib_TCEforms = t3lib_div::makeInstance("t3lib_TCEforms"); - $this->t3lib_TCEforms->backPath = $GLOBALS["BACK_PATH"]; - return $this->t3lib_TCEforms->dbFileCon(); - } - - // ************************ - // ACTIONS - // *********************** - function renderActions() { - global $LANG; - $uid = t3lib_div::intInRange(t3lib_div::_GP("sys_action_uid"),0); - $out=""; - $header=""; - if ($uid) { - $res = $this->getActionResPointer($uid); - if($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { - - // Action header: - $header = t3lib_iconworks::getIconImage("sys_action",$actionRow,$this->backPath,'hspace="2" class="absmiddle"').''.htmlspecialchars($actionRow["title"]).''; - $out.=' - - - - - - - - - '; - $out.='
' . $header . '
' . $LANG->sL(t3lib_BEfunc::getItemLabel('sys_action', 'type')). ' ' . '' . htmlspecialchars(t3lib_BEfunc::getProcessedValue('sys_action', 'type', $actionRow['type'])) . '
' . $LANG->sL(t3lib_BEfunc::getItemLabel('sys_action', 'description')) . ' ' . '' . nl2br(htmlspecialchars($actionRow['description'])) . '
'; - $theCode = $this->pObj->doc->section("",$out,0,1); - - - - // Types of actions: - switch($actionRow["type"]) { - case 1: // new BE user - $actionContent=""; - $beRec = t3lib_BEfunc::getRecord("be_users",intval($actionRow["t1_copy_of_user"])); - if (is_array($beRec)) { - // Create or update: - $inData = t3lib_div::_GP("data"); -// debug($inData); - $userRecord=""; - $newFlag=0; - if (is_array($inData["be_users"])) { - $nId = $this->action_t1_createUpdateBeUser($inData["be_users"],$actionRow); - $userRecord=t3lib_BEfunc::getRecord("be_users",$nId); - } - if (t3lib_div::_GP("be_users_uid")) { - $userRecord = t3lib_BEfunc::getRecord('be_users', t3lib_div::_GP('be_users_uid'), '*', ' AND cruser_id='.intval($this->BE_USER->user['uid']).' AND createdByAction='.intval($actionRow['uid'])); - } - if (!is_array($userRecord)) { - $userRecord=array(); - if (is_array($inData["be_users"]["NEW"])) { $userRecord=$inData["be_users"]["NEW"]; } - $userRecord["uid"]="NEW"; - $newFlag=1; - } - - // List of users... - $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'be_users', 'pid=0 AND cruser_id='.intval($this->BE_USER->user['uid']).' AND createdByAction='.intval($actionRow['uid']).t3lib_BEfunc::deleteClause('be_users'), '', 'username'); - $lines = array(); - while($uRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { - $lines[] = "".($uRow["uid"]==$userRecord["uid"]?"":"").$this->action_linkUserName(t3lib_iconworks::getIconImage("be_users",$uRow,$this->backPath,'title="uid='.$uRow["uid"].'" hspace="2" align="top"').$uRow["username"]." (".$uRow["realName"].")".($uRow["uid"]==$userRecord["uid"]?"":"")."",$actionRow["uid"],$uRow["uid"])."
"; - } - if (count($lines)) { - $theCode.= $this->pObj->doc->section($LANG->getLL("action_t1_listOfUsers"),implode("",$lines),0,1); - } - - $formA=Array(); - $opt=array(); - - $grList = t3lib_div::trimExplode(",",$actionRow["t1_allowed_groups"],1); - $opt[]=''; - foreach ($grlist as $gu) { - $checkGr = t3lib_BEfunc::getRecord("be_groups",$gu); - if (is_array($checkGr)) $opt[]=''; - } - - $formA[]=array($LANG->getLL("action_BEu_hidden").": ", ''); - $formA[]=array($LANG->getLL("action_BEu_username").": ", 'pObj->doc->formWidth(15).'>'); - $formA[]=array($LANG->getLL("action_BEu_password").": ", 'pObj->doc->formWidth(15).'>'); - $formA[]=array($LANG->getLL("action_BEu_realName").": ", 'pObj->doc->formWidth(30).'>'); - $formA[]=array($LANG->getLL("action_BEu_email").": ", 'pObj->doc->formWidth(30).'>'); - if (count($grList)) { - $formA[]=array($LANG->getLL("action_BEu_usergroups").": ", ''); - } - // DB mounts: - $loadDB = t3lib_div::makeInstance("t3lib_loadDBGroup"); - $loadDB->start($userRecord["db_mountpoints"],"pages"); - $params=array( - "size" => 3 - ); - $formA[]=array($LANG->getLL("action_BEu_db_mount").": ", $this->t3lib_TCEforms->dbFileIcons('data[be_users]['.$userRecord["uid"].'][db_mountpoints]','db','pages',$loadDB->itemArray,"",$params)); - - $formA[]=array(" "," "); - $formA[]=array(" ", ''.(!$newFlag?' ':'')); - - if (!$newFlag) { - $p = 'uid='.$userRecord["uid"].", ".$LANG->getLL("lHomedir").": "; - $hPath=$this->action_getUserMainDir(); - if ($hPath && @is_dir($hPath.$userRecord["uid"]."/")) { - $p.= $hPath; - } else { - $p.= $LANG->getLL("lNone"); - } - $actionContent.=t3lib_iconworks::getIconImage("be_users",$userRecord,$this->backPath,'title="'.htmlspecialchars($p).'" hspace=2 align=top').$userRecord["username"]." (".$userRecord["realName"].")"; - } - $actionContent.=$this->pObj->doc->table($formA); - $theCode.= $this->pObj->doc->section($LANG->getLL($newFlag?"action_Create":"action_Update"),$actionContent,0,1); - } else { - $theCode.= $this->pObj->doc->section($LANG->getLL("action_error"),''.$LANG->getLL("action_notReady").'',0,1); - } - break; - case 2: //SQL query - if (t3lib_extMgm::isLoaded("lowlevel")) { - $sql_query = unserialize($actionRow["t2_data"]); - if (is_array($sql_query) && strtoupper(substr(trim($sql_query["qSelect"]),0,6))=="SELECT") { - $fullsearch = t3lib_div::makeInstance("t3lib_fullsearch"); - $fullsearch->formW = 40; - $fullsearch->noDownloadB=1; - $actionContent=""; - // debug($sql_query); - $type = $sql_query["qC"]["search_query_makeQuery"]; - $res = $GLOBALS['TYPO3_DB']->sql_query($sql_query["qSelect"]); - if (!$GLOBALS['TYPO3_DB']->sql_error()) { - $fullsearch->formW=48; - $cP=$fullsearch->getQueryResultCode($type,$res,$sql_query["qC"]["queryTable"]); - $actionContent=$cP["content"]; - if ($type=="csv" || $type=="xml") { - $actionContent.='

'.$LANG->getLL("action_download_file").''; - } - } else { - $actionContent.=$GLOBALS['TYPO3_DB']->sql_error(); - } - if ($this->BE_USER->isAdmin()) { - $actionContent.="
".$fullsearch->tableWrap($sql_query["qSelect"]); - $actionContent.='
' . $GLOBALS['LANG']->getLL('action_editQuery') . ''; - } - $theCode.= $this->pObj->doc->section($LANG->getLL("action_t2_result"),$actionContent,0,1); - } else { - $theCode.= $this->pObj->doc->section($LANG->getLL("action_error"),''.$LANG->getLL("action_notReady").'',0,1); - } - } else { - $theCode.= $this->pObj->doc->section( - $GLOBALS['LANG']->getLL('action_error'), - '' . $GLOBALS['LANG']->getLL('action_lowlevelMissing', true) . '', - 0, 1 - ); - } - break; - case 3: //list records - return htmlspecialchars($this->headLInk('tx_taskcenterrootlist', 1)). '
'. $this->urlInIframe($this->backPath."db_list.php?id=".intval($actionRow["t3_listPid"])."&table=".$actionRow["t3_tables"],1); - break; - case 4: //edit records - $dbAnalysis = t3lib_div::makeInstance("t3lib_loadDBGroup"); - $dbAnalysis->fromTC=0; - $dbAnalysis->start($actionRow["t4_recordsToEdit"],"*"); - $dbAnalysis->getFromDB(); - - $lines=array(); - foreach ($dbAnalysis->itemArray as $el) { - $path = t3lib_BEfunc::getRecordPath ($el["id"],$this->perms_clause,$this->BE_USER->uc["titleLen"]); - $lines[]=' - '. - ''. - t3lib_iconworks::getIconImage($el["table"],$dbAnalysis->results[$el["table"]][$el["id"]],$this->backPath,'hspace="2" align="top" title="'.htmlspecialchars($path).'"'). - t3lib_BEfunc::getRecordTitle($el["table"],$dbAnalysis->results[$el["table"]][$el["id"]],TRUE).' - '; - } - $actionContent = ''.implode("",$lines).'
'; - $theCode.= $this->pObj->doc->section($LANG->getLL("action_t4_edit"),$actionContent,0,1); - break; - case 5: //new record - return htmlspecialchars($this->headLInk('tx_taskcenterrootlist', 1)). '
'. $this->urlInIframe($this->backPath.'alt_doc.php?returnUrl='.rawurlencode('db_list.php?id='.intval($actionRow['t3_listPid']).'&table='.$actionRow['t3_tables']).'&edit['.$actionRow['t3_tables'].']['.intval($actionRow['t3_listPid']).']=new',1); - break; - default: - $theCode.= $this->pObj->doc->section($LANG->getLL("action_error"),''.$LANG->getLL("action_noType").'',0,1); - break; - } - - } - } - return $theCode; - } - function getActionResPointer($uid=0) { - if ($this->BE_USER->isAdmin()) { - $wQ=''; - if (intval($uid)>0) $wQ.=' AND sys_action.uid='.intval($uid); - - $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_action', 'sys_action.pid=0'.$wQ, '', 'sys_action.sorting'); - } else { - $wQ = 'be_groups.uid IN ('.($this->BE_USER->groupList?$this->BE_USER->groupList:0).')'; - $hQ = 'AND sys_action.hidden=0 '; - if (intval($uid)>0) $wQ.=' AND sys_action.uid='.intval($uid); - - $res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( - 'sys_action.*', - 'sys_action', - 'sys_action_asgr_mm', - 'be_groups', - ' AND '.$wQ.' AND sys_action.pid=0 '.$hQ, - 'sys_action.uid', - 'sys_action.sorting' - ); - } - - return $res; - } - function renderActionList() { - global $LANG; - - $res = $this->getActionResPointer(); - $lines=array(); - while($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { - $lines[]=''.t3lib_iconworks::getIconImage("sys_action",$actionRow,$this->backPath,'hspace="2" align="top"').$this->action_link($this->fixed_lgd(htmlspecialchars($actionRow['title'])),$actionRow['uid'],htmlspecialchars($actionRow['description'])).'
'; - } - $out = implode("",$lines); - return $out; - } - function action_link($str,$id,$title="") { - $str=''.$str.''; - return $str; - } - function action_linkUserName($str,$id,$bid) { - $str=''.$str.''; - return $str; - } - function action_t1_createUpdateBeUser($arr,$actionRow=array()) { - reset($arr); - $key = key($arr); - $data=""; - $nId=0; - $BEuid = $actionRow["t1_copy_of_user"]; - if ($key=="NEW") { - $beRec = t3lib_BEfunc::getRecord("be_users",intval($BEuid)); - if (is_array($beRec) && trim($arr[$key]["password"]) && $this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"])) { -// debug($arr[$key]); - $data=array(); - $data["be_users"][$key]=$beRec; - $data["be_users"][$key]["username"]=$this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"]); - $data["be_users"][$key]["password"]=md5(trim($arr[$key]["password"])); - $data["be_users"][$key]["realName"]=$arr[$key]["realName"]; - $data["be_users"][$key]["email"]=$arr[$key]["email"]; - $data["be_users"][$key]["disable"]=intval($arr[$key]["disable"]); - $data["be_users"][$key]["admin"]=0; - $data["be_users"][$key]["usergroup"] = $this->fixUserGroup($data["be_users"][$key]["usergroup"],$actionRow["t1_allowed_groups"],$arr[$key]["usergroups"]); - $data["be_users"][$key]["db_mountpoints"]=$arr[$key]["db_mountpoints"]; - $data["be_users"][$key]["createdByAction"]=$actionRow["uid"]; - } - } else { - $beRec = t3lib_BEfunc::getRecord("be_users",intval($key)); - if (is_array($beRec) && $beRec["cruser_id"]==$this->BE_USER->user["uid"]) { - if (t3lib_div::_GP("_delete_")) { - // delete... ? - $cmd=array(); - $cmd["be_users"][$key]["delete"]=1; - - $tce = t3lib_div::makeInstance("t3lib_TCEmain"); - $tce->stripslashes_values=0; - $tce->start(Array(),$cmd,$this->BE_USER); - $tce->admin=1; - $tce->process_cmdmap(); -// debug($cmd); - $nId = 0; - } elseif ($this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"])) { - // check ownership... - $data=array(); - $data["be_users"][$key]["username"]=$this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"]); - if (trim($arr[$key]["password"])) {$data["be_users"][$key]["password"]=md5(trim($arr[$key]["password"]));} - - $data["be_users"][$key]["realName"]=$arr[$key]["realName"]; - $data["be_users"][$key]["email"]=$arr[$key]["email"]; - $data["be_users"][$key]["disable"]=intval($arr[$key]["disable"]); - $data["be_users"][$key]["admin"]=0; - $data["be_users"][$key]["usergroup"] = $this->fixUserGroup($beRec["usergroup"],$actionRow["t1_allowed_groups"],$arr[$key]["usergroups"]); - $data["be_users"][$key]["db_mountpoints"]=$arr[$key]["db_mountpoints"]; - $nId=$key; - } - } - } - - - if (is_array($data)) { - $tce = t3lib_div::makeInstance("t3lib_TCEmain"); - $tce->stripslashes_values=0; - $tce->start($data,Array(),$this->BE_USER); - $tce->admin=1; - $tce->process_datamap(); - $nId = intval($tce->substNEWwithIDs["NEW"]); - if ($nId) { // Create - $this->action_createDir($nId); - } else { // update - $nId=intval($key); - } - unset($tce); - } - return $nId; - } - function fixUsername($username,$prefix) { - $username=trim($username); - $prefix=trim($prefix); - $username=preg_replace('/^'.quotemeta($prefix).'/','',$username); - - if ($username) { - return $prefix.$username; - } else return false; - } - function fixUserGroup($curUserGroup,$allowedGroups,$inGroups) { - // User group: - // All current groups: - $cGroups = array_flip(t3lib_div::trimExplode(",",$curUserGroup,1)); - $grList = t3lib_div::intExplode(",",$allowedGroups); - foreach ($grList as $gu) { - unset($cGroups[$gu]); // Remove the group if it's in the array for some reason... - } - // reverse array again and set incoming groups: - $cGroups=array_keys($cGroups); - if (is_array($inGroups)) { - foreach ($inGroups as $gu) { - $checkGr = t3lib_BEfunc::getRecord("be_groups",$gu); - if (is_array($checkGr) && in_array($gu,$grList)) { - $cGroups[]=$gu; - } - } - } - return implode(",",$cGroups); - } - function action_createDir($uid) { - $path = $this->action_getUserMainDir(); - if ($path) { - @mkdir($path.$uid,0755); - @mkdir($path.$uid."/_temp_",0755); -// debug($path); - } - } - function action_getUserMainDir() { - $path = $GLOBALS["TYPO3_CONF_VARS"]["BE"]["userHomePath"]; - if ($path && @is_dir($path) && - $GLOBALS["TYPO3_CONF_VARS"]["BE"]["lockRootPath"] && - t3lib_div::isFirstPartOfStr($path,$GLOBALS["TYPO3_CONF_VARS"]["BE"]["lockRootPath"]) && - substr($path,-1)=="/" - ) { - return $path; - } - } -} - -if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/sys_action/class.tx_sysaction.php"]) { - include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/sys_action/class.tx_sysaction.php"]); -} - -?> Index: typo3/sysext/sys_action/ext_emconf.php =================================================================== --- typo3/sysext/sys_action/ext_emconf.php (revision 7997) +++ typo3/sysext/sys_action/ext_emconf.php (working copy) @@ -33,13 +33,12 @@ 'author_company' => 'Curby Soft Multimedia', 'CGLcompliance' => '', 'CGLcompliance_note' => '', - 'version' => '1.2.0', + 'version' => '2.0.0', '_md5_values_when_last_written' => 'a:17:{s:8:"TODO.txt";s:4:"17ff";s:22:"class.tx_sysaction.php";s:4:"627a";s:16:"ext_autoload.php";s:4:"9b72";s:12:"ext_icon.gif";s:4:"f410";s:14:"ext_tables.php";s:4:"abdf";s:14:"ext_tables.sql";s:4:"c36f";s:13:"locallang.xml";s:4:"3327";s:27:"locallang_csh_sysaction.xml";s:4:"a1d4";s:17:"locallang_tca.xml";s:4:"abe1";s:14:"sys_action.gif";s:4:"eb3a";s:17:"sys_action__h.gif";s:4:"7a29";s:7:"tca.php";s:4:"3356";s:32:"task/class.tx_sysaction_task.php";s:4:"207e";s:46:"toolbarmenu/class.tx_sysaction_toolbarmenu.php";s:4:"11d3";s:35:"toolbarmenu/registerToolbarItem.php";s:4:"58a6";s:29:"toolbarmenu/tx_sysactions.css";s:4:"bd1b";s:28:"toolbarmenu/tx_sysactions.js";s:4:"deb0";}', 'constraints' => array( 'depends' => array( - 'taskcenter' => '1.0.0-0.0.0', - 'php' => '5.1.0-0.0.0', - 'typo3' => '4.3.0-0.0.0', + 'taskcenter' => '2.0.0-0.0.0', + 'typo3' => '4.4.0-0.0.0', ), 'conflicts' => array( ), Index: typo3/sysext/sys_action/ext_tables.php =================================================================== --- typo3/sysext/sys_action/ext_tables.php (revision 7997) +++ typo3/sysext/sys_action/ext_tables.php (working copy) @@ -4,8 +4,8 @@ } if (TYPO3_MODE == 'BE') { - $TCA['sys_action'] = array ( - 'ctrl' => array ( + $TCA['sys_action'] = array( + 'ctrl' => array( 'label' => 'title', 'tstamp' => 'tstamp', 'default_sortby' => 'ORDER BY title', @@ -17,7 +17,7 @@ 'adminOnly' => 1, 'rootLevel' => -1, 'setToDefaultOnCopy' => 'assign_to_groups', - 'enablecolumns' => array ( + 'enablecolumns' => array( 'disabled' => 'hidden' ), 'typeicon_classes' => array( @@ -33,11 +33,10 @@ t3lib_extMgm::addLLrefForTCAdescr('sys_action','EXT:sys_action/locallang_csh_sysaction.xml'); - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['sys_action']['tasks'] = array( + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['sys_action']['tx_sysaction_task'] = array( 'title' => 'LLL:EXT:sys_action/locallang_tca.xml:sys_action', 'description' => 'LLL:EXT:sys_action/locallang_csh_sysaction.xml:.description', 'icon' => 'EXT:sys_action/sys_action.gif', - 'task' => 'tx_sysaction_task' ); } ?> \ No newline at end of file Index: typo3/sysext/sys_action/task/class.tx_sysaction_task.php =================================================================== --- typo3/sysext/sys_action/task/class.tx_sysaction_task.php (revision 7997) +++ typo3/sysext/sys_action/task/class.tx_sysaction_task.php (working copy) @@ -59,9 +59,9 @@ // if no task selected, render the menu if ($show == 0) { $content .= $this->taskObject->description( - $GLOBALS['LANG']->getLL('sys_action'), - $GLOBALS['LANG']->getLL('description') - ); + $GLOBALS['LANG']->getLL('sys_action'), + $GLOBALS['LANG']->getLL('description') + ); $content .= $this->renderActionList(); } else { @@ -71,7 +71,7 @@ if (count($record) == 0) { $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_error-not-found', true), + $GLOBALS['LANG']->getLL('action_error-not-found', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); @@ -100,7 +100,7 @@ default: $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_noType', true), + $GLOBALS['LANG']->getLL('action_noType', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); @@ -121,16 +121,16 @@ $content = '

' . $GLOBALS['LANG']->getLL('description') . '

'; // get the actions - $lines = $this->getActions(); - if (count($lines) > 0) { + $actionList = $this->getActions(); + if (count($actionList) > 0) { $items = ''; // render a single action menu item - foreach ($lines as $line) { - $active = (t3lib_div::_GP('show') === $line['uid']) ? ' class="active" ' : ''; + foreach ($actionList as $action) { + $active = (t3lib_div::_GP('show') === $action['uid']) ? ' class="active" ' : ''; $items .= ' - ' . - htmlspecialchars($line['title']) . + ' . + htmlspecialchars($action['title']) . ' '; } @@ -144,11 +144,11 @@ * Get all actions of an user. Admins can see any action, all others only those * whic are allowed in sys_action record itself. * - * @param boolean $toOverview: If true, the link redirects to the taskcenter + * @param boolean $toOverview: If TRUE, the link redirects to the taskcenter * @return array Array holding every needed information of a sys_action */ protected function getActions() { - $lines = array(); + $actionList = array(); // admins can see any record if ($GLOBALS['BE_USER']->isAdmin()) { @@ -188,18 +188,18 @@ ''; } - $lines[] = array( + $actionList[] = array( 'uid' => $actionRow['uid'], 'title' => $actionRow['title'], 'description' => $actionRow['description'], 'descriptionHtml' => nl2br(htmlspecialchars($actionRow['description'])) . $editActionLink, - 'link' => 'mod.php?M=user_task&SET[function]=sys_action.tasks&show=' . $actionRow['uid'], + 'link' => 'mod.php?M=user_task&SET[function]=sys_action.tx_sysaction_task&show=' . $actionRow['uid'], 'icon' => 'EXT:sys_action/sys_action.gif' ); } $GLOBALS['TYPO3_DB']->sql_free_result($res); - return $lines; + return $actionList; } /** @@ -211,15 +211,15 @@ $content = ''; // get the sys_action records - $lines = $this->getActions(); + $actionList = $this->getActions(); // if any actions are found for the current users - if (count($lines) > 0) { - $content .= $this->taskObject->renderListMenu($lines); + if (count($actionList) > 0) { + $content .= $this->taskObject->renderListMenu($actionList); } else { $flashMessage = t3lib_div::makeInstance ( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_not-found-description', true), + $GLOBALS['LANG']->getLL('action_not-found-description', TRUE), $GLOBALS['LANG']->getLL('action_not-found'), t3lib_FlashMessage::INFO ); @@ -255,7 +255,7 @@ if (!is_array($beRec)) { $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_notReady', true), + $GLOBALS['LANG']->getLL('action_notReady', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); @@ -264,8 +264,6 @@ return $content; } - $userRecord = array(); - $newFlag = 0; $vars = t3lib_div::_POST('data'); $key = 'NEW'; @@ -311,13 +309,12 @@ } - // load BE user to edit if (intval(t3lib_div::_GP('be_users_uid')) > 0) { $tmpUserId = intval(t3lib_div::_GP('be_users_uid')); + // check if the selected user is created by the current user $rawRecord = $this->isCreatedByUser($tmpUserId, $record); - if ($rawRecord) { // delete user if (t3lib_div::_GP('delete') == 1) { @@ -327,7 +324,6 @@ $key = $tmpUserId; $vars = $rawRecord; } - } $this->JScode(); @@ -338,37 +334,37 @@
General fields
- - + +
- - + +
- - + +
- - + +
- - + +
Configuration
- - ' . $this->getUsergroups($record, $vars) . '
- + ' . $this->t3lib_TCEforms->dbFileIcons('data[db_mountpoints]', 'db', 'pages', $loadDB->itemArray, '', array('size' => 3)) . '
@@ -396,8 +392,8 @@ 'be_users', 'uid=' . $userId, array ( - 'deleted' => 1, - 'tstamp' => $GLOBALS['ACCESS_TIME'] + 'deleted' => 1, + 'tstamp' => $GLOBALS['ACCESS_TIME'] ) ); @@ -411,14 +407,14 @@ * * @param int $id: Id of the BE user * @param array $action: sys_action record. - * @return mixed the record of the BE user if found, otherwise false + * @return mixed the record of the BE user if found, otherwise FALSE */ protected function isCreatedByUser($id, $action) { $record = t3lib_BEfunc::getRecord( 'be_users', $id, '*', - ' AND cruser_id=' . $GLOBALS['BE_USER']->user['uid'] . ' AND createdByAction=' . intval($action['uid']) + ' AND cruser_id=' . $GLOBALS['BE_USER']->user['uid'] . ' AND createdByAction=' . $action['uid'] ); if (is_array($record)) { @@ -438,7 +434,7 @@ */ protected function getCreatedUsers($action, $selectedUser) { $content = ''; - $lines = array(); + $userList = array(); // List of users $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( @@ -459,13 +455,13 @@ $line = '' . $line . ''; } - $lines[] = $line; + $userList[] = $line; } $GLOBALS['TYPO3_DB']->sql_free_result($res); // if any records found - if (count($lines)) { - $content .= '
' . $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t1_listOfUsers'), implode('
', $lines)); + if (count($userList)) { + $content .= '
' . $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t1_listOfUsers'), implode('
', $userList)); } return $content; @@ -507,8 +503,6 @@ * @return int Id of the new/updated user */ protected function saveNewBackendUser($record, $vars) { - $content = ''; - // check if the db mount is a page the current user is allowed to.); $vars['db_mountpoints'] = $this->fixDbMount($vars['db_mountpoints']); // check if the usergroup is allowed @@ -709,6 +703,13 @@ } } + /** + * Get all allowed usergroups which can be applied to a user record + * + * @param array $record sys_action record + * @param array $vars Selected be_user record + * @return string rendered user groups + */ protected function getUsergroups($record, $vars) { $content = ''; // do nothing if no groups are allowed @@ -750,7 +751,7 @@ */ protected function viewEditRecord($record) { $content = ''; - $lines = array(); + $actionList = array(); $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup'); $dbAnalysis->fromTC = 0; @@ -767,7 +768,7 @@ $description .= ' - ' . t3lib_BEfunc::dateTimeAge($record['crdate']); } - $lines[$el['id']] = array( + $actionList[$el['id']] = array( 'title' => $title, 'description' => t3lib_BEfunc::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, @@ -777,7 +778,7 @@ } // render the record list - $content .= $this->taskObject->renderListMenu($lines); + $content .= $this->taskObject->renderListMenu($actionList); return $content; } @@ -801,7 +802,6 @@ $fullsearch->formW = 40; $fullsearch->noDownloadB = 1; - $type = $sql_query['qC']['search_query_makeQuery']; $res = $GLOBALS['TYPO3_DB']->sql_query($sql_query['qSelect']); @@ -823,14 +823,14 @@ // Admin users are allowed to see and edit the query if ($GLOBALS['BE_USER']->isAdmin()) { $actionContent .= '
' . $fullsearch->tableWrap($sql_query['qSelect']); - $actionContent .= '
getLL('action_editQuery') . '" href="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('lowlevel') . 'dbint/index.php?id=' . '&SET[function]=search' . '&SET[search]=query' . '&storeControl[STORE]=-' . $record['uid'] . '&storeControl[LOAD]=1' . '"> ' . - $GLOBALS['LANG']->getLL('action_editQuery') . '

'; + $GLOBALS['LANG']->getLL('action_editQuery') . '

'; } $content .= $this->taskObject->doc->section($GLOBALS['LANG']->getLL('action_t2_result'), $actionContent, 0, 1); @@ -838,7 +838,7 @@ // query is not configured $flashMessage = t3lib_div::makeInstance ( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_notReady', true), + $GLOBALS['LANG']->getLL('action_notReady', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); @@ -848,7 +848,7 @@ // required sysext lowlevel is not installed $flashMessage = t3lib_div::makeInstance ( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_lowlevelMissing', true), + $GLOBALS['LANG']->getLL('action_lowlevelMissing', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); @@ -872,7 +872,7 @@ if ($this->id == 0 || $this->table == '') { $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_lowlevelMissing', true), + $GLOBALS['LANG']->getLL('action_lowlevelMissing', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); @@ -884,15 +884,10 @@ require_once($GLOBALS['BACK_PATH'] . 'class.db_list.inc'); require_once($GLOBALS['BACK_PATH'] . 'class.db_list_extra.inc'); - - // Start document template object: -// $this->doc = t3lib_div::makeInstance('template'); - // Loading current page record and checking access: $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->taskObject->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; - // If there is access to the page, then render the list contents and set up the document template object: if ($access) { // Initialize the dblist object: @@ -978,7 +973,6 @@ // Setting up the context sensitive menu: $this->taskObject->doc->getContextMenuCode(); - // Begin to compile the whole page $content .= '
' . $dblist->HTMLcode . @@ -987,7 +981,6 @@ // If a listing was produced, create the page footer with search form etc: if ($dblist->HTMLcode) { - // Making field select box (when extended view for a single table is enabled): if ($dblist->table) { $tmpBackpath = $GLOBALS['BACK_PATH']; @@ -1000,7 +993,7 @@ // not enough rights to access the list view or the page $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', - $GLOBALS['LANG']->getLL('action_error-access', true), + $GLOBALS['LANG']->getLL('action_error-access', TRUE), $GLOBALS['LANG']->getLL('action_error'), t3lib_FlashMessage::ERROR ); Index: typo3/sysext/sys_action/tca.php =================================================================== --- typo3/sysext/sys_action/tca.php (revision 7997) +++ typo3/sysext/sys_action/tca.php (working copy) @@ -3,40 +3,40 @@ // ****************************************************************** // sys_action // ****************************************************************** -$TCA['sys_action'] = array ( +$TCA['sys_action'] = array( 'ctrl' => $TCA['sys_action']['ctrl'], - 'interface' => array ( + 'interface' => array( 'showRecordFieldList' => 'hidden,title,type,description,assign_to_groups' ), - 'columns' => array ( - 'title' => array ( + 'columns' => array( + 'title' => array( 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.title', - 'config' => array ( + 'config' => array( 'type' => 'input', 'size' => '25', 'max' => '256', 'eval' => 'trim,required' ) ), - 'description' => array ( + 'description' => array( 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.description', - 'config' => array ( + 'config' => array( 'type' => 'text', 'rows' => 10, 'cols' => 48 ) ), - 'hidden' => array ( + 'hidden' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.hidden', - 'config' => array ( + 'config' => array( 'type' => 'check' ) ), - 'type' => array ( + 'type' => array( 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.type', - 'config' => array ( + 'config' => array( 'type' => 'select', - 'items' => array ( + 'items' => array( array('', '0'), array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.1', '1'), array('LLL:EXT:sys_action/locallang_tca.php:sys_action.type.2', '2'), @@ -46,9 +46,9 @@ ) ) ), - 'assign_to_groups' => array ( + 'assign_to_groups' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.assign_to_groups', - 'config' => array ( + 'config' => array( 'type' => 'select', 'foreign_table' => 'be_groups', 'foreign_table_where' => 'ORDER BY be_groups.title', @@ -59,18 +59,18 @@ 'autoSizeMax' => '10' ) ), - 't1_userprefix' => array ( + 't1_userprefix' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_userprefix', - 'config' => array ( + 'config' => array( 'type' => 'input', 'size' => '25', 'max' => '10', 'eval' => 'trim' ) ), - 't1_allowed_groups' => array ( + 't1_allowed_groups' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_allowed_groups', - 'config' => array ( + 'config' => array( 'type' => 'select', 'foreign_table' => 'be_groups', 'foreign_table_where' => 'ORDER BY be_groups.title', @@ -79,15 +79,15 @@ 'autoSizeMax' => '10' ) ), - 't1_create_user_dir' => array ( + 't1_create_user_dir' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_create_user_dir', - 'config' => array ( + 'config' => array( 'type' => 'check' ) ), - 't1_copy_of_user' => array ( + 't1_copy_of_user' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t1_copy_of_user', - 'config' => array ( + 'config' => array( 'type' => 'group', 'internal_type' => 'db', 'allowed' => 'be_users', @@ -102,9 +102,9 @@ ) ) ), - 't3_listPid' => array ( + 't3_listPid' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t3_listPid', - 'config' => array ( + 'config' => array( 'type' => 'group', 'internal_type' => 'db', 'allowed' => 'pages', @@ -119,19 +119,19 @@ ) ) ), - 't3_tables' => array ( + 't3_tables' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t3_tables', - 'config' => array ( + 'config' => array( 'type' => 'select', 'special' => 'tables', - 'items' => array ( + 'items' => array( array('','') ) ) ), - 't4_recordsToEdit' => array ( + 't4_recordsToEdit' => array( 'label' => 'LLL:EXT:sys_action/locallang_tca.php:sys_action.t4_recordsToEdit', - 'config' => array ( + 'config' => array( 'type' => 'group', 'internal_type' => 'db', 'allowed' => '*', @@ -149,8 +149,8 @@ ), ), - 'types' => array ( - '0' => array('showitem' => 'hidden;;;;1-1-1,type,title;;;;2-2-2'), + 'types' => array( + '0' => array('showitem' => 'hidden;;;;1-1-1,type,title;;;;2-2-2,description;;;;3-3-3,assign_to_groups,'), '1' => array('showitem' => 'hidden;;;;1-1-1,type,title;;;;2-2-2,description;;;;3-3-3,assign_to_groups,--div--,t1_userprefix;;;;5-5-5,t1_copy_of_user,t1_allowed_groups,t1_create_user_dir'), '2' => array('showitem' => 'hidden;;;;1-1-1,type,title;;;;2-2-2,description;;;;3-3-3,assign_to_groups,--div--,'), '3' => array('showitem' => 'hidden;;;;1-1-1,type,title;;;;2-2-2,description;;;;3-3-3,assign_to_groups,--div--,t3_listPid;;;;5-5-5,t3_tables;'), Index: typo3/sysext/sys_action/TODO.txt =================================================================== --- typo3/sysext/sys_action/TODO.txt (revision 7997) +++ typo3/sysext/sys_action/TODO.txt (working copy) @@ -1 +0,0 @@ -- BUG?: Save queries when you select "Edit query" for an action Index: typo3/sysext/sys_action/toolbarmenu/class.tx_sysaction_toolbarmenu.php =================================================================== --- typo3/sysext/sys_action/toolbarmenu/class.tx_sysaction_toolbarmenu.php (revision 7997) +++ typo3/sysext/sys_action/toolbarmenu/class.tx_sysaction_toolbarmenu.php (working copy) @@ -142,12 +142,10 @@ while ($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($queryResource)) { $actions[] = array( $actionRow['title'], - 'mod.php?M=user_task&SET[function]=sys_action.tasks&show=' . $actionRow['uid'], - t3lib_iconworks::getIconImage( + 'mod.php?M=user_task&SET[function]==sys_action.tx_sysaction_task&show=' . $actionRow['uid'], + t3lib_iconworks::getSpriteIconForRecord( 'sys_action', - $actionRow, - $GLOBALS['BACK_PATH'], - 'hspace="2" class="absmiddle"' + $actionRow ), ); } Index: typo3/sysext/sys_action/toolbarmenu/tx_sysactions.css =================================================================== --- typo3/sysext/sys_action/toolbarmenu/tx_sysactions.css (revision 7997) +++ typo3/sysext/sys_action/toolbarmenu/tx_sysactions.css (working copy) @@ -5,8 +5,8 @@ #tx-sys-action-menu ul { position: absolute; list-style: none; - padding: 2px 0px 0px; - margin: 0px; + padding: 2px 0 0; + margin: 0; background-color: #f9f9f9; border: 1px solid #abb2bc; border-top: none;