diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
index bb931c8..a620ac4 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.cs
@@ -121,6 +121,9 @@ namespace PROJ_ETS.WebUserControls
public void doUpdate()
{
btnAddNew.Enabled = cudEnabled;
+ btnCloneWeek.Enabled = cudEnabled;
+ btnAddNew.Visible = isWritable();
+ btnCloneWeek.Visible = isWritable();
fixBtnAddNewComm();
if (!cudEnabled)
{
@@ -159,7 +162,7 @@ namespace PROJ_ETS.WebUserControls
{
// controllo le condizioni: in primis se in web config è abilitato edit passato è ok...
bool answ = utils.obj.confReadBool("bazCudPastEnabled");
- // se non globalmente permesso controllo se sia anno/sett successiva a quelal corrente
+ // se non globalmente permesso controllo se sia anno/sett successiva a quella corrente
if (!answ)
{
DateTime ora = DateTime.Now;
@@ -317,24 +320,24 @@ namespace PROJ_ETS.WebUserControls
rigaComm = (DS_utilsProjEts.v_selCommesseRow)tabComm.Select(string.Format("value = {0}", tabBazSingle[pos_y].idxFase))[0];
if (showOre)
{
- // aggiungo button x fare elemento cliccabile
- LinkButton lnkbDel = new LinkButton();
// controllo se CUD è abilitato
- if (cudEnabled)
+ if (cudEnabled && isWritable())
{
+ // aggiungo button x fare elemento cliccabile
+ LinkButton lnkbDel = new LinkButton();
lnkbDel.Click += new EventHandler(lnkbDel_Click);
lnkbDel.CommandArgument = rigaComm.value.ToString();
lnkbDel.Text = string.Format("{0:0##} h [elimina]", oreTotComm[pos_y]);
lnkbDel.ToolTip = string.Format("Click per eliminare commessa {0}", rigaComm.label.Substring(0, 9));
lnkbDel.OnClientClick = "return confirm('Confermi eliminazione record?')";
+ lnkbDel.Enabled = cudEnabled;
+ cell.Controls.Add(lnkbDel);
}
else
{
- lnkbDel.Text = string.Format("{0:0##} h", oreTotComm[pos_y]);
- lnkbDel.ToolTip = string.Format("Commessa {0} (non modificabile)", rigaComm.label.Substring(0, 9));
+ cell.Text = string.Format("{0:0##} h", oreTotComm[pos_y]);
+ cell.ToolTip = string.Format("Commessa {0} (non modificabile)", rigaComm.label.Substring(0, 9));
}
- lnkbDel.Enabled = cudEnabled;
- cell.Controls.Add(lnkbDel);
}
else
{
@@ -364,7 +367,7 @@ namespace PROJ_ETS.WebUserControls
}
catch
{ }
- doUpdate();
+ Response.Redirect("Bazaar");
}
}
///
@@ -409,24 +412,29 @@ namespace PROJ_ETS.WebUserControls
{
cell = new TableCell();
cell.CssClass = TabellaRisorse[pos_x, pos_y].Css;
- // aggiungo button x fare elemento cliccabile
- LinkButton lnkb = new LinkButton();
- lnkb.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip;
- lnkb.Text = TabellaRisorse[pos_x, pos_y].Label;
- lnkb.CssClass = "openDiag"; // server x far si che apra il dialog modale...
- // controllo se CUD è abilitato
- if (cudEnabled)
+ // controllo SE devo emttere link o meno: se CUD è abilitato e se è WRITABLE
+ if (cudEnabled && isWritable())
{
+ // aggiungo button x fare elemento cliccabile
+ LinkButton lnkb = new LinkButton();
+ lnkb.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip;
+ lnkb.Text = TabellaRisorse[pos_x, pos_y].Label;
+ lnkb.CssClass = "openDiag"; // server x far si che apra il dialog modale...
lnkb.Click += new EventHandler(lnkb_Click);
lnkb.CommandArgument = string.Format("{0}#{1}", TabellaRisorse[pos_x, pos_y].IdxDipendente, TabellaRisorse[pos_x, pos_y].IdxFase);
+ lnkb.Enabled = cudEnabled && isWritable();
+ cell.Controls.Add(lnkb);
+ }
+ else
+ {
+ cell.ToolTip = TabellaRisorse[pos_x, pos_y].ToolTip;
+ cell.Text = TabellaRisorse[pos_x, pos_y].Label;
}
- lnkb.Enabled = cudEnabled;
// controllo se la cella è selezionata, nel caso BOLD!
if (TabellaRisorse[pos_x, pos_y].IdxDipendente == IdxDipSel && TabellaRisorse[pos_x, pos_y].IdxFase == IdxFaseSel)
{
cell.CssClass = "selCel";
}
- cell.Controls.Add(lnkb);
// carico in cella di tabella il linkButton
riga.Cells.Add(cell);
}
@@ -447,6 +455,17 @@ namespace PROJ_ETS.WebUserControls
showPnlAddNewComm(!pnlAddNew.Visible);
}
///
+ /// gestione visualizzaizone pannello elenco commesse da inserire
+ ///
+ ///
+ ///
+ protected void btnCloneWeek_Click(object sender, EventArgs e)
+ {
+ // clono dalal week precedente (con valori a zero...), se valori ci sono NON li sovrascrivo...
+ DataProxy_ProjEts.DP.taBaz.clonePrevWeek(anno, settimana);
+ Response.Redirect("Bazaar");
+ }
+ ///
/// controllo visibilità pannello
///
///
@@ -589,5 +608,69 @@ namespace PROJ_ETS.WebUserControls
}
}
+
+ ///
+ /// pagina corrente (URL finale)
+ ///
+ public string _paginaCorrente { get; set; }
+ ///
+ /// salva in variabile pagina il nome della pagina corrente
+ ///
+ protected void PagCorrente()
+ {
+ Uri MyUrl = Request.Url;
+ string delimStr = "/";
+ char[] delimiter = delimStr.ToCharArray();
+ string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
+ int n = finalUrl.Length;
+ _paginaCorrente = finalUrl[n - 1].ToString();
+ }
+ ///
+ /// risponde alla domanda se l'utente abbia permesso tipo writable (S) nel permessi2funzione
+ ///
+ ///
+ public bool isWritable()
+ {
+ bool answ = false;
+ if (_paginaCorrente == null)
+ {
+ PagCorrente();
+ }
+ answ = user_std.UtSn.isPageWriteEnabled(_paginaCorrente);
+ return answ;
+ }
+ ///
+ /// risponde alla domanda se l'utente sia PowerUser
+ ///
+ ///
+ public bool isPowerUser
+ {
+ get
+ {
+ return user_std.UtSn.userHasRight("PowerUser");
+ }
+ }
+ ///
+ /// risponde alla domanda se l'utente sia PowerReader
+ ///
+ ///
+ public bool isPowerReader
+ {
+ get
+ {
+ return user_std.UtSn.userHasRight("PowerReader");
+ }
+ }
+ ///
+ /// risponde alla domanda se l'utente sia User
+ ///
+ ///
+ public bool isUser
+ {
+ get
+ {
+ return user_std.UtSn.userHasRight("User");
+ }
+ }
}
}
\ No newline at end of file
diff --git a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs
index a4fb600..9133f53 100644
--- a/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs
+++ b/PROJ-ETS/PROJ-ETS/WebUserControls/mod_weekPlan.ascx.designer.cs
@@ -30,6 +30,15 @@ namespace PROJ_ETS.WebUserControls {
///
protected global::System.Web.UI.WebControls.Button btnAddNew;
+ ///
+ /// btnCloneWeek control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnCloneWeek;
+
///
/// pnlAddNew control.
///
diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll
index cb8d219..0219681 100644
Binary files a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll and b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll differ
diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll
index dde6fdb..8cac704 100644
Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ
diff --git a/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip b/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip
index 404457c..bf1109f 100644
Binary files a/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip and b/PROJ-ETS/ReleaseClienti/ETS/PROJ-ETS.zip differ