mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 06:32:32 +02:00
2021-03-08 Fred Gleason <fredg@paravelsystems.com>
* Removed the 'RDCartFilter::userIsAdmin()' and 'RDCartFilter::setUserIsAdmin()' methods. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
de570896f1
commit
7ed7218b20
@ -21241,3 +21241,6 @@
|
||||
in rddbmgr(8).
|
||||
* Fixed a bug in 'CheckSchedCodeRules()' in rddbmgr(8) that
|
||||
would throw a SQL error when no schedule codes were defined.
|
||||
2021-03-08 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed the 'RDCartFilter::userIsAdmin()' and
|
||||
'RDCartFilter::setUserIsAdmin()' methods.
|
||||
|
@ -79,8 +79,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
//
|
||||
// Cart Filter
|
||||
//
|
||||
cart_cart_filter=new RDCartFilter(false,this);
|
||||
cart_cart_filter->setUserIsAdmin(user_is_admin);
|
||||
cart_cart_filter=new RDCartFilter(false,user_is_admin,this);
|
||||
connect(rda,SIGNAL(userChanged()),cart_cart_filter,SLOT(changeUser()));
|
||||
|
||||
//
|
||||
@ -150,8 +149,6 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
cart_cancel_button->setFont(buttonFont());
|
||||
connect(cart_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||
|
||||
cart_cart_model->setFilterSql(cart_cart_filter->filterSql());
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
|
@ -26,16 +26,17 @@
|
||||
#include "rdcartfilter.h"
|
||||
#include "rdescape_string.h"
|
||||
|
||||
RDCartFilter::RDCartFilter(bool show_drag_box,QWidget *parent)
|
||||
RDCartFilter::RDCartFilter(bool show_drag_box,bool user_is_admin,
|
||||
QWidget *parent)
|
||||
: RDWidget(parent)
|
||||
{
|
||||
d_show_cart_type=RDCart::All;
|
||||
d_show_track_carts=true;
|
||||
d_user_is_admin=false;
|
||||
d_user_is_admin=user_is_admin;
|
||||
d_cart_model=NULL;
|
||||
d_show_drag_box=show_drag_box;
|
||||
|
||||
d_group_model=new RDGroupListModel(true,false,this);
|
||||
d_group_model=new RDGroupListModel(true,user_is_admin,this);
|
||||
|
||||
//
|
||||
// Filter Phrase
|
||||
@ -246,50 +247,9 @@ QString RDCartFilter::filterSql(const QStringList &and_fields) const
|
||||
if(d_showmatches_box->isChecked()) {
|
||||
sql+=QString().sprintf("limit %d ",RD_LIMITED_CART_SEARCH_QUANTITY);
|
||||
}
|
||||
|
||||
// printf("FILTER SQL: %s\n",sql.toUtf8().constData());
|
||||
|
||||
return sql;
|
||||
|
||||
/*
|
||||
|
||||
if(type_filter.isEmpty()) {
|
||||
return QString("where CART.NUMBER=0 ");
|
||||
}
|
||||
|
||||
QStringList schedcodes;
|
||||
if(d_codes_box->currentText()!=tr("ALL")) {
|
||||
schedcodes << d_codes_box->currentText();
|
||||
}
|
||||
if(d_codes2_box->currentText()!=tr("ALL")) {
|
||||
schedcodes << d_codes2_box->currentText();
|
||||
}
|
||||
if(d_group_box->currentText()==QString(tr("ALL"))) {
|
||||
if(d_user_is_admin) {
|
||||
// sql=" where ";
|
||||
}
|
||||
else {
|
||||
sql+=RDAllCartSearchText(d_filter_edit->text(),schedcodes,
|
||||
rda->user()->name(),true)+" "+type_filter;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sql+=RDCartSearchText(d_filter_edit->text(),d_group_box->currentText(),
|
||||
schedcodes,true)+" "+type_filter;
|
||||
}
|
||||
for(int i=0;i<and_fields.size();i++) {
|
||||
sql+="&& "+and_fields.at(i)+" ";
|
||||
}
|
||||
// sql+=" group by CART.NUMBER order by CART.NUMBER ";
|
||||
sql+=" order by CART.NUMBER ";
|
||||
if(d_showmatches_box->isChecked()) {
|
||||
sql+=QString().sprintf("limit %d ",RD_LIMITED_CART_SEARCH_QUANTITY);
|
||||
}
|
||||
|
||||
// printf("SQL: %s\n",sql.toUtf8().constData());
|
||||
|
||||
return sql;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@ -372,21 +332,6 @@ void RDCartFilter::setLimitSearch(bool state)
|
||||
}
|
||||
|
||||
|
||||
bool RDCartFilter::userIsAdmin() const
|
||||
{
|
||||
return d_user_is_admin;
|
||||
}
|
||||
|
||||
|
||||
void RDCartFilter::setUserIsAdmin(bool state)
|
||||
{
|
||||
if(state!=d_user_is_admin) {
|
||||
d_user_is_admin=state;
|
||||
changeUser();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QString RDCartFilter::service() const
|
||||
{
|
||||
return d_service;
|
||||
@ -446,9 +391,7 @@ void RDCartFilter::changeUser()
|
||||
RDSqlQuery *q;
|
||||
|
||||
if(d_service.isEmpty()) {
|
||||
// LoadUserGroups();
|
||||
d_group_model->changeUser();
|
||||
// d_group_box->setCurrentText(tr("ALL"));
|
||||
d_group_box->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ class RDCartFilter : public RDWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
RDCartFilter(bool show_drag_box,QWidget *parent=0);
|
||||
RDCartFilter(bool show_drag_box,bool user_is_admin,QWidget *parent);
|
||||
~RDCartFilter();
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
@ -54,8 +54,6 @@ class RDCartFilter : public RDWidget
|
||||
void setShowTrackCarts(bool state);
|
||||
bool limitSearch() const;
|
||||
void setLimitSearch(bool state);
|
||||
bool userIsAdmin() const;
|
||||
void setUserIsAdmin(bool state);
|
||||
QString service() const;
|
||||
void setService(const QString &svc);
|
||||
RDLibraryModel *model() const;
|
||||
|
@ -80,8 +80,7 @@ RDCutDialog::RDCutDialog(QString *filter,QString *group,QString *schedcode,
|
||||
//
|
||||
// Cart Filter
|
||||
//
|
||||
cart_cart_filter=new RDCartFilter(false,this);
|
||||
cart_cart_filter->setUserIsAdmin(user_is_admin);
|
||||
cart_cart_filter=new RDCartFilter(false,user_is_admin,this);
|
||||
cart_cart_filter->setShowCartType(RDCart::Audio);
|
||||
cart_cart_filter->setShowTrackCarts(!exclude_tracks);
|
||||
connect(rda,SIGNAL(userChanged()),cart_cart_filter,SLOT(changeUser()));
|
||||
|
@ -142,7 +142,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
//
|
||||
// Filter
|
||||
//
|
||||
lib_cart_filter=new RDCartFilter(true,this);
|
||||
lib_cart_filter=new RDCartFilter(true,false,this);
|
||||
connect(rda,SIGNAL(userChanged()),lib_cart_filter,SLOT(changeUser()));
|
||||
connect(lib_cart_filter,SIGNAL(selectedGroupChanged(const QString &)),
|
||||
this,SLOT(selectedGroupChangedData(const QString &)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user