private function generateHiddens(WpTesting_Model_Step $step)
 {
     $hiddens = array();
     $hiddens['passer_action'] = $step->isLast() ? WpTesting_Doer_TestPasser::ACTION_PROCESS_FORM : WpTesting_Doer_TestPasser::ACTION_FILL_FORM;
     if (!fRequest::isPost()) {
         return $hiddens;
     }
     unset($_POST['passer_action']);
     foreach ($_POST as $key => $value) {
         if (!is_array($value)) {
             $hiddens[$key] = $value;
             continue;
         }
         foreach ($value as $index => $subValue) {
             $hiddens["{$key}[{$index}]"] = $subValue;
         }
     }
     return $hiddens;
 }
Exemple #2
0
            //fURL::redirect($manage_url);
        }
    } catch (fNotFoundException $e) {
        fMessaging::create('error', $manage_url, 'The check requested, ' . fHTML::encode($check_id) . ', could not be found');
        fURL::redirect($manage_url);
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/ackAll_results.php';
} else {
    if ($action == 'notifyAll') {
        try {
            $check = new Check($check_id);
            $subject_mail = fRequest::get('subject_mail');
            $content_mail = fRequest::get('content_mail');
            if (fRequest::isPost()) {
                if (empty($subject_mail) || empty($content_mail)) {
                    fMessaging::create('error', fURL::get(), "You have to fill the subject and the content to send this mail");
                } else {
                    fRequest::validateCSRFToken(fRequest::get('token'));
                    $recipients = array();
                    $id_user_session = fSession::get('user_id');
                    $user_session = new User($id_user_session);
                    $recipients[] = array("mail" => $user_session->getEmail(), "name" => $user_session->getUsername());
                    $alt_ids = array();
                    $subscription_alt = Subscription::findAll($check_id, NULL, NULL, NULL, TRUE);
                    foreach ($subscription_alt as $alt) {
                        $user = new User($alt->getUserId());
                        $recipients[] = array("mail" => usr_var('alt_email', $user->getUserId()), "name" => $user->getUsername());
                        $alt_ids[] = $alt->getUserId();
                    }
Exemple #3
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 Print Master.  If not, see <http://www.gnu.org/licenses/>.
*/
// Include initialisation file
include_once 'inc/core.php';
// Get parameters
$redirect = fRequest::get('redirect', 'string');
$consumable_id = fRequest::get('consumable_id', 'integer?');
$qty = fRequest::get('qty');
$cost = fRequest::get('cost', 'float?');
// Determine status - show page or update stock
if (fRequest::isPost() && $consumable_id != NULL) {
    // Increase stock
    try {
        // Get objects matching the printer/consumable
        $consumable = new Consumable($consumable_id);
        // Update cost if present
        if ($cost) {
            $consumable->setCost($cost);
            $consumable->store();
        }
        // Update consumable
        $updated = $consumable->increaseStockBy($qty);
        #die(var_export($updated));
        // Check status of installation
        if ($updated == FALSE) {
            fMessaging::create('error', $redirect, $consumable->err);
 protected function isPost()
 {
     return fRequest::isPost();
 }