public function delete()
 {
     if (!$this->CheckParams($this->_templateobject->idField)) {
         sendBack();
     }
     $flash = Flash::Instance();
     parent::delete($this->modeltype);
     sendTo('modulecomponents', 'view', $this->_modules, array('id' => $this->_data['module_components_id']));
 }
 public function delete()
 {
     parent::delete('ProjectNote');
     if (isset($this->_data['project_id'])) {
         sendTo('projects', 'view', array('projects'), array('id' => $this->_data['project_id']));
     } else {
         sendTo('projects', 'index', array('projects'), array('a' => 'b'));
     }
 }
 public function delete()
 {
     if (!$this->CheckParams($this->_templateobject->idField)) {
         sendBack();
     }
     $flash = Flash::Instance();
     parent::delete($this->modeltype);
     sendTo($this->name, 'index', $this->_modules);
 }
 public function delete()
 {
     $flash = Flash::Instance();
     if (!isModuleAdmin()) {
         $flash->addError('Sorry, must be a module admin to delete resource templates.');
         sendBack();
     }
     parent::delete('Resourcetemplate');
     sendTo('resourcetemplate', 'index', 'projects');
 }
 public function delete()
 {
     $result = parent::delete($this->modeltype);
     if (isset($this->_data['ajax'])) {
         header('Content-type: application/json');
         if ($result) {
             echo json_encode(array('success' => TRUE));
         } else {
             echo json_encode(array('success' => FALSE));
         }
         exit;
     }
     sendTo($this->name, 'index', $this->_modules);
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('Opportunity');
     sendTo('opportunitys', 'index', array('crm'));
 }
 public function delete()
 {
     parent::delete('ProjectIssueLine');
     sendBack();
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('Companycontactmethod');
     sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
 }
Example #9
0
 public function deleteAttachmentDependences(&$uri, &$params, &$criteria, $original)
 {
     Controller::delete(array('concept' => 'attachment', 'id' => isset($params['attachment']) ? $params['attachment'] : $original['URI']['id']));
 }
Example #10
0
if (!isset($_SESSION['user'])) {
    header("Location: index.php");
}
include_once "includes/DB/Controller.php";
include_once "includes/Files/Upload.php";
include_once "includes/layout/header.php";
include_once "includes/layout/nav.php";
?>

<?php 
$controller = new Controller();
// Delete item
if (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
    $item = $controller->getItem($_GET['delete']);
    unlink("uploads/{$item['categoryId']}/{$item['imgName']}");
    $controller->delete($_GET['delete'], "items");
}
// Upload a new item
if (isset($_POST['uploadBtn'])) {
    $uploadErrors = array();
    $category;
    $name;
    // Get input from form
    if (isset($_POST['category']) && $_POST['category'] == "") {
        $uploadErrors[] = "Category";
    } else {
        $category = $_POST['category'];
        echo $category;
    }
    if (isset($_POST['name']) && $_POST['name'] == "") {
        $uploadErrors[] = "name";
Example #11
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete($this->modeltype);
     sendBack();
 }
Example #12
0
 public function doImapRead(&$uri, &$result, &$criteria, $original)
 {
     /**
      * Se a busca for apenas no banco de dados, pula-se todas as verificações 
      * deste interceptor.
      */
     if ($original['URI']['service'] == 'PostgreSQL') {
         return $result;
     }
     if ($result) {
         $imap_uri = $uri;
         $imap_uri['service'] = 'Imap';
         $imap_result = Controller::find($imap_uri, false, array('filter' => array('=', 'messageId', $result['messageId'])));
     }
     /**
      * Faz a consistência do banco com o imap
      */
     if (count($imap_result) < 1) {
         $r = Controller::delete($uri, null, $criteria);
         return false;
     } else {
         $imap_result = $imap_result[0];
     }
     /**
      * Faz a consistência do banco com o imap
      */
     if ($imap_result['messageId'] !== $result['messageId']) {
         $n = $imap_result;
         $n['followupflagId'] = 1;
         $n['backgroundColor'] = '#FF2016';
         $n['id'] = Controller::create(array('concept' => 'followupflagged'), $n);
         $result = $imap_result + $n;
     }
     $result = $result + $imap_result;
     return $result;
 }
Example #13
0
 public function delete()
 {
     // Set some defaults
     parent::delete($this->modeltype);
     sendTo($this->name, 'index', $this->_modules);
 }
Example #14
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('System');
     sendTo($this->name, 'index', $this->_modules);
 }
Example #15
0
 function delete()
 {
     SurSuppressionEchange($this->page);
     return parent::delete(true);
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('OpportunityNote');
     sendBack();
 }
 public function delete()
 {
     $result = parent::delete($this->modeltype);
     sendTo($this->name, 'index', $this->_modules);
 }
 /**
  * Salva um contato recente
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     José Vicente Tezza Jr. 
  * @return     retorna a uri do contato recente
  * @access     public
  * */
 function post($request)
 {
     $this->secured();
     //verificar se a preferencia de contatos dinamicos nao esta ativada
     if (!$this->isEnabledDynamicContacts(Config::me("uidNumber"))) {
         $response = new Response($request);
         $this->createException($request, $response, Response::UNAUTHORIZED, 'Resource unauthorized', 'disabled dynamic contacts preference');
         return $response;
     }
     if (count($_POST) == 0) {
         $response = new Response($request);
         $response->code = Response::INTERNALSERVERERROR;
         return $response;
     }
     //recuperar os atributos definidos no conceito 'user'
     $map = Config::get('dynamicContact', 'PostgreSQL.mapping');
     $params = array();
     foreach ($_POST as $key => $value) {
         if (!isset($map[$key]) || $key == 'id' || $key == 'timestamp' || $key == 'number_of_messages') {
             continue;
         }
         $params[$key] = $value;
     }
     if (count($params) == 0) {
         $response = new Response($request);
         $response->code = Response::INTERNALSERVERERROR;
         return $response;
     }
     $response = new Response($request);
     $response->addHeader('Content-type', 'aplication/json');
     $response->code = Response::CREATED;
     //completar os atributos
     $params['owner'] = Config::me("uidNumber");
     $params['number_of_messages'] = '1';
     $params['timestamp'] = time();
     try {
         //verificar o limite maximo de contatos dinamicos nas preferencias do administrador
         $sql = "SELECT config_value " . "FROM phpgw_config " . "WHERE config_app = 'expressoMail' " . "AND config_name = 'expressoMail_Number_of_dynamic_contacts'";
         $numberOfMessages = Controller::service('PostgreSQL')->execResultSql($sql, true);
         $numberOfMessages = count($numberOfMessages) > 0 ? (int) $numberOfMessages['config_value'] : 0;
         //realizar busca de contatos dinamicos ordenados pela data de utilizacao
         $dynamicContacts = Controller::find(array('concept' => 'dynamicContact'), false, array('filter' => array('=', 'owner', Config::me("uidNumber")), 'order' => array('timestamp')));
         $numberOfDynamicContacts = $dynamicContacts !== false ? count($dynamicContacts) : 0;
         //se a quantidade de contatos dinamicos de usuario exceder o limite maximo definido nas preferencias do administrador,
         //remover o contato dinamico mais antigo
         if ($numberOfMessages > 0 && $numberOfDynamicContacts >= $numberOfMessages) {
             $id = $dynamicContacts[0]['id'];
             $delete = Controller::delete(array('concept' => 'dynamicContact', 'id' => $id));
             if (!$delete) {
                 $this->createException($request, $response, Response::INTERNALSERVERERROR, 'Internal Server Error', Controller::service('PostgreSQL')->error);
                 return $response;
             }
         }
         //inserir o novo contato dinamico
         $create = Controller::create(array('concept' => 'dynamicContact'), $params);
         if (!$create) {
             throw new Exception(Controller::service('PostgreSQL')->error);
         }
     } catch (Exception $ex) {
         $response->code = Response::INTERNALSERVERERROR;
         return $response;
     }
     $response->body = json_encode(null);
     return $response;
 }
Example #19
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('SalesPerson');
     sendBack();
 }
Example #20
0
    $recog = new Controller();
    $recog->recoger($recoger_usuario);
}
//*******************dos formas a pasar el parametro con el link con el ID***********
// $id_track=$_GET['id'];
//  echo $id_track;
// function callfunction(){
//     echo "estamos en callfuncion";
// }
//******************segunda forma llamamos a funkcion desde un link******************
if ($_GET['action'] == 'callfunction') {
    $id_track = $_GET['id'];
    $fetcha_track = $_GET['fecha'];
    if (!isset($fetcha_track)) {
        $del = new Controller();
        $del->delete($id_track);
    } elseif (isset($fetcha_track) && isset($id_track)) {
        $delconfecha = new Controller();
        $delconfecha->deleteconfecha($id_track, $fetcha_track);
    }
}
if ($_GET['action'] == 'mapamostrar') {
    $content = json_decode($_GET['data']);
    $map = new Controller();
    $map->extract();
    echo "mapamostrar";
}
if (isset($_POST['signup'])) {
    if (empty($login) || empty($nombre) || empty($password) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
        echo "<script language='javascript'>";
        echo "alert('falta datos o datos incorectos !!!!')";
Example #21
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('HasRole');
     sendTo('HasRoles', 'index', array('admin'));
 }
Example #22
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('LoggedCall');
     sendBack();
 }
