Commit ec5ebeb9 authored by Gaurav Mishra's avatar Gaurav Mishra 🐼 Committed by Gaurav Mishra

feat(select2): Use select2 lib for drop-downs

Use select2 library to add search functionality in long drop-downs.
Signed-off-by: Gaurav Mishra's avatarGaurav Mishra <gmishx@gmail.com>
parent eb37bc22
......@@ -128,9 +128,9 @@ class admin_folder_delete extends FO_Plugin {
$V.= "</ul>\n";
$text = _("Select the folder to delete: ");
$V.= "<P>$text\n";
$V.= "<select name='folder'>\n";
$V.= "<select name='folder' class='ui-render-select2'>\n";
$text = _("select folder");
$V.= "<option value=''>[$text]</option>\n";
$V.= "<option value='' disabled selected>[$text]</option>\n";
$V.= FolderListOption(-1, 0, 1, -1, true);
$V.= "</select><P />\n";
$text = _("Delete");
......
......@@ -15,7 +15,8 @@
<li>{{ "Select the folder containing the file to delete"|trans }}:
<select name='folder'
onLoad='Uploads_Get("{{ tracebackUri }}?mod=upload_options&folder=-1")'
onChange='Uploads_Get("{{ tracebackUri }}?mod=upload_options&folder=" + this.value)'>
onChange='Uploads_Get("{{ tracebackUri }}?mod=upload_options&folder=" + this.value)'
class="ui-render-select2">
{{ rootFolderListOptions }}
</select>
</li>
......@@ -39,7 +40,7 @@
<script>
window.onload = function() {
$('#folder_select').select2();
$("select[name=folder]").trigger('change');
};
function Uploads_Reply()
......@@ -50,4 +51,4 @@
}
}
</script>
{% endblock %}
\ No newline at end of file
{% endblock %}
......@@ -41,7 +41,7 @@ abstract class DefaultPlugin implements Plugin
const MENU_ORDER = "menuOrder";
const MENU_TARGET = "menuTarget";
const TITLE = "title";
/** @var ContainerBuilder */
protected $container;
/** @var Twig_Environment */
......@@ -364,6 +364,7 @@ abstract class DefaultPlugin implements Plugin
}
$styles = "<link rel='stylesheet' href='css/jquery-ui.css'>\n";
$styles .= "<link rel='stylesheet' href='css/select2.min.css'>\n";
$styles .= "<link rel='stylesheet' href='css/jquery.dataTables.css'>\n";
$styles .= "<link rel='stylesheet' href='css/fossology.css'>\n";
$styles .= "<link rel='icon' type='image/x-icon' href='favicon.ico'>\n";
......@@ -398,7 +399,7 @@ abstract class DefaultPlugin implements Plugin
{
return $this->render("include/base.html.twig",$this->mergeWithDefault(array("content"=>$content)));
}
/**
* @param string $name
* @throws \Exception
......
......@@ -25,7 +25,7 @@ class MenuRenderer
* @param $parm a list of parameters to add to the URL.
* @param $uploadId upload id
*/
public static function menuToActiveSelect($menu, &$parm, $uploadId = "")
public static function menuToActiveSelect($menu, &$parm, $uploadId = "")
{
if (empty($menu)) {
return '';
......@@ -57,13 +57,13 @@ class MenuRenderer
}
$optionsOut .= $entry;
}
if (plugin_find_id('showjobs') >= 0)
{
$optionsOut .= '<option value="' . Traceback_uri() . '?mod=showjobs&upload='.$uploadId.'" title="' . _("Scan History") . '" >'._("History").'</option>';
}
return '<select class="goto-active-option"><option>-- select action --</option>'.$optionsOut.'</select>';
}
return '<select class="goto-active-option"><option disabled selected>-- select action --</option>'.$optionsOut.'</select>';
}
}
......@@ -75,7 +75,7 @@ function SelectBucketDataset($upload_pk, &$ars_pk, $id="selectbucketdataset", $e
if ($NumRows == 0) return $NoData;
$rows = pg_fetch_all($result);
pg_free_result($result);
if ($NumRows == 1)
if ($NumRows == 1)
{
$ars_pk = $rows[0]['ars_pk'];
return ""; /* only one row */
......@@ -141,7 +141,7 @@ function SelectBucketPool($selected, $active='Y')
$id = "default_bucketpool_fk";
$name = $id;
$select = "<select name='$name' id='$id'>";
$select = "<select name='$name' id='$id' class='ui-render-select2'>";
/* get the bucketpool recs */
if ($active == 'Y')
......@@ -152,7 +152,7 @@ function SelectBucketPool($selected, $active='Y')
$result = pg_query($PG_CONN, $sql);
DBCheckResult($result, $sql, __FILE__, __LINE__);
while ($row = pg_fetch_assoc($result))
while ($row = pg_fetch_assoc($result))
{
$select .= "<option value='$row[bucketpool_pk]'";
if ($row['bucketpool_pk'] == $selected) $select .= " SELECTED ";
......@@ -165,11 +165,11 @@ function SelectBucketPool($selected, $active='Y')
/**
* \brief Get all the unique bucket_pk's for a given uploadtree_pk and
* for a given nomos and bucket agent.
*
*
* \param $nomosagent_pk
* \param $bucketagent_pk
* \param $uploadtree_pk
*
*
* \return array of unique bucket_pk's, may be empty if no buckets.
* FATAL if any input is missing
*/
......@@ -178,11 +178,11 @@ function GetFileBuckets($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucket
global $PG_CONN;
$BuckArray = array();
if (empty($nomosagent_pk)|| empty($bucketagent_pk) || empty($uploadtree_pk))
if (empty($nomosagent_pk)|| empty($bucketagent_pk) || empty($uploadtree_pk))
Fatal("Missing parameter: nomosagent_pk $nomosagent_pk, bucketagent_pk: $bucketagent_pk, uploadtree_pk: $uploadtree_pk<br>", __FILE__, __LINE__);
/* Find lft and rgt bounds for this $uploadtree_pk */
$sql = "SELECT lft,rgt,upload_fk FROM uploadtree
$sql = "SELECT lft,rgt,upload_fk FROM uploadtree
WHERE uploadtree_pk = $uploadtree_pk";
$result = pg_query($PG_CONN, $sql);
DBCheckResult($result, $sql, __FILE__, __LINE__);
......@@ -200,11 +200,11 @@ function GetFileBuckets($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucket
/*select all the buckets for this tree */
$sql = "SELECT distinct(bucket_fk) as bucket_pk
from bucket_file, bucket_def,
(SELECT distinct(pfile_fk) as PF from uploadtree
where upload_fk=$upload_pk
(SELECT distinct(pfile_fk) as PF from uploadtree
where upload_fk=$upload_pk
and ((ufile_mode & (1<<28))=0)
and uploadtree.lft BETWEEN $lft and $rgt) as SS
where PF=pfile_fk and agent_fk=$bucketagent_pk
where PF=pfile_fk and agent_fk=$bucketagent_pk
and bucket_file.nomosagent_fk=$nomosagent_pk
and bucket_pk=bucket_fk
and bucketpool_fk=$bucketpool_pk";
......@@ -221,7 +221,7 @@ function GetFileBuckets($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucket
/**
* \brief Get string of $delimiter delimited bucket names for the given inputs.
* Args are same as GetFileBuckets().
*
*
* \param $nomosagent_pk
* \param $bucketagent_pk
* \param $uploadtree_pk
......@@ -233,7 +233,7 @@ function GetFileBuckets($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucket
*
* \return string of $delimiter delimited bucket names for the given inputs.
*/
function GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $uploadtree_pk,
function GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $uploadtree_pk,
$bucketDefArray, $delimiter, $color)
{
$outstr = "";
......@@ -244,7 +244,7 @@ function GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $uploadtree_pk,
/* convert array of bucket_pk's to array of bucket names */
$BuckNames = array();
foreach ($BuckArray as $bucket_pk)
foreach ($BuckArray as $bucket_pk)
{
$BuckNames[$bucket_pk] = $bucketDefArray[$bucket_pk]['bucket_name'];
}
......@@ -271,18 +271,18 @@ function GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $uploadtree_pk,
else
$outstr .= $bucket_name;
}
return $outstr;
}
/**
* \brief Check if a bucket_pk is found in a tree
* \brief Check if a bucket_pk is found in a tree
* for a given nomos and bucket agent.
*
*
* \param $bucket_pk
* \param $uploadtree_pk
*
* \param $uploadtree_pk
*
* \return True if bucket_pk is found in the tree
* False if not
*/
......@@ -291,7 +291,7 @@ function BucketInTree($bucket_pk, $uploadtree_pk)
global $PG_CONN;
$BuckArray = array();
if (empty($bucket_pk) || empty($uploadtree_pk))
if (empty($bucket_pk) || empty($uploadtree_pk))
Fatal("Missing parameter: bucket_pk: $bucket_pk, uploadtree_pk: $uploadtree_pk<br>", __FILE__, __LINE__);
/* Find lft and rgt bounds for this $uploadtree_pk */
......@@ -310,8 +310,8 @@ function BucketInTree($bucket_pk, $uploadtree_pk)
pg_free_result($result);
/* search for bucket in tree */
$sql = "SELECT bucket_fk from bucket_file,
(SELECT distinct(pfile_fk) as PF from uploadtree
$sql = "SELECT bucket_fk from bucket_file,
(SELECT distinct(pfile_fk) as PF from uploadtree
where uploadtree.lft BETWEEN $lft and $rgt and upload_fk='$upload_fk') as SS
where PF=pfile_fk and bucket_fk='$bucket_pk' limit 1";
......
......@@ -86,10 +86,6 @@ without any warranty.
<argument type="service" id="db.manager"/>
<argument type="service" id="dao.upload"/>
</service>
<service id="dao.ip" class="Fossology\Lib\Dao\IPDao">
<argument type="service" id="db.manager"/>
<argument type="service" id="dao.upload"/>
</service>
<service id="dao.show_jobs" class="Fossology\Lib\Dao\ShowJobsDao">
<argument type="service" id="db.manager"/>
<argument type="service" id="dao.upload"/>
......
......@@ -40,11 +40,11 @@ class admin_tag_manage extends FO_Plugin
/**
* \brief Enable/Disable Tag on one folder(all uploads under this folder) or one upload
*
*
* \param $folder_id - folder id
* \param $upload_id - upload id
* \param $manage - enable or disable
*
*
* \return return null when no uploads to manage, return 1 after setting
*/
function ManageTag($folder_id, $upload_id, $manage)
......@@ -74,7 +74,7 @@ class admin_tag_manage extends FO_Plugin
DBCheckResult($result, $sql, __FILE__, __LINE__);
$count = pg_num_rows($result);
pg_free_result($result);
if (empty($count) && $manage_value == true) // has not been disabled, and want to disable this upload
if (empty($count) && $manage_value == true) // has not been disabled, and want to disable this upload
{
$sql = "INSERT INTO tag_manage(upload_fk, is_disabled) VALUES($upload_id, true);";
$result = pg_query($PG_CONN, $sql);
......@@ -161,14 +161,15 @@ class admin_tag_manage extends FO_Plugin
$V .= "<li>$text<br>\n";
$V .= "<select name='folder'\n";
$V .= "onLoad='Uploads_Get((\"" . Traceback_uri() . "?mod=upload_options&folder=$Folder' ";
$V .= "onChange='Uploads_Get(\"" . Traceback_uri() . "?mod=upload_options&folder=\" + this.value)'>\n";
$V .= "onChange='Uploads_Get(\"" . Traceback_uri() . "?mod=upload_options&folder=\" + this.value)' ";
$V .= "class='ui-render-select2'>\n";
$V .= FolderListOption(-1,0,1,$Folder);
$V .= "</select><P />\n";
$text = _("Select the upload to enable/disable:");
$V .= "<li>$text<br>";
$V .= "<div id='tagdiv'>\n";
$V .= "<select size='10' name='upload' onChange='Tagging_Get(\"" . Traceback_uri() . "?mod=upload_tagging&upload=\" + this.value)'>\n";
$V .= "<select size='10' name='upload' onChange='Tagging_Get(\"" . Traceback_uri() . "?mod=upload_tagging&upload=\" + this.value)'>\n";
$List = FolderListUploads_perm($Folder, Auth::PERM_WRITE);
foreach($List as $L)
{
......
......@@ -91,7 +91,7 @@ class AjaxBrowse extends DefaultPlugin
$beyondUpload = intval($request->get("beyond"));
$commentText = $request->get('commentText');
$direction = $request->get('direction');
if (!empty($columnName) && !empty($uploadId) && !empty($value))
{
$uploadBrowseProxy = new UploadBrowseProxy($groupId, $this->userPerm, $this->dbManager);
......@@ -175,7 +175,7 @@ class AjaxBrowse extends DefaultPlugin
{
$show = $request->get('show');
$folder = $request->get('folder');
$uploadId = intval($row['upload_pk']);
$description = htmlentities($row['upload_desc']);
......@@ -212,7 +212,7 @@ class AjaxBrowse extends DefaultPlugin
{
$nameColumn = '<input type="checkbox" name="uploads[]" class="browse-upload-checkbox" value="'.$uploadId.'"/>'.$nameColumn;
}
$dateCol = substr($row['upload_ts'], 0, 19);
$pairIdPrio = array($uploadId, floatval($row[UploadBrowseProxy::PRIO_COLUMN]));
if (!$this->userPerm && 4 == $row['status_fk'])
......@@ -235,7 +235,7 @@ class AjaxBrowse extends DefaultPlugin
}
$rejectableUploadId = ($this->userPerm || $row['status_fk'] < 4) ? $uploadId : 0;
$tripleComment = array($rejectableUploadId, $row['status_fk'], htmlspecialchars($row['status_comment']));
$sql = "SELECT rf_pk, rf_shortname FROM upload_clearing_license ucl, license_ref"
. " WHERE ucl.group_fk=$1 AND upload_fk=$2 AND ucl.rf_fk=rf_pk";
$stmt = __METHOD__.'.collectMainLicenses';
......@@ -269,11 +269,11 @@ class AjaxBrowse extends DefaultPlugin
$databaseMap[1] = _('Unassigned');
return $this->createSelect($selectElementName,$databaseMap, $selectedValue,$action);
}
private function createSelect($id,$options,$select='',$action='')
{
$html = "<select name=\"$id\" id=\"$id\" $action>";
$html = "<select name=\"$id\" id=\"$id\" $action class=\"ui-render-select2\">";
foreach($options as $key=>$disp)
{
$html .= '<option value="'.$key.'"';
......@@ -284,9 +284,9 @@ class AjaxBrowse extends DefaultPlugin
$html .= ">$disp</option>";
}
$html .= '</select>';
return $html;
return $html;
}
/**
* @param Request $request
......@@ -297,19 +297,19 @@ class AjaxBrowse extends DefaultPlugin
$uploadBrowseProxy = new UploadBrowseProxy(Auth::getGroupId(), $this->userPerm, $this->dbManager);
$params = array($request->get('folder'));
$partQuery = $uploadBrowseProxy->getFolderPartialQuery($params);
$iTotalRecordsRow = $this->dbManager->getSingleRow("SELECT count(*) FROM $partQuery", $params, __METHOD__ . "count.all");
$iTotalRecords = $iTotalRecordsRow['count'];
$this->filterParams = $params;
$filter = $this->getSearchString($request->get('sSearch'));
$filter .= $this->getIntegerFilter(intval($request->get('assigneeSelected')), 'assignee');
$filter .= $this->getIntegerFilter(intval($request->get('statusSelected')), 'status_fk');
$iTotalDisplayRecordsRow = $this->dbManager->getSingleRow("SELECT count(*) FROM $partQuery $filter",
$this->filterParams, __METHOD__ . ".count.". $filter);
$iTotalDisplayRecords = $iTotalDisplayRecordsRow['count'];
$orderString = $this->getOrderString();
$stmt = __METHOD__ . "getFolderContents" . $orderString . $filter;
......
......@@ -77,5 +77,6 @@ var bulkFormTableContent = (function(){
$('#bulkFormAddLicense').click(function(){ bulkFormTableContent[0](); });
$('#bulkFormRmLicense').click(function(){ bulkFormTableContent[1](); });
$('#bulkLicense').select2({width:'resolve'});
function getBulkFormTableContent(){ return bulkFormTableContent[3](); }
......@@ -8,7 +8,7 @@
<ol>
<li>
{{ "Select the parent folder:"|trans }}
<select name='parentid'>
<select name='parentid' class="ui-render-select2">
{{ folderOptions }}
</select>
<P />
......
......@@ -6,7 +6,7 @@
<form method='post'>
<ol>
<li> {{ "Select the folder to edit:"|trans }}
<select name="oldfolderid" onChange="window.location.href='{{ onchangeURI }}' + this.value">
<select name="oldfolderid" onChange="window.location.href='{{ onchangeURI }}' + this.value" class="ui-render-select2">
{{ folderListOption }} FolderListOption(-1, 0, 1, $FolderSelectId);
</select>
<P />
......
......@@ -72,7 +72,7 @@
</tr>
<tr>
<td align="right">{{ 'Risk level'|trans }}</td>
<td align="left">{{ macro.select('risk_level',range(0,5),'risk_level',risk_level) }}</td>
<td align="left">{{ macro.selectsingle('risk_level',range(0,5),'risk_level',risk_level) }}</td>
</tr>
</table>
{% if rfId %}
......
......@@ -64,7 +64,7 @@
</table>
{{ 'Compare with'| trans }}
<select id="cmp">
<select id="cmp" class="ui-render-select2">
<option value="0">--{{ 'existing license'|trans }}--</option>
{% for lic in licenseArray %}
<option value="{{ lic.id }}" title="{{ lic.fullname }}">{{ lic.shortname }}</option>
......
......@@ -12,7 +12,7 @@
<ol>
<li>{{"Select the folder containing the upload you wish to analyze"|trans}}:<br/>
<select name="folder" onLoad="Uploads_Get('{{ baseUri }}?mod=upload_options&folder={{ folderId }}');"
onChange="Uploads_Get('{{ baseUri }}?mod=upload_options&folder=' + this.value);">
onChange="Uploads_Get('{{ baseUri }}?mod=upload_options&folder=' + this.value);" class="ui-render-select2">
{{ folderListOptions }}
</select>
</li>
......
......@@ -37,7 +37,7 @@
<tr>
<th></th>
<th>
<select id="scanFilter">
<select id="scanFilter" class="ui-render-select2">
<option value="0">-- {{'filter for scan results'|trans}} --</option>
{% for shortname,row in scannerLicenses %}
<option value="{{row.rf_pk}}">{{ shortname }}</option>
......@@ -45,7 +45,7 @@
</select>
</th>
<th>
<select id="conFilter">
<select id="conFilter" class="ui-render-select2">
<option value="0">-- {{'filter for edited results'|trans}} --</option>
{% for shortname,row in editedLicenses %}
<option value="{{row.rf_pk}}">{{ shortname }}</option>
......
......@@ -9,7 +9,7 @@
<table>
<tr>
<td>{{ 'Available licenses'| trans }}:<br/>
<select name="licenseLeft" id=licenseLeft" style="min-width:200px" size="20" multiple="multiple">
<select name="licenseLeft" id="licenseLeft" style="min-width:200px" size="20" multiple="multiple">
{% for opt in licenseArray %}
<option value= {{ opt.id }} title='{{ opt.fullname | e }}'
ondblclick="javascript:window.open('{{ licenseUri }}{{ opt.id }}',
......@@ -25,7 +25,7 @@
</td>
<td>
{{ 'Selected licenses'|trans }}:<br/>
<select name="licenseRight" id="licenseRight" style="min-width:200px" size="20" multiple="multiple" >
<select name="licenseRight" id="licenseRight" style="min-width:200px" size="20" multiple="multiple">
</select>
</td>
</tr>
......
......@@ -7,7 +7,7 @@
{% if selected is not defined %}
{% set selected = -1 %}
{% endif %}
<select name="{{ name }}"{% if id is defined %} id="{{ id }}"{% endif %}>
<select name="{{ name }}"{% if id is defined %} id="{{ id }}"{% endif %} class="ui-render-select2">
{% for entry in folderStructure %}
<option value="{{ entry.folder.id }}"{% if selected == entry.folder.id %} selected="selected"{% endif %}>
{% for i in range(0, entry.depth*2) if i > 0 %}&nbsp;{% endfor %}{{ entry.folder.name | escape('html') }}
......
......@@ -16,7 +16,7 @@
<tr>
<th></th>
<th>
<select id="scanFilter">
<select id="scanFilter" class="ui-render-select2">
<option value="0">-- {{'filter for scan results'|trans}} --</option>
{% for shortname,row in scannerLicenses %}
<option value="{{row.rf_pk}}">{{ shortname }}</option>
......
......@@ -6,5 +6,14 @@
#}
<script src="scripts/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="scripts/jquery-ui.js" type="text/javascript"></script>
<script src="scripts/select2.full.min.js"></script>
<script src="scripts/select2.full.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
if(!$('.ui-render-select2').attr("size") > 0) {
$('.ui-render-select2').select2({
width: 'resolve'
});
}
});
</script>
{{ scripts }}
......@@ -34,7 +34,7 @@
{% set size = 0 %}
{% endif %}
<select name="{{ name }}"{% if id is defined %} id="{{ id }}"{% endif %}{% if size > 0 %} multiple="multiple" size="{{ size }}"{% endif %}{% if action is defined %}
{{ action}}{% endif %}>
{{ action}}{% endif %} class="ui-render-select2">
{% for key, value in options %}
<option value="{{ key }}"{% if selected == key %} selected="selected"{% endif %}>
{{ value|e }}
......
......@@ -25,7 +25,7 @@
<table>
<tr>
<td id="bulkExistingLicense">
<select id="bulkLicense" style="width:100%" >
<select id="bulkLicense" style="width:100%" class="ui-render-select2">
{% for license in licenseArray %}
<option value="{{ license.id }}" title="{{ license.fullname|e }}">{{ license.shortname|e }}</option>
{% endfor %}
......
......@@ -16,7 +16,7 @@
{{ 'You have no permission to change permissions on any upload in this folder.'|trans }}
{% else %}
{{ 'Select the upload you wish to edit'|trans }}:
<select id="uploadselect" name="uploadselect">
<select id="uploadselect" name="uploadselect" class="ui-render-select2">
{% for upload in uploadList %}
<option value="{{ upload.upload_pk }}"{% if upload.upload_pk==uploadId %} selected="selected"{% endif %}>{{ upload.name|e }},
{{ upload.upload_ts|date('Y-m-d h:i:s') }}</option>
......@@ -62,7 +62,7 @@
<h2>{{ "Look up who is a member of group "|trans }}</h2>
{{ "To edit group memberships "|trans }} <a href="?mod=group_manage_users">{{ "click here"|trans }}</a>
<br/>
{{ 'To list the users in a group, select the group'|trans }}: <select id="groupsForGum">
{{ 'To list the users in a group, select the group'|trans }}: <select id="groupsForGum" class="ui-render-select2">
{% for gId,gName in groupArray %}
<option value="{{ gId }}">{{ gName|e }}</option>
{% endfor %}
......
......@@ -35,7 +35,7 @@
<label for="host">
{{ 'Choose a host'| trans }}:
</label>
<select name='host'>
<select name='host' class="ui-render-select2">
{{ hostlist }}
</select>
</li>
......
......@@ -38,7 +38,7 @@
</tr>
<tr class="classic">
<th width="25%">{{ "Select the user's top-level folder. Access is restricted to this folder."|trans }}</th>
<td><select name="root_folder_fk">
<td><select name="root_folder_fk" class="ui-render-select2">
{{ folderListOption }}
</select></td>
</tr>
......
......@@ -37,11 +37,11 @@ class user_add extends FO_Plugin {
/**
* \brief Add a user.
*
*
* \return NULL on success, string on failure.
*/
function Add() {
global $PG_CONN;
if (!$PG_CONN) {
......@@ -85,7 +85,7 @@ class user_add extends FO_Plugin {
$text = _("Passwords did not match. Not added.");
return ($text);
}
if(empty($Email))
{
$text = _("Email must be specified. Not added.");
......@@ -98,7 +98,7 @@ class user_add extends FO_Plugin {
$text = _("Invalid email address. Not added.");
return ($text);
}
/* Make sure email is unique */
$email_count = $this->dbManager->getSingleRow("SELECT COUNT(*) as count FROM users WHERE user_email = $1 LIMIT 1;", array($Email))["count"];
if ($email_count > 0) {
......@@ -181,7 +181,7 @@ class user_add extends FO_Plugin {
$text = _("User root folder");
$V.= "$Style<th>$text";
$V.= "</th>";
$V.= "<td><select name='folder'>";
$V.= "<td><select name='folder' class='ui-render-select2'>";
$V.= FolderListOption(-1, 0);
$V.= "</select></td>\n";
$V.= "</tr>\n";
......
......@@ -38,7 +38,7 @@ class user_del extends FO_Plugin
/**
* \brief Delete a user.
*
*
* \return NULL on success, string on failure.
*/
function Delete($UserId)
......@@ -56,7 +56,7 @@ class user_del extends FO_Plugin
return($text);
}
/* Delete the users group
/* Delete the users group
* First look up the users group_pk
*/
$sql = "SELECT group_pk FROM groups WHERE group_name = '$row[user_name]' LIMIT 1;";
......@@ -138,7 +138,7 @@ class user_del extends FO_Plugin
$V .= _("To delete a user, enter the following information:<P />\n");
$V .= "<ol>\n";
$V .= _("<li>Select the user to delete.<br />");
$V .= "<select name='userid'>\n";
$V .= "<select name='userid' class='ui-render-select2'>\n";
while( $row = pg_fetch_assoc($result))
{
$V .= "<option value='" . $row['user_pk'] . "'>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment