function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_servicio_medico_prestado"
     $oListOpt =& $this->ListOptions->Items["detail_servicio_medico_prestado"];
     if (TRUE) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("servicio_medico_prestado", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("servicio_medico_prestadolist.php?" . EW_TABLE_SHOW_MASTER . "=cuenta&fk_idcuenta=" . strval($this->idcuenta->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["servicio_medico_prestado_grid"]->DetailView) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=servicio_medico_prestado")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "servicio_medico_prestado";
         }
         if ($GLOBALS["servicio_medico_prestado_grid"]->DetailEdit) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=servicio_medico_prestado")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "servicio_medico_prestado";
         }
         if ($GLOBALS["servicio_medico_prestado_grid"]->DetailAdd) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=servicio_medico_prestado")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "servicio_medico_prestado";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     // "detail_consulta"
     $oListOpt =& $this->ListOptions->Items["detail_consulta"];
     if (TRUE) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("consulta", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("consultalist.php?" . EW_TABLE_SHOW_MASTER . "=cuenta&fk_idcuenta=" . strval($this->idcuenta->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["consulta_grid"]->DetailView) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=consulta")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "consulta";
         }
         if ($GLOBALS["consulta_grid"]->DetailEdit) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=consulta")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "consulta";
         }
         if ($GLOBALS["consulta_grid"]->DetailAdd) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=consulta")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "consulta";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     // "detail_internado_diario"
     $oListOpt =& $this->ListOptions->Items["detail_internado_diario"];
     if (TRUE) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("internado_diario", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("internado_diariolist.php?" . EW_TABLE_SHOW_MASTER . "=cuenta&fk_idcuenta=" . strval($this->idcuenta->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["internado_diario_grid"]->DetailView) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=internado_diario")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "internado_diario";
         }
         if ($GLOBALS["internado_diario_grid"]->DetailEdit) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=internado_diario")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "internado_diario";
         }
         if ($GLOBALS["internado_diario_grid"]->DetailAdd) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=internado_diario")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "internado_diario";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->idcuenta->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>";
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
Esempio n. 2
0
 function SetupOtherOptions()
 {
     global $Language, $Security;
     $options =& $this->OtherOptions;
     $option =& $options["action"];
     // Add
     $item =& $option->Add("add");
     $item->Body = "<a class=\"ewAction ewAdd\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageAddLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageAddLink")) . "\" href=\"" . ew_HtmlEncode($this->AddUrl) . "\">" . $Language->Phrase("ViewPageAddLink") . "</a>";
     $item->Visible = $this->AddUrl != "";
     // Edit
     $item =& $option->Add("edit");
     $item->Body = "<a class=\"ewAction ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageEditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("ViewPageEditLink") . "</a>";
     $item->Visible = $this->EditUrl != "";
     // Copy
     $item =& $option->Add("copy");
     $item->Body = "<a class=\"ewAction ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("ViewPageCopyLink") . "</a>";
     $item->Visible = $this->CopyUrl != "";
     // Delete
     $item =& $option->Add("delete");
     $item->Body = "<a class=\"ewAction ewDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageDeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageDeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("ViewPageDeleteLink") . "</a>";
     $item->Visible = $this->DeleteUrl != "";
     $option =& $options["detail"];
     $DetailTableLink = "";
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_products"
     $item =& $option->Add("detail_products");
     $body = $Language->Phrase("ViewPageDetailLink") . $Language->TablePhrase("products", "TblCaption");
     $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("productslist.php?" . EW_TABLE_SHOW_MASTER . "=sub_category&fk_scat_id=" . urlencode(strval($this->scat_id->CurrentValue)) . "") . "\">" . $body . "</a>";
     $links = "";
     if ($GLOBALS["products_grid"] && $GLOBALS["products_grid"]->DetailView) {
         $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=products")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         if ($DetailViewTblVar != "") {
             $DetailViewTblVar .= ",";
         }
         $DetailViewTblVar .= "products";
     }
     if ($GLOBALS["products_grid"] && $GLOBALS["products_grid"]->DetailEdit) {
         $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=products")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         if ($DetailEditTblVar != "") {
             $DetailEditTblVar .= ",";
         }
         $DetailEditTblVar .= "products";
     }
     if ($GLOBALS["products_grid"] && $GLOBALS["products_grid"]->DetailAdd) {
         $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=products")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         if ($DetailCopyTblVar != "") {
             $DetailCopyTblVar .= ",";
         }
         $DetailCopyTblVar .= "products";
     }
     if ($links != "") {
         $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
         $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
     }
     $body = "<div class=\"btn-group\">" . $body . "</div>";
     $item->Body = $body;
     $item->Visible = TRUE;
     if ($item->Visible) {
         if ($DetailTableLink != "") {
             $DetailTableLink .= ",";
         }
         $DetailTableLink .= "products";
     }
     if ($this->ShowMultipleDetails) {
         $item->Visible = FALSE;
     }
     // Multiple details
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $option->Add("details");
         $oListOpt->Body = $body;
     }
     // Set up detail default
     $option =& $options["detail"];
     $options["detail"]->DropDownButtonPhrase = $Language->Phrase("ButtonDetails");
     $option->UseImageAndText = TRUE;
     $ar = explode(",", $DetailTableLink);
     $cnt = count($ar);
     $option->UseDropDownButton = $cnt > 1;
     $option->UseButtonGroup = TRUE;
     $item =& $option->Add($option->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
     // Set up action default
     $option =& $options["action"];
     $option->DropDownButtonPhrase = $Language->Phrase("ButtonActions");
     $option->UseImageAndText = TRUE;
     $option->UseDropDownButton = FALSE;
     $option->UseButtonGroup = TRUE;
     $item =& $option->Add($option->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
 }
Esempio n. 3
0
 function SetupOtherOptions()
 {
     global $Language, $Security;
     $options =& $this->OtherOptions;
     $option =& $options["action"];
     $option =& $options["detail"];
     $DetailTableLink = "";
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_in_bodegaubicaciones"
     $item =& $option->Add("detail_in_bodegaubicaciones");
     $body = $Language->Phrase("ViewPageDetailLink") . $Language->TablePhrase("in_bodegaubicaciones", "TblCaption");
     $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("in_bodegaubicacioneslist.php?" . EW_TABLE_SHOW_MASTER . "=in_bodegas&fk_codigo_bodega=" . urlencode(strval($this->codigo_bodega->CurrentValue)) . "") . "\">" . $body . "</a>";
     $links = "";
     if ($GLOBALS["in_bodegaubicaciones_grid"] && $GLOBALS["in_bodegaubicaciones_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'in_bodegaubicaciones')) {
         $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=in_bodegaubicaciones")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         if ($DetailViewTblVar != "") {
             $DetailViewTblVar .= ",";
         }
         $DetailViewTblVar .= "in_bodegaubicaciones";
     }
     if ($links != "") {
         $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
         $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
     }
     $body = "<div class=\"btn-group\">" . $body . "</div>";
     $item->Body = $body;
     $item->Visible = $Security->AllowList(CurrentProjectID() . 'in_bodegaubicaciones');
     if ($item->Visible) {
         if ($DetailTableLink != "") {
             $DetailTableLink .= ",";
         }
         $DetailTableLink .= "in_bodegaubicaciones";
     }
     if ($this->ShowMultipleDetails) {
         $item->Visible = FALSE;
     }
     // Multiple details
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $option->Add("details");
         $oListOpt->Body = $body;
     }
     // Set up detail default
     $option =& $options["detail"];
     $options["detail"]->DropDownButtonPhrase = $Language->Phrase("ButtonDetails");
     $option->UseImageAndText = TRUE;
     $ar = explode(",", $DetailTableLink);
     $cnt = count($ar);
     $option->UseDropDownButton = $cnt > 1;
     $option->UseButtonGroup = TRUE;
     $item =& $option->Add($option->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
     // Set up action default
     $option =& $options["action"];
     $option->DropDownButtonPhrase = $Language->Phrase("ButtonActions");
     $option->UseImageAndText = TRUE;
     $option->UseDropDownButton = TRUE;
     $option->UseButtonGroup = TRUE;
     $item =& $option->Add($option->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
 }
Esempio n. 4
0
 function SetupOtherOptions()
 {
     global $Language, $Security;
     $options =& $this->OtherOptions;
     $option =& $options["action"];
     // Add
     $item =& $option->Add("add");
     $item->Body = "<a class=\"ewAction ewAdd\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageAddLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageAddLink")) . "\" href=\"" . ew_HtmlEncode($this->AddUrl) . "\">" . $Language->Phrase("ViewPageAddLink") . "</a>";
     $item->Visible = $this->AddUrl != "" && $Security->CanAdd();
     // Edit
     $item =& $option->Add("edit");
     $item->Body = "<a class=\"ewAction ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageEditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("ViewPageEditLink") . "</a>";
     $item->Visible = $this->EditUrl != "" && $Security->CanEdit() && $this->ShowOptionLink('edit');
     // Copy
     $item =& $option->Add("copy");
     $item->Body = "<a class=\"ewAction ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("ViewPageCopyLink") . "</a>";
     $item->Visible = $this->CopyUrl != "" && $Security->CanAdd() && $this->ShowOptionLink('add');
     // Delete
     $item =& $option->Add("delete");
     $item->Body = "<a class=\"ewAction ewDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewPageDeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewPageDeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("ViewPageDeleteLink") . "</a>";
     $item->Visible = $this->DeleteUrl != "" && $Security->CanDelete() && $this->ShowOptionLink('delete');
     // Show detail edit/copy
     if ($this->getCurrentDetailTable() != "") {
         // Detail Edit
         $item =& $option->Add("detailedit");
         $item->Body = "<a class=\"ewAction ewDetailEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $this->getCurrentDetailTable())) . "\">" . $Language->Phrase("MasterDetailEditLink") . "</a>";
         $item->Visible = $Security->CanEdit() && $this->ShowOptionLink('delete');
         // Detail Copy
         $item =& $option->Add("detailcopy");
         $item->Body = "<a class=\"ewAction ewDetailCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $this->getCurrentDetailTable())) . "\">" . $Language->Phrase("MasterDetailCopyLink") . "</a>";
         $item->Visible = $Security->CanAdd() && $this->ShowOptionLink('delete');
     }
     $option =& $options["detail"];
     $DetailTableLink = "";
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_detalle_deudas"
     $item =& $option->Add("detail_detalle_deudas");
     $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("detalle_deudas", "TblCaption");
     $body .= str_replace("%c", $this->detalle_deudas_Count, $Language->Phrase("DetailCount"));
     $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_detalle_deudaslist.php?" . EW_TABLE_SHOW_MASTER . "=deudas&fk_id=" . strval($this->id->CurrentValue) . "") . "\">" . $body . "</a>";
     $links = "";
     if ($GLOBALS["detalle_deudas_grid"] && $GLOBALS["detalle_deudas_grid"]->DetailView && $Security->CanView() && $this->ShowOptionLink('view') && $Security->AllowView(CurrentProjectID() . 'detalle_deudas')) {
         $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=detalle_deudas")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         if ($DetailViewTblVar != "") {
             $DetailViewTblVar .= ",";
         }
         $DetailViewTblVar .= "detalle_deudas";
     }
     if ($GLOBALS["detalle_deudas_grid"] && $GLOBALS["detalle_deudas_grid"]->DetailEdit && $Security->CanEdit() && $this->ShowOptionLink('edit') && $Security->AllowEdit(CurrentProjectID() . 'detalle_deudas')) {
         $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=detalle_deudas")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         if ($DetailEditTblVar != "") {
             $DetailEditTblVar .= ",";
         }
         $DetailEditTblVar .= "detalle_deudas";
     }
     if ($GLOBALS["detalle_deudas_grid"] && $GLOBALS["detalle_deudas_grid"]->DetailAdd && $Security->CanAdd() && $this->ShowOptionLink('add') && $Security->AllowAdd(CurrentProjectID() . 'detalle_deudas')) {
         $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=detalle_deudas")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         if ($DetailCopyTblVar != "") {
             $DetailCopyTblVar .= ",";
         }
         $DetailCopyTblVar .= "detalle_deudas";
     }
     if ($links != "") {
         $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
         $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
     }
     $body = "<div class=\"btn-group\">" . $body . "</div>";
     $item->Body = $body;
     $item->Visible = $Security->AllowList(CurrentProjectID() . 'pagos') && $this->ShowOptionLink();
     if ($item->Visible) {
         if ($DetailTableLink != "") {
             $DetailTableLink .= ",";
         }
         $DetailTableLink .= "detalle_deudas";
     }
     if ($this->ShowMultipleDetails) {
         $item->Visible = FALSE;
     }
     // "detail_pagos"
     $item =& $option->Add("detail_pagos");
     $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("pagos", "TblCaption");
     $body .= str_replace("%c", $this->pagos_Count, $Language->Phrase("DetailCount"));
     $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_pagoslist.php?" . EW_TABLE_SHOW_MASTER . "=deudas&fk_id=" . strval($this->id->CurrentValue) . "") . "\">" . $body . "</a>";
     $links = "";
     if ($GLOBALS["pagos_grid"] && $GLOBALS["pagos_grid"]->DetailView && $Security->CanView() && $this->ShowOptionLink('view') && $Security->AllowView(CurrentProjectID() . 'pagos')) {
         $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=pagos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         if ($DetailViewTblVar != "") {
             $DetailViewTblVar .= ",";
         }
         $DetailViewTblVar .= "pagos";
     }
     if ($GLOBALS["pagos_grid"] && $GLOBALS["pagos_grid"]->DetailEdit && $Security->CanEdit() && $this->ShowOptionLink('edit') && $Security->AllowEdit(CurrentProjectID() . 'pagos')) {
         $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=pagos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         if ($DetailEditTblVar != "") {
             $DetailEditTblVar .= ",";
         }
         $DetailEditTblVar .= "pagos";
     }
     if ($GLOBALS["pagos_grid"] && $GLOBALS["pagos_grid"]->DetailAdd && $Security->CanAdd() && $this->ShowOptionLink('add') && $Security->AllowAdd(CurrentProjectID() . 'pagos')) {
         $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=pagos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         if ($DetailCopyTblVar != "") {
             $DetailCopyTblVar .= ",";
         }
         $DetailCopyTblVar .= "pagos";
     }
     if ($links != "") {
         $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
         $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
     }
     $body = "<div class=\"btn-group\">" . $body . "</div>";
     $item->Body = $body;
     $item->Visible = $Security->AllowList(CurrentProjectID() . 'pagos') && $this->ShowOptionLink();
     if ($item->Visible) {
         if ($DetailTableLink != "") {
             $DetailTableLink .= ",";
         }
         $DetailTableLink .= "pagos";
     }
     if ($this->ShowMultipleDetails) {
         $item->Visible = FALSE;
     }
     // Multiple details
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $option->Add("details");
         $oListOpt->Body = $body;
     }
     // Set up detail default
     $option =& $options["detail"];
     $options["detail"]->DropDownButtonPhrase = $Language->Phrase("ButtonDetails");
     $option->UseImageAndText = TRUE;
     $ar = explode(",", $DetailTableLink);
     $cnt = count($ar);
     $option->UseDropDownButton = $cnt > 1;
     $option->UseButtonGroup = TRUE;
     $item =& $option->Add($option->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
     // Set up action default
     $option =& $options["action"];
     $option->DropDownButtonPhrase = $Language->Phrase("ButtonActions");
     $option->UseImageAndText = TRUE;
     $option->UseDropDownButton = FALSE;
     $option->UseButtonGroup = TRUE;
     $item =& $option->Add($option->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
 }
Esempio n. 5
0
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // Set up row action and key
     if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") {
         $objForm->Index = $this->RowIndex;
         $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName);
         $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName);
         $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName);
         $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName);
         if ($this->RowAction != "") {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">";
         }
         if ($this->RowAction == "delete") {
             $rowkey = $objForm->GetValue($this->FormKeyName);
             $this->SetupKeyValues($rowkey);
         }
         if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">";
         }
     }
     // "delete"
     if ($this->AllowAddDeleteRow) {
         if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") {
             $option =& $this->ListOptions;
             $option->UseButtonGroup = TRUE;
             // Use button group for grid delete button
             $option->UseImageAndText = TRUE;
             // Use image and text for grid delete button
             $oListOpt =& $option->Items["griddelete"];
             $oListOpt->Body = "<a class=\"ewGridLink ewGridDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" onclick=\"return ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . "</a>";
         }
     }
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // Set up list action buttons
     $oListOpt =& $this->ListOptions->GetItem("listactions");
     if ($oListOpt) {
         $body = "";
         $links = array();
         foreach ($this->ListActions->Items as $listaction) {
             if ($listaction->Select == EW_ACTION_SINGLE && $listaction->Allow) {
                 $action = $listaction->Action;
                 $caption = $listaction->Caption;
                 $icon = $listaction->Icon != "" ? "<span class=\"" . ew_HtmlEncode($listaction->Icon) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\"></span> " : "";
                 $links[] = "<li><a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" title=\"" . ew_HtmlTitle($caption) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $icon . $listaction->Caption . "</a></li>";
                 if (count($links) == 1) {
                     // Single button
                     $body = "<a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" title=\"" . ew_HtmlTitle($caption) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $Language->Phrase("ListActionButton") . "</a>";
                 }
             }
         }
         if (count($links) > 1) {
             // More than one buttons, use dropdown
             $body = "<button class=\"dropdown-toggle btn btn-default btn-sm ewActions\" data-toggle=\"dropdown\">" . $Language->Phrase("ListActionButton") . "<b class=\"caret\"></b></button>";
             $content = "";
             foreach ($links as $link) {
                 $content .= "<li>" . $link . "</li>";
             }
             $body .= "<ul class=\"dropdown-menu" . ($oListOpt->OnLeft ? "" : " dropdown-menu-right") . "\">" . $content . "</ul>";
             $body = "<div class=\"btn-group\">" . $body . "</div>";
         }
         if (count($links) > 0) {
             $oListOpt->Body = $body;
             $oListOpt->Visible = TRUE;
         }
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_products"
     $oListOpt =& $this->ListOptions->Items["detail_products"];
     if (TRUE) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("products", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("productslist.php?" . EW_TABLE_SHOW_MASTER . "=sub_category&fk_scat_id=" . urlencode(strval($this->scat_id->CurrentValue)) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["products_grid"]->DetailView) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=products")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "products";
         }
         if ($GLOBALS["products_grid"]->DetailEdit) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=products")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "products";
         }
         if ($GLOBALS["products_grid"]->DetailAdd) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=products")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "products";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->scat_id->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event);'>";
     if ($this->CurrentAction == "gridedit" && is_numeric($this->RowIndex)) {
         $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $KeyName . "\" id=\"" . $KeyName . "\" value=\"" . $this->scat_id->CurrentValue . "\">";
     }
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
Esempio n. 6
0
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // Set up row action and key
     if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") {
         $objForm->Index = $this->RowIndex;
         $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName);
         $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName);
         $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName);
         $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName);
         if ($this->RowAction != "") {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">";
         }
         if ($this->RowAction == "delete") {
             $rowkey = $objForm->GetValue($this->FormKeyName);
             $this->SetupKeyValues($rowkey);
         }
         if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">";
         }
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) {
         // Inline Add/Copy
         $this->ListOptions->CustomItem = "copy";
         // Show copy column only
         $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit();\">" . $Language->Phrase("InsertLink") . "</a>&nbsp;" . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>";
         return;
     }
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if ($Security->CanView() && $this->ShowOptionLink('view')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($Security->CanEdit() && $this->ShowOptionLink('edit')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if ($Security->CanAdd() && $this->ShowOptionLink('add')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if ($Security->CanDelete() && $this->ShowOptionLink('delete')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_detalle_deudas"
     $oListOpt =& $this->ListOptions->Items["detail_detalle_deudas"];
     if ($Security->AllowList(CurrentProjectID() . 'detalle_deudas') && $this->ShowOptionLink()) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("detalle_deudas", "TblCaption");
         $body .= str_replace("%c", $this->detalle_deudas_Count, $Language->Phrase("DetailCount"));
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_detalle_deudaslist.php?" . EW_TABLE_SHOW_MASTER . "=deudas&fk_id=" . strval($this->id->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["detalle_deudas_grid"]->DetailView && $Security->CanView() && $this->ShowOptionLink('view') && $Security->AllowView(CurrentProjectID() . 'detalle_deudas')) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=detalle_deudas")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "detalle_deudas";
         }
         if ($GLOBALS["detalle_deudas_grid"]->DetailEdit && $Security->CanEdit() && $this->ShowOptionLink('edit') && $Security->AllowEdit(CurrentProjectID() . 'detalle_deudas')) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=detalle_deudas")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "detalle_deudas";
         }
         if ($GLOBALS["detalle_deudas_grid"]->DetailAdd && $Security->CanAdd() && $this->ShowOptionLink('add') && $Security->AllowAdd(CurrentProjectID() . 'detalle_deudas')) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=detalle_deudas")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "detalle_deudas";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     // "detail_pagos"
     $oListOpt =& $this->ListOptions->Items["detail_pagos"];
     if ($Security->AllowList(CurrentProjectID() . 'pagos') && $this->ShowOptionLink()) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("pagos", "TblCaption");
         $body .= str_replace("%c", $this->pagos_Count, $Language->Phrase("DetailCount"));
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_pagoslist.php?" . EW_TABLE_SHOW_MASTER . "=deudas&fk_id=" . strval($this->id->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["pagos_grid"]->DetailView && $Security->CanView() && $this->ShowOptionLink('view') && $Security->AllowView(CurrentProjectID() . 'pagos')) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=pagos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "pagos";
         }
         if ($GLOBALS["pagos_grid"]->DetailEdit && $Security->CanEdit() && $this->ShowOptionLink('edit') && $Security->AllowEdit(CurrentProjectID() . 'pagos')) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=pagos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "pagos";
         }
         if ($GLOBALS["pagos_grid"]->DetailAdd && $Security->CanAdd() && $this->ShowOptionLink('add') && $Security->AllowAdd(CurrentProjectID() . 'pagos')) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=pagos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "pagos";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->id->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>";
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // "sequence"
     $oListOpt =& $this->ListOptions->Items["sequence"];
     $oListOpt->Body = ew_FormatSeqNo($this->RecCnt);
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if ($Security->CanView() && $this->ShowOptionLink('view')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($Security->CanEdit() && $this->ShowOptionLink('edit')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if ($Security->CanDelete() && $this->ShowOptionLink('delete')) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_gastos_mantenimientos"
     $oListOpt =& $this->ListOptions->Items["detail_gastos_mantenimientos"];
     if ($Security->AllowList(CurrentProjectID() . 'gastos_mantenimientos') && $this->ShowOptionLink()) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("gastos_mantenimientos", "TblCaption");
         $body .= str_replace("%c", $this->gastos_mantenimientos_Count, $Language->Phrase("DetailCount"));
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("gastos_mantenimientoslist.php?" . EW_TABLE_SHOW_MASTER . "=hoja_mantenimientos&fk_codigo=" . urlencode(strval($this->codigo->CurrentValue)) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["gastos_mantenimientos_grid"]->DetailView && $Security->CanView() && $this->ShowOptionLink('view') && $Security->AllowView(CurrentProjectID() . 'gastos_mantenimientos')) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=gastos_mantenimientos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "gastos_mantenimientos";
         }
         if ($GLOBALS["gastos_mantenimientos_grid"]->DetailEdit && $Security->CanEdit() && $this->ShowOptionLink('edit') && $Security->AllowEdit(CurrentProjectID() . 'gastos_mantenimientos')) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=gastos_mantenimientos")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "gastos_mantenimientos";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>";
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
Esempio n. 8
0
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if (TRUE) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // Set up list action buttons
     $oListOpt =& $this->ListOptions->GetItem("listactions");
     if ($oListOpt) {
         $body = "";
         $links = array();
         foreach ($this->ListActions->Items as $listaction) {
             if ($listaction->Select == EW_ACTION_SINGLE && $listaction->Allow) {
                 $action = $listaction->Action;
                 $caption = $listaction->Caption;
                 $icon = $listaction->Icon != "" ? "<span class=\"" . ew_HtmlEncode($listaction->Icon) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\"></span> " : "";
                 $links[] = "<li><a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" title=\"" . ew_HtmlTitle($caption) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $icon . $listaction->Caption . "</a></li>";
                 if (count($links) == 1) {
                     // Single button
                     $body = "<a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" title=\"" . ew_HtmlTitle($caption) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $Language->Phrase("ListActionButton") . "</a>";
                 }
             }
         }
         if (count($links) > 1) {
             // More than one buttons, use dropdown
             $body = "<button class=\"dropdown-toggle btn btn-default btn-sm ewActions\" data-toggle=\"dropdown\">" . $Language->Phrase("ListActionButton") . "<b class=\"caret\"></b></button>";
             $content = "";
             foreach ($links as $link) {
                 $content .= "<li>" . $link . "</li>";
             }
             $body .= "<ul class=\"dropdown-menu" . ($oListOpt->OnLeft ? "" : " dropdown-menu-right") . "\">" . $content . "</ul>";
             $body = "<div class=\"btn-group\">" . $body . "</div>";
         }
         if (count($links) > 0) {
             $oListOpt->Body = $body;
             $oListOpt->Visible = TRUE;
         }
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_sub_category"
     $oListOpt =& $this->ListOptions->Items["detail_sub_category"];
     if (TRUE) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("sub_category", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("sub_categorylist.php?" . EW_TABLE_SHOW_MASTER . "=category&fk_category_id=" . urlencode(strval($this->category_id->CurrentValue)) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["sub_category_grid"]->DetailView) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=sub_category")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "sub_category";
         }
         if ($GLOBALS["sub_category_grid"]->DetailEdit) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=sub_category")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "sub_category";
         }
         if ($GLOBALS["sub_category_grid"]->DetailAdd) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=sub_category")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "sub_category";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->category_id->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event);'>";
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
Esempio n. 9
0
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // Set up row action and key
     if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") {
         $objForm->Index = $this->RowIndex;
         $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName);
         $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName);
         $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName);
         $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName);
         if ($this->RowAction != "") {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">";
         }
         if ($this->RowAction == "delete") {
             $rowkey = $objForm->GetValue($this->FormKeyName);
             $this->SetupKeyValues($rowkey);
         }
         if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">";
         }
     }
     // "delete"
     if ($this->AllowAddDeleteRow) {
         if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") {
             $option =& $this->ListOptions;
             $option->UseButtonGroup = TRUE;
             // Use button group for grid delete button
             $option->UseImageAndText = TRUE;
             // Use image and text for grid delete button
             $oListOpt =& $option->Items["griddelete"];
             if (!$Security->CanDelete() && is_numeric($this->RowIndex) && ($this->RowAction == "" || $this->RowAction == "edit")) {
                 // Do not allow delete existing record
                 $oListOpt->Body = "&nbsp;";
             } else {
                 $oListOpt->Body = "<a class=\"ewGridLink ewGridDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"javascript:void(0);\" onclick=\"ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . "</a>";
             }
         }
     }
     // "sequence"
     $oListOpt =& $this->ListOptions->Items["sequence"];
     $oListOpt->Body = ew_FormatSeqNo($this->RecCnt);
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) {
         // Inline Add/Copy
         $this->ListOptions->CustomItem = "copy";
         // Show copy column only
         $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit();\">" . $Language->Phrase("InsertLink") . "</a>&nbsp;" . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>";
         return;
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($this->CurrentAction == "edit" && $this->RowType == EW_ROWTYPE_EDIT) {
         // Inline-Edit
         $this->ListOptions->CustomItem = "edit";
         // Show edit column only
         $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineUpdate\" title=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . ew_GetHashUrl($this->PageName(), $this->PageObjName . "_row_" . $this->RowCnt) . "');\">" . $Language->Phrase("UpdateLink") . "</a>&nbsp;" . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"update\"></div>";
         $oListOpt->Body .= "<input type=\"hidden\" name=\"k" . $this->RowIndex . "_key\" id=\"k" . $this->RowIndex . "_key\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\">";
         return;
     }
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if ($Security->CanView()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($Security->CanEdit()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
         $oListOpt->Body .= "<a class=\"ewRowLink ewInlineEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" href=\"" . ew_HtmlEncode(ew_GetHashUrl($this->InlineEditUrl, $this->PageObjName . "_row_" . $this->RowCnt)) . "\">" . $Language->Phrase("InlineEditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if ($Security->CanAdd()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
         $oListOpt->Body .= "<a class=\"ewRowLink ewInlineCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->InlineCopyUrl) . "\">" . $Language->Phrase("InlineCopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if ($Security->CanDelete()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_seguimiento_tramites"
     $oListOpt =& $this->ListOptions->Items["detail_seguimiento_tramites"];
     if ($Security->AllowList(CurrentProjectID() . 'seguimiento_tramites')) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("seguimiento_tramites", "TblCaption");
         $body .= str_replace("%c", $this->seguimiento_tramites_Count, $Language->Phrase("DetailCount"));
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_seguimiento_tramiteslist.php?" . EW_TABLE_SHOW_MASTER . "=tramites&fk_codigo=" . strval($this->codigo->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["seguimiento_tramites_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'seguimiento_tramites')) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=seguimiento_tramites")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "seguimiento_tramites";
         }
         if ($GLOBALS["seguimiento_tramites_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'seguimiento_tramites')) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=seguimiento_tramites")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "seguimiento_tramites";
         }
         if ($GLOBALS["seguimiento_tramites_grid"]->DetailAdd && $Security->CanAdd() && $Security->AllowAdd(CurrentProjectID() . 'seguimiento_tramites')) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=seguimiento_tramites")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "seguimiento_tramites";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>";
     if ($this->CurrentAction == "gridedit" && is_numeric($this->RowIndex)) {
         $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $KeyName . "\" id=\"" . $KeyName . "\" value=\"" . $this->codigo->CurrentValue . "\">";
     }
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
Esempio n. 10
0
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // Set up row action and key
     if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") {
         $objForm->Index = $this->RowIndex;
         $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName);
         $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName);
         $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName);
         $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName);
         if ($this->RowAction != "") {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">";
         }
         if ($this->RowAction == "delete") {
             $rowkey = $objForm->GetValue($this->FormKeyName);
             $this->SetupKeyValues($rowkey);
         }
         if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) {
             $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">";
         }
     }
     // "delete"
     if ($this->AllowAddDeleteRow) {
         if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") {
             $option =& $this->ListOptions;
             $option->UseButtonGroup = TRUE;
             // Use button group for grid delete button
             $option->UseImageAndText = TRUE;
             // Use image and text for grid delete button
             $oListOpt =& $option->Items["griddelete"];
             if (!$Security->CanDelete() && is_numeric($this->RowIndex) && ($this->RowAction == "" || $this->RowAction == "edit")) {
                 // Do not allow delete existing record
                 $oListOpt->Body = "&nbsp;";
             } else {
                 $oListOpt->Body = "<a class=\"ewGridLink ewGridDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" onclick=\"return ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . "</a>";
             }
         }
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) {
         // Inline Add/Copy
         $this->ListOptions->CustomItem = "copy";
         // Show copy column only
         $cancelurl = $this->AddMasterUrl($this->PageUrl() . "a=cancel");
         $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . $this->AddMasterUrl($this->PageName()) . "');\">" . $Language->Phrase("InsertLink") . "</a>&nbsp;" . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $cancelurl . "\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>";
         return;
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($this->CurrentAction == "edit" && $this->RowType == EW_ROWTYPE_EDIT) {
         // Inline-Edit
         $this->ListOptions->CustomItem = "edit";
         // Show edit column only
         $cancelurl = $this->AddMasterUrl($this->PageUrl() . "a=cancel");
         $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineUpdate\" title=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . ew_GetHashUrl($this->AddMasterUrl($this->PageName()), $this->PageObjName . "_row_" . $this->RowCnt) . "');\">" . $Language->Phrase("UpdateLink") . "</a>&nbsp;" . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $cancelurl . "\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"update\"></div>";
         $oListOpt->Body .= "<input type=\"hidden\" name=\"k" . $this->RowIndex . "_key\" id=\"k" . $this->RowIndex . "_key\" value=\"" . ew_HtmlEncode($this->cat_id->CurrentValue) . "\">";
         return;
     }
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if ($Security->CanView()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($Security->CanEdit()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
         $oListOpt->Body .= "<a class=\"ewRowLink ewInlineEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" href=\"" . ew_HtmlEncode(ew_GetHashUrl($this->InlineEditUrl, $this->PageObjName . "_row_" . $this->RowCnt)) . "\">" . $Language->Phrase("InlineEditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if ($Security->CanAdd()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if ($Security->CanDelete()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // Set up list action buttons
     $oListOpt =& $this->ListOptions->GetItem("listactions");
     if ($oListOpt) {
         $body = "";
         $links = array();
         foreach ($this->ListActions->Items as $listaction) {
             if ($listaction->Select == EW_ACTION_SINGLE && $listaction->Allow) {
                 $action = $listaction->Action;
                 $caption = $listaction->Caption;
                 $icon = $listaction->Icon != "" ? "<span class=\"" . ew_HtmlEncode(str_replace(" ewIcon", "", $listaction->Icon)) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\"></span> " : "";
                 $links[] = "<li><a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $icon . $listaction->Caption . "</a></li>";
                 if (count($links) == 1) {
                     // Single button
                     $body = "<a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" title=\"" . ew_HtmlTitle($caption) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $Language->Phrase("ListActionButton") . "</a>";
                 }
             }
         }
         if (count($links) > 1) {
             // More than one buttons, use dropdown
             $body = "<button class=\"dropdown-toggle btn btn-default btn-sm ewActions\" title=\"" . ew_HtmlTitle($Language->Phrase("ListActionButton")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("ListActionButton") . "<b class=\"caret\"></b></button>";
             $content = "";
             foreach ($links as $link) {
                 $content .= "<li>" . $link . "</li>";
             }
             $body .= "<ul class=\"dropdown-menu" . ($oListOpt->OnLeft ? "" : " dropdown-menu-right") . "\">" . $content . "</ul>";
             $body = "<div class=\"btn-group\">" . $body . "</div>";
         }
         if (count($links) > 0) {
             $oListOpt->Body = $body;
             $oListOpt->Visible = TRUE;
         }
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_items"
     $oListOpt =& $this->ListOptions->Items["detail_items"];
     if ($Security->AllowList(CurrentProjectID() . 'items')) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("items", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("itemslist.php?" . EW_TABLE_SHOW_MASTER . "=categories&fk_cat_id=" . urlencode(strval($this->cat_id->CurrentValue)) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["items_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'items')) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=items")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "items";
         }
         if ($GLOBALS["items_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'items')) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=items")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "items";
         }
         if ($GLOBALS["items_grid"]->DetailAdd && $Security->CanAdd() && $Security->AllowAdd(CurrentProjectID() . 'items')) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=items")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "items";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->cat_id->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event);'>";
     if ($this->CurrentAction == "gridedit" && is_numeric($this->RowIndex)) {
         $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $KeyName . "\" id=\"" . $KeyName . "\" value=\"" . $this->cat_id->CurrentValue . "\">";
     }
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }
Esempio n. 11
0
 function RenderListOptions()
 {
     global $Security, $Language, $objForm;
     $this->ListOptions->LoadDefault();
     // "view"
     $oListOpt =& $this->ListOptions->Items["view"];
     if ($Security->CanView()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "edit"
     $oListOpt =& $this->ListOptions->Items["edit"];
     if ($Security->CanEdit()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "copy"
     $oListOpt =& $this->ListOptions->Items["copy"];
     if ($Security->CanAdd()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     // "delete"
     $oListOpt =& $this->ListOptions->Items["delete"];
     if ($Security->CanDelete()) {
         $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>";
     } else {
         $oListOpt->Body = "";
     }
     $DetailViewTblVar = "";
     $DetailCopyTblVar = "";
     $DetailEditTblVar = "";
     // "detail_actividad"
     $oListOpt =& $this->ListOptions->Items["detail_actividad"];
     if ($Security->AllowList(CurrentProjectID() . 'actividad')) {
         $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("actividad", "TblCaption");
         $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_actividadlist.php?" . EW_TABLE_SHOW_MASTER . "=rubros&fk_id=" . strval($this->id->CurrentValue) . "") . "\">" . $body . "</a>";
         $links = "";
         if ($GLOBALS["actividad_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'actividad')) {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=actividad")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
             if ($DetailViewTblVar != "") {
                 $DetailViewTblVar .= ",";
             }
             $DetailViewTblVar .= "actividad";
         }
         if ($GLOBALS["actividad_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'actividad')) {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=actividad")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
             if ($DetailEditTblVar != "") {
                 $DetailEditTblVar .= ",";
             }
             $DetailEditTblVar .= "actividad";
         }
         if ($GLOBALS["actividad_grid"]->DetailAdd && $Security->CanAdd() && $Security->AllowAdd(CurrentProjectID() . 'actividad')) {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=actividad")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
             if ($DetailCopyTblVar != "") {
                 $DetailCopyTblVar .= ",";
             }
             $DetailCopyTblVar .= "actividad";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>";
         }
         $body = "<div class=\"btn-group\">" . $body . "</div>";
         $oListOpt->Body = $body;
         if ($this->ShowMultipleDetails) {
             $oListOpt->Visible = FALSE;
         }
     }
     if ($this->ShowMultipleDetails) {
         $body = $Language->Phrase("MultipleMasterDetails");
         $body = "<div class=\"btn-group\">";
         $links = "";
         if ($DetailViewTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>";
         }
         if ($DetailEditTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>";
         }
         if ($DetailCopyTblVar != "") {
             $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>";
         }
         if ($links != "") {
             $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>";
             $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>";
         }
         $body .= "</div>";
         // Multiple details
         $oListOpt =& $this->ListOptions->Items["details"];
         $oListOpt->Body = $body;
     }
     // "checkbox"
     $oListOpt =& $this->ListOptions->Items["checkbox"];
     $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->id->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>";
     $this->RenderListOptionsExt();
     // Call ListOptions_Rendered event
     $this->ListOptions_Rendered();
 }