Example #1
0
 /**
  * Display menu
  */
 function showMenu()
 {
     global $CFG_GLPI;
     echo "<div align='center'><table class='tab_cadre' width='30%' cellpadding='5'>";
     echo "<tr><th colspan='4'>" . __('Menu', 'resources') . "</th></tr>";
     $canresting = plugin_resources_haveRight('resting', 'w');
     $canholiday = plugin_resources_haveRight('holiday', 'w');
     $canemployment = plugin_resources_haveRight('employment', 'w');
     $canseeemployment = plugin_resources_haveRight('employment', 'r');
     $canseebudget = plugin_resources_haveRight('budget', 'r');
     $colspan = "1";
     $colspan2 = "1";
     if (!$this->canCreate()) {
         $colspan += 3;
     }
     if (!$canresting || !$canholiday) {
         $colspan2 += 1;
     }
     echo "<tr><th colspan='4'>" . __('Resources management', 'resources') . "</th></tr>";
     echo "<tr class='tab_bg_1'>";
     if ($this->canCreate()) {
         //Add a resource
         echo "<td class='center'>";
         echo "<a href=\"./wizard.form.php\">";
         echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/newresource.png' alt='" . __('Declare an arrival', 'resources') . "'>";
         echo "<br>" . __('Declare an arrival', 'resources') . "</a>";
         echo "</td>";
         //See resources
         echo "<td class='center'>";
         echo "<a href=\"./resource.php\">";
         echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/resourcelist.png' alt='" . __('Search resources', 'resources') . "'>";
         echo "<br>" . __('Search resources', 'resources') . "</a>";
         echo "</td>";
         //Remove resources
         echo "<td class='center'>";
         echo "<a href=\"./resource.remove.php\">";
         echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/removeresource.png' alt='" . __('Declare a departure', 'resources') . "'>";
         echo "<br>" . __('Declare a departure', 'resources') . "</a>";
         echo "</td>";
     }
     echo "<td colspan='{$colspan}' class='center'>";
     echo "<a href=\"./directory.php\">";
     echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/directory.png' alt='" . PluginResourcesDirectory::getTypeName(1) . "'>";
     echo "<br>" . PluginResourcesDirectory::getTypeName(1) . "</a>";
     echo "</td>";
     echo "</tr>";
     if ($canresting || $canholiday) {
         echo "<tr><th colspan='4'>" . __('Others declarations', 'resources') . "</th></tr>";
         echo "<tr class='tab_bg_1'>";
         if ($canresting) {
             //Add resting resource
             echo "<td colspan='{$colspan2}' class='center'>";
             echo "<a href=\"./resourceresting.form.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/newresting.png' alt='" . __('Declare a non contract period', 'resources') . "'>";
             echo "<br>" . __('Declare a non contract period', 'resources') . "</a>";
             echo "</td>";
             //List resting resource
             echo "<td colspan='{$colspan2}' class='center'>";
             echo "<a href=\"./resourceresting.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/restinglist.png' alt='" . __('List of non contract periods', 'resources') . "'>";
             echo "<br>" . __('List of non contract periods', 'resources') . "</a>";
             echo "</td>";
         }
         if ($canholiday) {
             echo "<td colspan='{$colspan2}' class='center'>";
             echo "<a href=\"./resourceholiday.form.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/holidayresource.png' alt='" . __('Declare a forced holiday', 'resources') . "'>";
             echo "<br>" . __('Declare a forced holiday', 'resources') . "</a>";
             echo "</td>";
             echo "<td colspan='{$colspan2}' class='center'>";
             echo "<a href=\"./resourceholiday.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/holidaylist.png' alt='" . __('List of forced holidays', 'resources') . "'>";
             echo "<br>" . __('List of forced holidays', 'resources') . "</a>";
             echo "</td>";
         }
         echo "</tr>";
     }
     if ($canseeemployment || $canseebudget) {
         echo "<tr><th colspan='4'>" . __('Employments / budgets management', 'resources') . "</th></tr>";
         echo "<tr class='tab_bg_1'>";
         if ($canseeemployment) {
             if ($canemployment) {
                 //Add an employment
                 echo "<td class='center'>";
                 echo "<a href=\"./employment.form.php\">";
                 echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/employment.png' alt='" . __('Declare an employment', 'resources') . "'>";
                 echo "<br>" . __('Declare an employment', 'resources') . "</a>";
                 echo "</td>";
             }
             //See managment employments
             echo "<td class='center'>";
             echo "<a href=\"./employment.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/employmentlist.png' alt='" . __('Employment management', 'resources') . "'>";
             echo "<br>" . __('Employment management', 'resources') . "</a>";
             echo "</td>";
         }
         if ($canseebudget) {
             //See managment budgets
             echo "<td class='center'>";
             echo "<a href=\"./budget.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/budgetlist.png' alt='" . __('Budget management', 'resources') . "'>";
             echo "<br>" . __('Budget management', 'resources') . "</a>";
             echo "</td>";
         }
         if ($canseeemployment) {
             //See recap ressource / employment
             echo "<td class='center'>";
             echo "<a href=\"./recap.php\">";
             echo "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/resources/pics/recap.png' alt='" . __('List Employments / Resources', 'resources') . "'>";
             echo "<br>" . __('List Employments / Resources', 'resources') . "</a>";
             echo "</td>";
         }
         echo "</tr>";
     }
     echo " </table></div>";
 }
Example #2
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Resources. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
//show list of users linked with a resource
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
    Html::header(PluginResourcesResource::getTypeName(2), '', "plugins", "resources");
} else {
    Html::helpHeader(PluginResourcesResource::getTypeName(2));
}
$directory = new PluginResourcesDirectory();
if ($directory->canView() || Session::haveRight("config", "w")) {
    if (empty($_GET["sort"])) {
        $_GET["sort"] = "34";
    }
    if (empty($_GET["order"])) {
        $_GET["order"] = "ASC";
    }
    Search::manageGetValues("PluginResourcesDirectory");
    $directory->showGenericSearch($_GET);
    $directory->showMinimalList($_GET);
} else {
    Html::displayRightError();
}
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
    Html::footer();
Example #3
0
function plugin_resources_dynamicReport($parm)
{
    if ($parm["item_type"] == 'PluginResourcesDirectory') {
        $PluginResourcesDirectory = new PluginResourcesDirectory();
        //$PluginResourcesDirectory->showList($parm);
        $PluginResourcesDirectory->showMinimalList($parm);
        return true;
    } else {
        if ($parm["item_type"] == 'PluginResourcesRecap') {
            $PluginResourcesRecap = new PluginResourcesRecap();
            $PluginResourcesRecap->showMinimalList($parm);
            return true;
        }
    }
    return false;
}