Example #23
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('Project');
     sendTo('Projects', 'index', array('projects'));
 }
 public function delete()
 {
     parent::delete('InjectorClass');
     sendTo('Injectorclasss', 'index', array('system_admin'));
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('CompanyPermission');
     sendTo('CompanyPermissions', 'index', array('admin'));
 }
Example #26
0
 static function delete($data, $params = false)
 {
     $user = Controller::find(array('concept' => 'user', 'service' => 'OpenLDAP'), false, array('filter' => array('=', 'uid', $params['owner']), 'notExternal' => true));
     $params['owner'] = $user[0]['id'];
     self::initSessionVars(array('user' => array('uidNumber' => $params['owner'])));
     //Busca as Agendas do usuario
     $sig = Controller::find(array('concept' => 'calendarSignature'), array('user', 'calendar'), array('filter' => array('=', 'user', $params['owner'])));
     //TODO: RESGATAR AGENDA
     foreach ($sig as $i => $v) {
         $cal = Controller::read(array('concept' => 'calendar', 'id' => $v['calendar']), array('location'));
         if ($cal['location'] === $params['calendarName']) {
             $params['calendar'] = $v['calendar'];
         }
     }
     if (isset($params['calendar'])) {
         require_once ROOTPATH . '/plugins/icalcreator/iCalcreator.class.php';
         $vcalendar = new icalCreatorVcalendar();
         $vcalendar->parse($data);
         $vcalendar->sort();
         $toDelete = array();
         while ($component = $vcalendar->getComponent()) {
             switch (strtoupper($component->objName)) {
                 case 'VEVENT':
                     $toDelete[] = $component->getProperty('uid', false, false);
                     break;
                 case 'VTIMEZONE':
                     break;
             }
         }
         self::$deleted = $toDelete;
         foreach ($toDelete as $v) {
             $even = Controller::find(array('concept' => 'schedulable'), false, array('filter' => array('AND', array('=', 'calendar', $params['calendar']), array('=', 'uid', $v))));
             if (is_array($even) && count($even) > 0) {
                 Controller::delete(array('concept' => 'schedulable', 'id' => $even[0]['id']));
             }
         }
     }
 }
 /**
  * Remove um contato recente
  *
  * @license    http://www.gnu.org/copyleft/gpl.html GPL
  * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
  * @sponsor    Caixa Econômica Federal
  * @author     José Vicente Tezza Jr. 
  * @access     public
  * */
 function delete($request, $id)
 {
     $this->secured();
     //verificar se a preferencia de contatos dinamicos nao esta ativada
     if (!$this->isEnabledDynamicContacts(Config::me("uidNumber"))) {
         $response = new Response($request);
         $this->createException($request, $response, Response::UNAUTHORIZED, 'Resource unauthorized', 'disabled dynamic contacts preference');
         return $response;
     }
     $response = new Response($request);
     $response->addHeader('Content-type', 'aplication/json');
     $response->code = Response::NOCONTENT;
     try {
         //Verifica se o recurso existe
         $dinamicContact = Controller::read(array('concept' => 'dynamicContact', 'id' => $id));
         //Se existe o recurso
         if ($dinamicContact) {
             $delete = Controller::delete(array('concept' => 'dynamicContact', 'id' => $id));
             if (!$delete) {
                 $this->createException($request, $response, Response::INTERNALSERVERERROR, 'Internal Server Error', Controller::service('PostgreSQL')->error);
                 return $response;
             }
         } else {
             $this->createException($request, $response, Response::NOTFOUND, 'Bad request', 'Invalid data');
             return $response;
         }
     } catch (Exception $ex) {
         $this->createException($request, $response, Response::INTERNALSERVERERROR, 'Internal Server Error', 'Internal Server Error');
         return $response;
     }
     $response->body = json_encode(null);
     return $response;
 }
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete('CalendarEventAttendee');
     sendBack();
 }
Example #29
0
 public function delete()
 {
     $flash = Flash::Instance();
     parent::delete($this->modeltype);
     sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
 }
Example #30
0
    session_unset();
}
if (!isset($_SESSION['user'])) {
    header("Location: index.php");
}
include_once "includes/DB/Controller.php";
include_once "includes/Files/Upload.php";
include_once "includes/layout/header.php";
include_once "includes/layout/nav.php";
?>

<?php 
$controller = new Controller();
// Delete category
if (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
    $controller->delete($_GET['delete'], "categories");
}
// Create new category
if (isset($_POST['submit'])) {
    $uploadErrors = array();
    $category = "";
    if (isset($_POST['name']) && $_POST['name'] == "") {
        $uploadErrors[] = "name";
    } else {
        $name = $_POST['name'];
    }
    // Check if we had any errors in the form
    if (count($uploadErrors) == 0) {
        // Add category to the database
        if ($controller->addCategory($name)) {
            // Success